Stopped the process of running in-memory tests from creating empty WEB-INF directories.

--- src/appengine_magic/testing.clj
+++ src/appengine_magic/testing.clj
@@ -1,4 +1,5 @@
 (ns appengine-magic.testing
+  (:use [appengine-magic.utils :only [os-type]])
   (:import [com.google.appengine.tools.development.testing LocalServiceTestHelper
             LocalServiceTestConfig
             LocalMemcacheServiceTestConfig LocalMemcacheServiceTestConfig$SizeUnit
@@ -51,8 +52,11 @@
       (.setMaxTxnLifetimeMs ldstc max-txn-lifetime-ms))
     (when-not (nil? max-query-lifetime-ms)
       (.setMaxQueryLifetimeMs ldstc max-query-lifetime-ms))
-    (when-not (nil? backing-store-location)
-      (.setBackingStoreLocation ldstc backing-store-location))
+    (if-not (nil? backing-store-location)
+        (.setBackingStoreLocation ldstc backing-store-location)
+        (.setBackingStoreLocation ldstc (if (= :windows (os-type))
+                                            "NUL"
+                                            "/dev/null")))
     ldstc))


(analyze) can take a model as 2nd param

(analyze) can take a model as 2nd param

--- src/babel/francais/workbook.clj
+++ src/babel/francais/workbook.clj
@@ -24,8 +24,11 @@
    [dag_unify.core :refer [fail-path-between get-in remove-false strip-refs unify]]
    [hiccup.core :refer [html]]))

-(defn analyze [surface-form]
-  (morph/analyze surface-form lexicon))
+(defn analyze
+  ([surface-form]
+   (morph/analyze surface-form (:lexicon medium)))
+  ([surface-form model]
+   (morph/analyze surface-form (:lexicon model))))

 (defn generate
   ([spec]


only satisfy :synthdefs-loaded dep when *all* synthdefs have been loaded (not just the first)

--- src/overtone/sc/machinery/synthdef.clj
+++ src/overtone/sc/machinery/synthdef.clj
@@ -223,8 +223,8 @@

 (defn- load-all-synthdefs []
   (doseq [[sname sdef] @loaded-synthdefs*]
-    (snd "/d_recv" (synthdef-bytes sdef))
-    (satisfy-deps :synthdefs-loaded)))
+    (snd "/d_recv" (synthdef-bytes sdef)))
+  (satisfy-deps :synthdefs-loaded))

 (on-deps :server-connected ::load-all-synthdefs load-all-synthdefs)


refine np-only grammar

refine np-only grammar

--- src/babel/italiano/grammar.cljc
+++ src/babel/italiano/grammar.cljc
@@ -14,7 +14,7 @@
                      ]]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log])
-   [dag_unify.core :refer (fail? get-in merge unifyc)]))
+   [dag_unify.core :refer (fail? get-in merge remove-matching-keys unifyc)]))

 (def hc-agreement
   (let [agr (atom :top)]
@@ -468,4 +468,45 @@
      :index (create-index grammar (flatten (vals lexicon)) head-principle)
      }))

+(def np-grammar
+  (let [grammar
+        (filter #(= (:rule %) "noun-phrase2")
+                grammar)
+        lexicon
+        (into {}
+              (for [[k v] lexicon]
+                (let [filtered-v
+                      (filter #(or (= (get-in % [:synsem :cat]) :adjective)
+                                   (= (get-in % [:synsem :cat]) :det)
+                                   (and (= (get-in % [:synsem :cat]) :noun)
+                                        (not (= (get-in % [:synsem :propernoun] false) true))
+                                        (not (= (get-in % [:synsem :pronoun] false) true))))
+                              v)
+                      remove-semantic-features
+                      (map (fn [lexeme]
+                             (remove-matching-keys lexeme
+                                                   #(or
+                                                     (= % :activity)        (= % :animate)  (= % :artifact)
+                                                     (= % :buyable)         (= % :clothing) (= % :consumable)
+                                                     (= % :drinkable)       (= % :edible)   (= % :furniture)
+                                                     (= % :human)           (= % :legible)  (= % :part-of-human-body)
+                                                     (= % :physical-object) (= % :place)    (= % :speakable))))
+                           filtered-v)]
+                  (if (not (empty? remove-semantic-features))
+                    [k remove-semantic-features]))))]
+    {:name "np-grammar"
+     :morph-walk-tree (fn [tree]
+                        (do
+                          (merge tree
+                                 (morph-walk-tree tree))))
+     :language "it"
+     :language-keyword :italiano
+     :morph fo
+     :lookup (fn [arg]
+               (analyze arg lexicon))
+     :enrich enrich
+     :grammar grammar
+     :lexicon lexicon
+     :index (create-index grammar (flatten (vals lexicon)) head-principle)}))
+
 (log/info "Italiano grammars defined (small, medium).")


add comment

add comment

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -1038,7 +1038,9 @@
                                    :agr {:gender gender
                                          :number number}}}}}))

-         (unify essere-common {:synsem {:sem {:pred :be}}})
+         ;; TODO: do we need this? maybe remove?
+         (unify essere-common {:notes "be"
+                               :synsem {:sem {:pred :be}}})

            ;; essere: copula ;; note that we don't enforce agreement the same here as we do in essere-adjective: TODO: try to make more consistent.
            (let [gender (atom :top)


calzoni is inherently :plur

calzoni is inherently :plur

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -495,7 +495,8 @@
            common-noun
            countable-noun
            masculine-noun
-           {:synsem {:sem {:pred :calzoni
+           {:synsem {:agr {:number :plur}
+                     :sem {:pred :calzoni
                            :artifact true
                            :speakable false
                            :legible false


(maint) When logging, log exception first

We get better log messages if the first argument to log/errorf is
an exception.

--- src/puppetlabs/pcp/broker/activemq.clj
+++ src/puppetlabs/pcp/broker/activemq.clj
@@ -32,6 +32,6 @@
                                                                  (callback-fn thawed)))
                                                  :transacted true
                                                  :on-failure (fn [error]
-                                                               (log/errorf "error consuming message from %s: %s" queue (:exception error)))})]
+                                                               (log/errorf (:exception error) "error consuming message from %s" queue))})]
                  (mq-cons/start consumer)
                  consumer))))))


Widen search criteria

Widen search criteria

--- src/clj/freestuffly/scraper.clj
+++ src/clj/freestuffly/scraper.clj
@@ -6,10 +6,10 @@
   (:require [hickory.select :as s]))

 (def ^:private interesting-keywords
-  #"(?i)paint|playstation|camping|emulsion|lamp|ladder|roller|xbox|mac|fish|marine|kitchen")
+  #"(?i)paint|playstation|camp|emulsion|lamp|ladder|roller|xbox|mac|fish|marine|kitchen|new|unused|ergodox|cherry")

 (def ^:private freecycle-group "southwark-freecycle")
-(def ^:private freecycle-results-per-page 50)
+(def ^:private freecycle-results-per-page 100)

 (defn- interesting-finds
   [results]


fix Cortez Chip targeting

fix Cortez Chip targeting

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -139,7 +139,7 @@

    "Cortez Chip"
    {:abilities [{:prompt "Choose a piece of ICE"
-                 :choices {:req #(and (not (rezzed? %)) (ice? %))}
+                 :choices {:req ice?}
                  :effect (req (let [ice target]
                                 (update! state side (assoc card :cortez-target ice))
                                 (trash state side (get-card state card) {:cause :ability-cost})


[REFACTOR] Refactor `get-short-url` function

We split the `get-short-url` function into 2 functions:
- `get-short-url-jq-evt-handler-maker` which returns a function suitable
  for a jQuery event handler that will do the checks previously done in
  the `get-short-url` function before trying to make the ajax call to
  obtain the short url
- `make-request-to-get-shorturl` which makes the ajax request to obtain
  the short url

The primary purpose of this patch is to allow reuse of the
`get-short-url-jq-evt-handler-maker` function in upcoming patches, which
will try to obtain the short url on other events.

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/main.cljs
+++ src/cljs/cljs_nusmods/main.cljs
@@ -401,13 +401,11 @@
         (initialize-exhibit3 (aget js/window "MODULES")
                              (aget js/window "AUXMODULES")))))

-(defn- get-short-url
-  "Tries to obtain a short url and sets the result in the #url-shortener
-   <input>"
-  [$urlShortenerInput localStorage]
+(defn- make-request-to-get-short-url
+  "Makes the ajax request to the server to obtain a short url"
+  [currentUrl $urlShortenerInput localStorage localStorageKey]
   (ajax "/shorten"
-        {:data     {:url (js/encodeURI
-                           (aget js/document "URL"))}
+        {:data     {:url (js/encodeURI currentUrl)}
          :dataType "json"

          :success
@@ -424,6 +422,22 @@
                      (.val $urlShortenerInput
                            "an error occurred"))}))

+(defn- get-short-url-jq-evt-handler-maker
+  "Returns a function suitable for a jQuery event handler; the returned function
+   tries to obtain a short url and sets the result in the #url-shortener
+   <input>"
+  [$urlShortenerInput localStorage]
+  (fn []
+    (let [currentUrl (aget js/document "URL")
+          localStorageKey (str "shortUrl-" currentUrl)
+
+          mbShortUrl (and localStorage
+                          (.getItem localStorage localStorageKey))]
+      (if mbShortUrl
+          (.val $urlShortenerInput mbShortUrl)
+          (make-request-to-get-short-url currentUrl $urlShortenerInput
+                                         localStorage localStorageKey)))))
+
 (defn- short-url-setup
   "Setup url shortening"
   []
@@ -445,16 +459,8 @@
         zcbClient          (ZeroClipboard. $copy-to-clipboard)
         $urlShortenerInput ($ :#url-shortener)]
     (.click $urlShortenerInput
-            (fn []
-              (let [currentUrl      (aget js/document "URL")
-                    localStorageKey (str "shortUrl-" currentUrl)
-
-                    mbShortUrl
-                    (and localStorage
-                         (.getItem localStorage localStorageKey))]
-                (if mbShortUrl
-                    (.val $urlShortenerInput mbShortUrl)
-                    (get-short-url $urlShortenerInput localStorage)))))))
+            (get-short-url-jq-evt-handler-maker $urlShortenerInput
+                                                localStorage))))

 ; Main entry point of the program
 (defn ^:export init [acad-year sem]


Makes the grid more adjustable and adds oscillator patterns

--- src/cljs/game_of_life/core.cljs
+++ src/cljs/game_of_life/core.cljs
@@ -6,45 +6,27 @@

 (enable-console-print!)

-
-(defonce empty-grid (utils/create-empty-grid 40 40))
-
-(def rows  40)
-(def columns 40 )
+(def rows      40)
+(def columns   40)
+(def cell-size 10)
+
+(defonce empty-grid (utils/create-empty-grid rows columns))
+
+(defonce empty-grid (utils/create-empty-grid rows columns))

 (def app-state (atom {:grid empty-grid
                       :preview nil
                       :timer nil
-                      :settings {:cell-size 10
-                                 :board-width 400
-                                 :board-height 400
+                      :settings {:cell-size cell-size
+                                 :board-width (* cell-size columns)
+                                 :board-height (* cell-size rows)
                                  :live-cell-color "red"
                                  :dead-cell-color "white"
                                  :preview-color "#b3b3b3"
-                                 :interval 500}}))
-
-;; Patterns
-
-(defonce glider (utils/expand-to [[0 1 0]
-                                  [0 0 1]
-                                  [1 1 1]] rows columns))
-
-(defonce lwss (utils/expand-to [[0 1 0 0 1]
-                                [1 0 0 0 0]
-                                [1 0 0 0 1]
-                                [1 1 1 1 0]] rows columns))
-
-(defonce mwss (utils/expand-to [[0 0 0 1 0 0]
-                                [0 1 0 0 0 1]
-                                [1 0 0 0 0 0]
-                                [1 0 0 0 0 1]
-                                [1 1 1 1 1 0]] rows columns))
-
-(defonce hwss (utils/expand-to [[0 0 0 1 1 0 0]
-                                [0 1 0 0 0 0 1]
-                                [1 0 0 0 0 0 0]
-                                [1 0 0 0 0 0 1]
-                                [1 1 1 1 1 1 0]] rows columns))
+                                 :interval 100}}))
+
+(println (:settings @app-state))
+(println "grid width: " (count (get-in @app-state [:grid 0] )))

 (defn set-preview [preview-matrix]
   (swap! app-state update-in [:preview] (constantly preview-matrix)))
@@ -67,16 +49,18 @@
         get-matrix-coords (fn [mouse-event canvas]
                             (let [window-x (.-x mouse-event)
                                   window-y (.-y mouse-event)
+                                  cell-size (get-in @app-state [:settings :cell-size])
                                   [canvas-x canvas-y] (get-canvas-coords [window-x window-y] canvas)
-                                  matrix-x (.floor js/Math (/ canvas-x 10))
-                                  matrix-y (.floor js/Math (/ canvas-y 10))]
-                              (println "window coords: " [[window-x window-y]]
-                                       " canvas coords: " [[canvas-x canvas-y]]
-                                       " matrix coors: " [matrix-x matrix-y])
+                                  matrix-x (.floor js/Math (/ canvas-x cell-size))
+                                  matrix-y (.floor js/Math (/ canvas-y cell-size))]
+
+                              ;; (println "window coords: " [[window-x window-y]]
+                              ;;          " canvas coords: " [[canvas-x canvas-y]]
+                              ;;          " matrix coors: " [matrix-x matrix-y])
+
                               [matrix-x matrix-y]))

         render-cell! (fn [ctx {:keys [cell-size live-cell-color dead-cell-color]}]
-                       (println "live-cell-color: " live-cell-color)
                        (fn [[y x] item]
                          (let [alive? (= item 1)
                                redraw-dead? dead-cell-color]
@@ -97,6 +81,8 @@
                               preview-settings (-> settings
                                                    (assoc :live-cell-color preview-color)
                                                    (assoc :dead-cell-color nil))]
+                          ;; (doseq [row grid]
+                          ;;   (println row))
                           (when ctx
                             (matrix/emap-indexed (render-cell! ctx settings) grid)
                             (when preview
@@ -117,7 +103,7 @@
                            (set-mouse-down! true))

               mouse-up (fn [e]
-                         (println "mouseup x:" (.-x e) " y:" (.-y e))
+                         ;;(println "mouseup x:" (.-x e) " y:" (.-y e))
                          (set-mouse-down! false))

               mouse-move (fn [e]
@@ -129,7 +115,6 @@
           (set! (.-onmouseup canvas) mouse-up)
           (set! (.-onmousemove canvas) mouse-move)

-          (println "mouse click added. mousedown added")
           (reset! comp-state {:canvas canvas
                               :ctx ctx})))

@@ -155,8 +140,88 @@
   (stop-game!)
   (swap! app-state update-in [:grid] (constantly empty-grid)))

+;; -------------- Patterns ----------------
+
+;; Space ships
+
+(defonce glider (utils/expand-to [[0 1 0]
+                                  [0 0 1]
+                                  [1 1 1]] rows columns))
+
+(defonce lwss (utils/expand-to [[0 1 0 0 1]
+                                [1 0 0 0 0]
+                                [1 0 0 0 1]
+                                [1 1 1 1 0]] rows columns))
+
+(defonce mwss (utils/expand-to [[0 0 0 1 0 0]
+                                [0 1 0 0 0 1]
+                                [1 0 0 0 0 0]
+                                [1 0 0 0 0 1]
+                                [1 1 1 1 1 0]] rows columns))
+
+(defonce hwss (utils/expand-to [[0 0 0 1 1 0 0]
+                                [0 1 0 0 0 0 1]
+                                [1 0 0 0 0 0 0]
+                                [1 0 0 0 0 0 1]
+                                [1 1 1 1 1 1 0]] rows columns))
+
+;; Oscillators
+
+(defonce pulsar (utils/expand-to [[0 0 1 1 1 0 0 0 1 1 1 0 0]
+                                  [0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                  [1 0 0 0 0 1 0 1 0 0 0 0 1]
+                                  [1 0 0 0 0 1 0 1 0 0 0 0 1]
+                                  [1 0 0 0 0 1 0 1 0 0 0 0 1]
+                                  [0 0 1 1 1 0 0 0 1 1 1 0 0]
+                                  [0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                  [0 0 1 1 1 0 0 0 1 1 1 0 0]
+                                  [1 0 0 0 0 1 0 1 0 0 0 0 1]
+                                  [1 0 0 0 0 1 0 1 0 0 0 0 1]
+                                  [1 0 0 0 0 1 0 1 0 0 0 0 1]
+                                  [0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                  [0 0 1 1 1 0 0 0 1 1 1 0 0]] rows columns))
+
+(defonce figure-8 (utils/expand-to [[1 1 1 0 0 0]
+                                    [1 1 1 0 0 0]
+                                    [1 1 1 0 0 0]
+                                    [0 0 0 1 1 1]
+                                    [0 0 0 1 1 1]
+                                    [0 0 0 1 1 1]] rows columns))
+
+(defonce queenbee (utils/expand-to [
+                                    [0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0]
+                                    [0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0]
+                                    [0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1]
+                                    [1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1]
+                                    [1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                    [0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0]
+                                    [0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0]] rows columns))
+
+(defonce twinbee (utils/expand-to [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0]
+                                   [1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1]
+                                   [1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1]
+                                   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0]
+                                   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
+                                   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0]
+                                   [1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0]
+                                   [1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0]
+                                   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0]]
+                                  rows columns))
+
+
+
+
+
 ;; -------------------------
 ;; View
+
+(defn pattern-button [pattern-matrix name]
+  [:button {:on-click #(set-pattern pattern-matrix)
+            :on-mouse-over #(set-preview pattern-matrix)
+            :on-mouse-out #(set-preview nil)
+            :class "small-btn blue"} name])

 (defn game-of-life []
   [:div {:style {:margin "0px 0px 0px 0px"}}
@@ -167,8 +232,8 @@
      [:div
       [:div {:class "half-size"}
        [:button {:on-click #(start-game!)
-                      :disabled running?
-                      :class "full-btn green"} "PLAY"]]
+                 :disabled running?
+                 :class "full-btn green"} "PLAY"]]
       [:div {:class "half-size"}
        [:button {:on-click #(stop-game!)
                  :disabled (not running?)
@@ -179,26 +244,18 @@

    [:div
     [:h5 "space ships"]
-
     [:div
-     [:button {:on-click #(set-pattern glider)
-               :on-mouse-over #(set-preview glider)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "Glider"]
-     [:button {:on-click #(set-pattern lwss)
-               :on-mouse-over #(set-preview lwss)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "LW space ship"]
-     [:button {:on-click #(set-pattern mwss)
-               :on-mouse-over #(set-preview mwss)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "MW space ship"]
-     [:button {:on-click #(set-pattern hwss)
-               :on-mouse-over #(set-preview hwss)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "HW space ship"]
-     ]
-    ]])
+     (pattern-button glider "Glider")
+     (pattern-button lwss "LW space ship")
+     (pattern-button mwss "MW space ship")
+     (pattern-button hwss "HW space ship")]]
+
+   [:div
+    [:h5 "Oscillators"]
+    (pattern-button pulsar "Pulsar")
+    (pattern-button figure-8 "Figure 8")
+    (pattern-button queenbee "Queen bee shuttle")
+    (pattern-button twinbee "Twin bees shuttle")]])

 ;; -------------------------
 ;; Initialize app


redeploy to reconfigure for ssl

redeploy to reconfigure for ssl

--- src/cljs/secret_shame/core.cljs
+++ src/cljs/secret_shame/core.cljs
@@ -65,7 +65,7 @@
       (if-not @editing?
         [:h4.list-group-item-heading "Thief"]
         [:input.list-group-item-heading.editing
-         {:onChange (fn [e] (.log js/console "occupation changed"))
+         {:onChange (fn [e] (.log js/console "occupation has changed"))
           :value "Thief"}])]

      [:div.list-group.item.widget.widget-card


Pr-str keyword values.

Pr-str keyword values.

--- src/stuttaford/radiant/components.cljs
+++ src/stuttaford/radiant/components.cljs
@@ -116,4 +116,6 @@
                  (for [row (->> rows (paginate current-page) (sort-rows sort-col))]
                    [:tr
                     (for [value row]
-                      [:td value])])]))]))))
+                      [:td (if (keyword? value)
+                             (pr-str value)
+                             value)])])]))]))))


[#206] [Message queue] monitor-fn: log mid-circle-size as intented (@nberger)

When the queue size exceeds max-circle-size, a warn message is logged.
It was logging the max size when it was supposed to log the actual size

--- src/taoensso/carmine/message_queue.clj
+++ src/taoensso/carmine/message_queue.clj
@@ -301,7 +301,7 @@
           (when (> (- instant udt-last-warning) (or warn-backoff-ms 0))
             (when (compare-and-set! udt-last-warning_ udt-last-warning instant)
               (timbre/warnf "Message queue size warning: %s (mid-circle-size: %s)"
-                qname max-circle-size))))))))
+                qname mid-circle-size))))))))

 (defn worker
   "Returns a threaded worker to poll for and handle messages `enqueue`'d to


Rename filter predicate with a more semantic name.

--- src/time_tracker/invoices/handlers.clj
+++ src/time_tracker/invoices/handlers.clj
@@ -21,9 +21,9 @@
        (util/normalize-entities)))

 (defn- get-timers-to-invoice
-  [connection start end projects]
+  [connection start end invoice-project?]
   (->> (timers-db/retrieve-between connection start end)
-       (filter #(projects (:project-id %)))
+       (filter #(invoice-project? (:project-id %)))
        (util/normalize-entities)))

 (defn- coerce-rates-map


Change background color to white

Change background color to white

maybe flickering stops now.

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/gui/repl.clj
+++ src/conexp/contrib/gui/repl.clj
@@ -215,9 +215,7 @@
         rpl (into-text-area repl-container repl-thread)]
     (doto rpl
       (.setFont (Font. "Monospaced" Font/PLAIN 16))
-      (.setBackground Color/BLACK)
-      (.setForeground Color/WHITE)
-      (.setCaretColor Color/RED))
+      (.setCaretColor Color/BLACK))
     (.start output-thread)
     (JScrollPane. rpl)))


Fix implementation of do-swing

Fix implementation of do-swing

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/contrib/gui/util.clj
+++ src/conexp/contrib/gui/util.clj
@@ -32,7 +32,7 @@
   "Executes body within the Swing Dispatch Thread or immediately, if
   execution is already in this thread."
   [& body]
-  `(invoke-soon #(do ~@body)))
+  `(invoke-soon ~@body))

 (defmacro do-swing-return
   "Executes body in a thread-safe manner for Swing and returns its value."


Log requests against /api

Log requests against /api

--- src/yetibot/core/webapp/routes/api.clj
+++ src/yetibot/core/webapp/routes/api.clj
@@ -23,7 +23,8 @@
      ; e.g. 'yetibot.core.adapters.slack/*target*
      (symbol (str adapter-ns) "*target*")]))

-(defn api [{:keys [chat-source command token]}]
+(defn api [{:keys [chat-source command token] :as params}]
+  (info "/api called with params:" params)
   (cond
     (empty? chat-source) "chat-source parameter is required!"
     (empty? command) "command parameter is required!"


CMR-8764: Added logging when client still uses Echo-Token header.

--- other/cmr-exchange/authz/src/cmr/authz/token.clj
+++ other/cmr-exchange/authz/src/cmr/authz/token.clj
@@ -28,6 +28,8 @@
 (defn extract
   "Extract the value of `Authorization` or `Echo-Token` header that was passed in the request."
   [request]
+  (when (request/get-header request "echo-token")
+    (log/warn (format "Still using Echo-Token for authorization, client id: %s." (request/get-header request "client-id"))))
   (or (request/get-header request "authorization")
       (request/get-header request "echo-token")))


Make aleph default clojure web container

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/app/server.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/app/server.clj
@@ -58,7 +58,7 @@
   "Starts the server and returns a function that when called, will
    stop the application server."
   ([port]
-    (start port "httpkit"))
+    (start port "aleph"))
   ([port impl]
    (log/info "=============== SSCLJ START" port "===============")
    (log/info "java vendor: " (System/getProperty "java.vendor"))


remove old kernel

remove old kernel

--- core/src/samsara_core/kernel.clj
+++ core/src/samsara_core/kernel.clj
@@ -1,448 +0,0 @@
-(ns samsara-core.kernel
-  (:refer-clojure :exclude [var-get var-set])
-  (:require [clojure.string :as str]
-            [taoensso.timbre :as log]
-            [where.core :refer [where]])
-  (:require [samsara-core.core :as core])
-  (:require [moebius.kv :as kv])
-  (:require [samsara.utils :refer [to-json from-json invariant]])
-  (:require [samsara-core.utils :refer [load-txlog-from-file]])
-  (:require [samsara.trackit :refer [track-time track-rate new-registry
-                                     count-tracker distribution-tracker
-                                     track-pass-count] :as trk]))
-
-;;
-;;   THIS NEED TO BE COMPLETELY RE-DESIGNED!!!!
-;;
-;; Things to keep in mind:
-;; * stream impedence format
-;;   [topic, part, key, msg] -> [state, [event]] ->
-;;   -> [topic, key, msg]
-;; * batching of messages not a single message
-;; * a processable stream will contain data
-;;   from multiple topics (ingestion, ingestion-kv)
-;;   which need to be processed in a single thread,
-;;   here there is a conflict with the idea of batching
-;;   which assume items of the same type.
-;; * should be able to support raw/untouched streams
-;;   which can be in different formats
-;; * support for global kv-state
-;; * support for stream with no output
-;; * support for orthogonal concerns such as
-;;   logging, and metrics collecting
-;; * handling of exception on a message level
-;; * handling of the output-collector done properly
-;;
-
-;; runtime pipeline initialized by init-pipeline!
-(def ^:dynamic *config*        nil)
-(def ^:dynamic *dispatchers*   nil)
-(def ^:dynamic *global-stores* nil) ;; thread local only
-(def ^:dynamic *stores*        nil)
-
-(def ^:dynamic *print-streams*  false)
-
-(defmacro printf-stream [& args]
-  `(when *print-streams*
-     (printf ~@args)))
-
-(def tmp-registry (new-registry))
-(def all-events-counter (binding [trk/*registry* tmp-registry]
-                          (count-tracker "events.all.counter")))
-
-(defn events-counter-stats []
-  (binding [trk/*registry* tmp-registry]
-    (trk/get-metric "events.all.counter")))
-
-
-(def ^:const DEFAULT-STREAM-CFG
-  {:input-partitions          :all
-   :state                     :none
-   :format                    :json
-   :processor                 "samsara-core.core/make-samsara-processor"
-   :processor-type            :samsara-factory
-   :bootstrap                 false
-   :output-topic-partition-fn :sourceId})
-
-
-(defn- config-state-topic
-  [{:keys [input-topic state-topic state] :as cfg}]
-  (if (and (= :partitioned state) (not state-topic))
-    (assoc cfg :state-topic (str input-topic "-kv"))
-    cfg))
-
-
-(defn- config-stream
-  [stream-cfg]
-  (->> stream-cfg
-    (merge DEFAULT-STREAM-CFG)
-    config-state-topic))
-
-
-(defn normalize-stream-config [config]
-  (update config :streams (partial mapv config-stream)))
-
-;;
-;; Utility classes to handle per thread local state
-;;
-
-
-
-(defn thread-local
-  "Create a thread-local var"
-  [init]
-  (proxy [ThreadLocal] []
-    (initialValue [] init)))
-
-
-
-(defprotocol ILocalVar
-  (var-set [this new-val] "set the new value of a local var")
-  (var-get [this] "return the value of local var"))
-
-
-
-(extend-type ThreadLocal
-
-  ILocalVar
-  (var-set [this new-val] (.set this new-val))
-  (var-get [this] (.get this)))
-
-
-
-;; track
-;; how many messages in / out
-;; how many msg/sec
-;; how big is msg in / out
-;; distrib of msg size in / out
-;; processing time
-(defn- make-trackers [job-name stream]
-  (let [topic (-> stream :input-topic)
-        prefix (str "pipeline." job-name "." topic)
-
-        track-time-name (str prefix ".overall-processing.time")
-        track-time-name2 (str prefix ".pipeline-processing.time")
-
-        track-pipeline-time (fn [pipeline]
-                              (fn [state event]
-                                (track-time track-time-name2
-                                            (pipeline state event))))
-
-        total-size-in (count-tracker (str prefix ".in.total-size"))
-        dist-size-in (distribution-tracker (str prefix ".in.size"))
-
-        total-size-out(count-tracker (str prefix ".out.total-size"))
-        dist-size-out (distribution-tracker (str prefix ".out.size"))
-
-        size-in-tracker (invariant #(let [sz (count %)]
-                                   (total-size-in sz)
-                                   (dist-size-in sz)))
-        size-out-tracker (invariant #(let [sz (count (second %))]
-                                   (total-size-out sz)
-                                   (dist-size-out sz)))
-
-        ]
-    {:track-time-name track-time-name
-     :size-in-tracker size-in-tracker
-     :size-out-tracker size-out-tracker
-     :track-pipeline-time track-pipeline-time}))
-
-
-(defn create-function-from-name
-  [fn-ns fn-name & {:keys [is-factory? config]}]
-  ;; requiring the namespace
-  (require (symbol fn-ns))
-  (let [fn-symbol (resolve (symbol fn-ns fn-name))]
-    (if-not fn-symbol
-      (throw (ex-info (str "function '" fn-ns "/" fn-name "' not found.") {}))
-      (if is-factory?
-        (fn-symbol config)
-        fn-symbol))))
-
-
-(defmulti create-core-processor
-  (fn [{:keys [processor-type] :as stream} config] processor-type))
-
-
-(defmethod create-core-processor :samsara-factory
-  [{:keys [id processor] :as stream} config]
-  (let [factory (or processor
-                   "samsara-core.core/make-samsara-processor")
-        [fns ff] (str/split factory #"/")]
-    (log/info "Loading processor[" id "]:" factory)
-    (create-function-from-name fns ff :is-factory? true :config config)))
-
-
-
-(defmethod create-core-processor :raw
-  [{:keys [id processor] :as stream} config]
-  (let [[fns ff] (str/split processor #"/")]
-    (log/info "Loading processor[" id "]:" processor)
-    (create-function-from-name fns ff)))
-
-
-
-(defmethod create-core-processor :raw-factory
-  [{:keys [id processor] :as stream} config]
-  (let [[fns ff] (str/split processor #"/")]
-    (log/info "Loading processor[" id "]:" processor)
-    (create-function-from-name fns ff :is-factory? true :config config)))
-
-
-(defn make-raw-pipeline
-  [{:keys [output-topic-partition-fn output-topic] :as stream}
-   {{:keys [job-name]} :job :as config}]
-  (let [{:keys [track-time-name
-                track-pipeline-time
-                size-in-tracker
-                size-out-tracker]} (make-trackers job-name stream)
-        pipeline (track-pipeline-time (create-core-processor stream config))
-        output-topic-fn (constantly output-topic)]
-    (fn [state event]
-      (track-time track-time-name
-                  (->> event
-                       size-in-tracker
-                       from-json
-                       vector
-                       (pipeline state) ;; -> [state [events]]
-                       ((fn [[s events]]
-                          [s
-                           (->> events
-                                (map (juxt output-topic-fn output-topic-partition-fn to-json))
-                                (map size-out-tracker))])))))))
-
-
-
-(defn kv-restore!
-  "Takes an event in json format which contain an Tx-Log entry and
-   it pushes the change to the running *kv-store*"
-  [stream ^String event]
-  ;; this ugly stuff works because *stores* is thread-local
-  (printf-stream "STATE[%s] : %s\n" stream event)
-  (track-time (str "pipeline." (-> *config* :job :job-name) ".stores.local." stream ".restore.time")
-    (let [kv-store (get *stores* stream)]
-      (var-set kv-store
-               (->> event
-                    from-json
-                    vector
-                    (kv/restore (var-get kv-store)))))))
-
-
-
-(defn global-kv-restore!
-  "Takes an event in json format which contain an Tx-Log entry and
-   it pushes the change to the running *global-stores*"
-  [stream-id ^String event]
-  (printf-stream "GLOBAL[%s] : %s\n" stream-id event)
-  (track-time (str "pipeline." (-> *config* :job :job-name) ".stores.global." (name stream-id) ".restore.time")
-   (let [txlog (->> event from-json vector)]
-     (swap! *global-stores*
-            update
-            stream-id
-            (fn [kvstore]
-              (kv/restore (or kvstore (kv/make-in-memory-kvstore))
-                          txlog))))))
-
-
-
-(defn global-store [store-id]
-  (get @*global-stores* store-id))
-
-
-
-(defn global-store-lookup [store-id sourceId key]
-  (some-> (global-store store-id) (kv/get sourceId key)))
-
-
-
-(defn load-global-store-from-txlog-file! [keystore-id file]
-  (let [kvstore (load-txlog-from-file file)]
-    (swap! *global-stores* assoc keystore-id kvstore)))
-
-
-
-(defn process-dispatch
-  "Takes an event as a JSON encoded String and depending on the stream
-   name dispatches the function to the appropriate handler.
-   One handler is the normal pipeline processing, the second handler
-   is for the kv-store"
-  [output-collector stream partition key message]
-
-  (all-events-counter)
-  (try
-    (if-let [dispatcher (get *dispatchers* stream)]
-      (let [{:keys [topic-filter handler]} dispatcher]
-        (when (topic-filter partition)
-          (handler output-collector stream partition key message)))
-      ;; TODO: throw error
-      (log/warn "No dispatcher found for:" stream))
-
-    ;;
-    ;; ERROR Handling
-    ;;
-    (catch Exception x
-      (log/warn x "Error processing message from [" stream "]:" message)
-      (track-rate (str "pipeline." (-> *config* :job :job-name) "." stream ".errors"))
-      (output-collector [[(str stream "-errors") key message]]))))
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-
-(defn- compile-partition-filter
-  [{:keys [input-partitions] :as cfg}]
-  (if (= :all input-partitions)
-    (constantly true)
-    (set input-partitions)))
-
-
-(defn- tx-log->formatter
-  "Return a function which turns the tx-log into a a triplet of
-
-   [topic partition-key json-data]"
-  [kvstore-topic]
-  (fn [txlog]
-    (->> txlog
-         (map (fn [[k ver v]]
-                [kvstore-topic k (to-json [k ver v])])))))
-
-
-
-
-
-(defn- compile-input-topic-handler [{:keys [state-topic] :as stream-cfg} config]
-  (let [tx-log->messages (tx-log->formatter state-topic)
-        pipeline (make-raw-pipeline stream-cfg config)]
-    (fn [output-collector stream partition key message]
-
-      (printf-stream "INPUT[%s/%s/%s] : %s\n" stream partition key message)
-
-      ;; other messages are processed by the normal pipeline, however here
-      ;; we need to emit the state messages as well.
-
-      ;; this ugly stuff works because *stores* is thread-local
-      (let [kv-state (get *stores* stream)
-            state    (var-get kv-state)
-            [new-state rich-events] (pipeline state message)
-            txlog     (kv/tx-log new-state)
-            txlog-msg (tx-log->messages txlog)
-            all-output (concat txlog-msg rich-events)]
-
-        ;; emitting the output
-        (output-collector all-output)
-
-        ;; flushing tx-log
-        (let [new-state' (kv/flush-tx-log new-state txlog)]
-          (var-set kv-state new-state'))))))
-
-
-(defn- compile-input-topic-config [{:keys [input-topic state] :as stream} config]
-  (when (or (= state :none) (= state :partitioned))
-    {input-topic {:topic-filter (compile-partition-filter stream)
-                  :handler (compile-input-topic-handler stream config)}}))
-
-(defn- compile-kv-state-handler [{:keys [input-topic state] :as stream}]
-  (fn [output-collector stream partition key message]
-    (kv-restore! input-topic message)))
-
-(defn- compile-global-kv-state-handler [{:keys [id] :as stream}]
-  (fn [output-collector stream partition key message]
-    (global-kv-restore! id message)))
-
-;; return a fn which takes [output-collector stream partition key message]
-(defn- compile-custom-state-handler [{:keys [id] :as stream} config]
-  (create-core-processor stream config))
-
-
-(defn- compile-state-topic-config
-  [{:keys [state-topic state input-topic] :as stream}
-   config]
-  (cond
-
-    (= state :partitioned)
-    {state-topic {:topic-filter (compile-partition-filter stream)
-                  :handler (compile-kv-state-handler stream)}}
-
-    (= state :global)
-    {input-topic {:topic-filter identity
-                  :handler (compile-global-kv-state-handler stream)}}
-
-    (= state :custom)
-    {input-topic {:topic-filter identity
-                  :handler (compile-custom-state-handler stream config)}}
-    ))
-
-
-(defn- compile-stream-config
-  [stream config]
-  (merge
-   (compile-input-topic-config stream config)
-   (compile-state-topic-config stream config)))
-
-
-(defn compile-config [config]
-  (->> config
-       :streams
-       (mapcat #(compile-stream-config % config))
-       (into {})))
-
-
-(defn init-stores [config]
-  (let [streams (map :input-topic
-                     (filter (where [:state = :partitioned])
-                             (:streams config)))
-        _ (log/info "Initializing kv-store for the following streams: " streams)
-        local-store (constantly (thread-local (kv/make-in-memory-kvstore)))]
-    (into {} (map (juxt identity local-store) streams))))
-
-
-(defn init-pipeline! [config]
-  (log/info "Initialize processors...")
-  (alter-var-root #'*config*        (constantly config))
-  (alter-var-root #'*stores*        (constantly (init-stores config)))
-  (alter-var-root #'*global-stores* (constantly (atom {})))
-  (alter-var-root #'*dispatchers*   (constantly (compile-config config))))
-
-
-
-
-(comment
-  (def config (#'samsara-core.main/read-config "./config/config.edn"))
-
-  (init-pipeline! config)
-
-  (keys (compile-config config))
-
-  (def stream (-> config :streams first))
-
-  (defn out-> [all-output]
-    (println (with-out-str
-               (clojure.pprint/pprint all-output))))
-
-
-  (def msg "{\"publishedAt\":1444755781999,\"receivedAt\":1444755781764,\"timestamp\":1444755781000,\"sourceId\":\"3aw4sedrtcyvgbuhjkn\",\"eventName\":\"user.item.removed\",\"page\":\"orders\",\"item\":\"sku-5433\",\"action\":\"remove\"}")
-
-  (process-dispatch out-> "ingestion" 0 "ciao" msg)
-
-  ((:handler (*dispatchers* "ingestion")) out-> "ingestion" 0 "ciao" msg)
-
-  ((compile-input-topic-handler stream config) out-> "ingestion" 0 "ciao" msg)
-
-  ((tx-log->formatter "ingestion-kv") (kv/tx-log (-> (kv/make-in-memory-kvstore) (kv/set "ciao" :a 1))))
-
-  (def state (kv/make-in-memory-kvstore))
-  ((make-raw-pipeline stream config)  state msg)
-  ((create-core-processor stream config) state [(from-json msg)])
-
-  (:output-topic-partition-fn stream)
-
-  *global-stores*
-
-  ((:handler (*dispatchers* "dimension1")) out-> "dimension1" 0 "ciao" "[\"ciao\",1,{\"a\":1}]")
-
-  (global-kv-restore! :dimension1 "[\"ciao\",1,{\"a\":1}]")
-
-
-)


Adopt a better style in test's descriptions.

--- test/berry/formatter/camelize_test.clj
+++ test/berry/formatter/camelize_test.clj
@@ -4,10 +4,10 @@

 (deftest camel-case

-  (testing "a word with underlines"
+  (testing "A word with underlines."

            (is (= "firstName" (camelize "first_name"))))

-  (testing "a word with dashes"
+  (testing "A word with dashes."

            (is (= "anotherAnyWord" (camelize "another-any-word")))))


unit tests

unit tests

Unit tests clean up

--- test/weathermaxspreadapp/core_test.clj
+++ test/weathermaxspreadapp/core_test.clj
@@ -1,4 +1,8 @@
 (ns weathermaxspreadapp.core-test
+  ^{:author "@joeabala"
+    :doc "Test namespace. weather_test1.dat and weather_test2.dat are located in the run folder"
+    :added "1.0"
+    }
   (:require [clojure.test :refer :all]
             [weathermaxspreadapp.core :as core]
             [weathermaxspreadapp.core :refer :all]))
@@ -6,12 +10,12 @@
 (deftest calculate-spread-test
   "Testing calculate-spread function"
   (is (= [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30]
-         (core/calculate-spread "/Users/abala/abala/projects/clojure/weatherapp/src/weather_test1.dat")))
+         (core/calculate-spread "/Users/abala/abala/projects/clojure/weatherapp/src/weather_test1.dat"))) ;; edit file path appropriately
   (is (= [15 20 10 40 5 5 50 5 10 10 5 30 10 10 15 10 5 25 20 20 20 40 25 25 25 45 20 5 5 5]
-         (core/calculate-spread "/Users/abala/abala/projects/clojure/weatherapp/src/weather_test2.dat"))))
+         (core/calculate-spread "/Users/abala/abala/projects/clojure/weatherapp/src/weather_test2.dat")))) ;; edit file path appropriately

 (deftest print-results-test
   "Testing print results function"
   (is (= [3 3.8] (core/print-result [1.5 2.3 3.8])))
   (is (= [1 44.3] (core/print-result [44.3 32.8 41.2])))
-  (is (= [2 95.1] (core/print-result [88.5 95.1 10.2]))))+  (is (= [2 95.1] (core/print-result [88.5 95.1 10.2]))))


fix bezier final dot bug

fix bezier final dot bug

--- frontend/src/uxbox/main/ui/workspace/drawarea.cljs
+++ frontend/src/uxbox/main/ui/workspace/drawarea.cljs
@@ -94,9 +94,6 @@
          [:circle.close-bezier {:cx x
                    :cy y
                    :r 5
-                   :stroke "#d52747"
-                   :stroke-width "2px"
-                   :style {:cursor "pointer"}
                    :on-click on-click}])])))

 ;; --- Drawing Initialization


remember to start/stop the interval timer for looper

--- src/om_next_datascript_localisation_demo/components/looper.cljs
+++ src/om_next_datascript_localisation_demo/components/looper.cljs
@@ -4,11 +4,32 @@
     [sablono.core :as html :refer-macros [html]]
     [om-next-datascript-localisation-demo.logging :refer-macros [log]]))

+(defn make-timer [this]
+  (js/setInterval #(.inc-index this) 4000))

 (defui Looper
   Object
   (initLocalState [this]
-    {:current-index 0})
+    {:current-index 0 :timer 0})
+
+  (componentWillMount [this]
+    ;;(log "Looper: componentWillMount")
+    (om/update-state! this assoc :timer (make-timer this)))
+
+  (componentWillUnmount [this]
+    ;;(log "Looper: componentWillUnmount")
+    (if-let [timer (om/get-state this :timer)]
+      (js/clearInterval timer)))
+
+  (componentWillReceiveProps [this new-props]
+    ;;(log "Looper: componentWillReceiveProps")
+    (if-let [timer (om/get-state this :timer)]
+      (js/clearInterval timer))
+    (let [things (:things new-props)
+          length (count things)]
+      (if (> length 0)
+        (om/set-state! this {:current-index 0 :timer (make-timer this)})
+        (om/set-state! this {:current-index 0 :timer 0}))))

   (inc-index [this]
     (let [props (om/props this)
@@ -17,7 +38,8 @@
           current-index (om/get-state this :current-index)
           new-index (inc current-index)
           new-index (if (>= new-index length) 0 new-index)]
-      (om/set-state! this {:current-index new-index})))
+      ;;(log "Looper: inc-index")
+      (om/update-state! this assoc :current-index new-index)))

   (render [this]
     (let [props (om/props this)
@@ -25,8 +47,6 @@
           current-index (om/get-state this :current-index)]
       ;;(log "Looper: render:" props)
       ;;(log "Looper: render: current-index" current-index)
-      (js/setTimeout #(.inc-index this) 4000)
       (html [:p (nth things current-index)]))))

-
 (def looper (om/factory Looper))


(TK-110) Default idle timeout now set in millis

--- src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+++ src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
@@ -136,9 +136,9 @@
 (def default-graceful-stop-timeout 60000)

 (def default-proxy-idle-timeout
-  "The default number of seconds to wait before the proxy gives up on the
+  "The default number of milliseconds to wait before the proxy gives up on the
   upstream server if the :idle-timeout value isn't set in the proxy config."
-  60)
+  60000)

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Utility Functions
@@ -374,7 +374,8 @@

       (createHttpClient []
         (let [client (proxy-super createHttpClient)
-              timeout (* 1000 (or idle-timeout default-proxy-idle-timeout))]
+              timeout (if idle-timeout (* 1000 idle-timeout)
+                                       default-proxy-idle-timeout)]
           (if (:follow-redirects options)
             (.setFollowRedirects client true)
             (.setFollowRedirects client false))


Frontend now gets response of completed character, not viewed or put anywhere yet

--- src/hphelper/server/handler.clj
+++ src/hphelper/server/handler.clj
@@ -89,10 +89,10 @@
             :newchar
             clojure.edn/read-string
             (cgen/create-character)
-            (#(do (log/trace "create-char:" %) %))
             (sl/save-char-to-db)
             (sl/load-char-from-db)
             (#(do (log/trace "response:" %) %))
+            (json/write-str)
             )
         )
   ;; Display a character


Catch exceptions otherwise disruptor thread stops

--- src/io/cyanite/engine/queue.clj
+++ src/io/cyanite/engine/queue.clj
@@ -71,8 +71,12 @@
      disruptor
      (into-array EventHandler
                  [(event-handler (fn [e]
-                                   (r/inc! reporter [:cyanite alias :events])
-                                   (f e)))]))
+                                   (try
+                                     (r/inc! reporter [:cyanite alias :events])
+                                     (f e)
+                                     (catch Exception ex
+                                       (r/inc! reporter [:cyanite alias :errors])
+                                       (r/capture! reporter ex)))))]))
     (.handleExceptionsWith
      disruptor
      (exception-handler (fn [[ex event]]


[l.d.compile] Add regexp support to :aot and :aot-exclude-ns

--- src/leiningen/droid/compile.clj
+++ src/leiningen/droid/compile.clj
@@ -1,20 +1,21 @@
 (ns leiningen.droid.compile
   "This part of the plugin is responsible for the project compilation."
   (:refer-clojure :exclude [compile])
-  (:require [leiningen compile javac]
+  (:require [bultitude.core :as bultitude]
             [clojure.java.io :as io]
-            [clojure.set :as sets]
+            [clojure.set :as set]
+            [clojure.string :as str]
+            [clostache.parser :as clostache]
+            [leiningen.compile :refer [stale-namespaces]]
+            [leiningen.core.classpath :refer [get-classpath]]
             [leiningen.core.eval :as eval]
-            [clojure.string :as st]
-            [clostache.parser :as clostache])
-  (:use [leiningen.droid.utils :only [get-sdk-android-jar sdk-binary
-                                      ensure-paths sh dev-build?]]
-        [leiningen.new.templates :only [slurp-resource sanitize]]
-        [leiningen.droid.manifest :only [get-package-name generate-manifest]]
-        [leiningen.core
-         [main :only [debug info abort]]
-         [classpath :only [get-classpath]]]
-        [bultitude.core :only [namespaces-on-classpath]]))
+            [leiningen.core.main :refer [debug info abort]]
+            [leiningen.droid.manifest :refer [get-package-name generate-manifest]]
+            [leiningen.droid.utils :refer [get-sdk-android-jar sdk-binary
+                                           ensure-paths sh dev-build?]]
+            leiningen.javac
+            [leiningen.new.templates :refer [slurp-resource sanitize]])
+  (:import java.util.regex.Pattern))

 ;; ### Pre-compilation tasks

@@ -58,12 +59,13 @@
        constants))

 (defn generate-build-constants
-  [{{:keys [manifest-path gen-path build-config]} :android :as project}]
+  [{{:keys [manifest-path gen-path build-config rename-manifest-package]}
+    :android :as project}]
   (let [res                (io/resource "templates/BuildConfig.java")
         package-name       (get-package-name manifest-path)
-        package-path       (apply io/file gen-path (st/split package-name #"\."))
+        package-path       (apply io/file gen-path (str/split package-name #"\."))
         version-name       (-> project :version)
-        application-id     (or (-> project :android :rename-manifest-package) package-name)
+        application-id     (or rename-manifest-package package-name)
         template-constants (map-constants (merge {"VERSION_NAME"   version-name
                                                   "APPLICATION_ID" application-id}
                                                  build-config))]
@@ -72,8 +74,7 @@
           :package-name package-name
           :constants    template-constants}
          (clostache/render (slurp-resource res))
-         (spit (io/file package-path "BuildConfig.java"))))
-  project)
+         (spit (io/file package-path "BuildConfig.java")))))

 (defn generate-resource-code
   "Generates the R.java file from the resources.
@@ -99,8 +100,7 @@
         external-resources
         "-I" android-jar
         "-J" gen-path
-        "--generate-dependencies"))
-  project)
+        "--generate-dependencies")))

 (defn code-gen
   "Generates R.java and builds a manifest with the appropriate version
@@ -113,16 +113,31 @@
 (defn namespaces-to-compile
   "Takes project and returns a set of namespaces that should be AOT-compiled."
   [{{:keys [aot aot-exclude-ns]} :android :as project}]
-  (-> (case aot
-        :all
-          (seq (leiningen.compile/stale-namespaces (assoc project :aot :all)))
-        :all-with-unused
-          (namespaces-on-classpath :classpath
-                                   (map io/file (get-classpath project)))
-        ;; else
-          (map symbol aot))
-      set
-      (sets/difference (set (map symbol aot-exclude-ns)))))
+  (let [all-nses (bultitude/namespaces-on-classpath
+                  :classpath (map io/file (get-classpath project)))
+        include (case aot
+                  :all (stale-namespaces (assoc project :aot :all))
+                  :all-with-unused all-nses
+                  aot)
+        exclude aot-exclude-ns
+
+        {include-nses false, include-regexps true}
+        (group-by #(instance? Pattern %) include)
+
+        {exclude-nses false, exclude-regexps true}
+        (group-by #(instance? Pattern %) exclude)]
+    (->> (set/difference (set (map str (if (seq include-regexps)
+                                         all-nses include-nses)))
+                         (set exclude-nses))
+         (filter (fn [ns] (if (seq include-regexps)
+                           (some #(re-matches % ns) include-regexps)
+                           true)))
+         (remove (fn [ns] (if (seq exclude-regexps)
+                           (some #(re-matches % ns) exclude-regexps)
+                           false)))
+         (concat (if (seq include-regexps)
+                   include-nses ()))
+         (map symbol))))

 (defn compile-clojure
   "Compiles Clojure files into .class files.


Need to make sure things aren't lazy

Need to make sure things aren't lazy

--- src/maestro/messages/alarms.clj
+++ src/maestro/messages/alarms.clj
@@ -18,7 +18,7 @@
 (defn swap-policy-arns
   [scaling-policy-arns action-arns]
   (when action-arns
-    (map (partial swap-policy-arn scaling-policy-arns) action-arns)))
+    (vec (map (partial swap-policy-arn scaling-policy-arns) action-arns))))

 (defn ensure-action-arn
   [scaling-policy-arns {:keys [alarm-actions insufficient-data-actions ok-actions] :as alarm}]
@@ -31,7 +31,7 @@
 (defn ensure-action-arns
   [{:keys [cloudwatch-alarms scaling-policy-arns]}]
   (when (seq cloudwatch-alarms)
-    (map (partial ensure-action-arn scaling-policy-arns) cloudwatch-alarms)))
+    (vec (map (partial ensure-action-arn scaling-policy-arns) cloudwatch-alarms))))

 (defn populate-action-arns
   [{:keys [parameters]}]


Reduce the number of files we need to generate.

--- POC/aggregation/tools/genAssessments/src/genAssessments/core.clj
+++ POC/aggregation/tools/genAssessments/src/genAssessments/core.clj
@@ -13,7 +13,7 @@
   )
 )

-(defn gen-student [districtName schoolName id]
+(defn gen-student [schoolName id]
   (element :Student {}
     (element :StudentUniqueStateId {} (join "-" [schoolName id]))
     (element :Name {}
@@ -29,23 +29,15 @@
   )
 )

-(defn gen-students [districtName schoolName ids output-file]
+(defn gen-students [schoolName ids output-file]
   (gen-edfi :InterchangeStudentParent output-file
     (into ()
       [
         (for [id ids
-          :let [tmp (gen-student districtName schoolName id)]]
+          :let [tmp (gen-student schoolName id)]]
           tmp
         )
       ]
-    )
-  )
-)
-
-(defn student-ref [districtName schoolName student]
-  (element :StudentReference {}
-    (element :StudentIdentity {}
-      (element :StudentUniqueStateId {} (join "-" [schoolName student]))
     )
   )
 )
@@ -169,33 +161,6 @@
   )
 )

-(defn gen-enroll
-  [districtName schoolName student]
-  (element :StudentSchoolAssociation {}
-    (student-ref districtName schoolName student)
-    (element :SchoolReference {}
-      (element :EducationalOrgIdentity {}
-        (element :StateOrganizationId {} districtName)
-      )
-    )
-    (element :EntryDate {} "2011-09-01")
-    (element :EntryGradeLevel {} "Seventh grade")
-  )
-)
-
-(defn gen-section-assoc
-  [districtName schoolName studentName sectionName]
-  (element :StudentSectionAssociation {}
-    (student-ref districtName schoolName studentName)
-    (element :SectionReference {}
-      (element :SectionIdentity {}
-        (element :StateOrganizationId {} districtName)
-        (element :UniqueSectionCode {} sectionName)
-      )
-    )
-  )
-)
-
 (defn create-assessment [assessmentName]
   (let [tmp (element :Assessment {:id "Grade_7_2011_State_Math"}
       (element :AssessmentTitle {} assessmentName)
@@ -259,16 +224,26 @@
     (> 33 score) "E")
 )

-(defn gen-saa [districtName schoolName student assessment date]
+(defn student-ref [schoolName student]
+  (element :StudentReference {}
+    (element :StudentIdentity {}
+      (element :StudentUniqueStateId {} (join "-" [schoolName student]))
+    )
+  )
+)
+
+(defn gen-saa [schoolName student assessment date]
   (let [score (rand-nth (range 6 33))]
     (element :StudentAssessment {}
       (element :AdministrationDate {} date)
+      (element :AdministrationEndDate {} date)
+      (element :SerialNumber {} "2")
       (element :ScoreResults {:AssessmentReportingMethod "Scale score"}
         (element :Result {} (str score)))
         (element :PerformanceLevels {}
           (element :CodeValue {} (get-perf-level score))
         )
-        (student-ref districtName schoolName student)
+        (student-ref schoolName student)
         (element :AssessmentReference {}
           (element :AssessmentIdentity {}
             (element :AssessmentIdentificationCode {:IdentificationSystem "Test Contractor"}
@@ -281,16 +256,43 @@
 )

 (defn gen-saas
-  [districtName schoolName students assessment n output-file]
+  [schoolName students assessment n output-file]
   (gen-edfi :InterchangeStudentAssessment output-file
     (for [studentName students, i (range 1 n)]
-      (gen-saa districtName schoolName studentName assessment (str "2011-10-" (format "%02d" i)))
+      (gen-saa schoolName studentName assessment (str "2011-10-" (format "%02d" i)))
+    )
+  )
+)
+
+(defn gen-enroll
+  [schoolName student]
+  (element :StudentSchoolAssociation {}
+    (student-ref schoolName student)
+    (element :SchoolReference {}
+      (element :EducationalOrgIdentity {}
+        (element :StateOrganizationId {} schoolName)
+      )
+    )
+    (element :EntryDate {} "2011-09-01")
+    (element :EntryGradeLevel {} "Seventh grade")
+  )
+)
+
+(defn gen-section-assoc
+  [districtName schoolName studentName sectionName]
+  (element :StudentSectionAssociation {}
+    (student-ref schoolName studentName)
+    (element :SectionReference {}
+      (element :SectionIdentity {}
+        (element :StateOrganizationId {} districtName)
+        (element :UniqueSectionCode {} sectionName)
+      )
     )
   )
 )

 (defn enroll [districtName schoolName studentName]
-  (gen-enroll districtName schoolName studentName)
+  (gen-enroll schoolName studentName)
   (gen-section-assoc districtName schoolName studentName "Math-7-2011-Sec2")
 )

@@ -344,7 +346,7 @@
   (gen-edfi :InterchangeEducationOrgCalendar output-file (reverse (create-session districtName)))
 )

-(defn create-section [districtName schoolName]
+(defn create-section [districtName]
   (into () [
     (element :CourseOffering {}
       (element :LocalCourseCode {} "Math-7")
@@ -397,57 +399,57 @@
   )
 )

-(defn gen-sections [districtName schoolName output-file]
-  (gen-edfi :InterchangeMasterSchedule output-file (reverse (create-section districtName schoolName)))
+(defn gen-sections [districtName output-file]
+  (gen-edfi :InterchangeMasterSchedule output-file (reverse (create-section districtName)))
 )

 (def districts
-    ["Abbott","Addison","Adirondack","Afton","Akron","Albany City","Albion","Alden","Alexander","Alexandria","Alfred-Almond",
-     "Allegany-Limestone","Altmar Parish-Williamstown","Amagansett","Amherst","Amityville","Amsterdam City","Andes","Andover",
-     "Ardsley","Argyle","Arkport","Arlington","Attica","Auburn City","Ausable Valley","Averill Park","Avoca","Avon","Babylon",
-     "Bainbridge-Guilford","Baldwin","Baldwinsville","Ballston Spa","Barker","Batavia City","Bath","Bay Shore","Bayport-Blue Point",
-     "Beacon City","Beaver River","Bedford","Beekmantown","Belfast","Belleville Henderson","Bellmore","Bellmore-Merrick Central",
-     "Bemus Point","Berkshire","Berlin","Berne-Knox-Westerlo","Bethlehem","Bethpage","Binghamton City","Blind Brook-Rye",
-     "Bolivar-Richburg","Bolton","Bradford","Brasher Falls","Brentwood","Brewster","Briarcliff Manor","Bridgehampton","Brighton",
-     "Broadalbin-Perth","Brockport","Brocton","Bronxville","Brookfield","Brookhaven-Comsewogue","Broome-Delaware-Tioga Boces",
-     "Brunswic","Brushton-Moira","Buffalo City","Burnt Hills-Ballston Lake","Byram Hills","Byron-Bergen","Cairo-Durham",
-     "Caledonia-Mumford","Cambridge","Camden","Campbell-Savona","Canajoharie","Canandaigua City","Canaseraga","Canastota",
-     "Candor","Canisteo-Greenwood","Canton","Capital Region Boces","Carle Place","Carmel","Carthage","Cassadaga Valley",
-     "Cato-Meridian","Catskill","Cattar-Allegany-Erie-Wyoming Boces","Cattaraugus-Little Valley","Cayuga-Onondaga Boces",
-     "Cazenovia","Center Moriches","Central Islip","Central Square","Chappaqua","Charlotte Valley","Chateaugay","Chatham",
-     "Chautauqua Lake","Chazy","Cheektowaga","Cheektowaga-Maryvale","Cheektowaga-Sloan","Chenango Forks","Chenango Valley",
-     "Cherry Valley-Springfield","Chester","Chittenango","Churchville-Chili","Cincinnatus","Clarence","Clarkstown","Cleveland Hill",
-     "Clifton-Fin","Clinton","Clinton-Essex-Warren-Washing Boces","Clyde-Savannah","Clymer","Cobleskill-Richmondville","Cohoes City",
-     "Cold Spring Harbor","Colton-Pierrepont","Commack","Connetquot","Cooperstown","Copenhagen","Copiague","Corinth","Corning City",
-     "Cornwall","Cortland City","Coxsackie-Athens","Croton-Harmon","Crown Point","Cuba-Rushford","Dalton-Nunda (Keshequa)",
-     "Dansville","Deer Park","Delaware Academy At Delhi","Delaw-Chenango-Madison-Otsego Boces","Depew","Deposit","Deruyter",
-     "Dobbs Ferry","Dolgeville","Dover","Downsville","Dryden","Duanesburg","Dundee","Dunkirk City","Dutchess Boces","East Aurora",
-     "East Bloomfield","East Greenbush","East Hampton","East Irondequoit","East Islip","East Meadow","East Moriches",
-     "East Quogue","East Ramapo  (Spring Valley)","East Rochester","East Rockaway","East Syracuse-Minoa","East Williston",
-     "Eastchester","Eastern Suffolk Boces","Eastport-South Manor","Eden","Edgemont","Edinburg Common","Edmeston","Edwards-Knox",
-     "Elba","Eldred","Elizabethtown-Lewis","Ellenville","Ellicottville","Elmira City","Elmira Heights","Elmont","Elmsford",
-     "Elwood","Erie 1 Boces","Erie 2-Chautauqua-Cattaraugus Boces","Evans-Brant  (Lake Shore)","Fabius-Pompey","Fairport",
-     "Falconer","Fallsburg","Farmingdale","Fayetteville-Manlius","Fillmore","Fire Island","Fishers Island","Floral Park-Bellerose",
-     "Florida","Fonda-Fultonville","Forestville","Fort Ann","Fort Edward","Fort Plain","Frankfort-Schuyler","Franklin",
-     "Garden City","Garrison","Gates-Chili","General Brown","Genesee Valley Boces","Genesee Valley","Geneseo","Geneva City",
-     "Hadley-Luzerne","Haldane","Half Hollow Hills","Hamburg","Hamilton","Hamilton-Fulton-Montgomery Boces","Hammond",
-     "Homer","Honeoye","Honeoye Falls-Lima","Hoosic Valley","Hoosick Falls","Hopevale  At Hamburg","Hornell City",
-     "Inlet Comn","Iroquois","Irvington","Island Park","Island Trees","Islip","Ithaca City","Jamestown City","Jamesville-Dewitt",
-     "Keene","Kendall","Kenmore-Tonawanda","Kinderhook","Kings Park","Kingston City","Kiryas Joel Village","La Fargeville",
-     "Livonia","Lockport City","Locust Valley","Long Beach City","Long Lake","Longwood","Lowville Academy","Lyme",
-     "Middletown City","NYC Geog Dist # 1 - Manhattan","NYC Geog Dist # 2 - Manhattan","NYC Geog Dist # 3 - Manhattan",
-     "NYC Geog Dist # 4 - Manhattan","NYC Geog Dist # 5 - Manhattan","NYC Geog Dist # 6 - Manhattan","NYC Geog Dist # 7 - Bronx",
-     "NYC Geog Dist # 8 - Bronx","NYC Geog Dist # 9 - Bronx","NYC Geog Dist #10 - Bronx","NYC Geog Dist #11 - Bronx",
-     "NYC Geog Dist #12 - Bronx","NYC Geog Dist #13 - Brooklyn","NYC Geog Dist #14 - Brooklyn","NYC Geog Dist #15 - Brooklyn",
-     "NYC Geog Dist #16 - Brooklyn","NYC Geog Dist #17 - Brooklyn","NYC Geog Dist #18 - Brooklyn","NYC Geog Dist #19 - Brooklyn",
-     "NYC Geog Dist #20 - Brooklyn","NYC Geog Dist #21 - Brooklyn","NYC Geog Dist #22 - Brooklyn","NYC Geog Dist #23 - Brooklyn",
-     "NYC Geog Dist #24 - Queens","NYC Geog Dist #25 - Queens","NYC Geog Dist #26 - Queens","NYC Geog Dist #27 - Queens",
-     "NYC Geog Dist #31 - Staten Island","NYC Geog Dist #32 - Brooklyn","NYC Spec Schools - Dist 75","Oakfield-Alabama",
-     "Ossining","Oswego Boces","Oswego City","Otego-Unadilla","Otsego-Delaw-Schoharie-Greene Boces","Owego-Apalachin",
-     "Panama","Parishville-Hopkinton","Patchogue-Medford","Pavilion","Pawling","Pearl River","Peekskill City","Poland",
-     "Randolph","Raquette Lake","Ravena-Coeymans-Selkirk","Red Creek","Red Hook","Remsen","Remsenburg-Speonk",
-     "Salem","Salmon River","Sandy Creek","Saranac","Saranac Lake","Saratoga Springs City","Saugerties","Sauquoit Valley" ] )
+    ["Abbott","Addison","Adirondack","Afton","Akron","Albany-City","Albion","Alden","Alexander","Alexandria","Alfred",
+     "Allegany","Altmar-Parish","Amagansett","Amherst","Amityville","Amsterdam","Andes","Andover",
+     "Ardsley","Argyle","Arkport","Arlington","Attica","Auburn-City","Ausable-Valley","Averill-Park","Avoca","Avon","Babylon",
+     "Bainbridge","Baldwin","Baldwinsville","Ballston","Barker","Batavia","Bath","Bay-Shore","Bayport-Blue",
+     "Beacon-City","Beaver-River","Bedford","Beekmantown","Belfast","Belleville","Bellmore","Bellmore-Merrick",
+     "Bemus","Berkshire","Berlin","Berne-Knox","Bethlehem","Bethpage","Binghamton","Brook-Rye",
+     "Bolivar","Bolton","Bradford","Brasher","Brentwood","Brewster","Briarcliff","Bridgehampton","Brighton",
+     "Broadalbin","Brockport","Brocton","Bronxville","Brookfield","Brookhaven","Broome",
+     "Brunswic","Brushton","Buffalo","Burnt-Hills","Byram Hills","Byron-Bergen","Cairo-Durham",
+     "Caledonia","Cambridge","Camden","Campbell","Canajoharie","Canandaigua","Canaseraga","Canastota",
+     "Candor","Canisteo","Canton","Capital","Carle-Place","Carmel","Carthage","Cassadaga",
+     "Cato-Meridian","Catskill","Cattar-Allegany","Cattaraugus","Cayuga",
+     "Cazenovia","Center","Central-Islip","Central-Square","Chappaqua","Charlotte","Chateaugay","Chatham",
+     "Chautauqua","Chazy","Cheektowaga","Maryvale","Sloan","Chenango-Forks","Chenango",
+     "Cherry-Valley","Chester","Chittenango","Churchville","Cincinnatus","Clarence","Clarkstown","Cleveland",
+     "Clifton-Fin","Clinton","Clinton-Essex","Clyde","Clymer","Cobleskill","Cohoes-City",
+     "Cold-Spring","Colton","Commack","Connetquot","Cooperstown","Copenhagen","Copiague","Corinth","Corning-City",
+     "Cornwall","Cortland-City","Coxsackie","Croton-Harmon","Crown-Point","Cuba-Rushford","Dalton-Nunda",
+     "Dansville","Deer-Park","Delaware","Delaw-","Depew","Deposit","Deruyter",
+     "Dobbs-Ferry","Dolgeville","Dover","Downsville","Dryden","Duanesburg","Dundee","Dunkirk-City","Dutchess","East-Aurora",
+     "East-Bloomfield","East-Greenbush","East-Hampton","East-Irondequoit","East-Islip","East-Meadow","East-Moriches",
+     "East-Quogue","East-Ramapo","East-Rochester","East-Rockaway","East-Syracuse","East-Williston",
+     "Eastchester","Eastern-Suffolk","Eastport-South","Eden","Edgemont","Edinburg-Common","Edmeston","Edwards-Knox",
+     "Elba","Eldred","Elizabethtown","Ellenville","Ellicottville","Elmira-City","Elmira-Heights","Elmont","Elmsford",
+     "Elwood","Erie","Erie-2","Evans-Brant","Fabius-Pompey","Fairport",
+     "Falconer","Fallsburg","Farmingdale","Fayetteville","Fillmore","Fire-Island","Fishers-Island","Floral-Park",
+     "Florida","Fonda","Forestville","Fort-Ann","Fort-Edward","Fort-Plain","Frankfort","Franklin",
+     "Garden-City","Garrison","Gates-Chili","General-Brown","Genesee-Valley","Geneseo","Geneva-City",
+     "Hadley-Luzerne","Haldane","Half-Hollow","Hamburg","Hamilton","Hamilton","Hammond",
+     "Homer","Honeoye","Honeoye","Hoosic-Valley","Hoosick-Falls","Hopevale","Hornell-City",
+     "Inlet-Comn","Iroquois","Irvington","Island-Park","Island-Trees","Islip","Ithaca-City","Jamestown-City","Jamesville",
+     "Keene","Kendall","Kenmore","Kinderhook","Kings-Park","Kingston-City","Kiryas","La-Fargeville",
+     "Livonia","Lockport-City","Locust-Valley","Long-Beach","Long-Lake","Longwood","Lowville-Academy","Lyme",
+     "Middletown","1 - Manhattan","2- Manhattan","3 - Manhattan",
+     "4 - Manhattan","5 - Manhattan","6 - Manhattan","7 - Bronx",
+     "8 - Bronx","9 - Bronx","10 - Bronx","11 - Bronx",
+     "12 - Bronx","13 - Brooklyn","14 - Brooklyn","15 - Brooklyn",
+     "16 - Brooklyn","17 - Brooklyn","18 - Brooklyn","19 - Brooklyn",
+     "20 - Brooklyn","21 - Brooklyn","22 - Brooklyn","23 - Brooklyn",
+     "24 - Queens","25 - Queens","26 - Queens","27 - Queens",
+     "31 - Staten Island","32 - Brooklyn","NYC Spec Schools","Oakfield",
+     "Ossining","Oswego","Oswego-City","Otego-Unadilla","Otsego-Delaw","Owego-Apalachin",
+     "Panama","Parishville","Patchogue","Pavilion","Pawling","Pearl-River","Peekskill","Poland",
+     "Randolph","Raquette","Ravena","Red-Creek","Red-Hook","Remsen","Remsenburg",
+     "Salem","Salmon","Sandy-Creek","Saranac","Saranac-Lake","Saratoga-Springs","Saugerties","Sauquoit-Valley" ] )

 (defn gen-district-schools
   [districtCount schoolsPerDistrict studentsPerSchool]
@@ -473,26 +475,26 @@
   (def filename (.getName file))
   (def formatString (str "edfi-xml,%s,%s,%s"))
   (let [rval (str
+      (if (substring? "-assessment.xml" filename)
+        (format formatString "AssessmentMetadata" filename md5string)
+      )
+      (if (substring? "-schools.xml" filename)
+        (format formatString "EducationOrganization" filename md5string)
+      )
+      (if (substring? "-calendar.xml" filename)
+        (format formatString "EducationOrgCalendar" filename md5string)
+      )
+      (if (substring? "-master-schedule.xml" filename)
+        (format formatString "MasterSchedule" filename md5string)
+      )
       (if (substring? "student.xml" filename)
         (format formatString "StudentParent" filename, md5string)
       )
-      (if (substring? "-schools.xml" filename)
-        (format formatString "EducationOrganization" filename md5string)
-      )
-      (if (substring? "-assessment.xml" filename)
-        (format formatString "AssessmentMetadata" filename md5string)
-      )
       (if (substring? "-enrollment.xml" filename)
         (format formatString "StudentEnrollment" filename md5string)
       )
-      (if (substring? "-sections.xml" filename)
-        (format formatString "MasterSchedule" filename md5string)
-      )
       (if (substring? "-assessment-results.xml" filename)
         (format formatString "StudentAssessment" filename md5string)
-      )
-      (if (substring? "-calendar.xml" filename)
-        (format formatString "EducationOrgCalendar" filename md5string)
       )
       ; need
       ; edfi-xml,StaffAssociation,InterchangeStaffAssociation.xml,c5efbe159ac926629a3b494460243aba
@@ -514,17 +516,20 @@

 (defn gen-big-data
   [districtCount schoolCount studentCount]
-  (gen-assessment "Grade 7 State Math" "/tmp/test/A-assessment.xml")
+  (def sectionName "7th Grade Math -Sec 2")
+  (def assessmentName "Grade 7 State Math")
+
+  (gen-assessment assessmentName "/tmp/test/A-assessment.xml")
   (doseq [ [district] (map list (gen-district-schools districtCount schoolCount studentCount))]
     (doseq [ [districtName schools] district]
       (gen-schools districtName schools (format "/tmp/test/B-%s-schools.xml" districtName))
       (gen-session districtName (format "/tmp/test/C-%s-calendar.xml" districtName))
+      (gen-sections districtName (format "/tmp/test/D-%s-master-schedule.xml" districtName))
       (doseq [ schoolName schools ]
         (def rng (range 1 (+ 1 studentCount)))
-        (gen-students districtName schoolName rng (format "/tmp/test/D-%s-student.xml" schoolName))
-        (gen-sections districtName schoolName (format "/tmp/test/E-%s-sections.xml" schoolName))
+        (gen-students schoolName rng (format "/tmp/test/E-%s-student.xml" schoolName))
         (gen-enrollments districtName schoolName rng "7th Grade Math - Sec 2" (format "/tmp/test/F-%s-enrollment.xml" schoolName))
-        (gen-saas districtName schoolName rng "Grade 7 State Math" 6 (format "/tmp/test/G-%s-assessment-results.xml" schoolName))
+        (gen-saas schoolName rng assessmentName 6 (format "/tmp/test/G-%s-assessment-results.xml" schoolName))
       )
     )
   )


CLJS-1316 let does not detect invalid binding vector when it contains destructuring

In order for assert-args to work properly you need to pass fnname first. Fixes issue for let and loop

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -692,7 +692,7 @@
   the binding-forms are bound to their respective init-exprs or parts
   therein."
   [bindings & body]
-  (assert-args
+  (assert-args let
      (vector? bindings) "a vector for its binding"
      (even? (count bindings)) "an even number of forms in binding vector")
   `(let* ~(destructure bindings) ~@body))
@@ -702,7 +702,7 @@
   the binding-forms are bound to their respective init-exprs or parts
   therein. Acts as a recur target."
   [bindings & body]
-  (assert-args
+  (assert-args loop
     (vector? bindings) "a vector for its binding"
     (even? (count bindings)) "an even number of forms in binding vector")
   (core/let [db (destructure bindings)]


Add TODO

Add TODO

--- src/main/clojure/pigpen/pig.clj
+++ src/main/clojure/pigpen/pig.clj
@@ -418,6 +418,7 @@
   [args]
   (->> args
     (map (fn [a] (if (instance? DataBag a)
+                   ;; TODO tune this
                    (let [c (a/chan java.lang.Long/MAX_VALUE)]
                      [(util/safe-go (util/chan->lazy-seq c)) c])
                    [a nil])))


Clean up :tags and :sig entries in api

Clean up :tags and :sig entries in api

--- hyde-pallet-core/src/com/palletops/hyde_pallet/core.clj
+++ hyde-pallet-core/src/com/palletops/hyde_pallet/core.clj
@@ -55,6 +55,8 @@
                     (swapper :name str)
                     (swapper :var-type (comp str name))
                     (swapper :ns-name str)
+                    (swapper :tag (constantly "")) ;; currently killing it
+                    (swapper :sig clean-arglists)
                     (swapper :arglists clean-arglists)
                     (swapper :doc indent-md-headers)))]
     (postwalk clean api-doc)))
@@ -182,8 +184,19 @@
      {:path "README.md"
       :front-matter {:title "hyde-pallet" :layout "doc"}
       :content (slurp "README.md")})
-    (hyde/write-document!
+    #_(hyde/write-document!
      root
      {:path "example.md"
       :front-matter {:title "Example" :layout "doc"}
       :content (slurp "doc-src/example.md")})))
+
+#_(defn build-site [root jekyll-config site-config]
+;  (hyde/create-collections-dirs! root site-config)
+;  (hyde/write-gemfile! root jekyll-config)
+;  (hyde/write-config! root site-config)
+                                        ;  (hyde/copy-resources! root site-config)
+  (let [test (slurp "/tmp/test.edn")]
+    (println test)
+    (hyde/write-data! root "test" (clojure.edn/read-string test)))
+
+  )


Remove caddisfly tests count assertion

Remove caddisfly tests count assertion

--- backend/src/akvo/lumen/component/caddisfly.clj
+++ backend/src/akvo/lumen/component/caddisfly.clj
@@ -42,7 +42,7 @@
         tests (version-schema-backwards-adapt
                v0-tests
                (-> local-schema-uri io/resource slurp (json/parse-string keyword) extract-tests-v2))]
-    (assert (= v2-count (count tests)))
+    (when-not (= v2-count (count tests))(log/error :failed-caddisfly-expectations :v2-count v2-count :tests-count (count tests)))
     (log/warn ::start "Using caddisfly LOCAL schema-uri:" local-schema-uri)
     (map->Caddisfly (assoc opts :schema tests))))

@@ -53,7 +53,7 @@
         tests (version-schema-backwards-adapt
                v0-tests
                (-> schema-uri client/get :body (json/decode keyword) extract-tests-v2))]
-    (assert (= v2-count (count tests)))
+    (when-not (= v2-count (count tests))(log/error :failed-caddisfly-expectations :v2-count v2-count :tests-count (count tests)))
     (log/info ::start "Using caddisfly ONLINE schema-uri" schema-uri)
     (map->Caddisfly (assoc opts :schema tests))))


Make column collapsible on button click

Make column collapsible on button click

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -70,9 +70,11 @@
   Object
   (render [this]
     (let [pokemon (om/props this)]
-      (dom/tr #js {:id              (str "poketable-row-details-" (:id pokemon))
-                   :className       "collapse"}
-              (dom/td #js {:colSpan 12} "ahoi")))))
+      (dom/tr #js {:id        (str "poketable-row-details-" (:id pokemon))
+                   :className "collapse"}
+              (dom/td #js {:className "well"
+                           :colSpan 13}
+                      "ahoi")))))
 (def poketable-entry-details (om/factory PokeTableEntryDetails {}))

 (defui PokeTableEntry
@@ -84,11 +86,7 @@
                    :data-favorite   (:favorite pokemon)
                    :data-id         (:id pokemon)
                    :data-iv-perfect (:individual_percentage pokemon)
-                   :data-cp         (:cp pokemon)
-                   :data-toggle   "collapse"
-                   :data-target   (str "#poketable-row-details-" (:id pokemon))
-                   :aria-expanded "false"
-                   :aria-controls "collapseExample"}
+                   :data-cp         (:cp pokemon)}
               (dom/td nil
                       (dom/div #js {:className "checkbox"})
                       (dom/label nil
@@ -106,7 +104,14 @@
               (dom/td nil (:individual_attack pokemon))
               (dom/td nil (:individual_defense pokemon))
               (dom/td nil (:individual_stamina pokemon))
-              (dom/td nil (:candy pokemon))))))
+              (dom/td nil (:candy pokemon))
+              (dom/td nil (dom/button #js {:className "btn btn-sm btn-info"
+                                           :type "button"
+                                           :data-toggle     "collapse"
+                                           :data-target     (str "#poketable-row-details-" (:id pokemon))
+                                           :aria-expanded   "false"
+                                           :aria-controls   (str "poketable-row-details-" (:id pokemon))}
+                                      "Details"))))))
 (def poketable-entry (om/factory PokeTableEntry {}))

 (defui PokeTable
@@ -129,13 +134,14 @@
                                            (vlib/sortable-table-header :individual_attack "IV Attack")
                                            (vlib/sortable-table-header :individual_defense "IV Defense")
                                            (vlib/sortable-table-header :individual_stamina "IV Stamina")
-                                           (vlib/sortable-table-header :candy "Candy")))
+                                           (vlib/sortable-table-header :candy "Candy")
+                                           (dom/th nil "")))
                         (dom/tbody nil
                                    (interleave
                                      (map #(poketable-entry (lib/merge-react-key %)) (lib/inventory-pokemon))
                                      (map #(poketable-entry-details (lib/merge-react-key %)) (lib/inventory-pokemon))))
                         #_(apply dom/tbody nil
-                               (map #(poketable-entry (lib/merge-react-key %)) (lib/inventory-pokemon))))
+                                 (map #(poketable-entry (lib/merge-react-key %)) (lib/inventory-pokemon))))
              #_(let [jquery (js* "$")]
                  (.stickyTableHeaders (jquery "#poketable"))))))
 (def poketable (om/factory PokeTable {}))


CMR-1700: Slight refactoring in response to PR comments

--- bootstrap-app/src/cmr/bootstrap/api/routes.clj
+++ bootstrap-app/src/cmr/bootstrap/api/routes.clj
@@ -114,7 +114,7 @@
 (defn- bootstrap-virtual-products
   "Bootstrap virtual products."
   [context params]
-  (let [{:keys [provider-id entry-title]} params]
+  (let [{:keys [provider-id entry-title synchronous]} params]
     (when-not (and provider-id entry-title)
       (srv-errors/throw-service-error
         :bad-request
@@ -128,7 +128,7 @@
     (info (format "Bootstrapping virtual products for provider [%s] entry-title [%s]"
                   provider-id
                   entry-title))
-    (bs/bootstrap-virtual-products context (= "true" (:synchronous params)) provider-id entry-title)
+    (bs/bootstrap-virtual-products context (= "true" synchronous) provider-id entry-title)
     {:status 202 :body {:message "Bootstrapping virtual products."}}))

 (defn- build-routes [system]


Use button component

Use button component

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -1945,20 +1945,18 @@
                                                    :on-change (fn [{:keys [file-name file-content]}]
                                                                 (om/update-state! owner #(merge % {:file-name file-name
                                                                                :file-content file-content})))}))])
-        :actions [(forms/managed-button
-                   [:input.upload-profile-button
-                    {:data-failed-text "Failed" ,
-                     :data-success-text "Uploaded" ,
-                     :data-loading-text "Uploading..." ,
-                     :value "Upload" ,
-                     :type "submit"
-                     :disabled (not (and file-content description))
-                     :on-click #(raise! owner [:upload-provisioning-profile {:project-name project-name
-                                                                             :vcs-type vcs-type
-                                                                             :description description
-                                                                             :file-content (base64/encodeString file-content)
-                                                                             :file-name file-name
-                                                                             :on-success close-fn}])}])]
+        :actions [(button/managed-button {:failed-text "Failed"
+                                          :success-text "Uploaded"
+                                          :loading-text "Uploading..."
+                                          :disabled? (not (and file-content description))
+                                          :kind :primary
+                                          :on-click #(raise! owner [:upload-provisioning-profile {:project-name project-name
+                                                                                :vcs-type vcs-type
+                                                                                :description description
+                                                                                :file-content (base64/encodeString file-content)
+                                                                                :file-name file-name
+                                                                                :on-success close-fn}])}
+                                         "Upload")]
         :close-fn close-fn}))))

 (defn code-signing [{:keys [project-data error-message]} owner]


Note trigger/emit limitation on job-completed events.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -669,7 +669,7 @@
              :added "0.8.0"}

             :trigger/emit
-            {:doc "A fully qualified, namespaced keyword pointing to a function on the classpath at runtime. This function takes 5 arguments: the event map, the window map that this trigger is defined on, the trigger map, a state-event map, and the window state as an immutable value. It must return a segment, or vector of segments, which will flow downstream."
+            {:doc "A fully qualified, namespaced keyword pointing to a function on the classpath at runtime. This function takes 5 arguments: the event map, the window map that this trigger is defined on, the trigger map, a state-event map, and the window state as an immutable value. It must return a segment, or vector of segments, which will flow downstream. Please note, Onyx does not currently provide guarantees that trigger/emit'd segments will be flushed as a result aof a `:job-completed` trigger event."
              :type :keyword
              :optional? true
              :added "0.10.0"}


Fix typo in information model.

Fix typo in information model.

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -432,7 +432,7 @@

             :trigger/threshold
             {:doc "A segment trigger will fire every threshold of segments."
-             :required-when ["`:trigger/on` is `:segments`"]
+             :required-when ["`:trigger/on` is `:segment`"]
              :type [:integer :elements]
              :example [5 :elements]
              :optional? true


CMR-356: Made cloud cover sortable.

CMR-356: Made cloud cover sortable.

--- src/cmr/search/services/parameter_validation.clj
+++ src/cmr/search/services/parameter_validation.clj
@@ -73,7 +73,8 @@
               :short-name
               :version
               :provider
-              :data-size}})
+              :data-size
+              :cloud-cover}})

 (defn sort-key-validation
   "Validates the sort-key parameter if present"


Specify that detect-silence has one output. Although the specs indicate otherwise, the synthdef generated with sclang specifies 1 output, and specifying 0 causes scserver to crash.

--- src/overtone/sc/ugen/filter.clj
+++ src/overtone/sc/ugen/filter.clj
@@ -286,9 +286,10 @@
   {:name "DetectSilence",
    :args [{:name "in", :default 0.0 :doc "any source"}
           {:name "amp", :default 0.0001 :doc "when input falls below this, evaluate doneAction"}
-          {:name "time", :default 0.1 :doc "the minimum duration of the for which input must fall below thresh before this triggers. The default is 0.1 seconds"}
-          {:name "action", :default 0 :map DONE-ACTIONS}],
-   :num-outs 0
+          {:name "time", :default 0.1 :doc "the minimum duration of the input signal which input must fall below thresh before this triggers. The default is 0.1 seconds"}
+          {:name "action", :default 0 :map DONE-ACTIONS :doc "the action to perform when silence is detected"}],
+   :num-outs 1 ;; although the spec indicates there's no output, sclang generates one and without
+               ;; any things crash.
    :check-inputs same-rate-as-first-input
    :doc "If the signal input starts with silence at the beginning of the synth's duration, then DetectSilence will wait indefinitely until the first sound before starting to monitor for silence. This UGen outputs 1 if silence is detected, otherwise 0."
    :auto-rate true})


implemented limit

implemented limit

--- pigpen-cascading/src/main/clojure/pigpen/cascading.clj
+++ pigpen-cascading/src/main/clojure/pigpen/cascading.clj
@@ -8,7 +8,8 @@
            (cascading.operation Identity)
            (cascading.pipe.joiner OuterJoin BufferJoin InnerJoin LeftJoin RightJoin)
            (org.apache.hadoop.io BytesWritable)
-           (cascading.pipe.assembly Unique))
+           (cascading.pipe.assembly Unique)
+           (cascading.operation.filter Limit))
   (:require [pigpen.runtime :as rt]
             [pigpen.cascading.runtime :as cs]
             [pigpen.raw :as raw]
@@ -144,6 +145,12 @@
   (let [pipe ((:pipes flowdef) (first ancestors))]
     (update-in flowdef [:pipes] (partial merge {id (Unique. pipe Fields/ALL)}))))

+(defmethod command->flowdef :limit
+  [{:keys [id n ancestors]} flowdef]
+  {:pre [id n (= 1 (count ancestors))]}
+  (let [pipe ((:pipes flowdef) (first ancestors))]
+    (update-in flowdef [:pipes] (partial merge {id (Each. pipe (Limit. n))}))))
+
 (defmethod command->flowdef :script
   [_ flowdef]
   ; No-op, since the flowdef already contains everything needed to handle multiple outputs.
@@ -172,6 +179,7 @@
 (defn commands->flow
   "Transforms a series of commands into a Cascading flow"
   [commands]
+  (clojure.pprint/pprint commands)
   (let [flowdef (reduce (fn [def cmd] (command->flowdef cmd def)) {} (preprocess-commands commands))
         {:keys [sources pipe-to-sink sinks pipes]} flowdef
         sources-map (into {} (map (fn [s] [(str s) (sources s)]) (keys sources)))


(maint) Add stage method to allow easier invocation from other namespaces

This commit moves aspects of the main function into a stage function. This will
allow the same stage-all-the-things method to be called from other namespaces
with ease.

--- src/puppetlabs/ezbake/stage.clj
+++ src/puppetlabs/ezbake/stage.clj
@@ -340,6 +340,23 @@
                               (deputils/generate-manifest-string lein-project))
        :uberjar-name  (:uberjar-name lein-project)})))

+(defn stage-all-the-things
+  [build-target project template-dir project-file]
+  (clean)
+    (cp-template-files template-dir)
+    (let [lein-project (project/read project-file)
+          config-files (cp-shared-config-files lein-project)
+          config-files (cp-project-config-files project config-files)]
+      (cp-doc-files lein-project)
+      (cp-project-file project-file)
+      (rename-redhat-spec-file lein-project)
+      (rename-debian-init-file lein-project)
+      (rename-debian-default-file lein-project)
+      (generate-ezbake-config-file lein-project build-target config-files)
+      (generate-project-data-yaml lein-project)
+      (generate-manifest-file lein-project)
+      (create-git-repo lein-project)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Main

@@ -353,20 +370,7 @@
         template-dir (fs/file template-dir-prefix build-target)
         project-file (.toString (fs/file "./configs" project (str project ".clj")))]
     (try
-      (clean)
-      (cp-template-files template-dir)
-      (let [lein-project (project/read project-file)
-            config-files (cp-shared-config-files lein-project)
-            config-files (cp-project-config-files project config-files)]
-        (cp-doc-files lein-project)
-        (cp-project-file project-file)
-        (rename-redhat-spec-file lein-project)
-        (rename-debian-init-file lein-project)
-        (rename-debian-default-file lein-project)
-        (generate-ezbake-config-file lein-project build-target config-files)
-        (generate-project-data-yaml lein-project)
-        (generate-manifest-file lein-project)
-        (create-git-repo lein-project))
+      (stage-all-the-things build-target project template-dir project-file)
       (finally
         ;; this is required in order to make the threads started by sh/sh terminate,
         ;; and thus allow the jvm to exit


DRY up simulated responses

DRY up simulated responses

--- pedestal-app/app/src/semtag_web/simulated/services.cljs
+++ pedestal-app/app/src/semtag_web/simulated/services.cljs
@@ -1,16 +1,37 @@
 (ns semtag-web.simulated.services
   (:require [semtag-web.services :as services]))
+
+
+(def api-responses
+  {:tags '("funny" "awesome" "boa" "bom")
+   :search {:tags '(["funny"])
+            :things [{:url "http://funnyordie.com" :desc "yop"
+                      :type "site" :tags ["funny"]}]}
+   :types {:results '({:url-percent "1.00", :name-percent "0.00", :count "3", :name "api"})
+           :counts {:thing 3, :name 2, :url 2, :tags 4}}
+   :tag-stats (list
+                {:desc "1 idea, 1 cjar", :count "2", :tag "cjar=lein-newnew"}
+                {:desc "1 cjar, 1 obook, 5 plugin", :count "7", :tag "lib=jquery"})
+   :all (list {:id 17592186048331, :desc "handy, programmatic and linkable access to HTTP specs, including an emacs plugin", :type "repo", :url "https://github.com/andreineculau/know-your-http-well", :created-at #inst "2013-09-07T15:31:38.781-00:00", :tags '("emacs" "http")}
+              {:id 17592186048328, :desc "nice, visual listing of designers by city and/or price range", :type "site", :url "http://sortfolio.com/", :created-at #inst "2013-09-07T15:27:45.772-00:00", :tags '("designer")})})

 (defmulti send-message
   "Given a message, simulate an effect"
   (fn [message input-queue] (keyword (:value message))))
+
+(defmethod send-message :default
+  [{:keys [value]} input-queue]
+  (services/put-value
+    [(keyword (str value "-results"))]
+    input-queue
+    ((keyword value) api-responses)))

 (defmethod send-message :home
   [message input-queue]
   (services/put-value
     [:tags-results]
     input-queue
-    '("funny" "awesome" "boa" "bom")))
+    (:tags api-responses)))

 (defmethod send-message :search
   [message input-queue]
@@ -18,34 +39,7 @@
   (services/put-value
     [:search-results]
     input-queue
-    {:tags '(["funny"])
-     :things [{:url "http://funnyordie.com" :desc (str "tiz " (:query message))
-               :type "site" :tags ["funny"]}]}))
-
-(defmethod send-message :types
-  [message input-queue]
-  (services/put-value
-    [:types-results]
-    input-queue
-    {:results '({:url-percent "1.00", :name-percent "0.00", :count "3", :name "api"})
-     :counts {:thing 3, :name 2, :url 2, :tags 4}}))
-
-(defmethod send-message :tag-stats
-  [message input-queue]
-  (services/put-value
-    [:tag-stats-results]
-    input-queue
-    (list
-      {:desc "1 idea, 1 cjar", :count "2", :tag "cjar=lein-newnew"}
-      {:desc "1 cjar, 1 obook, 5 plugin", :count "7", :tag "lib=jquery"})))
-
-(defmethod send-message :all
-  [message input-queue]
-  (services/put-value
-    [:all-results]
-    input-queue
-    (list {:id 17592186048331, :desc "handy, programmatic and linkable access to HTTP specs, including an emacs plugin", :type "repo", :url "https://github.com/andreineculau/know-your-http-well", :created-at #inst "2013-09-07T15:31:38.781-00:00", :tags '("emacs" "http")}
-          {:id 17592186048328, :desc "nice, visual listing of designers by city and/or price range", :type "site", :url "http://sortfolio.com/", :created-at #inst "2013-09-07T15:27:45.772-00:00", :tags '("designer")})))
+    (:search api-responses)))

 (defn services-fn [message input-queue]
   (services/services-fn message input-queue send-message))


adding yml copy

adding yml copy

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -2,6 +2,8 @@
   "A standalone puppet provisioner"
   (:import com.jcraft.jsch.JSchException)
   (:use
+    [clj-yaml.core :as yaml]
+    [clojure.java.io :only (file)]
     [clojure.core.strint :only (<<)]
     [celestial.core :only (Provision)]
     [celestial.model :only (pconstruct)]
@@ -15,18 +17,28 @@
   "Copy a opsk module into server"
   (copy host src "/tmp"))

-(defrecord Standalone [host type]
+(defn copy-yml-type [{:keys [type hostname puppet-std] :as _type} host]
+  (let [path (<< "/tmp/~{hostname}.yml") f (file path)
+        name (get-in puppet-std [:module :name])]
+    (spit f (yaml/generate-string (select-keys _type [:classes])))
+    (copy host path (<< "/tmp/~{name}/"))
+    (.delete f)))
+
+(defrecord Standalone [ip type]
   Provision
   (apply- [this]
     (use 'celestial.puppet-standalone)
     (let [puppet-std (type :puppet-std) module (puppet-std :module)]
-     (try (copy-module {:host host} module)
-      (execute {:host host}
-        (step :extract "cd /tmp" (<< "tar -xzf ~(:name module).tar.gz"))
-        (step :run (<< "cd /tmp/~(:name module)") "./scripts/run.sh "))
+     (try
+      (copy-module {:host ip} module)
+      (execute {:host ip}
+        (step :extract "cd /tmp" (<< "tar -xzf ~(:name module).tar.gz")))
+      (copy-yml-type type ip)
+      (execute {:host ip}
+          (step :run (<< "cd /tmp/~(:name module)") "./scripts/run.sh "))
       (finally
-        (execute {:host host} (step :cleanup "cd /tmp" (<< "rm -rf ~(:name module)*"))))))))
+        (execute {:host ip} (step :cleanup "cd /tmp" (<< "rm -rf ~(:name module)*"))))))))

 (defmethod pconstruct :puppet-std [type {:keys [machine] :as spec}]
-   (Standalone. (machine :ip) type))
+   (Standalone. (machine :ip) (assoc type :hostname (machine :hostname))))


handling a cases when run-opts are nil

handling a cases when run-opts are nil

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -85,5 +85,5 @@
 (defmethod pconstruct :puppet-std [{:keys [run-opts] :as type} {:keys [machine env] :as spec}]
   (let [remote {:host (machine :ip) :user (or (machine :user) "root")}
         by-env (get-in type [:puppet-std env])
-        with-opts (update-in by-env [:args] (fn [a] (concat a (run-opts :args))))]
+        with-opts (update-in by-env [:args] (fn [a] (concat a ((or run-opts {}) :args))))]
     (Standalone. remote (assoc with-opts :hostname (machine :hostname)))))


Forgot the secret/ on a file I moved.

Forgot the secret/ on a file I moved.

--- src/circle/backend/nodes/circle.clj
+++ src/circle/backend/nodes/circle.clj
@@ -49,8 +49,8 @@
                       :keypair-name "www"
                       :security-groups ["www" "allow-DB"]
                       :username "ubuntu"
-                      :public-key (slurp "www.id_rsa.pub")
-                      :private-key (slurp "www.id_rsa")}
+                      :public-key (slurp "secret/www.id_rsa.pub")
+                      :private-key (slurp "secret/www.id_rsa")}
    :phases {:bootstrap (pallet.phase/phase-fn
                         (automated-admin-user/automated-admin-user))
             :configure (fn [session]


Function encode-spaces should accept Strings only

--- src/clj_jenkins_api/jenkins_api.clj
+++ src/clj_jenkins_api/jenkins_api.clj
@@ -23,7 +23,7 @@

 (defn encode-spaces
     "Encode spaces in URL into its codes."
-    [url]
+    [^String url]
     (clojure.string/replace url " " "%20"))

 (defn job-name->url