GG/PC - adding Spanish translations

GG/PC - adding Spanish translations

--- src/objective8/translation.clj
+++ src/objective8/translation.clj
@@ -27,8 +27,8 @@
                                      :reddit-text "Submit to Reddit"
                                      :url-label "URL to share"
                                      :url-title "The link to this page"}
-                      :index {:doc-title "Objective8"
-                             :doc-description "Objective8 is description"
+                      :index {:doc-title "Objective[8]"
+                             :doc-description ""
                              :index-welcome "Collaborative policy making for democratic organisations."
                              :index-intro "Gather community opinion, generate ideas, share, discuss, vote and collaborate with experts to draft new policy."
                              :index-get-started-signed-out "Get started"
@@ -37,13 +37,13 @@
                              :index-get-started-title-signed-in "Create an Objective"
                              :index-learn-more "Learn more"
                              :index-learn-more-title "Learn more"}
-                     :sign-in {:doc-title "Sign in | Objective8"
+                     :sign-in {:doc-title "Sign in | Objective[8]"
                                :doc-description "Sign in ..."
                                :page-title "Please sign in"
                                :twitter-sign-in-btn "Sign in with twitter"
                                :twitter-sign-in-title "Sign in with twitter"}
-                     :objective-create {:doc-title "Create an Objective | Objective8"
-                                        :doc-description "Create an Objective  ..."
+                     :objective-create {:doc-title "Create an Objective | Objective[8]"
+                                        :doc-description "Create an Objective ..."
                                         :page-title "Create an objective"
                                         :page-intro "Objective8 centers it’s policy drafting process around Objectives. We define an objectives as 'a desired outcome achieved by introducing new policy'. "
                                         :title-label "Title"
@@ -58,23 +58,18 @@
                                         :end-date-title "Please enter an end date"
                                         :end-date-placeholder"yyyy-mm-dd"
                                         :submit "Create"}
-                     :objective-new-link {:doc-title "Success | Objective8"
-                                          :doc-description "Success! You created an objective ..."
-                                          :page-title "Success"
-                                          :objective-link-text "Your new objective is here"}
-                     :objective-view {:doc-title "Objective | Objective8"
+                     :objective-view {:doc-title "Objective | Objective[8]"
                                       :doc-description "Objective  ..."
                                       :description-label "Description"
                                       :goals-label "Goals"
                                       :end-date-label "End date"
-                                      :owner-label "Created by:"
                                       :created-message "Your objective has been created!"}
                      :comment-view {:created-message "Your comment has been added!"
                                     :comment-title "Comments"}
                      :comment-create {:comment-label "Comment"
                                       :comment-title "Comments are a maximum length of 500 characters"
                                       :post-button "Post"}
-                     :users-email {:doc-title "Sign up | Objective8"
+                     :users-email {:doc-title "Sign up | Objective[8]"
                                    :doc-description "Email  ..."
                                    :page-title "Add your email"
                                    :user-email-welcome "Adding your email address will let us notify you when you receive responses to comments, objectives and votes."
@@ -82,81 +77,76 @@
                                    :email-title "Add your email title"
                                    :button "Submit" }}
                 :es {:base {:header-logo-text "Objective[8]"
-                            :header-logo-title "Spanish(Go to home page)"
-                            :browsehappy! "Spanish(You are using an outdated browser. Please upgrade your browser to improve your experience.)"}
-                     :navigation-global {:sign-in-text "Spanish(Sign in)"
-                                         :sign-in-title "Spanish(Go to sign in)"
-                                         :sign-out-text "Spanish(Sign out)"
-                                         :sign-out-title "Spanish(Go to sign out)"
-                                         :profile-text "Spanish(Profile)"
-                                         :profile-title "Spanish(Go to user profile)"}
-                     :share-widget {:title "Spanish(Share this page:)"
-                                     :facebook-title "Spanish(Share on Facebook...)"
-                                     :facebook-text "Spanish(Share on Facebook)"
-                                     :google-plus-title "Spanish(Plus one this page on Google)"
-                                     :google-plus-text "Spanish(Google +1)"
-                                     :twitter-title "Spanish(Share this page on Twitter)"
-                                     :twitter-text "Spanish(Tweet)"
-                                     :linkedin-title "Spanish(Share this page on LinkedIn)"
-                                     :linkedin-text "Spanish(Share on LinkedIn)"
-                                     :reddit-title "Spanish(Submit this page to Reddit)"
-                                     :reddit-text "Spanish(Submit to Reddit)"
-                                     :url-label "Spanish(URL to share)"
-                                     :url-title "Spanish(The link to this page)"}
-                     :index {:doc-title "Spanish(Objective8)"
-                             :doc-description "Spanish(Objective8 is description)"
-                             :index-welcome "Spanish(Collaborative policy making for democratic organisations.)"
-                             :index-intro "Spanish(Gather community opinion, generate ideas, share, discuss, vote and collaborate with experts to draft new policy.)"
-                             :index-get-started-signed-out "Spanish(Get started)"
-                             :index-get-started-title-signed-out "Spanish(Get started)"
-                             :index-get-started-signed-in "Spanish(Create an Objective)"
-                             :index-get-started-title-signed-in "Spanish(Create an Objective)"
-                             :index-learn-more "Spanish(Learn more)"
-                             :index-learn-more-title "Spanish(Learn more)"}
-                     :sign-in {:doc-title "Spanish(Sign in | Objective8)"
-                               :doc-description "Spanish(Sign in ...)"
-                               :page-title "Spanish(Please sign in)"
-                               :twitter-sign-in-btn "Spanish(Sign in with twitter)"
-                               :twitter-sign-in-title "Spanish(Sign in with twitter)"}
-                     :objective-create {:doc-title "Spanish(Create an Objective | Objective8)"
-                                        :doc-description "Spanish(Create an Objective  ...)"
-                                        :page-title "Spanish(Create an objective)"
+                            :header-logo-title "Inicio"
+                            :browsehappy! "Por favor actualiza tu navegador para que tengas una mejor experiencia."}
+                     :navigation-global {:sign-in-text "Entrar"
+                                         :sign-in-title "Iniciar sesión"
+                                         :sign-out-text "Salir"
+                                         :sign-out-title "Cerrar sesión"
+                                         :profile-text "Perfil"
+                                         :profile-title "Perfil"}
+                     :share-widget {:title "Compartir"
+                                     :facebook-title "Compartir en Facebook"
+                                     :facebook-text "Compartir en Facebook"
+                                     :google-plus-title "Compartir en Google+"
+                                     :google-plus-text "Compartir en Google+"
+                                     :twitter-title "Compartir en Twitter"
+                                     :twitter-text "Compartir en Twitter"
+                                     :linkedin-title "Compartir en LinkedIn"
+                                     :linkedin-text "Compartir en LinkedIn"
+                                     :reddit-title "Compartir en Reddit"
+                                     :reddit-text "Compartir en Reddit"
+                                     :url-label "Comparte el link"
+                                     :url-title "Comparte el link"}
+                     :index {:doc-title "Objective[8]"
+                             :doc-description ""
+                             :index-welcome "Politicos colaborando con organizaciones democráticas"
+                             :index-intro "Recolectar la opinion de la comunidad, generar ideas, compartir, discutir, votar y colaborar con expertos para redactar nuevas politicas."
+                             :index-get-started-signed-out "Pariticipa"
+                             :index-get-started-title-signed-out "Pariticipa"
+                             :index-get-started-signed-in "Crea un objetivo"
+                             :index-get-started-title-signed-in "Crea un objetivo"
+                             :index-learn-more "Más información"
+                             :index-learn-more-title "Más información"}
+                     :sign-in {:doc-title "Entrar | Objective[8]"
+                               :doc-description "Entrar"
+                               :page-title "Por favor entra a tu cuenta"
+                               :twitter-sign-in-btn "Entra con Twitter"
+                               :twitter-sign-in-title "Entra con Twitter"}
+                     :objective-create {:doc-title "Crea un objetivo | Objective[8]"
+                                        :doc-description "Crea un objetivo"
+                                        :page-title "Crea un objetivo"
                                         :page-intro "Spanish(Objective8 centers it’s policy drafting process around Objectives. We define an objectives as 'a desired outcome achieved by introducing new policy'.)"
-                                        :title-label "Spanish(Title)"
-                                        :title-title "Spanish(3 characters minimum, 120 characters maximum)"
-                                        :title-placeholder "Spanish(e.g, Reduce city traffic)"
-                                        :goals-label "Spanish(Goals)"
-                                        :goals-title "Spanish(50 characters minimum, 500 characters maximum)"
+                                        :title-label "Título"
+                                        :title-title "3 carateres mínimo, 120 carateres máximo"
+                                        :title-placeholder "e. Reducir trafico en la ciudad"
+                                        :goals-label "Meta"
+                                        :goals-title "50 carateres mínimo, 500 carateres máximo"
                                         :goals-placeholder "Spanish(e.g, Encourage cycling, walking and greener methods or transport)"
-                                        :description-label "Spanish(Description)"
-                                        :description-title "Spanish(Enter an optional description up to 1000 characters)"
-                                        :end-date-label "Spanish(End date)"
-                                        :end-date-title "Spanish(Please enter an end date)"
+                                        :description-label "Descripción"
+                                        :description-title "Escribe una descripcion máximo de 1000 caracteres."
+                                        :end-date-label "Fecha de vencimiento"
+                                        :end-date-title "Por favor escribe la fecha de vencimiento"
                                         :end-date-placeholder "yyyy-mm-dd"
-                                        :submit "Spanish(Create)"}
-                     :objective-new-link {:doc-title "Spanish(Success | Objective8)"
-                                          :doc-description "Spanish(Success! You created an objective ...)"
-                                          :page-title "Spanish(Success)"
-                                          :objective-link-text "Spanish(Your new objective is here)"}
-                     :objective-view {:doc-title "Spanish(Objective | Objective8)"
-                                      :doc-description "Spanish(Objective  ...)"
-                                      :description-label "Spanish(Description)"
-                                      :goals-label "Spanish(Goals)"
-                                      :end-date-label "Spanish(End date)"
-                                      :owner-label "Spanish(Created by:)"
-                                      :created-message "Spanish(Your objective has been created!)"}
-                    :comment-view {:created-message "Spanish(Your comment has been added!)"
-                                   :comment-title "Spanish(Comments)"}
-                     :comment-create {:comment-label "Spanish(Comment)"
-                                      :comment-title "Spanish(Comments are a maximum length of 500 characters)"
-                                      :post-button "Spanish(Post)"}
-                     :users-email {:doc-title "Spanish(User email | Objective8)"
-                                   :doc-description "Spanish(Email  ...)"
-                                   :page-title "Spanish(Add your email)"
-                                   :user-email-welcome "Spanish(Adding your email address will let us notify you when you receive responses to comments, objectives and votes.)"
-                                   :email-label "Spanish(Email)"
-                                   :email-title "Spanish(Add your email title)"
-                                   :button "Spanish(Submit)"}}}
+                                        :submit "Crear"}
+                     :objective-view {:doc-title "Objetivo | Objective[8]"
+                                      :doc-description ""
+                                      :description-label "Descripción"
+                                      :goals-label "Meta"
+                                      :end-date-label "Fecha de vencimiento"
+                                      :created-message "Tu objetivo ha sido creado"}
+                    :comment-view {:created-message "Tu comentario ha sido creado"
+                                   :comment-title "Comentarios"}
+                     :comment-create {:comment-label "Comentario"
+                                      :comment-title "Los comentarios son máximo de 500 caracteres."
+                                      :post-button "Crear"}
+                     :users-email {:doc-title "Perfil | Objective[8]"
+                                   :doc-description ""
+                                   :page-title "Escribe tu cuenta de correo electrónico"
+                                   :user-email-welcome "Tu correo electrónico nos permitira informarte cuando recivas respuestas a tus comentarios, objetivos y votos."
+                                   :email-label "Correo electrónico"
+                                   :email-title "Escribe tu cuenta de correo electrónico"
+                                   :button "Crear"}}}
    :dev-mode? false
    :fallback-locale :en
    :log-missing-translations-function (fn [{:keys [locale ks scope]}]


Fix dev figwheel reloading

Fix dev figwheel reloading

--- env/dev/cljs/gtfve/dev.cljs
+++ env/dev/cljs/gtfve/dev.cljs
@@ -8,7 +8,7 @@

 (figwheel/watch-and-reload
   :websocket-url "ws://localhost:3449/figwheel-ws"
-  :jsload-callback (fn [] (r/force-update-all)))
+  :jsload-callback (fn [] (core/init!)))

 (weasel/connect "ws://localhost:9001" :verbose true)


Fixed implementation of nrepl-server.

Fixed implementation of nrepl-server.

--- lambdalf-lib/src/main/clojure/alfresco.clj
+++ lambdalf-lib/src/main/clojure/alfresco.clj
@@ -2,18 +2,28 @@
   (:require [swank.swank]))
 (use '[clojure.tools.nrepl.server :only (start-server stop-server)])

+; Start the Swank server
 (def ^:dynamic *swank-server* (atom nil))

-(defn- switch
+(defn- switch-swank
   "Starts up the swank server. Server shutdown is currently not supported."
   [current]
   (swank.swank/start-repl))

 (defn start-swank []
-  (swap! *swank-server* switch))
+  (swap! *swank-server* switch-swank))

-; Start the nREPL server - note: should be handled more like the swank server above (i.e. hold a reference to the server in an atom)
-(defonce nrepl-server (start-server :port 7888))
+; Start the NREPL server
+; (defonce nrepl-server (start-server :port 7888))
+(def ^:dynamic *nrepl-server* (atom nil))
+
+(defn- switch-nrepl
+  "Starts up the NREPL server. Server shutdown is currently not supported."
+  [current]
+  (start-server :port 7888))
+
+(defn start-nrepl []
+  (swap! *nrepl-server* switch-nrepl))

 (gen-class :name alfresco.interop.ClojureInit
            :prefix "ci-"


Validate :onyx/restart-pred-fn in catalog entry

--- src/onyx/static/validation.clj
+++ src/onyx/static/validation.clj
@@ -8,6 +8,7 @@
   {:onyx/name schema/Keyword
    :onyx/type (schema/enum :input :output :function)
    :onyx/batch-size (schema/pred pos? 'pos?)
+   (schema/optional-key :onyx/restart-pred-fn) schema/Keyword
    (schema/optional-key :onyx/language) (schema/enum :java :clojure)
    (schema/optional-key :onyx/batch-timeout) (schema/pred pos? 'pos?)
    (schema/optional-key :onyx/doc) schema/Str


Disable use of group-by in task for now

Disable use of group-by in task for now

--- src/onyx_jepsen/simple_job.clj
+++ src/onyx_jepsen/simple_job.clj
@@ -88,9 +88,9 @@
                         :onyx/batch-size batch-size}
                        {:onyx/name :identity-log
                         :onyx/fn :onyx-peers.functions.functions/add-job-num
-                        :onyx/group-by-key :event-time
+                        ;:onyx/group-by-key :event-time
                         :onyx/uniqueness-key :id
-                        :onyx/flux-policy :continue
+                        ;:onyx/flux-policy :continue
                         :onyx/n-peers 1
                         :jepsen/job-num job-num
                         :onyx/params [:jepsen/job-num]
@@ -117,7 +117,6 @@
                          :trigger/refinement :accumulating
                          :trigger/on :segment
                          :trigger/fire-all-extents? true
-                         ;:trigger/notifications [:task-complete]
                          :trigger/threshold [1 :elements]
                          :trigger/sync :onyx-peers.functions.functions/update-state-log}]
              :lifecycles [{:lifecycle/task :persist


Be a bit more conservative with vertical whitespace.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -61,41 +61,27 @@

 (defn first-bit# [timing]
   (-> timing
-    (after -1)
-    (tempo 2)
+    (after -1) (tempo 2)
     (even-melody# [2 4 5 4 4 2 4])
-    (after 9)
-    (even-melody# [-2 1 2 1 1 -2 1])
-    (after 9)
-    (even-melody# [-2 1 2 1 1 -2 1 2 3 4])
-    (after 6)
-    (even-melody# [-1 -2 -3 0 0 -3 0 1 0 -3]))
+    (after 9) (even-melody# [-2 1 2 1 1 -2 1])
+    (after 9) (even-melody# [-2 1 2 1 1 -2 1 2 3 4])
+    (after 6) (even-melody# [-1 -2 -3 0 0 -3 0 1 0 -3]))
   (rhythm-n-bass# timing (take 8 (cycle progression))))

 (defn variation# [timing]
-  (-> timing
-    (tempo 2)
-    (after 9)
-    (even-melody# [11 11 12 9 7])
-    (after 11)
-    (even-melody# [8 8 9 8 3])
-    (after 11)
-    (even-melody# [8 8 9 6 4])
-    (after 11)
-    (even-melody# [11 11 12 11 8]))
-  (first-bit# timing))
+  (first-bit# timing)
+  (-> timing (tempo 2)
+    (after 9) (even-melody# [11 11 12 9 7])
+    (after 11) (even-melody# [8 8 9 8 3])
+    (after 11) (even-melody# [8 8 9 6 4])
+    (after 11) (even-melody# [11 11 12 11 8])))

 (defn final-chord# [timing]
-  (-> timing
-    (after -1)
-    (tempo 2)
-    (even-melody# [11 13 14]))
-  (at (timing 0)
-      (chord# (update-in I [:i] raise))))
+  (-> timing (after -1) (tempo 2) (even-melody# [11 13 14]))
+  (at (timing 0) (chord# (update-in I [:i] raise))))

 (defn play# [] (->
-                 (bpm 160 (now))
-                 (after 2)
+                 (bpm 160 (now)) (after 2)
                  intro# intro# first-bit#
                  (tempo 3/2)
                  first-bit# variation# final-chord#))


Add comment

Add comment

--- examples/frontend-auth/src/frontend/core.cljs
+++ examples/frontend-auth/src/frontend/core.cljs
@@ -140,6 +140,10 @@
     (fn [new-match]
       (swap! state (fn [state]
                      (if new-match
+                       ;; Only run the controllers, which are likely to call authentcated APIs,
+                       ;; if user has been authenticated.
+                       ;; Alternative solution could be to always run controllers,
+                       ;; check authentication status in each controller, or check authentication status in API calls.
                        (if (:user state)
                          (assoc state :match (assoc new-match :controllers (rfc/apply-controllers (:controllers (:match state)) new-match)))
                          (assoc state :match new-match))))))


Reverse the order of arguments for from and speed-up so that we can use them in the threading.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -9,8 +9,8 @@
         ms-per-beat (/ ms-per-minute beats-per-minute)]
     #(+ start (* ms-per-beat %))))

-(defn from [timing offset] #(timing (+ offset %)))
-(defn speed-up [timing factor] #(timing (/ % factor)))
+(defn from [offset timing] #(timing (+ offset %)))
+(defn speed-up [factor timing] #(timing (/ % factor)))

 (def scale 56)
 (defn ground [note] (+ scale note))
@@ -47,7 +47,7 @@
     (at (timing 3) (note# (:base chord1)))
     (at (timing 4) (note# (:base chord2)))
     (at (timing 6) (chord# (dissoc chord2 :base)))
-    (let [next (from timing 8)]
+    (let [next (from 8 timing)]
       (if chords
         (rhythm-n-bass# next chords)
         next))))
@@ -55,7 +55,7 @@
 (defn even-melody# [timing [note & notes]]
   (do
     (at (timing 0) (note# note))
-    (let [next (from timing 1)]
+    (let [next (from 1 timing)]
       (if notes
         (even-melody# next notes)
         next))))
@@ -65,12 +65,12 @@
     (rhythm-n-bass# timing (take 8 (cycle progression))))

 (defn first-bit# [timing]
-    (even-melody# (speed-up (from timing -1) 2) (map ionian [2 4 5 4 4 2 4]))
-    (even-melody# (speed-up (from timing 7) 2) (map ionian [-2 1 2 1 1 -2 1]))
-    (even-melody# (speed-up (from timing 15) 2) (map ionian [-2 1 2 1 1 -2 1 2 3 4]))
-    (even-melody# (speed-up (from timing 23) 2) (map ionian [-1 -2 -3 0 0 -3 0 1 0 -3]))
+    (even-melody# (speed-up 2 (from -1 timing)) (map ionian [2 4 5 4 4 2 4]))
+    (even-melody# (speed-up 2 (from 7 timing)) (map ionian [-2 1 2 1 1 -2 1]))
+    (even-melody# (speed-up 2 (from 15 timing)) (map ionian [-2 1 2 1 1 -2 1 2 3 4]))
+    (even-melody# (speed-up 2 (from 23 timing)) (map ionian [-1 -2 -3 0 0 -3 0 1 0 -3]))
     (rhythm-n-bass# timing (take 8 (cycle progression))))

-(defn play# [] (-> (from (bpm 150) 2) intro# first-bit# first-bit#))
+(defn play# [] (-> (bpm 150) intro# first-bit# first-bit#))

 ; (play#)


(SERVER-303) Add version check test

(SERVER-303) Add version check test

Add a test to ensure that the master correctly calls the
check-for-updates! function in the dujour-version-check library
on initialization.

--- test/unit/puppetlabs/services/master/master_service_test.clj
+++ test/unit/puppetlabs/services/master/master_service_test.clj
@@ -4,7 +4,6 @@
     [puppetlabs.services.master.master-service :refer :all]
     [puppetlabs.services.config.puppet-server-config-service :refer [puppet-server-config-service]]
     [puppetlabs.services.jruby.jruby-puppet-service :as jruby]
-    [puppetlabs.services.protocols.jruby-puppet :as jruby-protocol]
     [puppetlabs.trapperkeeper.services.webserver.jetty9-service :refer [jetty9-service]]
     [puppetlabs.trapperkeeper.services.webrouting.webrouting-service :refer [webrouting-service]]
     [puppetlabs.services.request-handler.request-handler-service :refer [request-handler-service]]
@@ -14,7 +13,9 @@
     [puppetlabs.services.puppet-profiler.puppet-profiler-service :as profiler]
     [puppetlabs.trapperkeeper.testutils.logging :as logutils]
     [puppetlabs.services.ca.certificate-authority-service :refer [certificate-authority-service]]
-    [me.raynes.fs :as fs]))
+    [puppetlabs.dujour.version-check :as version-check]
+    [me.raynes.fs :as fs]
+    [puppetlabs.puppetserver.certificate-authority :as ca]))

 (deftest ca-files-test
   (testing "CA settings from puppet are honored and the CA
@@ -68,3 +69,51 @@
                   (test-path! "cert_inventory" "target/master-service-test/inventory.txt"))))))
         (finally
           (fs/delete-dir test-dir))))))
+
+; This atom will store the parameters passed to the version-check-test-fn, which allows us to keep the
+; assertions about their values inside the version-check-test and will also ensure failures will appear if
+; the master stops calling the check-for-updates! function
+(def version-check-params
+  (atom {}))
+
+(defn version-check-test-fn
+  [request-values update-server-url]
+  (swap! version-check-params #(assoc % :request-values request-values
+                                         :update-server-url update-server-url)))
+
+(deftest version-check-test
+  (testing "master calls into the dujour version check library using the correct values"
+    (with-redefs
+
+      [version-check/check-for-updates! version-check-test-fn
+       ; Redefine the CA functions to ensure that the master does not create
+       ; any SSL files
+       ca/retrieve-ca-cert! (fn [_ _])
+       ca/retrieve-ca-crl!  (fn [_ _])
+       ca/initialize-master-ssl! (fn [_ _ _])]
+      (logutils/with-test-logging
+        (tk-testutils/with-app-with-config
+          app
+
+          [master-service
+           puppet-server-config-service
+           jruby/jruby-puppet-pooled-service
+           jetty9-service
+           webrouting-service
+           request-handler-service
+           profiler/puppet-profiler-service
+           certificate-authority-service]
+
+          (-> (jruby-testutils/jruby-puppet-tk-config
+                (jruby-testutils/jruby-puppet-config {:max-active-instances 1}))
+              (assoc :webserver {:port 8081})
+              (assoc :web-router-service
+                     {:puppetlabs.services.ca.certificate-authority-service/certificate-authority-service ""
+                      :puppetlabs.services.master.master-service/master-service                           {:master-routes       "/puppet"
+                                                                                :invalid-in-puppet-4 "/"}})
+              (assoc :product {:update-server-url "http://notarealurl/"
+                               :name              {:group-id    "puppets"
+                                                   :artifact-id "yoda"}}))
+          (is (= {:group-id "puppets" :artifact-id "yoda"}
+                 (get-in @version-check-params [:request-values :product-name])))
+          (is (= "http://notarealurl/" (:update-server-url @version-check-params))))))))


Remove an unnecessary requirement

Remove an unnecessary requirement

--- src/cljam/tools/cli.clj
+++ src/cljam/tools/cli.clj
@@ -7,7 +7,6 @@
             [cljam.io.sam :as sam]
             [cljam.io.sam.util :as sam-util]
             [cljam.io.sam.util.header :as header]
-            [cljam.io.sequence :as cseq]
             [cljam.algo.bam-indexer :as bai]
             [cljam.algo.normal :as normal]
             [cljam.algo.sorter :as sorter]


cleanup; Updated getting_started.cljs

cleanup; Updated getting_started.cljs

--- src/css-guide/styles/getting_started.cljs
+++ src/css-guide/styles/getting_started.cljs
@@ -7,7 +7,7 @@
             [om.dom :as dom]))

 (defarticle intro
-"# What is this?
+"# Untangled UI

 A styleguide of user interface patterns for web applications and websites built with a custom PostCSS preprocessor
 rendered with ClojureScript.


Remove reference to router-sub

Remove reference to router-sub

--- src/re_view/subscriptions.cljs
+++ src/re_view/subscriptions.cljs
@@ -1,6 +1,5 @@
 (ns re-view.subscriptions
-  (:require [re-view.subscriptions.router-sub :as router-sub]
-            [re-view.subscriptions.db-sub])
+  (:require [re-view.subscriptions.db-sub])
   (:require-macros [re-view.subscriptions]))

 (defn init-sub


resetting index on new item list

resetting index on new item list

--- src/reagent_search/search.cljs
+++ src/reagent_search/search.cljs
@@ -45,6 +45,8 @@
          new-fval (get (vec @ref-items) new-findex)]
      (println "items: " @ref-items)
      (println "new fval:" new-fval ", new-findex: " new-findex)
+     (if (not (nil? new-fval))
+       (reset! ref-focus-item new-findex))
      (recur))))

 (defn- autocomplete-component
@@ -53,11 +55,14 @@
   the number of items rendered is limited to size items"
   [size itemsref textvalue chan-selecteditems chan-focus]
   (let [ref-focus-item (atom -1)]
+        (handle-autocompleteitemselected chan-selecteditems itemsref textvalue)
+        (handle-autocomplete-focus chan-focus itemsref ref-focus-item)
     (fn []
       (if-not (empty? @itemsref)
         (do
-        (handle-autocompleteitemselected chan-selecteditems itemsref textvalue)
-        (handle-autocomplete-focus chan-focus itemsref ref-focus-item)
+        ;; (handle-autocompleteitemselected chan-selecteditems itemsref textvalue)
+        ;; (handle-autocomplete-focus chan-focus itemsref ref-focus-item)
+          (reset! ref-focus-item -1)
         [:div.open.dropdown-toggle {:data-toggle "dropdown"}
          [:ul.dropdown-menu
           {:role "menu"}


CMR-1145: Addressed review comments

CMR-1145: Addressed review comments

--- system-int-test/test/cmr/system_int_test/ingest/collection_update_test.clj
+++ system-int-test/test/cmr/system_int_test/ingest/collection_update_test.clj
@@ -442,19 +442,19 @@
         ;; No Spatial test collections
         coll-no-spatial-no-grans  (make-coll "coll-no-spatial-no-grans" nil)
         coll-no-spatial-with-grans  (make-coll "coll-no-spatial-with-grans" nil)
-        gran4 (make-gran coll-no-spatial-with-grans nil)]
+        gran4 (make-gran coll-no-spatial-with-grans nil)
+
+        update-collection (fn [coll new-spatial-params]
+                            (let [updated-coll (dissoc coll :revision-id)
+                                  updated-coll (assoc updated-coll
+                                                      :spatial-coverage (when new-spatial-params
+                                                                          (dc/spatial new-spatial-params)))]
+                              (d/ingest "PROV1" updated-coll)))]

     (index/wait-until-indexed)
     (testing "Updates allowed with no granules"
       (are [coll new-spatial-params]
-           (let [updated-coll (as-> coll updated-coll
-                                    (dissoc updated-coll :revision-id)
-                                    (if new-spatial-params
-                                      (assoc updated-coll
-                                             :spatial-coverage (dc/spatial new-spatial-params))
-                                      (dissoc updated-coll :spatial-coverage)))]
-             (= 200 (:status (d/ingest "PROV1" updated-coll))))
-
+           (= 200 (:status (update-collection coll new-spatial-params)))
            coll-geodetic-no-grans {:gsr :cartesian}
            coll-cartesian-no-grans {:gsr :geodetic}
            coll-orbit-no-grans {:gsr :geodetic}
@@ -462,20 +462,16 @@

     (testing "Updates not permitted with granules"
       (are [coll new-spatial-params prev-gsr new-gsr]
-           (let [updated-coll (as-> coll updated-coll
-                                    (dissoc updated-coll :revision-id)
-                                    (if new-spatial-params
-                                      (assoc updated-coll
-                                             :spatial-coverage (dc/spatial new-spatial-params))
-                                      (dissoc updated-coll :spatial-coverage)))]
-             (= {:status 400
-                 :errors [(format (str "Collection changing from %s granule spatial representation to "
-                                       "%s is not allowed when the collection has granules."
-                                       " Found 1 granules.")
-                                  prev-gsr new-gsr)]}
-                (d/ingest "PROV1" updated-coll)))
+           (= {:status 400
+               :errors [(format (str "Collection changing from %s granule spatial representation to "
+                                     "%s is not allowed when the collection has granules."
+                                     " Found 1 granules.")
+                                prev-gsr new-gsr)]}
+              (update-collection coll new-spatial-params))

            coll-geodetic-with-grans {:gsr :cartesian} "GEODETIC" "CARTESIAN"
+           coll-geodetic-with-grans nil "GEODETIC" "NO_SPATIAL"
+           coll-geodetic-with-grans {:gsr :orbit :orbit orbit-params} "GEODETIC" "ORBIT"
            coll-cartesian-with-grans {:gsr :geodetic} "CARTESIAN" "GEODETIC"
            coll-orbit-with-grans {:gsr :geodetic} "ORBIT" "GEODETIC"
            coll-no-spatial-with-grans {:gsr :geodetic} "NO_SPATIAL" "GEODETIC"))))


bidi 0.5.1 built on ring 0.5.1

bidi 0.5.1 built on ring 0.5.1

--- modules/bidi/project.clj
+++ modules/bidi/project.clj
@@ -1,13 +1,13 @@
 ;; Copyright © 2014 JUXT LTD.

-(defproject juxt.modular/bidi "0.5.0"
+(defproject juxt.modular/bidi "0.5.1"
   :description "A modular extension that provides support for bidi routing"
   :url "https://github.com/juxt/modular/tree/master/modules/bidi"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
   :dependencies [[com.stuartsierra/component "0.2.1"]
                  [bidi "1.10.3"]
-                 [juxt.modular/ring "0.4.0"]
+                 [juxt.modular/ring "0.5.1"]
                  [prismatic/schema "0.2.1"]
                  [prismatic/plumbing "0.2.2"]]
   :profiles {:dev


Revert "Refactored CLJS to use Model/View/Update pattern."

This reverts commit 358437d571783756a34eb70d903860021b4720e7.

--- src-cljs/tea_time/core.cljs
+++ src-cljs/tea_time/core.cljs
@@ -7,13 +7,6 @@
             [markdown.core :refer [md->html]]
             [ajax.core :as ajax :refer [GET POST]])
   (:import goog.History))
-
-;; MODEL
-
-(def app-state {:teas-list (reagent/atom nil) :new-tea (reagent/atom nil) :edit-tea-id (reagent/atom nil)
-                :edit-tea (reagent/atom nil) :edit-tea-snap (reagent/atom nil) :show-edit (reagent/atom false)})
-
-;; VIEW

 (defn nav-link [uri title page collapsed?]
   [:li {:class (when (= page (session/get :page)) "active")}
@@ -64,7 +57,46 @@
        [:div {:dangerouslySetInnerHTML
               {:__html (md->html docs)}}]]])])

-
+(def teas-list (atom nil))
+(def new-tea (atom nil))
+(def edit-tea-id (reagent/atom nil))
+(def edit-tea (reagent/atom nil))
+(def edit-tea-snap (reagent/atom nil))
+(def show-edit (reagent/atom false))
+
+(defn get-teas
+  "Gets the list of all teas from the website"
+  []
+  (ajax/GET "/api/teas" :handler (fn [response] (reset! teas-list response))))
+(defn delete-tea
+  "Sends a get request that deletes the tea argument"
+  [name]
+  (ajax/GET (str "/api/teas/" name "/delete")
+                                  :error-handler (fn [response] (println "ERROR" response))
+                                  :handler (fn [response] (println name " deleted") (get-teas) (reset! edit-tea-snap nil))))
+
+(defn update-tea
+  "Sends an update request to the API, which updates the tea in the db"
+  [id newname]
+  (ajax/GET (str "/api/teas/" id "/update/" newname)
+                                          :error-handler (fn [response] (println "ERROR" response))
+                                          :handler (fn [response] (println newname " updated") (get-teas) (reset! edit-tea nil))))
+(defn post-to-teas-db
+  "Sends an Ajax Request to the API route to post the tea from the form to the database"
+  [tea-name]
+  ;; (println "post-to-teas-db hit, params: " tea-name)
+  (ajax/POST "/api/newtea" {:params {:new-tea tea-name} :format :json
+                           :handler (fn [] (println "New Tea Posted") (get-teas) (reset! new-tea nil))
+                           :error-handler (fn [err] (println "New Tea Failed To Post" err))}))
+
+(defn show-edit-form
+  "show/hide the show-edit-form"
+  [id name]
+  (println "show-edit-form" id "||" name "||" show-edit "||" @show-edit)
+  (reset! edit-tea-id (second id))
+  (reset! edit-tea (second name))
+  (reset! edit-tea-snap (second name))
+  (swap! show-edit not))

 (defn tealister
   "The page component for listing tea"
@@ -85,7 +117,7 @@
           [:tr
            [:td [:li]]
            [:td (second tea)]
-           [:td [:input.btn.btn-success {:type "button" :value "Edit" :on-click #(reset-app-state (first tea) (second tea))}]]])]]]]))
+           [:td [:input.btn.btn-success {:type "button" :value "Edit" :on-click #(show-edit-form (first tea) (second tea))}]]])]]]]))

 (defn tea-adder
@@ -94,26 +126,24 @@
   [:div.row
    [:div.col-md-12
     [:form {:post "/api/newtea"}
-     [:input.form-control {:field :text :id :in-tea :placeholder "Name of New Tea" :value @(:new-tea app-state) :on-change #(reset! (:new-tea app-state) (-> % .-target .-value))}
-      [:input.btn.btn-primary {:type "submit" :value (str "Add " @(:new-tea app-state)) :on-click #(post-to-teas-db @(:new-tea app-state))}]]]]])
-
-
+     [:input.form-control {:field :text :id :in-tea :placeholder "Name of New Tea" :value @new-tea :on-change #(reset! new-tea (-> % .-target .-value))}
+      [:input.btn.btn-primary {:type "submit" :value (str "Add " @new-tea) :on-click #(post-to-teas-db @new-tea)}]]]]])
+
+
 (defn tea-edit
   "The component of the form"
   []
   [:div.form-group
    [:div.row
     [:div.col-md-12
-     [:div.p (str "Preview: " (or @(:edit-tea-snap app-state) "*no tea selected*") " -> " (or @(:edit-tea app-state) "*no tea selected*"))]
+     [:div.p (str "Preview: " (or @edit-tea-snap "*no tea selected*") " -> " (or @edit-tea "*no tea selected*"))]
      [:div.p]
      [:form
-      [:input.form-control {:field :text :id :change-tea :value @(:edit-tea app-state) :on-change #(reset! (:edit-tea app-state) (-> % .-target .-value))}]
-      [:input.btn.btn-info {:type "submit" :value "Update Tea Name" :on-click #((update-tea
-                                                                                @(:edit-tea-id app-state)
-                                                                                @(:edit-tea app-state))
-                                                                                (reset! (:edit-tea app-state) nil)
-                                                                                (reset! (:edit-tea-snap app-state) nil))}]]
-     [:input.btn.btn-danger {:type "button" :value (str "Delete " @(:edit-tea-snap app-state)) :on-click #(delete-tea @(:edit-tea app-state))}]]]])
+      [:input.form-control {:field :text :id :change-tea :value @edit-tea :on-change #(reset! edit-tea (-> % .-target .-value))}]
+      [:input.btn.btn-info {:type "submit" :value "Update Tea Name" :on-click #((update-tea @edit-tea-id @edit-tea)
+                                                                                (reset! edit-tea nil)
+                                                                                (reset! edit-tea-snap nil))}]]
+     [:input.btn.btn-danger {:type "button" :value (str "Delete " @edit-tea-snap) :on-click #(delete-tea @edit-tea)}]]]])

 ;; this passes the value of the new tea atom into the post-to-teas-db function

@@ -138,45 +168,6 @@
 (defn page []
   [(pages (session/get :page))])

-; UPDATE
-
-(defn get-teas
-  "Gets the list of all teas from the website"
-  []
-  (ajax/GET "/api/teas" :handler (fn [response] (reset! (:teas-list app-state) response))))
-
-(defn delete-tea
-  "Sends a get request that deletes the tea argument"
-  [name]
-  (ajax/GET (str "/api/teas/" name "/delete")
-                                  :error-handler (fn [response] (println "ERROR" response))
-                                  :handler (fn [response] (println name " deleted") (get-teas) (reset! (:edit-tea-snap app-state) nil))))
-
-
-(defn update-tea
-  "Sends an update request to the API, which updates the tea in the db"
-  [id newname]
-  (ajax/GET (str "/api/teas/" id "/update/" newname)
-                                          :error-handler (fn [response] (println "ERROR" response))
-                                          :handler (fn [response] (println newname " updated") (get-teas) (reset! (:edit-tea app-state) nil))))
-(defn post-to-teas-db
-  "Sends an Ajax Request to the API route to post the tea from the form to the database"
-  [tea-name]
-  ;; (println "post-to-teas-db hit, params: " tea-name)
-  (ajax/POST "/api/newtea" {:params {:new-tea tea-name} :format :json
-                           :handler (fn [] (println "New Tea Posted") (get-teas) (reset! (:new-tea app-state) nil))
-                           :error-handler (fn [err] (println "New Tea Failed To Post" err))}))
-
-(defn reset-app-state
-  "Reset app-state"
-  [id name]
-  (println "reset-app-state" id "||" name "||" show-edit "||" @show-edit)
-  (reset! (:edit-tea-id app-state) (second id))
-  (reset! (:edit-tea app-state) (second name))
-  (reset! (:edit-tea-snap app-state) (second name))
-  (swap! (:show-edit app-state) not))
-
-
 ;; -------------------------
 ;; Routes
 (secretary/set-config! :prefix "#")


misc: use proper target prop on worker build

--- frontend/tools.clj
+++ frontend/tools.clj
@@ -49,6 +49,8 @@
   (api/build (api/inputs "src")
              (merge default-build-options
                     (get-output-options name true ::path)
+                    (when (= name "worker")
+                      {:target :webworker})
                     {:optimizations :advanced
                      :static-fns true
                      :elide-asserts true})))
@@ -58,6 +60,8 @@
   (api/build (api/inputs "src")
              (merge default-build-options
                     (get-output-options name true true)
+                    (when (= name "worker")
+                      {:target :webworker})
                     {:optimizations :none})))

 (defmethod task "build-tests"


Upgrade simple example lein-shadow to 0.1.6

--- examples/simple/project.clj
+++ examples/simple/project.clj
@@ -7,7 +7,7 @@
                  [reagent  "0.9.0-rc1"]
                  [re-frame "0.11.0-rc2-SNAPSHOT"]]

-  :plugins [[lein-shadow "0.1.5"]]
+  :plugins [[lein-shadow "0.1.6"]]

   :clean-targets ^{:protect false} [:target-path
                                     "shadow-cljs.edn"


add a new dimension - reporter

add a new dimension - reporter

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -85,6 +85,15 @@
 	     "southern"
 	    ])

+(def reporters [
+		"jules"
+		"andy"
+		"ian"
+		"steve"
+		"mitesh"
+		"ameen"
+		])
+
 (def num-years 10)

 (def max-weight 172) ;; metric tons
@@ -92,7 +101,7 @@

 (defn rnd [seq] (nth seq (rand-int (count seq))))

-(if false
+(if true
   (def *metamodel*
        (new org.dada.core.MetaModelImpl
 	    "Cetacea"
@@ -107,6 +116,7 @@
       [:id (Integer/TYPE) false]
       [:version (Integer/TYPE) true]
       [:time Date true]
+      [:reporter String true]
       [:type String false]		;a whale cannot change type
       [:ocean String true]
       [:length (Float/TYPE) true]
@@ -135,6 +145,7 @@
        (Date. (rand-int num-years)
 	      (rand-int 12)
 	      (+ (rand-int 28) 1))
+       (rnd reporters)
        (rnd types)
        (rnd oceans)
        (/ (rand-int max-length-x-100) 100)
@@ -461,45 +472,45 @@

 (defn by-year [time] (list (or (.lower years time) time)))

-;; (?2 [] all-whales)
-
-;; (?2 [(union)] all-whales)
-;; (?2 [(ccount)] all-whales)
-;; (?2 [(sum :weight)] all-whales)
-
-;; (?2 [(split :type)] all-whales)
-
-;; (?2 [(ccount)(ccount)] all-whales)
-;; (?2 [(union)(union)] all-whales)
-;; (?2 [(ccount)(union)] all-whales)
-;; (?2 [(sum :weight)(union)] all-whales)
-;; (?2 [(union)(ccount)] all-whales)
-;; (?2 [(union)(split :type)] all-whales)
-;; (?2 [(ccount)(split :type)] all-whales)
-;; (?2 [(split :time)(split :type)] all-whales)
-
-;; (?2 [(ccount)(split :time)(split :type)] all-whales)
-;; (?2 [(union)(split :time)(split :type)] all-whales)
-;; (?2 [(split :length)(split :time)(split :type)] all-whales)
-
-;; (?2 [(split :type nil [(ccount)])] all-whales)
-;; (?2 [(split :type nil [(split :time)])] all-whales)
-;; (?2 [(split :type nil [(split :time nil [(split :length)])])] all-whales)
-
-;; (?2 [(split :type nil [(ccount)(split :time)])] all-whales)
-;; (?2 [(split :type nil [(split :time nil)(split :length)])] all-whales)
-
-;; (?2 [(split :type nil [(pivot :time years (keyword (count-value-key nil)))(ccount)(split :time by-year)])] all-whales)
-
-;; (?2 [(union "count/type/year")(split :type nil [(pivot :time years (keyword (count-value-key nil)))(ccount)(split :time by-year)])] all-whales)
-
-;; (?2 [(union "count/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean )])] all-whales)
-
-;; (?2 [(union "sum(weight)/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (sum-value-key :weight)))(sum :weight)(split :ocean )])] all-whales)
-
-;; (?2 [(union "count/ocean/type")(split :ocean nil [(pivot :type types (keyword (count-value-key nil)))(ccount)(split :type )])] all-whales)
-
-;; (?2 [(union "sum(weight)/ocean/type")(split :ocean nil [(pivot :type types (keyword (sum-value-key :weight)))(sum :weight)(split :type )])] all-whales)
+(?2 [] all-whales)
+
+(?2 [(union)] all-whales)
+(?2 [(ccount)] all-whales)
+(?2 [(sum :weight)] all-whales)
+
+(?2 [(split :type)] all-whales)
+
+(?2 [(ccount)(ccount)] all-whales)
+(?2 [(union)(union)] all-whales)
+(?2 [(ccount)(union)] all-whales)
+(?2 [(sum :weight)(union)] all-whales)
+(?2 [(union)(ccount)] all-whales)
+(?2 [(union)(split :type)] all-whales)
+(?2 [(ccount)(split :type)] all-whales)
+(?2 [(split :time)(split :type)] all-whales)
+
+(?2 [(ccount)(split :time)(split :type)] all-whales)
+(?2 [(union)(split :time)(split :type)] all-whales)
+(?2 [(split :length)(split :time)(split :type)] all-whales)
+
+(?2 [(split :type nil [(ccount)])] all-whales)
+(?2 [(split :type nil [(split :time)])] all-whales)
+(?2 [(split :type nil [(split :time nil [(split :length)])])] all-whales)
+
+(?2 [(split :type nil [(ccount)(split :time)])] all-whales)
+(?2 [(split :type nil [(split :time nil)(split :length)])] all-whales)
+
+(?2 [(split :type nil [(pivot :time years (keyword (count-value-key nil)))(ccount)(split :time by-year)])] all-whales)
+
+(?2 [(union "count/type/year")(split :type nil [(pivot :time years (keyword (count-value-key nil)))(ccount)(split :time by-year)])] all-whales)
+
+(?2 [(union "count/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (count-value-key nil)))(ccount)(split :ocean )])] all-whales)
+
+(?2 [(union "sum(weight)/type/ocean")(split :type nil [(pivot :ocean oceans (keyword (sum-value-key :weight)))(sum :weight)(split :ocean )])] all-whales)
+
+(?2 [(union "count/ocean/type")(split :ocean nil [(pivot :type types (keyword (count-value-key nil)))(ccount)(split :type )])] all-whales)
+
+(?2 [(union "sum(weight)/ocean/type")(split :ocean nil [(pivot :type types (keyword (sum-value-key :weight)))(sum :weight)(split :type )])] all-whales)

 (def subquery [(pivot :time years (keyword (count-value-key nil)))(ccount)(split :time by-year)])

@@ -522,19 +533,19 @@
 (def some-whales
      (pmap (fn [id] (whale id)) (range num-whales)))

-(def some-whales2
+(def some-whales
      (let [#^Creator creator (.getCreator whale-metadata)]
        (map
 	#(.create creator (into-array Object %))
 	(list
-	 [0 0 (Date. 0 1 1) "blue whale" "arctic" 100 100]
-	 ;;[1 0 (Date. 0 1 1) "blue whale" "indian" 200 100]
-	 ;; [2 0 (Date. 0 1 1) "gray whale" "arctic" 100 100]
-	 ;; [3 0 (Date. 0 1 1) "gray whale" "indian" 200 100]
-	 ;; [4 0 (Date. 1 1 1) "blue whale" "arctic" 100 100]
-	 ;; [5 0 (Date. 1 1 1) "blue whale" "indian" 200 100]
-	 ;; [6 0 (Date. 1 1 1) "gray whale" "arctic" 100 100]
-	 ;; [7 0 (Date. 1 1 1) "gray whale" "indian" 200 100]
+	 [0 0 (Date. 0 1 1) "jules" "blue whale" "arctic" 100 100]
+	 [1 0 (Date. 0 1 1) "jules" "blue whale" "indian" 200 100]
+	 [2 0 (Date. 0 1 1) "jules" "gray whale" "arctic" 100 100]
+	 [3 0 (Date. 0 1 1) "jules" "gray whale" "indian" 200 100]
+	 [4 0 (Date. 1 1 1) "jules" "blue whale" "arctic" 100 100]
+	 [5 0 (Date. 1 1 1) "jules" "blue whale" "indian" 200 100]
+	 [6 0 (Date. 1 1 1) "jules" "gray whale" "arctic" 100 100]
+	 [7 0 (Date. 1 1 1) "jules" "gray whale" "indian" 200 100]
 	 ))
        ))


added type annotations

added type annotations

--- src/selmer/template_parser.clj
+++ src/selmer/template_parser.clj
@@ -43,7 +43,7 @@
           (read-char rdr))
         templates))))

-(defn consume-block [rdr & [buf]]
+(defn consume-block [rdr & [^StringBuilder buf]]
   (loop [ch (read-char rdr)
          blocks-to-close 1]
     (when (and (pos? blocks-to-close) ch)
@@ -51,12 +51,13 @@
         (let [content (read-tag-content rdr)]
           (when buf (.append buf content))
           (recur (read-char rdr)
-                 (cond
-                   (re-matches #"\{\%\s*block.*" content)
-                   (inc blocks-to-close)
-                   (re-matches #"\{\%\s*endblock.*" content)
-                   (dec blocks-to-close)
-                   :else blocks-to-close)))
+                 (long
+                   (cond
+                     (re-matches #"\{\%\s*block.*" content)
+                     (inc blocks-to-close)
+                     (re-matches #"\{\%\s*endblock.*" content)
+                     (dec blocks-to-close)
+                     :else blocks-to-close))))
         (do
           (when buf (.append buf ch))
           (recur (read-char rdr) blocks-to-close))))))
@@ -144,7 +145,7 @@
           (let [tag-str (read-tag-content rdr)]
             (.append buf
               (if (re-matches #"\{\%\s*include.*" tag-str)
-                (preprocess-template (.replaceAll (get-tag-name #"include" tag-str) "\"" ""))
+                (preprocess-template (.replaceAll ^String (get-tag-name #"include" tag-str) "\"" ""))
               tag-str)))
           (.append buf ch))
         (recur (read-char rdr)))))))


CMR-4239 - Fixed failing tests.

CMR-4239 - Fixed failing tests.

--- metadata-db-app/src/cmr/metadata_db/data/oracle/search.clj
+++ metadata-db-app/src/cmr/metadata_db/data/oracle/search.clj
@@ -31,7 +31,7 @@
    :service (into common-columns [:service_name :user_id])
    :acl (into common-columns [:provider_id :user_id :acl_identity])
    :humanizer (into common-columns [:user_id])
-   :variable (into common-columns [:variable_name :measurement :user_id])
+   :variable (into common-columns [:provider_id :variable_name :measurement :user_id])
    :variable-association (into common-columns
                                [:associated_concept_id :associated_revision_id
                                 :variable_name :user_id])})
@@ -95,7 +95,8 @@
   "Retrieve concept maps from the given table, handling small providers separately from
   normal providers."
   (fn [db table concept-type providers params]
-    (:small (first providers))))
+    (or (:small (first providers))
+        (= :variable concept-type))))

 ;; Execute a query against the small providers table
 (defmethod find-concepts-in-table true


document process-files

document process-files

--- src/me/panzoo/story.clj
+++ src/me/panzoo/story.clj
@@ -471,7 +471,11 @@
 ; The output stream can be a file or standard output or anything
 ; `clojure.java.io/writer` can handle.

-(defn process-files [in-paths out]
+;@process-files
+(defn process-files
+  "Take a list of file paths and an output stream, and render each file to the
+  stream as HTML."
+  [in-paths out]
   (with-out-stream out
     (render-files in-paths)))


One more minor ns cleanup tweak :sad:

One more minor ns cleanup tweak :sad:

--- src/metabase/driver.clj
+++ src/metabase/driver.clj
@@ -6,8 +6,8 @@
             [medley.core :as m]
             [metabase.db :refer [ins sel upd]]
             (metabase.models [database :refer [Database]]
-                             [query-execution :refer [QueryExecution]])
-            [metabase.models.setting :refer [defsetting]]
+                             [query-execution :refer [QueryExecution]]
+                             [setting :refer [defsetting]])
             [metabase.util :as u])
   (:import clojure.lang.Keyword))


refactor long condition into hash lookup

--- src/minkowski/core.cljs
+++ src/minkowski/core.cljs
@@ -15,6 +15,8 @@
 (def minkowski-distance (distance/minkowski minkowski-order))
 (def isoquants [])
 (def mouse-point [0 0])
+(def metric-names {1.0 "Miejska" 2.0 "Euklidesowa" distance/infinity "Czebyszewa"})
+(def default-metric-name "Minkowskiego")

 ; application logic
@@ -45,7 +47,7 @@
   (let [minkowski-order-text (if (= minkowski-order distance/infinity) "∞" (gstring/format "%.2f" minkowski-order))]
     (aset order-field "innerHTML" minkowski-order-text))
   (set! minkowski-distance (distance/minkowski minkowski-order))
-  (let [metric-name (if (= minkowski-order 1.0) "Miejska" (if (= minkowski-order 2.0) "Euklidesowa" (if (= minkowski-order distance/infinity) "Czebyszewa" "Minkowskiego")))] (aset metric-name-field "innerHTML" metric-name)))
+  (let [metric-name (get metric-names minkowski-order default-metric-name)] (aset metric-name-field "innerHTML" metric-name)))

 (defn window-resized []
   (let [new-width (aget visualization "clientWidth") new-height (aget visualization "clientHeight")]


Minor: two small refactors

Minor: two small refactors

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -17,24 +17,28 @@

 (defonce app-state (atom {:rendering-data initial-rendering-data}))

-
-
 (defn reset-rendering-data!
   "Resets the rendering data to the original (i.e. reset the zoom)
    to something which should look ok on most screens"
   []
   (swap! app-state :assoc :rendering-data initial-rendering-data))

+(defn make-canvases-fill-window!
+  "Sets the rendering canvas and the overlay canvas to the same
+   size as the enclosing window"
+  []
+  (aset canvas "width"(.-innerWidth js/window))
+  (aset canvas "height"(.-innerHeight js/window))
+
+  (aset overlay-canvas "width"(.-innerWidth js/window))
+  (aset overlay-canvas "height"(.-innerHeight js/window)))
+
 (defn render-mandelbrot!
   [{:keys [scale x0 y0 escape-radius] :as render-state}]

   (println render-state)

-  (aset canvas "width"(.-innerWidth js/window))
-  (aset canvas "height"(.-innerHeight js/window))
-
-  (aset overlay-canvas "width"(.-innerWidth js/window))
-  (aset overlay-canvas "height"(.-innerHeight js/window))
+  (make-canvases-fill-window!)

   (let [max-iterations        (int (* 10 (Math/log scale))) ; Sensible?
         start                 (.getTime (js/Date.))
@@ -58,12 +62,12 @@
             iterations (js/mandelbrot_smoothed_iteration_count escape-radius-squared max-iterations real imaginary)
             intensity  (* 255 (/ iterations max-iterations))

-            i          (* 4 (+ x (* y width)))]
+            data-index (* 4 (+ x (* y width)))]

-        (aset data i intensity)
-        (aset data (+ i 1) intensity)
-        (aset data (+ i 2) intensity)
-        (aset data (+ i 3) 255))))
+        (aset data data-index intensity)
+        (aset data (+ data-index 1) intensity)
+        (aset data (+ data-index 2) intensity)
+        (aset data (+ data-index 3) 255))))

     (.putImageData context idata 0 0)


logging

logging

--- src/clojure/zensols/dataset/db.clj
+++ src/clojure/zensols/dataset/db.clj
@@ -451,12 +451,15 @@
       ;; they're indexed and added to the stats index
       (binding [*load-set-types* {:train (java.util.LinkedList.)
                                   :test (java.util.LinkedList.)}]
-       ;; if put-instance is private use a lambda form
+        ;; if put-instance is private use a lambda form
+        (log/infof "loading instances...")
         ((:create-instances-fn (connection)) put-instance)
         (let [{:keys [test train]} *load-set-types*]
           (when (or (not (empty? train)) (not (empty? test)))
-            (log/infof "divide: train: %d, test: %d"
-                       (count train) (count test))
+            ;; almost never get to hear since ES is still loading and will
+            ;; return no results
+            (log/infof "divide: %d: train: %d, test: %d"
+                       (+ (count train) (count test)))
             (reset! ids-inst {:train-test {:train (lazy-seq train)
                                            :test (lazy-seq test)}})
             (persist-id-state @ids-inst)))))))


(SERVER-251) Add a couple of more jruby flush tests

This commit adds a couple of more JRuby pool flush tests:

1) Make multiple JRuby flush requests back-to-back and ensure that
   nothing obviously *bad* happens.

2) Ensure that a file handle open from Ruby code run in a
   `ScriptingContainer` is not automatically invalidated when a
   pool flush is requested.

--- test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
@@ -141,6 +141,38 @@
         ;; now the pool is flushed, so the constants should be cleared
         (is (true? (verify-no-constants pool-context 4)))))))

+(deftest ^:integration admin-api-multiple-flush-jruby-pool-test
+  (testing "Flushing the jruby pool multiple times results in all new JRuby instances"
+    (bootstrap/with-puppetserver-running
+      app
+      {:puppet-admin {:client-whitelist ["localhost"]}
+       :jruby-puppet {:max-active-instances 4}}
+      (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
+            context (tk-services/service-context jruby-service)
+            pool-context (:pool-context context)
+            times-to-flush 3]
+        ;; set a ruby constant in each instance so that we can recognize them
+        (is (true? (set-constants-and-verify pool-context 4)))
+        (let [times-flushed (atom 0)
+              _ (add-watch (:pool-agent pool-context)
+                           :flush-callback
+                           (fn [k _ _ _]
+                             (when (= k :flush-callback)
+                               (swap! times-flushed inc))))
+              wait-until (+ (System/currentTimeMillis) 300000)]
+          (dotimes [_ times-to-flush]
+            (is (true? (trigger-flush ssl-request-options))))
+          (while (and (< (System/currentTimeMillis) wait-until)
+                      (< @times-flushed times-to-flush))
+            (Thread/sleep 100))
+          (is (< (System/currentTimeMillis) wait-until)
+              (str "Pool not flushed expected number of times before timeout"))
+          (is (= @times-flushed times-to-flush)
+              "Pool flushed an unexpected number of times")
+          (remove-watch (:pool-agent pool-context) :flush-callback))
+        ;; now the pool is flushed, so the constants should be cleared
+        (is (true? (verify-no-constants pool-context 4)))))))
+
 (deftest ^:integration hold-instance-while-pool-flush-in-progress-test
   (testing "instance borrowed from old pool before pool flush begins and returned *after* new pool is available"
     (bootstrap/with-puppetserver-running
@@ -159,6 +191,42 @@
           (is (true? (trigger-flush ssl-request-options)))
           ;; wait for the new pool to become available
           (wait-for-new-pool jruby-service)
+          ;; return the instance
+          (jruby-protocol/return-instance jruby-service instance)
+          ;; wait until the flush is complete
+          @flush-complete)
+        ;; now the pool is flushed, and the constants should be cleared
+        (is (true? (verify-no-constants pool-context 4)))))))
+
+(deftest ^:integration hold-file-handle-on-instance-while-pool-flush-in-progress-test
+  (testing "file handle opened from old pool instance is held open across pool flush"
+    (bootstrap/with-puppetserver-running
+      app
+      {:puppet-admin {:client-whitelist ["localhost"]}
+       :jruby-puppet {:max-active-instances 4}}
+      (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
+            context (tk-services/service-context jruby-service)
+            pool-context (:pool-context context)]
+        ;; set a ruby constant in each instance so that we can recognize them
+        (is (true? (set-constants-and-verify pool-context 4)))
+        (let [flush-complete (add-watch-for-flush-complete pool-context)
+              ;; borrow an instance and hold the reference to it.
+              instance (jruby-protocol/borrow-instance jruby-service)
+              sc (:scripting-container instance)]
+          (.runScriptlet sc
+                         (str "$unique_file = "
+                              "Puppet::FileSystem::Uniquefile.new"
+                              "('hold-instance-test-', './target')"))
+          (try
+            ;; trigger a flush
+            (is (true? (trigger-flush ssl-request-options)))
+            ;; wait for the new pool to become available
+            (wait-for-new-pool jruby-service)
+
+            (is (nil? (.runScriptlet sc "$unique_file.close"))
+                "Unexpected response on attempt to close unique file")
+            (finally
+              (.runScriptlet sc "$unique_file.unlink")))
           ;; return the instance
           (jruby-protocol/return-instance jruby-service instance)
           ;; wait until the flush is complete
@@ -246,4 +314,4 @@
               @flush-complete)

             ;; we should have three instances with the constant and one without.
-            (is (true? (check-jrubies-for-constant-counts pool-context 3 1)))))))))+            (is (true? (check-jrubies-for-constant-counts pool-context 3 1)))))))))


Fix for latest bidi dependency

Fix for latest bidi dependency

--- modules/cljs/src/modular/cljs.clj
+++ modules/cljs/src/modular/cljs.clj
@@ -5,7 +5,7 @@
    [com.stuartsierra.component :as component]
    [modular.bidi :refer (WebService)]
    [modular.template :refer (TemplateModel)]
-   [bidi.server :refer (files)]
+   [bidi.ring :refer (files)]
    [shadow.cljs.build :as cljs]
    [clojure.java.io :as io]
    [schema.core :as s]


(SERVER-1148) Added timed waits in jruby-pool-int-tests

This commit adds some upper bounds on the maximum number of iterations /
wait time for specific operations to complete while running the
jruby-pool-int-tests.  The bounded operations include the maximum wait
time for a new pool to be initialized, instances to be borrowed, pool
flushes to complete, and for the puppetserver service stack to be
stopped.

--- test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_pool_int_test.clj
@@ -39,6 +39,12 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Utilities

+(def default-borrow-timeout 180000)
+
+(defn timed-deref
+  [ref]
+  (deref ref 120000 :timed-out))
+
 (def script-to-check-if-constant-is-defined
   "! $instance_id.nil?")

@@ -103,21 +109,35 @@

 (defn wait-for-new-pool
   [jruby-service]
-  ;; borrow until we get an instance that doesn't have a constant,
-  ;; so we'll know that the new pool is online
-  (loop [instance (jruby-protocol/borrow-instance jruby-service :wait-for-new-pool)]
-    (let [has-constant? (constant-defined? instance)]
-      (jruby-protocol/return-instance jruby-service instance :wait-for-new-pool)
-      (when has-constant?
-        (recur (jruby-protocol/borrow-instance jruby-service :wait-for-new-pool))))))
+  (let [max-new-pool-wait-count 100000]
+    ;; borrow until we get an instance that doesn't have a constant,
+    ;; so we'll know that the new pool is online
+    (loop [instance (jruby-protocol/borrow-instance jruby-service :wait-for-new-pool)
+           loop-count 0]
+      (let [has-constant? (constant-defined? instance)]
+        (jruby-protocol/return-instance jruby-service instance :wait-for-new-pool)
+        (cond
+          (not has-constant?) true
+          (= loop-count max-new-pool-wait-count) false
+          :else (recur (jruby-protocol/borrow-instance
+                        jruby-service
+                        :wait-for-new-pool)
+                       (inc loop-count)))))))

 (defn borrow-until-desired-borrow-count
   [jruby-service desired-borrow-count]
-  (loop [instance (jruby-protocol/borrow-instance jruby-service :borrow-until-desired-borrow-count)]
-    (let [borrow-count (:borrow-count @(:state instance))]
-      (jruby-protocol/return-instance jruby-service instance :borrow-until-desired-borrow-count)
-      (if (< (inc borrow-count) desired-borrow-count)
-        (recur (jruby-protocol/borrow-instance jruby-service :borrow-until-desired-borrow-count))))))
+  (let [max-borrow-wait-count 100000]
+    (loop [instance (jruby-protocol/borrow-instance jruby-service :borrow-until-desired-borrow-count)
+           loop-count 0]
+      (let [borrow-count (:borrow-count @(:state instance))]
+        (jruby-protocol/return-instance jruby-service instance :borrow-until-desired-borrow-count)
+        (cond
+          (= (inc borrow-count) desired-borrow-count) true
+          (= loop-count max-borrow-wait-count) false
+          :else (recur (jruby-protocol/borrow-instance
+                        jruby-service
+                        :borrow-until-desired-borrow-count)
+                       (inc loop-count)))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Tests
@@ -126,7 +146,8 @@
   (testing "Flushing the pool results in all new JRuby instances"
     (bootstrap/with-puppetserver-running
       app
-      {:jruby-puppet {:max-active-instances 4}}
+      {:jruby-puppet {:max-active-instances 4
+                      :borrow-timeout default-borrow-timeout}}
       (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
             context (tk-services/service-context jruby-service)
             pool-context (:pool-context context)]
@@ -134,7 +155,8 @@
         (is (true? (set-constants-and-verify pool-context 4)))
         (let [flush-complete (add-watch-for-flush-complete pool-context)]
           (is (true? (trigger-flush ssl-request-options)))
-          @flush-complete)
+          (is (true? (timed-deref flush-complete))
+              "timed out waiting for the flush to complete"))
         ;; now the pool is flushed, so the constants should be cleared
         (is (true? (verify-no-constants pool-context 4)))))))

@@ -142,7 +164,8 @@
   (testing "instance borrowed from old pool before pool flush begins and returned *after* new pool is available"
     (bootstrap/with-puppetserver-running
       app
-      {:jruby-puppet {:max-active-instances 4}}
+      {:jruby-puppet {:max-active-instances 4
+                      :borrow-timeout default-borrow-timeout}}
       (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
             context (tk-services/service-context jruby-service)
             pool-context (:pool-context context)]
@@ -155,11 +178,12 @@
           ;; trigger a flush
           (is (true? (trigger-flush ssl-request-options)))
           ;; wait for the new pool to become available
-          (wait-for-new-pool jruby-service)
+          (is (true? (wait-for-new-pool jruby-service)))
           ;; return the instance
           (jruby-protocol/return-instance jruby-service instance :hold-instance-while-pool-flush-in-progress-test)
           ;; wait until the flush is complete
-          @flush-complete)
+          (is (true? (timed-deref flush-complete))
+              "timed out waiting for the flush to complete"))
         ;; now the pool is flushed, and the constants should be cleared
         (is (true? (verify-no-constants pool-context 4)))))))

@@ -167,7 +191,8 @@
   (testing "file handle opened from old pool instance is held open across pool flush"
     (bootstrap/with-puppetserver-running
       app
-      {:jruby-puppet {:max-active-instances 2}}
+      {:jruby-puppet {:max-active-instances 2
+                      :borrow-timeout default-borrow-timeout}}
       (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
             context (tk-services/service-context jruby-service)
             pool-context (:pool-context context)]
@@ -186,7 +211,7 @@
             ;; trigger a flush
             (is (true? (trigger-flush ssl-request-options)))
             ;; wait for the new pool to become available
-            (wait-for-new-pool jruby-service)
+            (is (true? (wait-for-new-pool jruby-service)))

             (is (nil? (.runScriptlet sc "$unique_file.close"))
                 "Unexpected response on attempt to close unique file")
@@ -195,7 +220,8 @@
           ;; return the instance
           (jruby-protocol/return-instance jruby-service instance :hold-instance-while-pool-flush-in-progress-test)
           ;; wait until the flush is complete
-          @flush-complete)
+          (is (true? (timed-deref flush-complete))
+              "timed out waiting for the flush to complete"))
         ;; now the pool is flushed, and the constants should be cleared
         (is (true? (verify-no-constants pool-context 2)))))))

@@ -216,7 +242,9 @@
            authorization/authorization-service]
           (merge (jruby-testutils/jruby-puppet-tk-config
                    (jruby-testutils/jruby-puppet-config {:max-active-instances      4
-                                                         :max-requests-per-instance 10}))
+                                                         :max-requests-per-instance 10
+                                                         :borrow-timeout
+                                                         default-borrow-timeout}))
                  {:webserver    (merge {:ssl-port 8140
                                         :ssl-host "localhost"}
                                        ssl-options)
@@ -238,7 +266,7 @@
               ;; we are going to borrow and return a second instance until we get its
               ;; request count up to max-requests - 1, so that we can use it to test
               ;; flushing behavior the next time we return it.
-              (borrow-until-desired-borrow-count jruby-service 9)
+              (is (true? (borrow-until-desired-borrow-count jruby-service 9)))
               ;; now we grab a reference to that instance and hold onto it for later.
               (let [instance2 (jruby-protocol/borrow-instance jruby-service
                                 :max-requests-flush-while-pool-flush-in-progress-test)]
@@ -247,12 +275,14 @@
                 ;; trigger a flush
                 (is (true? (trigger-flush ssl-options)))
                 ;; wait for the new pool to become available
-                (wait-for-new-pool jruby-service)
+                (is (true? (wait-for-new-pool jruby-service)))
                 ;; there will only be two instances in the new pool, because we are holding
                 ;; references to two from the old pool.
                 (is (true? (set-constants-and-verify pool-context 2)))
                 ;; borrow and return instance from the new pool until an instance flush is triggered
-                (borrow-until-desired-borrow-count jruby-service 10)
+                (is (true? (borrow-until-desired-borrow-count
+                            jruby-service
+                            10)))

                 ;; at this point, we still have the main flush in progress, waiting for us
                 ;; to release the two instances from the old pool.  we should also have
@@ -278,7 +308,8 @@
               (jruby-protocol/return-instance jruby-service instance1 :max-requests-flush-while-pool-flush-in-progress-test)

               ;; wait until the flush is complete
-              @flush-complete)
+              (is (true? (timed-deref flush-complete))
+                  "timed out waiting for the flush to complete"))

             ;; we should have three instances with the constant and one without.
             (is (true? (check-jrubies-for-constant-counts pool-context 3 1)))))))))
@@ -318,7 +349,9 @@
                      jetty9/jetty9-service
                      vcs/versioned-code-service]
            config (-> (jruby-testutils/jruby-puppet-tk-config
-                       (jruby-testutils/jruby-puppet-config {:max-active-instances 2}))
+                       (jruby-testutils/jruby-puppet-config {:max-active-instances 2
+                                                             :borrow-timeout
+                                                             default-borrow-timeout}))
                       (assoc-in [:webserver :port] 8081))
            app (tk/boot-services-with-config services config)
            cert (ssl-utils/pem->cert
@@ -338,7 +371,8 @@
             (Thread/yield))
           (is (= 503 (:status (ping-environment)))))
          (jruby-protocol/return-instance jruby-service jruby-instance :i-want-this-instance)
-         @stop-complete?
+         (is (not= :timed-out (timed-deref stop-complete?))
+             "timed out waiting for the stop to complete")
          (logging/with-test-logging
           (is (= 503 (:status (ping-environment))))))))))

@@ -346,7 +380,8 @@
   (testing "During a shutdown requests result in 503 http responses"
     (bootstrap/with-puppetserver-running
      app
-     {:jruby-puppet {:max-active-instances 2}}
+     {:jruby-puppet {:max-active-instances 2
+                     :borrow-timeout default-borrow-timeout}}
      (let [jruby-service (tk-app/get-service app :JRubyPuppetService)
            context (tk-services/service-context jruby-service)
            jruby-instance (jruby-protocol/borrow-instance jruby-service :i-want-this-instance)
@@ -360,7 +395,8 @@
             (Thread/yield)))
         (is (= 503 (:status (ping-environment)))))
        (jruby-protocol/return-instance jruby-service jruby-instance :i-want-this-instance)
-       @stop-complete?
+       (is (not= :timed-out (timed-deref stop-complete?))
+           "timed out waiting for the stop to complete")
        (let [app-context (tk-app/app-context app)]
          ;; We have to re-initialize the JRubyPuppetService here because
          ;; otherwise the tk-app/stop that is included in the
@@ -368,4 +404,4 @@
          ;; JRubyPuppetService is already stopped.
          (swap! app-context assoc-in [:service-contexts :JRubyPuppetService] {})
          (tk-internal/run-lifecycle-fn! app-context tk-services/init "init" :JRubyPuppetService jruby-service)
-         (tk-internal/run-lifecycle-fn! app-context tk-services/start "start" :JRubyPuppetService jruby-service))))))+         (tk-internal/run-lifecycle-fn! app-context tk-services/start "start" :JRubyPuppetService jruby-service))))))


convert let to function

convert let to function

--- ohack/src/ohack/core.clj
+++ ohack/src/ohack/core.clj
@@ -217,8 +217,14 @@
         (cons {:start (. m start) :end (. m end) :group (. m group)}
               (lazy-seq (step))))))))

-;; copy a line from the prn output and add in a hammer for good measure:
-(let [line "B|----1-----2----0----3----|--1---0---3------|--1---0---3---0h1-|--1---3------|"]
+(defn parse-guitar-tab-line
+  "reads a single well-formed line from the guitar tab
+  and returns a seq of seq, where each inner seq takes the form of
+  [index fret-value]
+  index = at what index in time the pluck should occur
+  fret-value = being which fret to pluck; nil if it should be rest
+  "
+  [line]
   ;; filter out everything before the actual guitar line "- ..." part
   ;; note: drop-while predicate needs a char (\-), not a string ("-")!
   (let [tab-string (apply str (drop-while #(not= % \-) line))]


Default impl for get-peer-site.

Default impl for get-peer-site.

--- src/onyx/extensions.clj
+++ src/onyx/extensions.clj
@@ -62,4 +62,7 @@
 (defmulti internal-retry-message (fn [messenger event id peer-link] (type messenger)))

 (defmethod open-peer-site :default
+  [_ _] "localhost")
+
+(defmethod get-peer-site :default
   [_ _] "localhost")


allow configuration of manifest.json name

closes #104

--- src/main/shadow/build/targets/browser.clj
+++ src/main/shadow/build/targets/browser.clj
@@ -273,7 +273,7 @@
 (defn flush-manifest
   [{:keys [build-options] :as state} include-foreign?]
   (spit
-    (data/output-file state "manifest.json")
+    (data/output-file state (:manifest-name build-options "manifest.json"))
     (let [data
           (->> (or (::closure/modules state)
                    (:build-modules state))


+(defn (get-encyc)

+(defn (get-encyc)

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -10,11 +10,31 @@

 (def encyc
   {
-   {:pred :house} {:artifact true
-                   :buyable true
-                   :place true}
-
-   {:animate true} {:living true}
+   {:activity true} {:animate false
+                     :artifact false
+                     :consumable false
+                     :part-of-human-body false}
+
+   {:animate true} {:activity false
+                    :artifact false
+                    :mass false
+                    :furniture false
+                    :physical-object true
+                    :part-of-human-body false
+                    :drinkable false
+                    :speakable false
+                    :place false}
+
+   {:artifact true} {:animate false
+                     :activity false
+                     :physical-object true}
+
+   {:buyable true} {:human false
+                    :part-of-human-body false}
+
+   {:city true} {:artifact true
+                 :legible false
+                 :place true}

    {:human true} {:animate true}

@@ -24,6 +44,11 @@
                 :buyable true
                 :edible false
                 :human false}
+
+   {:pred :house} {:artifact true
+                   :buyable true
+                   :place true}
+
    }
   )

@@ -35,7 +60,10 @@
   "null sem-impl: simply return input."
   (log/trace (str "null-sem-impl:" (strip-refs input)))
   input)
-
+
+(defn get-encyc [input k]
+  (get encyc {k (get-in input [k])} {}))
+
 (defn sem-impl [input & [original-input]]
   "expand input feature structures with semantic (really cultural) implicatures, e.g., if human, then not buyable or edible"
   (let [original-input (if original-input original-input
@@ -45,40 +73,11 @@
     (cond
       (= input :top) input
       true
-      (let [activity (if (= (get-in input '(:activity))
-                            true)
-                       {:animate false
-                        :artifact false
-                        :consumable false
-                        :part-of-human-body false})
-            animate (if (= (get-in input '(:animate))
-                           true)
-                      {:activity false
-                       :artifact false
-                       :mass false
-                       :furniture false
-                       :physical-object true
-                       :part-of-human-body false
-                       :drinkable false
-                       :speakable false
-                       :place false}{})
-            artifact (if (= (get-in input '(:artifact))
-                            true)
-                       {:animate false
-                        :activity false
-                        :physical-object true}{})
-
-            buyable (if (= (get-in input '(:buyable))
-                           true)
-                      {:human false
-                       :part-of-human-body false})
-
-            city (if (= (get-in input '(:city))
-                        true)
-                   {:place true
-                    :human false
-                    :animate false
-                    :legible false})
+      (let [activity (get-encyc input :activity)
+            animate  (get-encyc input :animate)
+            artifact (get-encyc input :artifact)
+            buyable  (get-encyc input :buyable)
+            city     (get-encyc input :city)

             clothing (if (= (get-in input '(:clothing))
                             true)
@@ -235,7 +234,8 @@
               (cond (= input :fail) :fail

                     true
-                    (merge input animate artifact buyable city clothing consumable consumable-false drinkable
+                    (merge input
+                           activity animate artifact buyable city clothing consumable consumable-false drinkable
                            drinkable-xor-edible-1 drinkable-xor-edible-2
                            edible furniture human inanimate
                            legible material-false non-places


[#2925] Fix test

[#2925] Fix test

--- backend/test/akvo/lumen/lib/import/clj_data_importer_test.clj
+++ backend/test/akvo/lumen/lib/import/clj_data_importer_test.clj
@@ -84,7 +84,7 @@
         (is (= (:group_id data-group) "metadata"))
         (is (= (:group_name data-group) "metadata"))
         (is (= (:repeatable data-group) false)))
-      (is (= (keys (first stored-data)) expected-stored-data))
+      (is (= (set (keys (first stored-data))) (set (conj expected-stored-data :c1 :c2 :c3 :c4))))
       (is (= (keys (first (->> (first data-groups)
                                (get-data *tenant-conn*)))) expected-stored-data)))))


Fixing test that failed with external db mode.

--- system-int-test/test/cmr/system_int_test/admin/cache_api_test.clj
+++ system-int-test/test/cmr/system_int_test/admin/cache_api_test.clj
@@ -177,9 +177,9 @@
       (s/only-with-real-database
         (testing "list cache keys for bootstrap"
           (let [response (list-cache-keys (url/bootstrap-read-caches-url) "token-imp" admin-read-token)]
-            (is (= #{["ABC-1" "read"]
-                     ["ABC-2" "read"]}
-                   (set response)))))))
+            (is (every? (set response)
+                        [["ABC-1" "read"]
+                         ["ABC-2" "read"]]))))))

     (testing "normal user cannot retrieve cache values"


CMR-1772: Removed a bug introduced by the last three commits.

--- system-int-test/test/cmr/system_int_test/virtual_product_test.clj
+++ system-int-test/test/cmr/system_int_test/virtual_product_test.clj
@@ -195,10 +195,8 @@

 (defn- assert-tombstones
   "Assert that the concepts with the given concept-ids and revision-id exist in mdb and are tombstones"
-  [vp-colls revision-id]
-  (doseq [concept-id (mapcat #(map :id (:refs (search/find-refs
-                                                :granule {:entry-title (:entry-title %)
-                                                          :page-size 50}))) vp-colls)]
+  [concept-ids revision-id]
+  (doseq [concept-id concept-ids]
     (is (:deleted (ingest/get-concept concept-id revision-id)))))

 ;; Verify that latest revision ids of virtual granules and the corresponding source granules
@@ -211,7 +209,10 @@
         granule-ur "SC:AST_L1A.003:2006227720"
         ast-l1a-gran (dg/granule ast-coll {:granule-ur granule-ur})
         ingest-result (d/ingest "LPDAAC_ECS" (assoc ast-l1a-gran :revision-id 5))
-        _ (index/wait-until-indexed)]
+        _ (index/wait-until-indexed)
+        vp-granule-ids (mapcat #(map :id (:refs (search/find-refs
+                                                :granule {:entry-title (:entry-title %)
+                                                          :page-size 50}))) vp-colls)]

     ;; check revision ids are in sync after ingest/update operations
     (assert-virtual-gran-revision-id vp-colls 5)
@@ -222,7 +223,7 @@
     ;; check revision ids are in sync after delete operations
     (ingest/delete-concept (d/item->concept ingest-result) {:revision-id 12})
     (index/wait-until-indexed)
-    (assert-tombstones vp-colls 12)
+    (assert-tombstones vp-granule-ids 12)
     (ingest/delete-concept (d/item->concept ingest-result) {:revision-id 14})
     (index/wait-until-indexed)
-    (assert-tombstones vp-colls 14)))
+    (assert-tombstones vp-granule-ids 14)))


Remove make-subproject

Remove make-subproject

The `select-keys` doesn't seem to be necessary, and adding the
`:local-repo-classpath` key doesn't seem to do anything with Leiningen
2.x. That means it seems to serve no real purpose.

--- plugin/src/leiningen/doo.clj
+++ plugin/src/leiningen/doo.clj
@@ -17,21 +17,6 @@
 (defn add-sources [project sources]
   (update-in project [:source-paths] #(into % sources)))

-;; TODO: what's this for?
-(defn make-subproject [project]
-  (-> project
-      ;; This might be protecting against something, remove?
-      (select-keys [:checkout-deps-shares
-                    :eval-in
-                    :jvm-opts
-                    :local-repo
-                    :repositories
-                    :resource-paths
-                    :source-paths
-                    :dependencies])
-      (assoc :local-repo-classpath true)
-      (with-meta (meta project))))
-
 (defn add-dep
   "Adds one dependency (needs to be a vector with a quoted symbol)
   to the project's dependencies.
@@ -43,10 +28,7 @@
 (defn run-local-project
   "Runs both forms (requires and form) in the context of the project"
   [project requires form]
-  (let [project' (-> project
-                   make-subproject
-                   ;; just for use inside the plugin
-                   (dissoc :eval-in))]
+  (let [project' (dissoc project :eval-in)] ;;just for use inside the plugin
     (leval/eval-in-project project'
       `(try
          (do


(SERVER-797) Add comment to env-class-info-tags about related tests

This commit adds a comment to the environment-class-info-tags tests
about why JRuby mocking is used and points to related tests in other
namespaces which use real JRubyPuppet instances.

--- test/unit/puppetlabs/services/jruby/jruby_puppet_service_test.clj
+++ test/unit/puppetlabs/services/jruby/jruby_puppet_service_test.clj
@@ -45,6 +45,22 @@

 (deftest environment-class-info-tags
   (testing "environment-class-info-tags cache has proper data"
+    ;; This test uses a mock JRubyPoolManagerService.  Where these tests are
+    ;; largely about validating the content of the environment cache, whose
+    ;; implementation lives in Clojure, having "real" JRuby instances running
+    ;; in the application stack does not seem essential for these tests.
+    ;;
+    ;; There are related tests in other namespaces which do use real JRubyPuppet
+    ;; instances:
+    ;;
+    ;; * puppetlabs.services.jruby.class-info-test - Makes direct calls on a
+    ;;   "real" JRubyPuppet to validate that the environment class content
+    ;;   matches the manifest content on disk.
+    ;;
+    ;; * puppetlabs.services.master.environment-classes-int-test - Stands up
+    ;;   a full application stack and makes calls to the "environment_classes"
+    ;;   HTTP endpoint which exercise both the Clojure-level environment class
+    ;;   cache and "real" JRubyPuppet instances for doing class info parsing.
     (let [config (jruby-service-test-config 1)]
       (bootstrap/with-app-with-config
        app


STORM-1523: Removed unneeded import for file that was removed.

--- storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj
+++ storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj
@@ -27,7 +27,7 @@
   (:import [org.apache.storm.generated Nimbus Nimbus$Client Nimbus$Processor
             AuthorizationException SubmitOptions TopologyInitialStatus KillOptions])
   (:import [org.apache.storm.utils Utils])
-  (:use [org.apache.storm cluster util config log])
+  (:use [org.apache.storm util config log])
   (:use [org.apache.storm.daemon common nimbus])
   (:require [conjure.core])
   (:use [conjure core]))


fill in timezone list

fill in timezone list

--- src/cljs/early_vote_site/early_vote_site_detail/views.cljs
+++ src/cljs/early_vote_site/early_vote_site_detail/views.cljs
@@ -78,7 +78,15 @@
              [:option {:value "EST"} "EST"]
              [:option {:value "EDT"} "EDT"]
              [:option {:value "CST"} "CST"]
-             [:option {:value "CDT"} "CDT"]]]
+             [:option {:value "CDT"} "CDT"]
+             [:option {:value "MST"} "MST"]
+             [:option {:value "MDT"} "MDT"]
+             [:option {:value "PST"} "PST"]
+             [:option {:value "PDT"} "PDT"]
+             [:option {:value "AKST"} "AKST"]
+             [:option {:value "AKDT"} "AKDT"]
+             [:option {:value "HST"} "HST"]
+             [:option {:value "HDT"} "HDT"]]]

        [:td {:colSpan 2}
         [:button.button {:on-click #(re-frame/dispatch [:schedule-form/save start-date end-date start-time end-time timezone])} "save schedule"]]])))


Korjataan turnaussivun linkki

Korjataan turnaussivun linkki

--- mtg-pairings-server/src/cljs/mtg_pairings_server/components/tournament.cljs
+++ mtg-pairings-server/src/cljs/mtg_pairings_server/components/tournament.cljs
@@ -4,7 +4,7 @@
             [mtg-pairings-server.routes :refer [tournament-path pairings-path]]))

 (defn tournament-header [id name day organizer]
-  [:h3 [:a {:href (tournament-path id)}
+  [:h3 [:a {:href (tournament-path {:id id})}
         (str name " " (format-date day) " — " organizer)]])

 (defn tournament [data]


Install ds db tx listener

Install ds db tx listener

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -4,6 +4,7 @@
             [weasel.repl :as ws-repl]
             [clojure.browser.repl :as repl]
             [clojure.string :as string]
+            [datascript :as d]
             [dommy.core :as dommy]
             [goog.dom]
             [goog.dom.DomHelper]
@@ -207,8 +208,13 @@
         handle-mouse-move!       #(handle-mouse-move cast! %)
         handle-canvas-mouse-down #(handle-mouse-down cast! %)
         handle-canvas-mouse-up   #(handle-mouse-up   cast! %)
-        handle-close!            #(cast! :application-shutdown [@histories])
-        ]
+        handle-close!            #(cast! :application-shutdown [@histories])]
+
+    (d/listen! (:db @state)
+               (fn [tx-report]
+                 (print "TX: " tx-report)
+                 (print "Send the tx to the server, unless the tx came from the server - not sure how to differentiate")))
+
     (js/document.addEventListener "keydown" handle-key-down false)
     (js/document.addEventListener "keyup" handle-key-up false)
     (js/document.addEventListener "mousemove" handle-mouse-move! false)


Use resolve to fetch more breadcrumbs

Use resolve to fetch more breadcrumbs

--- src-cljs/frontend/send.cljs
+++ src-cljs/frontend/send.cljs
@@ -520,7 +520,10 @@
                (= 1 (count children))
                (= :run/job (:key (first children)))
                (= [:job/build :job/name]
-                  (:query (first children))))))))
+                  (:query (first children)))))
+        (and (= :circleci/organization (:key ast))
+             (= '[:organization/vcs-type :organization/name] (:query ast)))
+        (project-crumb-ast? ast))))

 (defmulti send* key)

@@ -549,19 +552,6 @@
         (let [[expr cb] (de-alias-expression expr cb)
               ast (om-parser/expr->ast expr)]
           (cond
-            ;; Also :route/workflow (but a separate expression for breadcrumbs, which
-            ;; doesn't actually need to hit the server)
-            (and (= :circleci/organization (:key ast))
-                 (= '[:organization/vcs-type :organization/name] (:query ast)))
-            (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
-              (cb {:circleci/organization {:organization/vcs-type vcs-type
-                                           :organization/name name}}
-                  query))
-
-            ;; Also :route/workflow (but *another( expression for breadcrumbs, which
-            ;; doesn't actually need to hit the server)
-            (project-crumb-ast? ast) (get-project-name cb ast query)
-
             ;; :route/run crumbs
             (run-page-crumbs-ast? ast) (get-run-page-crumbs cb ast query)


brackets go wild - fix it

brackets go wild - fix it

--- src/paulkrake/goals.clj
+++ src/paulkrake/goals.clj
@@ -64,17 +64,17 @@
                           (goals-to-score-fn-factory y)
                           (goals-data spieltage y)
                           (p/predict-score y games)
-                          (assoc a i y))
-                {} x)
-              (map (fn [[i data]]
-                     [i (map (fn [[h g hp gp]]
-                               [h g (* i (fire hp)) (* i (fire gp))])
-                             data)])
-                   x)
-              (map (fn [[i data]] (reduce (fn [a [h g hg gg]]
-                                            (assoc a [h g] [hg gg])) {} data)) x)
-              (apply merge-with (fn [[h1 g1] [h2 g2]]
-                                  [(max h1 h2) (max g1 g2)]) x)
-              (map (fn [[h g hg gg]]
-                     [h g (first (get x [h g])) (second (get x [h g]))])
-                   games))))
+                          (assoc a i y)))
+              {} x)
+      (map (fn [[i data]]
+             [i (map (fn [[h g hp gp]]
+                       [h g (* i (fire hp)) (* i (fire gp))])
+                     data)])
+           x)
+      (map (fn [[i data]] (reduce (fn [a [h g hg gg]]
+                                   (assoc a [h g] [hg gg])) {} data)) x)
+      (apply merge-with (fn [[h1 g1] [h2 g2]]
+                          [(max h1 h2) (max g1 g2)]) x)
+      (map (fn [[h g hg gg]]
+             [h g (first (get x [h g])) (second (get x [h g]))])
+           games))))


make migration give existing threads reasonable group

--- src/chat/server/migrate.clj
+++ src/chat/server/migrate.clj
@@ -2,20 +2,68 @@
   (:require [chat.server.db :as db]
             [datomic.api :as d]
             [clojure.string :as string]
+            [clojure.set :as set]
             [clojure.edn :as edn]))

 (defn migrate-2016-05-13
   "Threads have associated groups"
   []
   (db/with-conn
-    (d/transact db/*conn*
+    #_(d/transact db/*conn*
       [{:db/ident :thread/group
         :db/valueType :db.type/ref
         :db/cardinality :db.cardinality/one
         :db/id #db/id [:db.part/db]
         :db.install/_attribute :db.part/db}])
-    ; TODO: migrate existing threads to appropriate groups
-    ))
+    (let [threads (->> (d/q '[:find [?t ...]
+                              :where
+                              [?t :thread/id]]
+                            (d/db db/*conn*))
+                       (d/pull-many
+                         (d/db db/*conn*)
+                         [:thread/id
+                          {:thread/mentioned [:user/id]}
+                          {:thread/tag [:tag/group]}
+                          {:message/_thread [:message/created-at
+                                             {:message/user [:user/id]}]}]))
+          tx
+          (vec
+            (for [th threads]
+              (let [author (->> (th :message/_thread)
+                                (sort-by :message/created-at)
+                                first
+                                :message/user)
+                    author-grp (-> author :user/id
+                                   db/get-groups-for-user
+                                   first :id)]
+                (cond
+                  (seq (th :thread/tag))
+                  (let [grp (get-in th [:thread/tag 0 :tag/group :db/id])]
+                    (when (nil? grp)
+                      (println "Nil by tag " (th :thread/id)))
+                    [:db/add [:thread/id (th :thread/id)]
+                     :thread/group grp])
+
+                  (seq (th :thread/mentioned))
+                  (let [grps (apply
+                               set/intersection
+                               (map (comp :id
+                                          db/get-groups-for-user
+                                          :user/id)
+                                    (cons author (th :thread/mentioned))))
+                        grp (or (first grps) author-grp)]
+                    (when (nil? grp)
+                      (println "Nil by mentions " (th :thread/id)))
+                    [:db/add [:thread/id (th :thread/id)]
+                     :thread/group [:group/id grp]])
+
+                  :else
+                  (let [grp author-grp]
+                    (when (nil? grp)
+                      (println "nil by author" (th :thread/id)))
+                    [:db/add [:thread/id (th :thread/id)]
+                     :thread/group [:group/id grp]])))))]
+      (d/transact db/*conn* tx))))

 (defn migrate-2016-05-07
   "Change how user preferences are stored"