Use https to clone in simple pipeline so that we don't need any github credentials

--- example/lambdacd_git/example/simple_pipeline.clj
+++ example/lambdacd_git/example/simple_pipeline.clj
@@ -10,7 +10,7 @@
             [lambdacd.runners :as runners]
             [clojure.java.io :as io]))

-(def repo-uri "git@github.com:flosell/testrepo")
+(def repo-uri "https://github.com/flosell/testrepo.git")

 (defn wait-for-git [args ctx]
   (core/wait-for-git ctx repo-uri


correct type

correct type

--- src/govalert/harvest/crawl.clj
+++ src/govalert/harvest/crawl.clj
@@ -71,7 +71,7 @@
 (defmethod types/agendas :url [url]
   (fetch-agendas url))

-(defmethod types/agendas null [agendas]
+(defmethod types/agendas nil [agendas]
   (fetch-agendas (:url agendas)))

 (defmethod types/agendas "subgroup" [agendas]


Restart when game finished

Restart when game finished

--- src/obb_demo/processor.cljs
+++ src/obb_demo/processor.cljs
@@ -40,10 +40,13 @@
         player (game/state game)
         actions (firingsquad/actions game player)]
     (println "--" player actions)
-    (-> (assoc game-data :actions actions)
-        (assoc :turn-num (if (= :final player)
-                           turn-num
-                           (inc turn-num))))))
+    (if (= :final (game/state game))
+      {:game (deployed-game)}
+      (-> (assoc game-data :actions actions)
+          #_(assoc game-data :game game)
+          (assoc :turn-num (if (= :final player)
+                             turn-num
+                             (inc turn-num)))))))

 (defn- process-actions
   "Processes actions"
@@ -60,8 +63,10 @@
               new-game (result/result-board result)]
           #_(println player action)
           (if-not (result/succeeded? result)
-            (do (println result)
-                game-data)
+            (do #_(println result)
+                (-> (assoc-in game-data [:game :state] :final)
+                    (dissoc :action)
+                    (dissoc :actions)))
             (-> (assoc game-data :game new-game)
                 (dissoc :action)
                 (assoc :actions (rest actions)))))


browser REPL source mapping for Chrome

browser REPL source mapping for Chrome

--- src/clj/cljs/repl/browser.clj
+++ src/clj/cljs/repl/browser.clj
@@ -199,37 +199,101 @@

 (defmulti parse-stacktrace (fn [repl-env st err opts] (:ua-product err)))

-;; -----------------------------------------------------------------------------
-;; Safari Stacktrace
-
-(defn safari-st-el->frame
-  "Parses a stack line into a frame representation, returning nil
-  if parse failed."
-  [st-el opts]
-  (let [[function flc] (if (re-find #"@" st-el)
-                         (string/split st-el #"@")
-                         [nil st-el])
-        xs (string/split flc #":")
-        [pre post]
+(defn parse-file-line-column [flc]
+  (let [xs (string/split flc #":")
+        [pre [line column]]
         (reduce
           (fn [[pre post] [x i]]
             (if (<= i 2)
               [pre (conj post x)]
               [(conj pre x) post]))
           [[] []] (map vector xs (range (count xs) 0 -1)))
-        file (string/join ":" pre)
-        [line column] (map #(Long/parseLong %) post)]
+        file (string/join ":" pre)]
+    [(cond-> file
+       (.startsWith file "(") (string/replace "(" ""))
+     (Long/parseLong
+       (cond-> line
+         (.endsWith line ")") (string/replace ")" "")))
+     (Long/parseLong
+       (cond-> column
+         (.endsWith column ")") (string/replace ")" "")))]))
+
+(defn parse-file [file opts]
+  (if (re-find #"http://localhost:9000/" file)
+    (-> file
+      (string/replace #"http://localhost:9000/" "")
+      (string/replace (Pattern/compile (str "^" (util/output-directory opts) "/")) ""))
+    (if-let [asset-root (:asset-root opts)]
+      (string/replace file asset-root "")
+      (throw
+        (ex-info (str "Could not relativize URL " file)
+          {:type :parse-stacktrace
+           :reason :relativize-url})))))
+
+;; -----------------------------------------------------------------------------
+;; Chrome Stacktrace
+
+(defn chrome-st-el->frame
+  [st-el opts]
+  (let [xs (-> st-el
+             (string/replace #"\s+at\s+" "")
+             (string/split #"\s+"))
+        [function flc] (if (== (count xs) 1)
+                         [nil (first xs)]
+                         [(first xs) (last xs)])
+        [file line column] (parse-file-line-column flc)]
     (if (and file function line column)
-      {:file (if (re-find #"http://localhost:9000/" file)
-               (-> file
-                 (string/replace #"http://localhost:9000/" "")
-                 (string/replace (Pattern/compile (str "^" (util/output-directory opts) "/")) ""))
-               (if-let [asset-root (:asset-root opts)]
-                 (string/replace file asset-root "")
-                 (throw
-                   (ex-info (str "Could not relativize URL " file)
-                     {:type :parse-stacktrace
-                      :reason :relativize-url}))))
+      {:file (parse-file file opts)
+       :function (string/replace function #"Object\." "")
+       :line line
+       :column column}
+      (when-not (string/blank? function)
+        {:file nil
+         :function (string/replace function #"Object\." "")
+         :line nil
+         :column nil}))))
+
+(comment
+  (chrome-st-el->frame
+    "\tat cljs$core$ffirst (http://localhost:9000/out/cljs/core.js:5356:34)" {})
+  )
+
+(defmethod parse-stacktrace :chrome
+  [repl-env st err opts]
+  (->> st
+    string/split-lines
+    (drop 1) ;; drop the error message
+    (map #(chrome-st-el->frame % opts))
+    (remove nil?)
+    vec))
+
+(comment
+  (parse-stacktrace nil
+    "\tat Object.cljs$core$seq [as seq] (http://localhost:9000/out/cljs/core.js:4258:8)
+\tat Object.cljs$core$first [as first] (http://localhost:9000/out/cljs/core.js:4288:19)
+\tat cljs$core$ffirst (http://localhost:9000/out/cljs/core.js:5356:34)
+\tat http://localhost:9000/out/cljs/core.js:16971:89
+\tat cljs.core.map.cljs$core$map__2 (http://localhost:9000/out/cljs/core.js:16972:3)
+\tat http://localhost:9000/out/cljs/core.js:10981:129
+\tat cljs.core.LazySeq.sval (http://localhost:9000/out/cljs/core.js:10982:3)
+\tat cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (http://localhost:9000/out/cljs/core.js:11073:10)
+\tat Object.cljs$core$seq [as seq] (http://localhost:9000/out/cljs/core.js:4239:13)
+\tat Object.cljs$core$pr_sequential_writer [as pr_sequential_writer] (http://localhost:9000/out/cljs/core.js:28706:14)"
+    {:ua-product :chrome}
+    nil)
+  )
+
+;; -----------------------------------------------------------------------------
+;; Safari Stacktrace
+
+(defn safari-st-el->frame
+  [st-el opts]
+  (let [[function flc] (if (re-find #"@" st-el)
+                         (string/split st-el #"@")
+                         [nil st-el])
+        [file line column] (parse-file-line-column flc)]
+    (if (and file function line column)
+      {:file (parse-file file opts)
        :function function
        :line line
        :column column}
@@ -256,7 +320,35 @@

 (comment
   (parse-stacktrace nil
-    "cljs$core$seq@http://localhost:9000/out/cljs/core.js:4259:17\ncljs$core$first@http://localhost:9000/out/cljs/core.js:4289:22\ncljs$core$ffirst@http://localhost:9000/out/cljs/core.js:5357:39\nhttp://localhost:9000/out/cljs/core.js:16972:92\nhttp://localhost:9000/out/cljs/core.js:16973:3\nhttp://localhost:9000/out/cljs/core.js:10982:133\nsval@http://localhost:9000/out/cljs/core.js:10983:3\ncljs$core$ISeqable$_seq$arity$1@http://localhost:9000/out/cljs/core.js:11074:14\ncljs$core$seq@http://localhost:9000/out/cljs/core.js:4240:44\ncljs$core$pr_sequential_writer@http://localhost:9000/out/cljs/core.js:28707:17\ncljs$core$IPrintWithWriter$_pr_writer$arity$3@http://localhost:9000/out/cljs/core.js:29386:38\ncljs$core$pr_writer_impl@http://localhost:9000/out/cljs/core.js:28912:57\ncljs$core$pr_writer@http://localhost:9000/out/cljs/core.js:29011:32\ncljs$core$pr_seq_writer@http://localhost:9000/out/cljs/core.js:29015:20\ncljs$core$pr_sb_with_opts@http://localhost:9000/out/cljs/core.js:29078:24\ncljs$core$pr_str_with_opts@http://localhost:9000/out/cljs/core.js:29092:48\ncljs$core$pr_str__delegate@http://localhost:9000/out/cljs/core.js:29130:34\ncljs$core$pr_str@http://localhost:9000/out/cljs/core.js:29139:39\n\neval code\neval@[native code]\nhttp://localhost:9000/out/clojure/browser/repl.js:23:271\nclojure$browser$repl$evaluate_javascript@http://localhost:9000/out/clojure/browser/repl.js:26:4\nhttp://localhost:9000/out/clojure/browser/repl.js:121:173\ndeliver@http://localhost:9000/out/goog/messaging/abstractchannel.js:142:21\nxpcDeliver@http://localhost:9000/out/goog/net/xpc/crosspagechannel.js:733:19\nmessageReceived_@http://localhost:9000/out/goog/net/xpc/nativemessagingtransport.js:321:23\nfireListener@http://localhost:9000/out/goog/events/events.js:741:25\nhandleBrowserEvent_@http://localhost:9000/out/goog/events/events.js:862:34\nhttp://localhost:9000/out/goog/events/events.js:276:42"
+    "cljs$core$seq@http://localhost:9000/out/cljs/core.js:4259:17
+cljs$core$first@http://localhost:9000/out/cljs/core.js:4289:22
+cljs$core$ffirst@http://localhost:9000/out/cljs/core.js:5357:39
+http://localhost:9000/out/cljs/core.js:16972:92
+http://localhost:9000/out/cljs/core.js:16973:3
+http://localhost:9000/out/cljs/core.js:10982:133
+sval@http://localhost:9000/out/cljs/core.js:10983:3
+cljs$core$ISeqable$_seq$arity$1@http://localhost:9000/out/cljs/core.js:11074:14
+cljs$core$seq@http://localhost:9000/out/cljs/core.js:4240:44
+cljs$core$pr_sequential_writer@http://localhost:9000/out/cljs/core.js:28707:17
+cljs$core$IPrintWithWriter$_pr_writer$arity$3@http://localhost:9000/out/cljs/core.js:29386:38
+cljs$core$pr_writer_impl@http://localhost:9000/out/cljs/core.js:28912:57
+cljs$core$pr_writer@http://localhost:9000/out/cljs/core.js:29011:32
+cljs$core$pr_seq_writer@http://localhost:9000/out/cljs/core.js:29015:20
+cljs$core$pr_sb_with_opts@http://localhost:9000/out/cljs/core.js:29078:24
+cljs$core$pr_str_with_opts@http://localhost:9000/out/cljs/core.js:29092:48
+cljs$core$pr_str__delegate@http://localhost:9000/out/cljs/core.js:29130:34
+cljs$core$pr_str@http://localhost:9000/out/cljs/core.js:29139:39
+eval code
+eval@[native code]
+http://localhost:9000/out/clojure/browser/repl.js:23:271
+clojure$browser$repl$evaluate_javascript@http://localhost:9000/out/clojure/browser/repl.js:26:4
+http://localhost:9000/out/clojure/browser/repl.js:121:173
+deliver@http://localhost:9000/out/goog/messaging/abstractchannel.js:142:21
+xpcDeliver@http://localhost:9000/out/goog/net/xpc/crosspagechannel.js:733:19
+messageReceived_@http://localhost:9000/out/goog/net/xpc/nativemessagingtransport.js:321:23
+fireListener@http://localhost:9000/out/goog/events/events.js:741:25
+handleBrowserEvent_@http://localhost:9000/out/goog/events/events.js:862:34
+http://localhost:9000/out/goog/events/events.js:276:42"
     {:ua-product :safari}
     nil)
   )


add om-tools to about

add om-tools to about

--- src/clj/foosball/software.clj
+++ src/clj/foosball/software.clj
@@ -27,6 +27,9 @@
    ['om/om
     "Om"
     "https://github.com/swannodette/om"]
+   ['prismatic/om-tools
+    "om-tools"
+    "https://github.com/Prismatic/om-tools"]
    ['org.clojure/core.async
     "core.async"
     "https://github.com/clojure/core.async"]


rewrote small sections of fire source.

rewrote small sections of fire source.

--- src/clj/forma/source/fire.clj
+++ src/clj/forma/source/fire.clj
@@ -94,31 +94,36 @@
         (hv->tilestring ?mod-h ?mod-v :> ?tilestring)
         (p/add-fields m-res :> ?m-res))))

+(defn extract-fields
+  [f-tuple]
+  [(.temp330 f-tuple)
+   (.conf50 f-tuple)
+   (.bothPreds f-tuple)
+   (.count f-tuple)])
+
 (defn add-fires
   "Adds together two FireTuple objects."
   [t1 t2]
-  (fire-tuple (+ (.temp330 t1) (.temp330 t2))
-              (+ (.conf50 t1) (.conf50 t2))
-              (+ (.bothPreds t1) (.bothPreds t2))
-              (+ (.count t1) (.count t2))))
-
+  (let [[f1 f2] (map extract-fields [t1 t2])]
+    (apply fire-tuple
+           (map + f1 f2))))

 ;; Combines various fire tuples into one.

-(defaggregateop comb
-  ([] (fire-tuple 0 0 0 0))
-  ([state tuple] (add-fires state tuple))
-  ([state] [state]))
+(defaggregateop merge-tuples
+  ([] [0 0 0 0])
+  ([state tuple] (map + state (extract-fields tuple)))
+  ([state] [(apply fire-tuple state)]))

 (defn aggregate-fires
   "Converts the datestring into a time period based on the supplied
   temporal resolution."
   [t-res src]
   (<- [?dataset ?m-res ?new-t-res ?tilestring ?tperiod ?sample ?line ?newtuple]
+      (src ?dataset ?m-res ?t-res ?tilestring ?datestring ?sample ?line ?tuple)
       (datetime->period ?new-t-res ?datestring :> ?tperiod)
-      (identity t-res :> ?new-t-res)
-      (comb ?tuple :> ?newtuple)
-      (src ?dataset ?m-res ?t-res ?tilestring ?datestring ?sample ?line ?tuple)))
+      (p/add-fields t-res :> ?new-t-res)
+      (merge-tuples ?tuple :> ?newtuple)))

 (defn running-sum
   "Given an accumulator, an initial value and an addition function,
@@ -128,7 +133,8 @@
   (first (reduce (fn [[coll last] new]
                    (let [last (add-func last new)]
                      [(conj coll last) last]))
-                 [acc init] tseries)))
+                 [acc init]
+                 tseries)))

 (defmapop [running-fire-sum [start end]]
   "Special case of `running-sum` for `FireTuple` thrift objects."


more playing with fire.

more playing with fire.

--- src/clj/forma/source/fire.clj
+++ src/clj/forma/source/fire.clj
@@ -1,9 +1,11 @@
 (ns forma.source.fire
   (:use cascalog.api
+        [forma.date-time :only (periodize)]
         [forma.matrix.utils :only (idx->colrow)]
         [forma.reproject :only (wgs84-index
                                 dimensions-at-res)]
-        [forma.source.modis :only (latlon->modis pixels-at-res)]
+        [forma.source.modis :only (latlon->modis
+                                   pixels-at-res)]
         [clojure.string :only (split)])
   (:require [cascalog.ops :as c]))

@@ -26,27 +28,46 @@
   (map (fn [val]
          (try (Float. val)
               (catch Exception _
-                (read-string val))))
+                val)))
        (split line #",")))

 (defn fire-source
   "Takes a source of textlines, and returns 2-tuples with latitude and
   longitude."
   [source]
-  (<- [?lat ?lon]
+  (<- [?dataset ?lat ?lon ?kelvin ?datestring]
       (source ?line)
-      (mangle ?line :> _ _ _ ?lat ?lon _ _ _ _ _)))
+      (identity "fire" :> ?dataset)
+      (mangle ?line :> ?lat ?lon ?kelvin _ _ ?datestring _ _ _ _ _ _)))
+
+(defmapop [to-period [t-res]]
+  [datestring]
+  (let [[month day year] (->> (split datestring #"/")
+                              (map #(Integer. %)))]
+    (periodize t-res year month day)))
+"12/31/2005"

 (defn rip-fires
   "Aggregates fire data at the supplied path by modis pixel at the
   supplied resolution."
-  [m-res path]
+  [m-res t-res path]
   (let [fires (fire-source (hfs-textline path))]
-    (<- [?mod-h ?mod-v ?sample ?line ?num-fires]
-        (fires ?lat ?lon)
+    (<- [?dataset ?mod-h ?mod-v ?sample ?line ?tperiod ?count ?max-t]
+        (fires ?dataset ?lat ?lon ?kelvin ?datestring)
+        (to-period [t-res] ?datestring :> ?tperiod)
+        (> ?kelvin 330)
         (latlon->modis m-res ?lat ?lon :> ?mod-h ?mod-v ?sample ?line)
-        (c/count ?num-fires))))
+        (c/max ?kelvin :> ?max-t)
+        (c/count ?count))))

+(defn run-rip
+  "Rips apart fires!"
+  [count m-res t-res path]
+  (?- (stdout) (c/first-n (rip-fires m-res t-res path)
+                          count)))
+
+;; FOR LATER...
+;;
 ;; ## ASCII Grid Sampling

 (defn liberate
@@ -76,8 +97,8 @@
   [source]
   (<- [?row-idx ?col-idx ?val]
       (source ?line)
-      (liberate ?line :> ?row-idx ?row-array)
-      (free-cols ?row-array :> ?col-idx ?val)))
+      (liberate ?line :> ?row-idx ?row-vec)
+      (free-cols ?row-vec :> ?col-idx ?val)))

 (defmapcatop
   ^{:doc "Returns tuples containing modis coordinates, plus the
@@ -105,6 +126,7 @@
     (?- (stdout)
         (sample-ascii \"1000\" 0.1 \"/path/to/ascii.csv\" [[8 6] [12 10]]))"
   [m-res ll-res ascii-path tile-seq]
+  {:pre [()]}
   (let [tile-source (memory-source-tap tile-seq)
         ascii-source (grid-source (hfs-textline ascii-path))]
     (<- [?mod-h ?mod-v ?sample ?line ?val]
@@ -118,3 +140,18 @@
   (?- (stdout)
       (sample-ascii m-res ll-res
                     ascii-path tile-seq)))
+
+
+(def count-agg
+  (<- [?a :> ?count]
+      (c/count ?count)))
+
+(defn count-test []
+  (let [tap (memory-source-tap [[1 2]
+                                [1 3]
+                                [1 4]])]
+    (?<- (stdout)
+         [?a ?count ?max]
+         (tap ?a ?b)
+         (c/max ?b :> ?max)
+         (c/count ?count))))


fix Populist Rally

fix Populist Rally

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -494,7 +494,8 @@
     :effect (effect (lose :corp :click-per-turn 1)
                     (register-events (:events (card-def card))
                                      (assoc card :zone '(:discard))))
-    :events {:corp-turn-ends {:effect (effect (gain :corp :click-per-turn 1))}}}
+    :events {:corp-turn-ends {:effect (effect (gain :corp :click-per-turn 1)
+                                              (unregister-events card))}}}

    "Power Nap"
    {:effect (effect (gain :credit (+ 2 (count (filter #(has-subtype? % "Double")


fix Test Run + Scavenge combo

fix Test Run + Scavenge combo

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -682,7 +682,7 @@
                                              ((if (= target "Heap") :discard :deck) runner))))
                       :effect (effect (runner-install (assoc-in target [:special :test-run] true) {:no-cost true}))
                       :end-turn
-                      {:req (req (find-cid (:cid target) (all-installed state :runner)))
+                      {:req (req (get-in (find-cid (:cid target) (all-installed state :runner)) [:special :test-run]))
                        :msg (msg "move " (:title target) " to the top of their Stack")
                        :effect (req (move state side (find-cid (:cid target) (all-installed state :runner))
                                           :deck {:front true}))}}


Removed unnecessary :use from ns.

Removed unnecessary :use from ns.

--- src/clj/http/async/client.clj
+++ src/clj/http/async/client.clj
@@ -17,8 +17,7 @@
   {:author "Hubert Iwaniuk"}
   (:refer-clojure :exclude [await promise])
   (:require [clojure.contrib.io :as duck])
-  (:use [http.async.client request headers util]
-        clojure.template)
+  (:use [http.async.client request headers util])
   (:import (java.io ByteArrayOutputStream)
            (com.ning.http.client AsyncHttpClient AsyncHttpClientConfig$Builder)
            (com.ning.http.client.providers.netty NettyAsyncHttpProviderConfig)))


Fix null pointer exception

Fix null pointer exception

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -56,11 +56,11 @@
                 start (System/currentTimeMillis)
                 _ (reset! retry-counter 0)
                 latencies (:latencies latency)
-                latency-00 (float (/ (get latencies 0.0) 1000000))
-                latency-05 (float (/ (get latencies 0.5) 1000000))
-                latency-095 (float (/ (get latencies 0.95) 1000000))
-                latency-099 (float (/ (get latencies 0.99) 1000000))
-                latency-0999 (float (/ (get latencies 0.999) 1000000))]
+                latency-00 (float (/ (get latencies 0.0 0) 1000000))
+                latency-05 (float (/ (get latencies 0.5 0) 1000000))
+                latency-095 (float (/ (get latencies 0.95 0) 1000000))
+                latency-099 (float (/ (get latencies 0.99 0) 1000000))
+                latency-0999 (float (/ (get latencies 0.999 0) 1000000))]
             (info "-> " throughput ", retries: " retry-cnt ", latency " latency " <-")
             (info "-> " latency-00 latency-05 latency-095 latency-099 latency-0999)
             (r/send-event client {:service "onyx-retry" :state "ok" :metric retry-cnt :tags ["benchmark"]})


Accept key and value decoders when creating message streams.

--- src/clj_kafka/consumer/zk.clj
+++ src/clj_kafka/consumer/zk.clj
@@ -34,12 +34,23 @@
    (when (.hasNext it)
      (cons (.next it) (lazy-iterate it)))))

+(defn create-message-streams
+  ([^ConsumerConnector consumer topic-count-map]
+   (.createMessageStreams consumer topic-count-map))
+  ([^ConsumerConnector consumer topic-count-map key-decoder value-decoder]
+   (.createMessageStreams consumer topic-count-map key-decoder value-decoder)))
+
 (defn messages
   "Creates a sequence of KafkaMessage messages from the given topic. Consumes
    messages from a single stream."
-  [^ConsumerConnector consumer topic & {:keys [threads]
+  [^ConsumerConnector consumer topic & {:keys [threads
+                                               key-decoder
+                                               value-decoder]
                                         :or   {threads 1}}]
-  (let [[_topic [stream & _]]
-        (first (.createMessageStreams consumer {topic (int threads)}))]
+  (let [topic-count-map {topic (int threads)}
+        streams (if (or key-decoder value-decoder)
+                  (create-message-streams consumer topic-count-map key-decoder value-decoder)
+                  (create-message-streams consumer topic-count-map))
+        [stream & _] (get streams topic)]
     (map to-clojure
          (lazy-iterate (.iterator ^KafkaStream stream)))))


make react happy with uniqe keys for dynamic children

--- src/cljs/lambdacd/output.cljs
+++ src/cljs/lambdacd/output.cljs
@@ -23,9 +23,9 @@
    (cond
      (:href detail) [:a {:href (:href detail)
                          :target "_blank"} (:label detail)]
-     (:raw detail) (list
+     (:raw detail) [:div
                      [:span (:label detail)]
-                     [:pre (:raw detail)])
+                     [:pre (:raw detail)]]
      :else [:span (:label detail)])
    (if (:details detail)
      (details-component (:details detail)))])
@@ -81,11 +81,13 @@
     (still-active? status) output
     :else (str output "\n\n" "Step is finished: " (status-to-string status))))

+(defn- console-output-line [idx line]
+  [:pre {:class "console-output__line" :key (str idx "-" (hash line))} line])
+
 (defn- console-component [output]
   (let [lines (console-output-processor/process-ascii-escape-characters output)]
     [:div {:class "console-output"}
-     (for [line lines]
-       [:pre {:class "console-output__line"} line])]))
+     (map-indexed console-output-line lines)]))

 (defn- plain-output-component [step raw-step-results-visible]
   (let [result (:result step)]


Field values and combobox implemented

Field values and combobox implemented

--- src/cljs/t5pmobile/leave.cljs
+++ src/cljs/t5pmobile/leave.cljs
@@ -36,7 +36,10 @@

 (defn fields-to-map [fielddef]
   (let [
-      newdata {(keyword (get fielddef "fieldcode"))  {:name (get fielddef "name") :fieldtype (get fielddef "fieldtype") :required (get fielddef "required") :num @fieldnum :timeformat (get fielddef "timeformat") :hide (get fielddef "hide") } }
+      newdata {(keyword (get fielddef "fieldcode")){
+        :name (get fielddef "name") :fieldtype (get fielddef "fieldtype")
+        :required (get fielddef "required") :num @fieldnum :timeformat (get fielddef "timeformat")
+        :hide (get fielddef "hide") :values (get fielddef "values")} }
     ]
     (swap! fieldnum inc)
     newdata
@@ -247,6 +250,26 @@
   )
 )

+
+(defn alertselected1 [event param]
+  ;(js/alert (str event  "ClojureScript says 'Boo!'" ))
+
+  ;(swap! app-state assoc :leavecode  event)
+
+  (jquery
+   (fn []
+     (-> (jquery (str "#" param ))
+       (.trigger  "click")
+     )
+   )
+  )
+  (swap! app-state assoc-in [:leaveapp (keyword param)] event)
+   (.log js/console (str "#" param ))
+  ;(setdatepickers2)
+  1
+)
+
+
 (defn alertselected [event]
   ;(js/alert (str event  "ClojureScript says 'Boo!'" ))

@@ -343,7 +366,29 @@
                 (dom/div {:className "col-sm-10"}
                   (cond
                     (= (:fieldtype (nth text 1)  )  0)
-                      (dom/input {:type "text" :id (name (first text) ) :onChange #(handle-change %)})
+                      ;;(dom/input {:type "text" :id (name (first text) ) :onChange #(handle-change %)})
+                      (dom/div {:className "col-sm-10"}
+                        (b/button-group
+                          {:id  (name (first text) ) }
+                          (b/dropdown {:title
+                          (if
+                            (= ( (keyword (nth text 0)) (:leaveapp @app-state)) nil )
+                              (:name  (nth text 1))
+                              ( (keyword (nth text 0)) (:leaveapp @app-state))
+
+                          )
+
+                          }
+                            (map (fn [item]
+                              (b/menu-item {:key (get item "code")
+                                :on-select  (fn [e](alertselected1 e (name (first text) )))
+                              } (get item "value"))
+                              )(:values (nth text 1))
+                            )
+                          )
+                        )
+                      )
+
                     (= (:fieldtype (nth text 1)  )  1)
                       (dom/input {:type "text" :id (name (first text) ) :oninput #(handle-change %)})
                     (= (:fieldtype (nth text 1)  )  2)
@@ -352,9 +397,7 @@
                       (dom/input {:type "checkbox"   :id (name (first text)) :label (:name  (nth text 1))
                       ;;:onClick #(handle-chkb-click %)
                       :onChange ( fn [e]( handle-chkb-change  e )   )
-                      ;;#(handle-chkb-change %)
-                                  })
-
+                      })
                   )

@@ -363,8 +406,11 @@
               )
               (sort
                 #(compare ( :num ( nth %1 1)) ( :num( nth %2 1)))
-              (into[] (:fields ((keyword (:leavecode (:leaveapp @app-state))) (:leavetypes @app-state)) )  )
-)
+                (filter (fn [x] ( not= (keyword (nth x 0)) :leavecode  )         )
+                  (into[] (:fields ((keyword (:leavecode (:leaveapp @app-state))) (:leavetypes @app-state)) )  )
+                )
+
+              )


Some formatting tweaks

Some formatting tweaks

--- src/clojure/picard/server.clj
+++ src/clojure/picard/server.clj
@@ -81,8 +81,7 @@
    state
    (fn [current-state]
      (if (= waiting-for-response (.next-up-fn current-state))
-       (assoc current-state
-         :next-up-fn incoming-request)
+       (assoc current-state :next-up-fn incoming-request)
        (assoc current-state
          :next-dn-fn nil
          :responded? true)))
@@ -110,6 +109,7 @@
   [state evt [_ hdrs body :as val] current-state]
   (when-not (= :response evt)
     (throw (Exception. "Um... responses start with the head?")))
+
   (let [write (.write (.ch current-state) (resp->netty-resp val))]
     (swap!
      state
@@ -166,9 +166,7 @@
     (swap!
      state
      (fn [current-state]
-       (assoc current-state
-         :next-up-fn nil
-         :upstream   nil))))
+       (assoc current-state :next-up-fn nil :upstream nil))))
   (if (.last-write current-state)
     (.addListener (.last-write current-state)
                   netty/close-channel-future-listener)


Updates to how routes are now collected based on jar-plugin changes.

--- src/cmr/http/kit/app/core.clj
+++ src/cmr/http/kit/app/core.clj
@@ -20,17 +20,18 @@
   For more information about JAR-file-based plugins, see:
   * https://github.com/cmr-exchange/cmr-jar-plugin"
   [httpd-component]
-  (let [{plugins-site-routes :site
-         plugins-api-routes :api} (registry/assembled-routes httpd-component)
-         main-site-routes-fn (config/site-routes httpd-component)]
-    (log/trace "plugins-site-routes:" (vec plugins-site-routes))
-    (log/trace "plugins-api-routes:" (vec plugins-api-routes))
+  (let [{plugins-site-routes-fns :site
+         plugins-api-routes-fns :api} (registry/resolved-routes httpd-component)
+         main-site-routes-fn (config/site-routes httpd-component)
+         main-api-routes-fn (config/api-routes httpd-component)]
+    (log/trace "plugins-site-routes-fns:" (vec plugins-site-routes-fns))
+    (log/trace "plugins-api-routes-fns:" (vec plugins-api-routes-fns))
     (log/trace "main-site-routes-fn:" main-site-routes-fn)
     ;; Note that the following calls don't call the routes, rather they call
     ;; the configuration function which extract the routes from the config
     ;; data. The route functions provided in the configuration data will be
     ;; called by a middleware wrapper.
-    {:site-routes (concat plugins-site-routes
+    {:site-routes (concat (mapcat #(% httpd-component) plugins-site-routes-fns)
                           (main-site-routes-fn httpd-component))
-     :plugins-api-routes plugins-api-routes
-     :main-api-routes-fn (config/api-routes httpd-component)}))
+     :plugins-api-routes-fns plugins-api-routes-fns
+     :main-api-routes-fn main-api-routes-fn}))


cleaned up tests

cleaned up tests

--- test/leiningen/test/jruby.clj
+++ test/leiningen/test/jruby.clj
@@ -8,13 +8,14 @@

 (def project (read-project "sample/project.clj"))

-
-(deftest test-rake-fail
-  (jruby project "rake" "-f" "sample/Rakefile" "sdfgds"))
+; still ugly right now
+; (deftest test-rake-fail
+;   (jruby project "rake" "-f" "sample/Rakefile" "sdfgds"))

 (deftest test-rake
   (jruby project "rake" "-f" "sample/Rakefile" "simple"))

+; not sure how to set the bundle file (its under sample/)
 ; (deftest test-rake
 ;   (jruby project "bundle" "install"))


indent asset download verbose messages

indent asset download verbose messages

--- src/overtone/libs/asset.clj
+++ src/overtone/libs/asset.clj
@@ -17,7 +17,7 @@
   "Download file at url to local filesystem at tmp-file verbosely."
   [url tmp-file]
   (println "Asset not cached - starting download...")
-  (binding [*verbose-overtone-file-helpers* true]
+  (binding [*verbose-overtone-file-helpers* 2]
     (download-file url tmp-file 20000 100 5000)))

 (defn- safe-url


Make use of multiple streams in (with-open)

--- src/main/clojure/cascade/asset.clj
+++ src/main/clojure/cascade/asset.clj
@@ -143,10 +143,10 @@
         ^URL asset-url (url-provider asset-path)
         _ (fail-if (nil? asset-url) "Could not locate %s asset %s." domain-name asset-path)
         mime-type (get-mime-type asset-path)]
-    (with-open [^OutputStream output-stream (open-output-stream-for-asset response asset-url mime-type)]
-      (with-open [^InputStream input-stream (.openStream asset-url)]
+    (with-open [^OutputStream output-stream (open-output-stream-for-asset response asset-url mime-type)
+                ^InputStream input-stream (.openStream asset-url)]
         (copy input-stream output-stream)
-        (.flush output-stream))))
+        (.flush output-stream)))
   ; If we got this far, we copied the contents (or failed, throwing an exception)
   true)


This works, duh

This works, duh

--- integration-tests/test-clustering/immutant/cluster_test.clj
+++ integration-tests/test-clustering/immutant/cluster_test.clj
@@ -67,10 +67,10 @@
 ;;     ;; across restarts
 ;;     (is (apply < (map :count @responses)))))

-;; (deftest publish-here-receive-there
-;;   (let [q1 (msg/queue "/queue/cluster" :context @ctx1)
-;;         q2 (msg/queue "/queue/cluster" :context @ctx2)]
-;;     (dotimes [i 10]
-;;       (msg/publish q1 i))
-;;     (is (= (range 10) (sort (repeatedly 10 #(msg/receive q2)))))))
+(deftest publish-here-receive-there
+  (let [q1 (msg/queue "/queue/cluster" :context (msg/context (assoc opts :port (messaging-port "server-one"))))
+        q2 (msg/queue "/queue/cluster" :context (msg/context (assoc opts :port (messaging-port "server-two"))))]
+    (dotimes [i 10]
+      (msg/publish q1 i))
+    (is (= (range 10) (sort (repeatedly 10 #(msg/receive q2)))))))


Fix copy-paste, types-test now really tests both implementations

--- test/containium/systems/cassandra_test.clj
+++ test/containium/systems/cassandra_test.clj
@@ -21,6 +21,8 @@
   [c x & xs]
   (every? (partial instance? c) (conj xs x)))

+
+;;; Actual tests.

 (deftest types
   ;; Open both an embedded Cassandra instance, and an Alia instance connecting to the
@@ -72,7 +74,7 @@
               alia-select (api/prepare alia select-cql)
               embed-result (first (api/do-prepared embedded embed-select
                                                    {:consistency :one, :keywordize? true}))
-              alia-result (first (api/do-prepared embedded embed-select
+              alia-result (first (api/do-prepared alia alia-select
                                                    {:consistency :one, :keywordize? true}))]
           (is (instances? java.net.Inet4Address (:it embed-result) (:it alia-result)))
           (is (instances? java.lang.String (:vc embed-result) (:vc alia-result)))


Add bundle? function

Add bundle? function

--- src/play_clj/core_utils.clj
+++ src/play_clj/core_utils.clj
@@ -18,6 +18,11 @@
            :x 100 :y 100)"
   [& entities]
   (BundleEntity. entities))
+
+(defn bundle?
+  "Returns true if `entity` is a `bundle`."
+  [entity]
+  (isa? (type entity) BundleEntity))

 (defn screenshot!
   "Captures a screenshot and either returns it as a `pixmap` or saves it to the


Switch h2 to multi_threaded by default.

Switch h2 to multi_threaded by default.

--- src/cavm/core.clj
+++ src/cavm/core.clj
@@ -163,7 +163,7 @@
   {:cache_size 65536
    :undo_log 1
    :log 1
-   :mvcc "TRUE"
+   :multi_threaded "TRUE"
    :trace_level_file 4}) ; 4 == slf4j

 ; Enable transaction log, rollback log, and MVCC (so we can load w/o blocking readers).


Don't need aclose.

Don't need aclose.

--- src/cbfg/npr.cljs
+++ src/cbfg/npr.cljs
@@ -1,5 +1,5 @@
 (ns cbfg.npr ; NPR stands for aNother Protocol for Replication, pronounced like UPR.
-  (:require-macros [cbfg.ago :refer [achan-buf ago ago-loop aclose
+  (:require-macros [cbfg.ago :refer [achan-buf ago ago-loop
                                      aput aput-close atake]]))

 (defprotocol NPRSnapshot


Only clean the project once

Only clean the project once

--- cljs.clj
+++ cljs.clj
@@ -7,16 +7,16 @@
   (p/ensure-dynamic-classloader)
   (-> "project.clj" load-file var-get))

-(def project (p/init-project (read-project-clj)))
+(-> (read-project-clj)
+    p/init-project
+    clean)

-(clean project)
 (println "Building paren-soup.js")
 (api/build "src" {:main          'nightcode.paren-soup
                   :optimizations :advanced
                   :output-to     "resources/public/paren-soup.js"
                   :output-dir    "target/public/paren-soup.out"})

-(clean project)
 (println "Building codemirror.js")
 (api/build "src" {:main          'nightcode.codemirror
                   :optimizations :advanced


cider: update nrepl plugin

cider: update nrepl plugin

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,3 +1,3 @@
-{:user {:plugins [[cider/cider-nrepl "0.11.0"]]}
+{:user {:plugins [[cider/cider-nrepl "0.12.0"]]}
  :repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]} ;emacs cider want specific repl <https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#replacing-default-repl-dependencies>
  }


Add extra feeds to combine

Add extra feeds to combine

--- newsfeed/src/newsfeed/api.clj
+++ newsfeed/src/newsfeed/api.clj
@@ -10,7 +10,9 @@
 (def options {:timeout 1000
               :user-agent "Newsfeed"})

-(def feed-urls [;;"https://news.ycombinator.com/rss"
+(def feed-urls ["https://www.reddit.com/r/sysadmin/.rss"
+                "https://www.reddit.com/r/programming/.rss"
+                "https://news.ycombinator.com/rss"
                 "http://www.martinfowler.com/feed.atom"
                 "https://www.thoughtworks.com/rss/insights.xml"])


Add more translations; add fn to prepend translations with strings

--- src/discuss/translations.cljs
+++ src/discuss/translations.cljs
@@ -6,7 +6,11 @@
                                      :back            "Zurück"
                                      :chars-remaining "Zeichen verbleibend"
                                      :hello           "Hallo"
-                                     :issue           "Diskussionsthema"}
+                                     :issue           "Diskussionsthema"
+                                     :login           "Login"
+                                     :logout          "Logout"
+                                     :save            "Speichern"
+                                     :show-discuss    "Zeige discuss"}
                         :discussion {:add-argument "Ein neues Argument hinzufügen"
                                      :current      "Aktuelle Diskussion"
                                      :restart      "Neustarten"
@@ -19,7 +23,11 @@
                                      :back            "Back"
                                      :chars-remaining "characters remaining"
                                      :hello           "Hello"
-                                     :issue           "Issue"}
+                                     :issue           "Issue"
+                                     :login           "Login"
+                                     :logout          "Logout"
+                                     :save            "Save"
+                                     :show-discuss    "Show discuss"}
                         :discussion {:add-argument "Add a new argument"
                                      :current      "Current Discussion"
                                      :restart      "Restart"
@@ -28,10 +36,18 @@
                                      :usages     "In which arguments has this reference been used?"
                                      :where-used "Where has this reference been used?"}}})

+(defn- prepend-translation
+  "Lookup given key and prepend some string to it."
+  [group key prepend]
+  (str prepend (get-in translations [(lib/get-language) group key])))
+
 (defn translate
   "Get translation string according to currently configured language."
-  [group key]
-  (get-in translations [(lib/get-language) group key]))
+  ([group key & options]
+   (let [option (first options)]
+     (cond
+       (= :space option) (prepend-translation group key " ")
+       :default (prepend-translation group key "")))))

 (translate :example :foo)


Indentation number 3.

Indentation number 3.

--- satellite-slave/src/satellite_slave/core.clj
+++ satellite-slave/src/satellite_slave/core.clj
@@ -178,10 +178,10 @@
                 (fn [_]
                   (try
                     (let [riemann (assoc riemann
-                                         :time (.toSeconds TimeUnit/MILLISECONDS
-                                                           (System/currentTimeMillis))
-                                         :service (str (:service settings)
-                                                       (:service riemann)))
+                                     :time (.toSeconds TimeUnit/MILLISECONDS
+                                                       (System/currentTimeMillis))
+                                     :service (str (:service settings)
+                                                   (:service riemann)))
                           test-output (run-test (dissoc test :schedule))
                           final-event (eventify riemann test-output)]
                       (doseq [client clients]


realizing pools should be defonce

realizing pools should be defonce

--- core.clj
+++ core.clj
@@ -1,5 +1,6 @@
 (ns tween.core
-  (:import Vector3
+  (:import Vector3
+    [UnityEngine Color]
     [UnityEngine Resources]
     [System GC]
     MonoBehaviour IEnumerator WaitForSeconds Time Mathf)
@@ -95,15 +96,16 @@

 (defmacro deftag [tag methods]
   (let [sym (symbol (last (re-seq #"[^\.]+" (str tag))))
+        once (gensym (str tag))
         pair-sym (symbol (str "Pair-" sym))
         wm-f #(with-meta % {:tag tag :volatile-mutable true})
         pool-m (zipmap [:p :c :r] (map (comp symbol str) ["<>" "*" "!"] (repeat pair-sym)))
         entry (conj methods {:pair {:tag pair-sym :pool pool-m}})]
     (swap! REGISTRY assoc tag entry)
     `(do
-      (deftype ~pair-sym [~(wm-f 'a) ~(wm-f 'b)])
-      (def-pool 10000 ~pair-sym ~'a ~'b)
-      (quote ~entry))))
+        (deftype ^:once ~pair-sym [~(wm-f 'a) ~(wm-f 'b)])
+        (def-pool 10000 ~pair-sym ~'a ~'b)
+        (quote ~entry))))

@@ -291,12 +293,11 @@

-
 (def run true)

 (defn hue [^UnityEngine.Material m ^UnityEngine.GameObject o]
   (timeline [
-    (wait (rand))
+    ;(wait (+ (rand) 0.1))
     (tween {:local
       {:scale (Vector3. 2.0 2.0 2.0)
        :position (v3+ (.position (.transform o))


Make sure all query retrieve the same list of properties from the interaction relation.

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -31,6 +31,10 @@
 (def list-properties
   "Set of properties we want when listing entries."
   ["uuid" "headline" "body" "reaction" "author" "created-at" "updated-at"])
+
+(def list-comment-properties
+  "Set of peroperties we want when retrieving comments"
+  ["uuid" "body" "reaction" "author" "parent-uuid" "created-at" "updated-at"])

 ;; ----- Utility functions -----

@@ -336,7 +340,7 @@
   "Given the UUID of the entry, return a list of the comments for the entry."
   [conn uuid :- lib-schema/UniqueID]
   {:pre [(db-common/conn? conn)]}
-  (filter :body (db-common/read-resources conn common/interaction-table-name "resource-uuid" uuid [:uuid :author :body :created-at])))
+  (filter :body (db-common/read-resources conn common/interaction-table-name "resource-uuid" uuid list-comment-properties)))

 (schema/defn ^:always-validate list-reactions-for-entry
   "Given the UUID of the entry, return a list of the reactions for the entry."
@@ -369,8 +373,7 @@
       "published-at" order start direction
       filter-map
       :interactions common/interaction-table-name :uuid :resource-uuid
-      ["uuid" "headline" "body" "reaction" "author"
-       "published-at" "created-at" "updated-at"] {:count count}))))
+      list-comment-properties {:count count}))))

 (schema/defn ^:always-validate paginated-entries-by-board
@@ -386,8 +389,7 @@
     :status-board-uuid [[:published board-uuid]]
     "published-at" order start direction
     :interactions common/interaction-table-name :uuid :resource-uuid
-    ["uuid" "headline" "body" "reaction" "author"
-     "published-at" "created-at" "updated-at"] {:count count}))
+    list-comment-properties {:count count}))

 (schema/defn ^:always-validate list-entries-by-org-author
   "
@@ -403,7 +405,7 @@
          (#{:published :draft} status)]}
   (db-common/read-resources-and-relations conn table-name :status-org-uuid-author-id [[status org-uuid user-id]]
                                           :interactions common/interaction-table-name :uuid :resource-uuid
-                                          list-properties {:count count})))
+                                          list-comment-properties {:count count})))

 (schema/defn ^:always-validate list-entries-by-board
   "Given the UUID of the board, return the published entries for the board with any interactions."
@@ -411,7 +413,7 @@
   {:pre [(db-common/conn? conn)]}
   (db-common/read-resources-and-relations conn table-name :status-board-uuid [[:published board-uuid]]
                                           :interactions common/interaction-table-name :uuid :resource-uuid
-                                          list-properties {:count count}))
+                                          list-comment-properties {:count count}))

 (schema/defn ^:always-validate list-all-entries-by-board
   "Given the UUID of the board, return all the entries for the board."
@@ -431,8 +433,7 @@
       :org-uuid-status-follow-ups-completed?-assignee-user-id-map-multi [[org-uuid :published false user-id]]
       "published-at" order start direction
       :interactions common/interaction-table-name :uuid :resource-uuid
-      ["uuid" "headline" "body" "reaction" "author"
-       "published-at" "created-at" "updated-at"] {:count count})))
+      list-comment-properties {:count count})))

 ;; ----- Entry follow-up manipulation -----


fix 'wordo' - should be binding now with-binding

--- src/overtone/config/file_store.clj
+++ src/overtone/config/file_store.clj
@@ -21,7 +21,7 @@
 (defmethod write-file-store :file
   [path data]
   (locking F-LOCK
-    (with-binding [*print-length* nil]
+    (binding [*print-length* nil]
       (spit path (with-out-str (pprint data))))))

 (defmethod read-file-store :file


bra va eller hur

bra va eller hur

--- src/nettle/fibers/types.clj
+++ src/nettle/fibers/types.clj
@@ -9,10 +9,10 @@
                               {:scalar? true}))

 (def primitive-list [[[:bool] primitive-traits]
+                     [[:int32 :int] primitive-number-traits]
+                     [[:int64 :long] primitive-number-traits]
                      [[:float :float32] primitive-number-traits]
-                     [[:float64 :double] primitive-number-traits]
-                     [[:int32 :int] primitive-number-traits]
-                     [[:int64 :long] primitive-number-traits]])
+                     [[:float64 :double] primitive-number-traits]])

 (defn scalar? [x]
   (:scalar? x))
@@ -23,7 +23,10 @@
 (defn add-primitive-entry [dst [names properties]]
   (reduce
    (fn [dst name]
-     (assoc dst name properties))
+     (assoc
+      dst name
+      (assoc properties :priority
+             (count dst))))
    dst
    names))

@@ -55,5 +58,12 @@
   ([x] (ad x {}))
   ([x derivative-map] (ad-sub x derivative-map)))

-(defn ad? [x]
-  (= (:type x) :ad))
+(defn is-type?
+  ([x t]
+   (if (map? x)
+     (= t (:type x))))
+  ([t] #(is-type? % t)))
+
+(def ad? (is-type? :ad))
+
+


:bug: Fixes problem with picker

:bug: Fixes problem with picker

--- frontend/src/app/main/ui/workspace/viewport.cljs
+++ frontend/src/app/main/ui/workspace/viewport.cljs
@@ -220,14 +220,14 @@
           (st/emit! (dwc/stop-picker))
           (modal/disallow-click-outside!))]

-    (mf/use-effect
+    (mf/use-layout-effect
      ;; Everytime we finish retrieving a new URL we redraw the canvas
      ;; so even if we're not finished the user can start to pick basic
      ;; shapes
-     (mf/deps fetch-pending)
+     (mf/deps props fetch-pending)
      (fn []
        (try
-         (timers/raf
+         (timers/schedule 100
           #(let [svg-node (mf/ref-val svg-ref)
                  canvas-node (mf/ref-val canvas-ref)
                  canvas-context (.getContext canvas-node "2d")
@@ -481,7 +481,6 @@
         (fn [event]
           (dom/prevent-default event)
           (cond
-
             (dnd/has-type? event "app/shape")
             (let [shape (dnd/get-data event "app/shape")
                   point (gpt/point (.-clientX event) (.-clientY event))
@@ -551,7 +550,8 @@
        [:& pixel-picker-overlay {:vport vport
                                  :vbox vbox
                                  :viewport-ref viewport-ref
-                                 :options options}])
+                                 :options options
+                                 :layout layout}])

      [:svg.viewport
       {:preserveAspectRatio "xMidYMid meet"


Add default board size

Add default board size

--- src/obb_rules_api/index.clj
+++ src/obb_rules_api/index.clj
@@ -2,6 +2,7 @@
   (:require [obb-rules-api.reply :as reply]
             [obb-rules.turn :as turn]
             [obb-rules.game :as game]
+            [obb-rules.board :as board]
             [obb-rules.actions.move :as move]))

 (defn handler
@@ -10,5 +11,7 @@
   (reply/ok {:name "obb-rules-api"
              :version (System/getProperty "obb-rules-api.version")
              :rules {:version game/version
+                     :default-board-width board/default-board-w
+                     :default-board-height board/default-board-h
                      :max-action-points turn/max-action-points
                      :min-move-percentage move/min-move-percentage}}))


Off by one error in checkpoint restart

Off by one error in checkpoint restart

--- src/onyx/plugin/datomic.clj
+++ src/onyx/plugin/datomic.clj
@@ -245,7 +245,7 @@
         commit-loop-ch (start-commit-loop! (:commit-ch pipeline) log checkpoint-key)
         producer-ch (thread
                       (try
-                        (loop [tx-index (:largest checkpointed) backoff initial-backoff]
+                        (loop [tx-index (inc (:largest checkpointed)) backoff initial-backoff]
                           ;; relies on the fact that tx-range is lazy, therefore only read-size elements will be realised
                           ;; always use a nil end-tx so that we don't have to rely on a tx id existing
                           ;; in order to determine whether we should emit the sentinel (tx ids don't walways increment)


Setup Mongo connection for development

Setup Mongo connection for development

--- src/servisne_info/handler.clj
+++ src/servisne_info/handler.clj
@@ -20,9 +20,9 @@
    put any initialization code here"
   []

-  (let [username (env :mongo-user)
-        password (env :mongo-password)
-        db       (env :mongo-db)]
+  (let [username (or (env :mongo-user) "")
+        password (or (env :mongo-password) "")
+        db       (or (env :mongo-db) "servisne")]
     (monger/connect!)
     (monger/use-db! db)
     (monger/authenticate (monger/get-db db) username (.toCharArray password)))


Check for handle-exceptions correctly

Check for handle-exceptions correctly

--- src/onyx/plugin/bookkeeper.clj
+++ src/onyx/plugin/bookkeeper.clj
@@ -295,11 +295,13 @@
                           shutdown-ch)))

 (defn read-handle-exception [event lifecycle lf-kw exception]
-  (cond (= exception org.apache.zookeeper.KeeperException$ConnectionLossException)
-        :restart
-        (= exception org.apache.bookkeeper.client.BKException$ZKException)
-        :restart
-        :else :defer))
+  (let [exception-type (type exception)]
+    (case exception-type
+      org.apache.zookeeper.KeeperException$ConnectionLossException
+      :restart
+      org.apache.bookkeeper.client.BKException$ZKException
+      :restart
+      :defer)))

 (def read-ledgers-calls
   {:lifecycle/before-task-start inject-read-ledgers-resources
@@ -321,11 +323,13 @@
   {})

 (defn write-handle-exception [event lifecycle lf-kw exception]
-  (cond (= exception org.apache.zookeeper.KeeperException$ConnectionLossException)
-        :restart
-        (= exception org.apache.bookkeeper.client.BKException$ZKException)
-        :restart
-        :else :defer))
+  (let [exception-type (type exception)]
+    (case exception-type
+      org.apache.zookeeper.KeeperException$ConnectionLossException
+      :restart
+      org.apache.bookkeeper.client.BKException$ZKException
+      :restart
+      :defer)))

 (def write-ledger-calls
   {:lifecycle/before-task-start inject-write-ledger-resources


Formatting tweaks on @samaaron's suggestion.

--- src/overtunes/songs/before.clj
+++ src/overtunes/songs/before.clj
@@ -64,25 +64,25 @@
   takes a frequency in Hz and a duration in seconds.
   (play-note :C4 organ-cornet 1.2)"
   [tone instrument duration]
-  (let [ seconds (/ duration 1000)
-         frequency (midi->hz (note tone))]
+  (let [seconds (/ duration 1000)
+        frequency (midi->hz (note tone))]
     (instrument frequency seconds)))

 (defn play-chord [tones instrument duration]
   "Plays a seq of tones as a chord on instrument for duration.
   (play-chord (chord :C4 :major) organ-cornet 1.2)"
   (if (not (empty? tones))
-    (let [ root (first tones)
-           bass [(- root 12) (- root 24)]
-           with-bass (concat bass tones)]
+    (let [root (first tones)
+          bass [(- root 12) (- root 24)]
+          with-bass (concat bass tones)]
       (doall (map (fn [tone] (play-note tone instrument duration)) with-bass)))))

 (defn play-progression [progression metro start]
   "Plays a seq of chords for two beats each on the cornet.
   Takes a metronome and a starting beat in addition to the chord progression.
   (play-progression [root fourth fifth] metro (metro))"
-  (let [ beats-per-chord 2
-         duration (* beats-per-chord (beat-length metro))]
+  (let [beats-per-chord 2
+        duration (* beats-per-chord (beat-length metro))]
     (when-not (empty? progression)
       (at (metro start) (play-chord (first progression) organ-cornet duration))
       (play-progression (rest progression) metro (+ start beats-per-chord)))))
@@ -105,12 +105,10 @@
 (defn play
   "Play the melody over the chords to metro's time."
   [chords metro]
-  (let
-  [ repetitions-per-chord (/ (count melody) 2)
-    melody-line (cycle-n (/ (count chords) repetitions-per-chord) melody)]
-  (do
-    (play-melody melody-line metro (metro))
-    (play-progression (concat chords finish) metro (metro)))))
+  (let [repetitions-per-chord (/ (count melody) 2)
+        melody-line (cycle-n (/ (count chords) repetitions-per-chord) melody)]
+  (play-melody melody-line metro (metro))
+  (play-progression (concat chords finish) metro (metro))))

 (defn full-version []
   "The full version of 'Before', grave."


emit all cases of vecn

emit all cases of vecn

--- src/gamma/emit/construct.cljs
+++ src/gamma/emit/construct.cljs
@@ -10,4 +10,24 @@
    [:nest 2
     (interpose [:span "," :line]
                (map #(emit db (db %)) (body x)))]
+   ")"])
+
+(defmethod emit :vec3 [db x]
+  [:group
+   (name (head x))
+   "("
+   [:line ""]
+   [:nest 2
+    (interpose [:span "," :line]
+               (map #(emit db (db %)) (body x)))]
+   ")"])
+
+(defmethod emit :vec2 [db x]
+  [:group
+   (name (head x))
+   "("
+   [:line ""]
+   [:nest 2
+    (interpose [:span "," :line]
+               (map #(emit db (db %)) (body x)))]
    ")"])


Move function and improve docstring

Move function and improve docstring

--- src/play_clj/core_graphics.clj
+++ src/play_clj/core_graphics.clj
@@ -156,43 +156,43 @@
   `(let [^MapLayers object# (map-layers* ~screen)]
      (u/calls! object# ~@options)))

+(defmacro map-layers!
+  "Calls a single method on a `map-layers`.
+
+    (map-layers! object :remove (map-layer screen \"objects\"))"
+  [object k & options]
+  `(u/call! ^MapLayers ~object ~k ~@options))
+
+(defn map-layer*
+  ([]
+    (MapLayer.))
+  ([screen layer]
+    (tiled-map-layer* screen layer)))
+
+(defmacro map-layer
+  "Returns a [MapLayer](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/maps/MapLayer.html)
+from the tiled map in `screen` that matches `layer`. This is necessary for
+non-tile layers, like object and image layers.
+
+    (map-layer screen \"objects\")"
+  [screen layer & options]
+  `(let [^MapLayer object# (map-layer* ~screen ~layer)]
+     (u/calls! object# ~@options)))
+
+(defmacro map-layer!
+  "Calls a single method on a `map-layer`.
+
+    (map-layer! (map-layer screen \"objects\")
+                :set-visible false)"
+  [object k & options]
+  `(u/call! ^MapLayer ~object ~k ~@options))
+
 (defn map-layer-names
   "Returns a list with strings cooresponding to the name of each layer in the
 tiled map in `screen`."
   [screen]
   (for [^MapLayer layer (map-layers screen)]
     (.getName layer)))
-
-(defmacro map-layers!
-  "Calls a single method on a `map-layers`.
-
-    (map-layers! screen :remove (map-layer screen \"objects\"))"
-  [object k & options]
-  `(u/call! ^MapLayers ~object ~k ~@options))
-
-(defn map-layer*
-  ([]
-    (MapLayer.))
-  ([screen layer]
-    (tiled-map-layer* screen layer)))
-
-(defmacro map-layer
-  "Returns a [MapLayer](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/maps/MapLayer.html)
-from the tiled map in `screen` that matches `layer`. This is necessary for
-non-tile layers, like object and image layers.
-
-    (map-layer screen \"objects\")"
-  [screen layer & options]
-  `(let [^MapLayer object# (map-layer* ~screen ~layer)]
-     (u/calls! object# ~@options)))
-
-(defmacro map-layer!
-  "Calls a single method on a `map-layer`.
-
-    (map-layer! (map-layer screen \"objects\")
-                :set-visible false)"
-  [object k & options]
-  `(u/call! ^MapLayer ~object ~k ~@options))

 (defn map-objects*
   ([]


Allow index to be passed to tiled-map-layer

--- src/play_clj/core_graphics.clj
+++ src/play_clj/core_graphics.clj
@@ -121,7 +121,7 @@
         (-> ^BatchTiledMapRenderer (u/get-obj screen :renderer)
             .getMap
             .getLayers
-            (.get (str layer))))))
+            (.get layer)))))

 (defmacro tiled-map-layer
   "Returns a [TiledMapTileLayer](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/maps/tiled/TiledMapTileLayer.html)


Extract event from coeffects in the same place as in db-handler->interceptor

A good principle to follow in designing anything is to make things that are the
same look the same, and things that behave differently look differently.

`db-handler->interceptor` and `fx-handler->interceptor` are very similar. Their
only difference is that the latter calls the `handler-fn` with all coeffects and
assoces the result to the `:effects` key directly, whereas the former calls the
`handler-fn` with just the db from inside the coeffects, and assoces the result
to just the db in the effects.

However the code of these two functions slightly differed in *where* the event
and the db resp. the whole coeffect was extracted from the context. Eliminate
that difference so that it is clearer what's different and what's the same about
these two functions.

--- src/re_frame/std_interceptors.cljc
+++ src/re_frame/std_interceptors.cljc
@@ -140,13 +140,13 @@
   :id     :fx-handler
   :before (fn fx-handler-before
             [context]
-            (let [{:keys [event] :as coeffects} (:coeffects context)
-                  new-context
+            (let [new-context
                   (trace/with-trace
                     {:op-type   :event/handler
                      :operation (get-in context [:coeffects :event])}
-                    (->> (handler-fn coeffects event)
-                         (assoc context :effects)))]
+                    (let [{:keys [event] :as coeffects} (:coeffects context)]
+                      (->> (handler-fn coeffects event)
+                           (assoc context :effects))))]
               (trace/merge-trace!
                 {:tags {:effects   (:effects new-context)
                         :coeffects (:coeffects context)}})


Remove private from registrar (we now need to access it in core to create restore function)

--- src/re_frame/registrar.cljc
+++ src/re_frame/registrar.cljc
@@ -10,9 +10,9 @@
 (def kinds #{:event :fx :cofx :sub})

 ;; This atom contains a register of all handlers.
-;; Is a map keyed first by kind (of handler), and then id.
-;; leaf nodes are handlers.
-(def ^:private kind->id->handler  (atom {}))
+;; Contains a map keyed first by `kind` (of handler), and then `id`.
+;; Leaf nodes are handlers.
+(def kind->id->handler  (atom {}))

 (defn get-handler


Fix typo in previous commit

Fix typo in previous commit

--- src/wonko/kafka/consume.clj
+++ src/wonko/kafka/consume.clj
@@ -13,7 +13,7 @@
 (defn init! [config]
   (reset! consumer (kc/consumer config)))

-(defn parse- [msg]
+(defn- parse [msg]
   (let [offset (-> (k/to-clojure msg) :offset)
         message (-> (k/to-clojure msg) :value (#(String. %)))]
     (try


Expose some of the protocol functions for convenience in the top level grafter.rdf namespaces

--- src/rdf-common/grafter/rdf.clj
+++ src/rdf-common/grafter/rdf.clj
@@ -2,7 +2,6 @@
   "Functions and macros for creating RDF data.  Includes a small
   DSL for creating turtle-like templated forms."
   (:require [grafter.rdf.protocols :as pr]
-            [grafter.rdf.protocols :refer [->Quad]]
             [potemkin.namespaces :refer [import-vars]]))

 ;; Force loading the required protocol implementations.  Keep separate from ns
@@ -12,7 +11,11 @@
 (import-vars
  [grafter.rdf.io
   language
-  literal])
+  literal]
+ [grafter.rdf.protocols
+  ->Quad
+  ->Triple
+  triple?])

 (defn subject
   "Return the RDF subject from a statement."


refactoring q3

refactoring q3

--- q3.clj
+++ q3.clj
@@ -1,11 +1,14 @@
 (def N 100)
-(def start-num 2)
-(def cards (for [x (range 1 (inc N)) y [false]] [x y]))
+(def START 2)

-(defn reverse-cards [cards num]
-  (map #(if (= 0 (mod (first %) num))
-            [(first %) (not (second %))]
-            %)
+(defn make-cards [num]
+  (for [x (range 1 (inc N)) y [false]] [x y]))
+
+(defn reverse-cards [cards reverse-num]
+  (map (fn [[num side]]
+         (if (= 0 (mod num reverse-num))
+             [num (not side)]
+             [num side]))
        cards))

 (defn reverse [cards num]
@@ -14,6 +17,7 @@
       (reverse (reverse-cards cards num) (inc num))))

 (defn get-answer []
-  (map #(first %)
-      (filter #(not (second %))
-              (reverse cards start-num))))
+  (let [cards (make-cards N)]
+    (map (fn [[num _]] num)
+         (filter (fn [[_ side]] (not side))
+                 (reverse cards START)))))


Calculate duration, rather than looking it up.

--- src/kolmogorov_music/song.clj
+++ src/kolmogorov_music/song.clj
@@ -7,7 +7,7 @@
             [leipzig.temperament :as temperament]
             [kolmogorov-music.champernowne :as champernowne]))

-(def master-volume 0.1)
+(def master-volume 0.05)

 ; Instruments
 ;(defonce sweep-bus (audio-bus))
@@ -58,8 +58,8 @@

 (defn encode [[duration pitch]]
   {:time 0
-   :duration (get [1/4 2/4 3/4 4/4 6/4 8/4 12/4 16/4] duration 1/4)
-   :pitch pitch })
+   :duration (/ duration 4)
+   :pitch pitch})

 (defn evens [[x _ & zs]]
   (when x
@@ -91,12 +91,12 @@

 (def track
   (->>
-    (champernowne/word 8 (rand-int 999999999))
-    (split-by 0)
+    (champernowne/word 16 0)
+    (split-by 15)
     (map arrange)
     sequentially
-    (take-while #(-> % :time (< 128)))
-    (where :pitch (comp temperament/equal scale/A scale/major))
+    (where :pitch (comp temperament/equal scale/A scale/minor))
+    (where :pitch scale/lower)
     (where :time (bpm 120))
     (where :duration (bpm 120))))


Removed reflection warnings

Removed reflection warnings

--- src/leiningen/amp/install.clj
+++ src/leiningen/amp/install.clj
@@ -116,7 +116,7 @@
 (defn- install!
   "Uses the Alfresco MMT to install the AMP into the target WAR"
   [amp war]
-  (ModuleManagementTool/main (into-array String ["install" (.toString amp) (.toString war)])))
+  (ModuleManagementTool/main (into-array String ["install" (str amp) (str war)])))

 (defn install-amp!
   "Installs the generated AMP into the specified WAR. If the target WAR is not


bumped up lein-ring

bumped up lein-ring

--- src/leiningen/new/reagent.clj
+++ src/leiningen/new/reagent.clj
@@ -46,7 +46,7 @@
   "Plugins for development or as part of an app."
   '[[lein-cljsbuild "1.0.4"]
     [lein-environ "1.0.0"]
-    [lein-ring "0.8.13"]
+    [lein-ring "0.9.0"]
     [lein-asset-minifier "0.2.2"]])

 (defn app-dependencies [opts]


Fixes #45 by adding author information to each entry

--- src/statuses/views/atom.clj
+++ src/statuses/views/atom.clj
@@ -1,6 +1,7 @@
 (ns statuses.views.atom
   (:require [statuses.backend.time :as time]
             [hiccup.util :as util]
+            [hiccup.element :as element]
             [statuses.views.common :as common]))

@@ -21,10 +22,9 @@
                 [{:keys [id author text time]}]
                 [:entry
                  [:title (str "Posted by @" author)]
+                 [:author [:name author] [:uri (element/link-to (str base-uri "?author=" author) author)]]
                  [:content {:type (str "html")} (util/escape-html (common/linkify text))]
                  [:id (str "tag:innoq.com,2012:statuses/" id)]
-                 [:author
-                   [:name author]]
                  [:published (time/time-to-rfc3339 time)]
                  [:updated (time/time-to-rfc3339 time)]
-                 [:link {:href (str base-uri "/statuses/updates/" id) }]]) items))))
+                 [:link {:href (str base-uri "/statuses/updates/" id) }]]) items))))


[#11864] Loopring smart contract bug

[#11864] Loopring smart contract bug

Signed-off-by: andrey <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ethereum/tokens.cljs
+++ src/status_im/ethereum/tokens.cljs
@@ -219,11 +219,10 @@
                     :name     "Monaco"
                     :address  "0xb63b606ac810a52cca15e44bb630fd42d8d1d83d"
                     :decimals 8}
-                   {:symbol               :LRC
-                    :name                 "loopring"
-                    :address              "0xef68e7c694f40c8202821edf525de3782458639f"
-                    :decimals             18
-                    :skip-decimals-check? true}
+                   {:symbol   :LRC
+                    :name     "LoopringCoin V2"
+                    :address  "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
+                    :decimals 18}
                    {:symbol   :ZSC
                     :name     "Zeus Shield Coin"
                     :address  "0x7a41e0517a5eca4fdbc7fbeba4d4c47b9ff6dc63"


Warning instead of compilation error (revert this on next major release)

--- src/kioo/core.clj
+++ src/kioo/core.clj
@@ -135,7 +135,11 @@
           (if (empty? (select start (eval-selector trans-selector)))
             (let [message (format "File %s does not contain selector %s %s."
                                   path sel trans-selector)]
-              (throw (AssertionError. message)))))
+              (try
+                (throw (AssertionError. message))
+                (catch AssertionError e
+                  (binding [*out* *err*]
+                    (println message)))))))

         `(let [~child-sym ~(compile (map-trans start trans) emit-opts)]
            (if (= 1 (count ~child-sym))


[CS] Use 3.0 data-spec in dev.core for `lein run`

--- dev-src/dev/core.clj
+++ dev-src/dev/core.clj
@@ -4,6 +4,7 @@
             [vip.data-processor.pipeline :as pipeline]
             [vip.data-processor.output.xml :as xml-output]
             [vip.data-processor.validation.data-spec :as data-spec]
+            [vip.data-processor.validation.data-spec.v3-0 :as v3-0]
             [vip.data-processor.validation.db :as db]
             [vip.data-processor.validation.transforms :as t]
             [vip.data-processor.validation.zip :as zip]
@@ -16,7 +17,7 @@
            zip/assoc-file
            zip/extracted-contents
            t/attach-sqlite-db
-           (data-spec/add-data-specs data-spec/data-specs)
+           (data-spec/add-data-specs v3-0/data-specs) ; TODO: decide which specs to add based on import
            t/remove-invalid-extensions
            t/xml-csv-branch
            psql/store-public-id


Add quick fix operation for some type mismatch messages

--- src/lt/plugins/elm_light.cljs
+++ src/lt/plugins/elm_light.cljs
@@ -16,7 +16,6 @@
             [lt.objs.browser :as browser]
             [lt.objs.eval :as eval]
             [lt.objs.sidebar.clients :as scl]
-            [lt.plugins.auto-complete :as auto-complete]
             [lt.util.js :as js-util]
             [clojure.string :as s])
   (:require-macros [lt.macros :refer [behavior]]))
@@ -42,6 +41,21 @@
    :to   {:ch (dec (:column end)) :line (dec (:line end))}})

+(defn- maybe-trim [ss]
+  (when ss
+    (s/trim ss)))
+
+(defn- str-contains? [source target]
+  (when (and source target)
+    (< -1 (.indexOf source target))))
+
+(defn- maybe-strip-hint [source]
+  (when source
+    (if (str-contains? source "Hint:")
+      (-> (re-find #"(?m)([\s\S]*?(?=Hint:))" source)
+          first
+          s/trim)
+      source)))

 (defn linter-action [ed row]
   (case (:tag row)
@@ -57,6 +71,7 @@
                                                         s/trim
                                                         (str "\n"))]
                                             (editor/replace ed from ann)))}]
+
     "NAMING ERROR" (let [fixes (->> (re-find #"(?m)Maybe you want one of the following\?(:?[\s\S]*$)" (:details row))
                                     second
                                     (s/split-lines)
@@ -69,9 +84,19 @@
                                     (editor/replace ed from to suggestion))})
                        fixes))

+    "TYPE MISMATCH"  (let [ann (-> (re-find #"(?m)But I am inferring that the definition has this type:([\s\S]*$)" (:details row))
+                                   second
+                                   maybe-trim
+                                   maybe-strip-hint)]
+                       (if (and ann (not (str-contains? ann "...")))
+                         [{:text "Fix annotation"
+                           :action (fn [_ {:keys [from to]}]
+                                     (editor/replace ed from to ann))}]
+                         ;; TODO: Could potentially handle typo's in records here too, but need to reliably find what the annotation belogs too (:
+                         []))
+
+
     []))
-
-

 (defn display-make-results [ed res path]


remove admin flag to show Build Timing on v2

--- src-cljs/frontend/components/build_head.cljs
+++ src-cljs/frontend/components/build_head.cljs
@@ -1270,7 +1270,7 @@
             [tab-tag {:class (when (= :config selected-tab) "active")}
              [tab-link-v2 {:href "#config"} "circle.yml"]]

-            (when (and admin? (build-model/finished? build))
+            (when (build-model/finished? build)
               [tab-tag {:class (when (= :build-timing selected-tab) "active")}
                [tab-link-v2 {:href "#build-timing"}
                 "Build Timing"]])


Remove leftover logging statements

Remove leftover logging statements

--- src-cljs/frontend/components/pages/team.cljs
+++ src-cljs/frontend/components/pages/team.cljs
@@ -100,8 +100,6 @@
                                (element :body
                                         (html
                                           [:div
-                                           (js/console.log "opts vcs: " (:vcs_type opts))
-                                           (js/console.log "opts org name : " (:org-name opts))
                                            [:.header
                                             "These are the people who are not using CircleCI yet ("
                                             [:span [:b count-with-email] " of " [:b count-users] " users have emails, " [:b count-selected] " are selected):"]]


clearer lookup

clearer lookup

--- src/timsg/scene_var/get.clj
+++ src/timsg/scene_var/get.clj
@@ -51,13 +51,13 @@
 (defonce world-ref
   (atom (Registry. {} {})))

-(defn- obj->anchors []
+(defn- obj->anchors [obj]
   (let [^Registry world @world-ref]
-    (.obj->anchors world)))
+    (get (.obj->anchors world) x)))

-(defn- anchor->obj []
+(defn- anchor->obj [anchor]
   (let [^Registry world @world-ref]
-    (.anchor->obj world)))
+    (get (.anchor->obj world) anchor)))

 (defn gc []
   (swap! world-ref
@@ -109,10 +109,10 @@
 (defn sva-serialize [^SceneVarAnchor sva]
   (set! (.edn sva)
     (pr-str
-      (get (obj->anchors) sva))))
+      (obj->anchors sva))))

 (defn sva-destroy [^SceneVarAnchor sva]
-  (doseq [anchor (get (obj->anchors) sva)]
+  (doseq [anchor (obj->anchors sva)]
     (dissoc-anchor! anchor)))

 (defn sva-deserialize [^SceneVarAnchor sva]
@@ -141,7 +141,7 @@
   [{:keys [name kw init update]
     :as init-spec}]
   (let [anchor kw]
-    (-> (or (when-let [x (get (anchor->obj) anchor)]
+    (-> (or (when-let [x (anchor->obj anchor)]
               (if (null-obj? x)
                 (do (gc) ;; there shouldn't be any of these
                     nil)
@@ -161,5 +161,5 @@
          (defn ~name
            ([] (~name @world-ref))
            ([^timsg.scene_var.types.Registry world#]
-            (when-let [^SceneVarAnchor sva# (obj-nil (get (.anchor->obj world#) ~kw))]
+            (when-let [^SceneVarAnchor sva# (obj-nil (anchor->obj ~kw))]
               (.gameObject sva#)))))))


Version 0.4.0-SNAPSHOT

Version 0.4.0-SNAPSHOT

--- metlog-vault/project.clj
+++ metlog-vault/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-vault "0.3.5"
+(defproject metlog-vault "0.4.0-SNAPSHOT"
   :description "Repository for long term storage of series data."

   :license {:name "Eclipse Public License"


Swallow bean not found exceptions as these are due to job churn.

--- src/onyx/metrics_endpoint.clj
+++ src/onyx/metrics_endpoint.clj
@@ -67,27 +67,30 @@
         selected (atom #{})]
     (doseq [selector mbean-selectors]
       (doseq [mbean (jmx/mbean-names selector)]
-        (let [canonical-key (.getCanonicalKeyPropertyListString mbean)]
-          ;; deduplicate
-          (when-not (@selected canonical-key)
-            (swap! selected conj canonical-key)
-            (doseq [attribute (jmx/attribute-names mbean)]
-              (try
-               (let [value (jmx/read mbean attribute)]
-                 (cond (number? value)
-                       (let [metric (job-metric->metric-str (.getCanonicalKeyPropertyListString mbean) attribute)]
-                         (when-not (blacklisted? blacklists metric)
-                           (.append builder (format "%s %s" metric value))
-                           (.append builder "\n")))
-                       (map? value)
-                       (run! (fn [[k v]]
-                               (when (number? v)
-                                 (let [metric (job-metric->metric-str (.getCanonicalKeyPropertyListString mbean)
-                                                                      (str (name attribute) "_" (name k)))]
-                                   (when-not (blacklisted? blacklists metric)
-                                     (.append builder (format "%s %s" metric v))
-                                     (.append builder "\n")))))
-                             value)))
-               ;; Safe to swallow
-               (catch javax.management.RuntimeMBeanException _)))))))
+        (try
+         (let [canonical-key (.getCanonicalKeyPropertyListString mbean)]
+           ;; deduplicate
+           (when-not (@selected canonical-key)
+             (swap! selected conj canonical-key)
+             (doseq [attribute (jmx/attribute-names mbean)]
+               (try
+                (let [value (jmx/read mbean attribute)]
+                  (cond (number? value)
+                        (let [metric (job-metric->metric-str (.getCanonicalKeyPropertyListString mbean) attribute)]
+                          (when-not (blacklisted? blacklists metric)
+                            (.append builder (format "%s %s" metric value))
+                            (.append builder "\n")))
+                        (map? value)
+                        (run! (fn [[k v]]
+                                (when (number? v)
+                                  (let [metric (job-metric->metric-str (.getCanonicalKeyPropertyListString mbean)
+                                                                       (str (name attribute) "_" (name k)))]
+                                    (when-not (blacklisted? blacklists metric)
+                                      (.append builder (format "%s %s" metric v))
+                                      (.append builder "\n")))))
+                              value)))
+                ;; Safe to swallow, jobs and beans are ephemeral
+                (catch javax.management.RuntimeMBeanException _)))))
+         ;; Safe to swallow, jobs and beans are ephemeral
+         (catch javax.management.InstanceNotFoundException _))))
     (str builder)))


Fix custom metrics tags reporting.

Fix custom metrics tags reporting.

--- src/onyx/metrics_endpoint.clj
+++ src/onyx/metrics_endpoint.clj
@@ -13,7 +13,7 @@
 (defn extract-metric [s]
   (let [ps (partition-all 2 (clojure.string/split s #"[.]"))
         metric (clojure.string/join "_" (last ps))
-        tags (reduce into [] (rest ps))]
+        tags (reduce into [] (butlast ps))]
     (if (some #{"job-id"} tags)
       {:tags tags :metric metric}
       {:tags [] :metric (clojure.string/replace s #"\." "_")})))


add mkdir! and file-exists? file helper fns

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -143,3 +143,18 @@
   [path]
   (let [path (resolve-tilde-path path)]
     (.length (file path))))
+
+(defn mkdir!
+  "Makes a dir at path if it doesn't already exist"
+  [path]
+  (let [path (resolve-tilde-path path)
+        f (File. path)]
+    (when-not (.exists f)
+      (.mkdir f))))
+
+(defn file-exists?
+  "Returns true if the file specified by path exists"
+  [path]
+  (let [path (resolve-tilde-path path)
+        f (File. path)]
+    (.exists f)))


also adjust ServiceEquiv so riemann will reload udp-server if max-size changes

--- src/riemann/transport/udp.clj
+++ src/riemann/transport/udp.clj
@@ -67,6 +67,7 @@
   ; TODO compare pipeline-factory!
   (equiv? [this other]
           (and (instance? UDPServer other)
+               (= max-size (:max-size other))
                (= so-rcvbuf (:so-rcvbuf other))
                (= host (:host other))
                (= port (:port other))))
@@ -74,6 +75,7 @@
   Service
   (conflict? [this other]
              (and (instance? UDPServer other)
+                  (= max-size (:max-size other))
                   (= so-rcvbuf (:so-rcvbuf other))
                   (= host (:host other))
                   (= port (:port other))))


fixed missing block tag

fixed missing block tag

--- src/selmer/template_parser.clj
+++ src/selmer/template_parser.clj
@@ -34,7 +34,7 @@
 (defn find-template-dependencies [filename & [templates]]
   (with-open [rdr (reader (str (resource-path) filename))]
     (loop [templates (assoc (or templates {}) filename {})
-           ch       (read-char rdr)]
+           ch        (read-char rdr)]
       (if ch
         (recur
           (if (= *tag-open* ch)
@@ -43,13 +43,12 @@
           (read-char rdr))
         templates))))

-(defn consume-block [rdr & [buf]]
+(defn consume-block [rdr & [buf]]
   (loop [ch (read-char rdr)
          blocks-to-close 1]
-    (when (and (pos? blocks-to-close) ch)
-
+    (when (and (pos? blocks-to-close) ch)
       (if (= *tag-open* ch)
-        (let [content (read-tag-content rdr)]
+        (let [content (read-tag-content rdr)]
           (when buf (.append buf content))
           (recur (read-char rdr)
                  (cond
@@ -76,7 +75,9 @@

                   (and (re-matches #"\{%\s*block.*" tag-str)
                        (= block-name (get-tag-name #"block" tag-str)))
-                  (.append buf (->buf [block-buf] (consume-block rdr block-buf)))
+                  (do
+                    (.append buf tag-str)
+                    (.append buf (->buf [block-buf] (consume-block rdr block-buf))))

                   :else
                   (.append buf tag-str)))
@@ -108,7 +109,7 @@
          (when ch
            (->>
              (if (= *tag-open* ch) (read-tag-str rdr filename blocks) ch)
-             (.append buf))
+             (.append buf))
            (recur (read-char rdr)))))))

 (defn find-blocks [template templates block-map]
@@ -151,3 +152,4 @@

 #_(println "\n-----------\n" (preprocess-template "templates/inheritance/inherit-c.html"))

+(println "\n-----------\n" (preprocess-template "templates/inheritance/inherit-b.html"))


formatting

formatting

--- src/selmer/template_parser.clj
+++ src/selmer/template_parser.clj
@@ -53,6 +53,7 @@

                 (re-matches #"\{\%\s*endblock.*" tag-str)
                 (dec blocks-to-close)
+
                 :else blocks-to-close))
             (read-char rdr)))
         (do


Added code for security group creation with ingress/egress

--- src/shuppet/securitygroups.clj
+++ src/shuppet/securitygroups.clj
@@ -8,29 +8,134 @@
    [clojure.data.zip.xml :refer [xml1-> attr xml-> text text= attr=]]))

-(defn xml-to-map [xml-string]
+(defn- xml-to-map [xml-string]
   (zip/xml-zip (xml/parse (java.io.ByteArrayInputStream. (.getBytes xml-string)))))

-(defn create-sg
-  "Creates a security group and returns the id"
-  [params]
-  (if-let [response (xml-to-map (ec2-request (merge params {"Action" "CreateSecurityGroup"})))]
-    (first (xml-> response :groupId text))))
+(defn- remove-nil [params]
+  (apply dissoc
+         params
+         (for [[k v] params :when (nil? v)] k)))

-(defn delete-sg
-  "Deletes a given security group"
-  [params]
-  (ec2-request (merge params {"Action" "DeleteSecurityGroup"})))
+(defn- process-list-of-maps [func opts]
+  (loop [count (count opts)
+         index (dec count)
+         result (into {}
+                      (map #(func count  %)
+                           (nth opts index))) ]
+    (if (= (dec count) 0)
+      result
+      (recur (dec count)
+             (dec index)
+             (into result
+                   (map #(func (dec count) %)
+                        (nth opts (dec index))))))))

-(defn describe-sg [params]
-  (let [response (xml-to-map (ec2-request (merge params {"Action" "DescribeSecurityGroups"})))]
-                                        ;TODO
-    (prn "Description = " response)))
+(defn- process-list [func i opts]
+  (loop [count (count opts)
+         index (dec count)
+         result (into {}
+                      (func i
+                            count
+                            (nth opts index))) ]
+    (if (= (dec count) 0)
+      result
+      (recur (dec count)
+             (dec index)
+             (into result
+                   (func i
+                         (dec count)
+                         (nth opts (dec index))))))))

-;(delete-sg {"GroupName" "test-sg3"})
-;(create-sg {"GroupName" "test-sg3" "GroupDescription" "test description"})
-;(create-sg {"GroupName" "test-sg3" "GroupDescription" "test description" "VpcId" "vpc-7bc88713" })
-;(delete-sg {"GroupName" "test-sg3"})
-;(describe-sg {"GroupId.1" "sg-9e7187f1"})
-;(describe-sg {"GroupId" "sg-f457b09b"})
+
+(defn- create-params [opts]
+  (remove-nil {"GroupName" (get opts :GroupName)
+               "GroupDescription" (get opts :GroupDescription)
+               "VpcId" (get opts :VpcId)}))
+
+
+(defn create
+  "Creates a security group and returns the id"
+  [opts]
+  (let [cr-params (create-params opts)]
+    (if-let [response (ec2-request (merge cr-params {"Action" "CreateSecurityGroup"}))]
+      (do
+        (first (xml-> (xml-to-map response) :groupId text))))))
+
+(defn compare-sg [current-config opts]
+  (prn "lets compare the configs here  TODO" current-config))
+
+(defn process [action params]
+  (condp = (keyword action)
+    :CreateSecurityGroup (create params)
+    (ec2-request (merge params {"Action" (name action)}))))
+
+(defn- sg-id [opts]
+  (if-let [id (get opts :GroupId)]
+    {"GroupId" id}
+    {"GroupName" (get opts :GroupName)}))
+
+(defn- build-ip-range-params [i1 i2 vals]
+  {(str "IpPermissions." i1 ".IpRanges." i2 ".CidrIp") vals})
+
+(defn- build-network-params [index [k v]]
+  (if (= (name k) "IpRanges")
+    (process-list build-ip-range-params index v)
+    {(str "IpPermissions." index "." (name k)) v}))
+
+
+(defn- apply-ingress [sg-id ingress]
+  (let [params (process-list-of-maps build-network-params ingress)]
+    (process "AuthorizeSecurityGroupIngress" (merge params {"GroupId" sg-id}))))
+
+(defn- apply-egress [sg-id outgress]
+  (let [params (process-list-of-maps build-network-params outgress) ]
+    (process "AuthorizeSecurityGroupEgress" (merge params {"GroupId" sg-id}))))
+
+(defn- configure-network [sg-id opts]
+  (when-let [ingress (get opts :Ingress)]
+    (apply-ingress sg-id ingress))
+  (when-let [egress (get opts :Egress)]
+    (apply-egress sg-id egress)))
+
+(defn- build-sg [opts]
+  (if-let [sg-id (create opts)]
+    (configure-network sg-id opts)
+    (prn "security group already exists")))
+
+(defn ensure [opts]
+;describe security group
+;if not present create and apply ingress/outgress
+;if present compare with the config
+;delete if needed
+  (if-let [response (process :DescribeSecurityGroups (sg-id opts))]
+    (compare-sg (xml-to-map response) opts)
+    (build-sg opts)))
+
+
+(defn sg []
+  {:GroupName "test-sg5"
+   :GroupDescription "test description"
+   :VpcId "vpc-7bc88713"
+   :Ingress [{:IpProtocol "tcp"
+              :FromPort "80"
+              :ToPort "80"
+              :IpRanges ["192.0.2.0/24" "198.51.100.0/24" ]
+              },
+             {:IpProtocol "udp"
+              :FromPort "80"
+              :ToPort "8080"
+              :IpRanges ["192.0.2.0/24" "198.51.100.0/24" ]
+              }]
+   :Egress [{:IpProtocol "tcp"
+              :FromPort "80"
+              :ToPort "80"
+              :IpRanges ["192.0.2.0/24" "198.51.100.0/24" ]
+              },
+             {:IpProtocol "udp"
+              :FromPort "80"
+              :ToPort "8080"
+              :IpRanges ["192.0.2.0/24" "198.51.100.0/24" ]
+              }]})
+
+;(ensure (sg))


Remove old comment

Remove old comment

--- src/clj/collect_earth_online/db/projects.clj
+++ src/clj/collect_earth_online/db/projects.clj
@@ -131,7 +131,7 @@
   (let [project-id (tc/val->int (:projectId params))
         stats      (first (call-sql "select_project_statistics" project-id))]
     (data-response {:flaggedPlots    (:flagged_plots stats)
-                    :analyzedPlots   (:analyzed_plots stats) ;TODO why don't these variable match?
+                    :analyzedPlots   (:analyzed_plots stats)
                     :unanalyzedPlots (:unanalyzed_plots stats)
                     :members         (:members stats)
                     :contributors    (:contributors stats)


Clean up parser

Clean up parser

--- src/clj/jest/compiler/NativeJestCompiler.clj
+++ src/clj/jest/compiler/NativeJestCompiler.clj
@@ -8,11 +8,12 @@
                          JestParser$MemberGetChainContext JestParser$MemberGetContext
                          JestParser$RecordConstructorContext JestParser$ExpressionListContext
                          JestParser$TypeAnnotationContext JestParser$FuncTypeAnnotationContext
-                         JestParser$LambdaContext JestParser$FunctionDefContext JestParser$MethodDefContext
+                         JestParser$LambdaContext JestParser$FunctionDefContext
+                         JestParser$MethodDefContext JestParser$ConditionalContext
                          JestParser$FunctionDefParamsContext JestParser$FunctionCallContext
                          JestParser$RecordDefContext JestParser$ImplementationDefContext
                          JestParser$MethodParamsContext JestParser$ForLoopContext
-                         JestParser$BlockContext JestParser$VarScopeContext JestParser$ConditionalContext
+                         JestParser$BlockContext JestParser$VarScopeContext
                          JestParser$ClojureVectorContext JestParser$ClojureMapContext)
            (jest.compiler ClojureSourceGenerator$BadSource)
            (sun.reflect.generics.reflectiveObjects NotImplementedException))
@@ -93,11 +94,11 @@
   [this ^JestParser$StatementTermContext ctx]

   (cond
-    (. ctx statement)   (self-visit this ctx statement) ;;(.. this (visitStatement (. ctx statement)))
-    (. ctx functionDef) (self-visit this ctx functionDef) ;;(.. this (visitFunctionDef (. ctx functionDef)))
-    (. ctx recordDef)   (self-visit this ctx recordDef)  ;;(.. this (visitRecordDef (. ctx recordDef)))
-    (. ctx block)       (self-visit this ctx block) ;;(.. this (visitBlock (. ctx block)))
-    (. ctx varScope)    (self-visit this ctx varScope) ;;(.. this (visitVarScope (. ctx varScope)))
+    (. ctx statement)   (self-visit this ctx statement)
+    (. ctx functionDef) (self-visit this ctx functionDef)
+    (. ctx recordDef)   (self-visit this ctx recordDef)
+    (. ctx block)       (self-visit this ctx block)
+    (. ctx varScope)    (self-visit this ctx varScope)

     :else (throw (new ClojureSourceGenerator$BadSource ctx))))

@@ -106,8 +107,8 @@
   [this ^JestParser$StatementContext ctx]

   (cond
-    (. ctx expression)    (self-visit this ctx expression) ;;(.. this (visitExpression (. ctx expression)))
-    (. ctx defAssignment) (self-visit this ctx defAssignment) ;;(.. this (visitDefAssignment (. ctx defAssignment)))
+    (. ctx expression)    (self-visit this ctx expression)
+    (. ctx defAssignment) (self-visit this ctx defAssignment)

     :else (throw (new ClojureSourceGenerator$BadSource ctx))))

@@ -116,8 +117,8 @@
   [this ^JestParser$DefAssignmentContext ctx]

   (let [type (. ctx type)
-        name (get-symbol ctx name) ;;(symbol (.. ctx name getText))
-        expr (self-visit this ctx expression)] ;;(.. this (visitExpression (. ctx expression)))]
+        name (get-symbol ctx name)
+        expr (self-visit this ctx expression)]

     (if type (println type))
     `(def ~name ~expr)))
@@ -126,7 +127,6 @@
 (defn -visitExpression
   [this ^JestParser$ExpressionContext ctx]
   (self-visit this ctx comparisonExpression))
-  ;;(.. this (visitComparisonExpression (. ctx comparisonExpression))))

 (def comparison-override-map {"==", "="})
@@ -318,7 +318,7 @@
   ;                                       }

   `(defn
-     ~(get-symbol ctx name) ;;.. ctx name getText)
+     ~(get-symbol ctx name)
      [~@(self-visit this ctx functionDefParams)]
      ~@(self-visit this ctx block)))


Make the ack button on the error message work

i.e. actually dispose the error message

--- src/cljs/mdr2/productions/in_production.cljs
+++ src/cljs/mdr2/productions/in_production.cljs
@@ -290,6 +290,11 @@
           ^{:key option}
           [:option {:value option} option])]]]]]])

+(rf/reg-event-db
+ ::ack-error
+ (fn [db [_ path]]
+   (fork/set-server-message db path nil)))
+
 (defn split-form [id]
   [fork/form {:initial-values {:volumes 2
                                :sample-rate 22050
@@ -301,6 +306,7 @@
               :keywordize-keys true
               }
    (fn [{:keys [values
+                path
                 form-id
                 handle-blur
                 submitting?
@@ -313,7 +319,9 @@
          :on-submit handle-submit}
         (when on-submit-server-message
           [:div.notification.is-danger
-           [:button.delete]
+           [:button.delete
+            {:type "button" ;; make sure the button doesn't trigger an event in the form
+             :on-click (fn [e] (rf/dispatch [::ack-error path]))}]
            on-submit-server-message])
         (select-field :volumes [2 3 4 5 6 7 8] props)
         (select-field :sample-rate [11025 22050 44100 48000] props)


CMR-158: modified function per feedback.

--- src/cmr/index_set/services/index_service.clj
+++ src/cmr/index_set/services/index_service.clj
@@ -88,8 +88,7 @@
 (deftracefn get-elastic-config
   "Forward elastic config to index-set app clients."
   [context]
-  (cheshire/generate-string (es-config/config)))
-
+  (es-config/config))

 (defn index-set-id-validation
   "Verify id is a positive integer."


For perf reasons, single print for REPL specials

Fixes #90

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -482,10 +482,12 @@

 (defn- dir*
   [nsname]
-  (run! prn
-    (distinct (sort (concat
-                      (public-syms nsname)
-                      (public-syms (symbol (str (name nsname) "$macros"))))))))
+  (print
+    (with-out-str
+      (run! prn
+        (distinct (sort (concat
+                          (public-syms nsname)
+                          (public-syms (symbol (str (name nsname) "$macros"))))))))))

 (defn- apropos*
   [str-or-pattern]
@@ -503,9 +505,11 @@

 (defn- print-doc
   [m]
-  (repl/print-doc (update m :doc (if (user-interface-idiom-ipad?)
-                                   identity
-                                   reflow))))
+  (print
+    (with-out-str
+      (repl/print-doc (update m :doc (if (user-interface-idiom-ipad?)
+                                       identity
+                                       reflow))))))

 (defn- doc*
   [sym]
@@ -546,18 +550,20 @@

 (defn- find-doc*
   [re-string-or-pattern]
-  (let [re       (re-pattern re-string-or-pattern)
-        sym-docs (sort-by first
-                   (mapcat (fn [ns]
-                             (map (juxt first (comp :doc second))
-                               (get-in @st [::ana/namespaces ns :defs])))
-                     (all-ns)))]
-    (doseq [[sym doc] sym-docs
-            :when (and doc
-                       (name sym)
-                       (or (re-find re doc)
-                           (re-find re (name sym))))]
-      (doc* sym))))
+  (print
+    (with-out-str
+      (let [re       (re-pattern re-string-or-pattern)
+            sym-docs (sort-by first
+                       (mapcat (fn [ns]
+                                 (map (juxt first (comp :doc second))
+                                   (get-in @st [::ana/namespaces ns :defs])))
+                         (all-ns)))]
+        (doseq [[sym doc] sym-docs
+                :when (and doc
+                           (name sym)
+                           (or (re-find re doc)
+                               (re-find re (name sym))))]
+          (doc* sym))))))

 (defn- source*
   [sym]


add code to compute Closure dependency graph from directories containing JavaScript files


Moved disk-persisted parsed lines to central location to prevent re-parsing multiple times.


Added resource-servlet and HTTP method macros

--- base/compojure.clj
+++ base/compojure.clj
@@ -78,7 +78,7 @@

 (defn add-resource
   "Add a resource to the global *resources*."
-  [method route & body]
+  [method route body]
   (def *resources*
     (cons [method (parse-route route) body] *resources*)))

@@ -91,3 +91,23 @@
                     (if (and (= meth method) (match-route route path))
                        body))]
     (some matches? *resources*)))
+
+(defn resource-servlet
+  "Create a pseudo-servlet from a resource. It's not quite a real
+  servlet because it's just a function that takes in a request and
+  a response object as arguments."
+  [resource]
+  (eval
+   `(fn ~'[request response]
+      (let ~'[method     (. request (getMethod))
+              full-path  (. request (getPathInfo))
+              param     #(. request (getParameter %))
+              header    #(. request (getHeader %))]
+        (update-response! ~'response (do ~@resource))))))
+
+; Add macros for GET, POST, PUT and DELETE
+(doseq method '(GET POST PUT DELETE)
+  (eval
+   `(defmacro ~method
+      ~'[route & body]
+      (add-resource ~(str method) ~'route ~'body))))


Added more comments, tidied up a bit

Added more comments, tidied up a bit

--- base/compojure.clj
+++ base/compojure.clj
@@ -6,12 +6,6 @@
   "Returns true if x is contained in coll, else false."
   [x coll]
   (some (partial = x) coll))
-
-(defn number?
-  "Returns true if an Clojure number type."
-  [x]
-  (or (instance? clojure.lang.FixNum x)
-      (instance? clojure.lang.DoubleNum x)))

 (defn re-escape
   "Escape all special regex chars in a string s."
@@ -38,7 +32,8 @@
     [(re-pattern regex) (map second symbols)]))

 (defn match-route
-  "Match a path against a parsed route."
+  "Match a path against a parsed route. Returns a map of keywords and their
+   matching path values."
   [[regex symbols] path]
   (let [matcher (re-matcher regex path)]
     (if (. matcher (matches))
@@ -47,7 +42,14 @@
                     (rest (re-groups matcher)))))))

 (defn update-response!
-  "Update a HttpServletResponse via a Clojure datatype."
+  "Destructively update a HttpServletResponse via a Clojure datatype.
+     * FixNum        - updates status code
+     * map           - updates headers
+     * string or seq - updates body
+   Additionally, multiple updates can be chained through a vector.
+
+   e.g (update-response! \"Foo\")       ; write 'Foo' to response body
+       (update-response! [200 \"Bar\"]) ; set status to 200, and write 'Bar'"
   [#^HttpServletResponse response change]
   (cond
     (string? change)
@@ -56,7 +58,7 @@
       (let [writer (. response (getWriter))]
         (doseq c change
           (. writer (print c))))
-    (number? change)
+    (instance? clojure.lang.FixNum change)
       (. response (setStatus change))
     (map? change)
       (doseq [k v] change


remove log/debug that showed up a lot in jstack

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -15,8 +15,6 @@
 (defn toks [s lookup]
   (let [tokens (string/split s tokenizer)
         tokens2 (toks2 tokens (count tokens))]
-    (log/debug (str "tokens: " tokens))
-    (log/debug (str "tokens2 size: " (count tokens2)))
     (pmap (fn [token-vector]
             (pmap lookup token-vector))
          tokens2)))
@@ -158,7 +156,6 @@
   "return a list of all possible parse trees for a string or a list of lists of maps (a result of looking up in a dictionary a list of tokens from the input string)"
   (cond (string? arg)
         (let [tokens (toks arg lookup)]
-          (log/debug (str "tokens: " (count tokens)))
           (parse tokens lookup grammar))

         (and (vector? arg)


set :show-notes to true since this is false by default in babel.generate

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -167,6 +167,7 @@
            :source (if source-expression
                      ((:morph @@(get models source-language))
                       source-expression
+                      :show-notes true
                       :from-language target-language-str))}]
       (if (:source pairing)
         (str (:target pairing) " => " (:source pairing))


Fix reflection

Fix reflection


support default opts on dependencies

support default opts on dependencies

--- src/cake/project.clj
+++ src/cake/project.clj
@@ -5,7 +5,7 @@
         [uncle.core :only [fileset-seq]]
         [clojure.string :only [join trim-newline]]
         [clojure.java.shell :only [sh]]
-        [cake.utils.useful :only [update merge-in tap]]
+        [cake.utils.useful :only [update merge-in into-map]]
         [clojure.java.io :only [reader]])
   (:import [java.io File]))

@@ -123,9 +123,10 @@
     (some #(% project) [namespace name])))

 (defn dep-map [deps]
-  (into {}
-    (for [[dep version & opts] deps]
-      [dep (apply hash-map :version version opts)])))
+  (let [[deps default-opts] (split-with (complement keyword?) deps)]
+    (into {}
+          (for [[dep version & opts] deps]
+            [dep (into-map :version version default-opts opts)]))))

 (defmulti get-version identity)


minor refactor

minor refactor

--- ssclj/tools/src/com/sixsq/slipstream/tools/cli/ssconfigmigrate.clj
+++ ssclj/tools/src/com/sixsq/slipstream/tools/cli/ssconfigmigrate.clj
@@ -48,13 +48,16 @@
 ;; Persistence.
 ;;

+(def con-attrs-to-remove
+  {"ec2" [:securityGroup]
+   "nuvlabox" [:orchestratorInstanceType :pdiskEndpoint]})
+
 (defn remove-attrs
   "Cleanup of old attributes during migration."
   [con]
-  (cond
-    (= "ec2" (:cloudServiceType con)) (dissoc con :securityGroup)
-    (= "nuvlabox" (:cloudServiceType con)) (dissoc con :orchestratorInstanceType :pdiskEndpoint)
-    :else con))
+  (if-let [attrs (get con-attrs-to-remove (:cloudServiceType con))]
+    (apply dissoc con attrs)
+    con))

 (defn persist-config!
   [sc]