fixed version for template

fixed version for template

--- template/project.clj
+++ template/project.clj
@@ -1,4 +1,4 @@
-(defproject swagger1st/lein-template "0.1.0-SNAPSHOT"
+(defproject swagger1st/lein-template "0.15.0"
   :description "Leiningen template for creating a swagger1st app."
   :url "https://github.com/sarnowski/swagger1st"

@@ -6,13 +6,4 @@
             :url "http://opensource.org/licenses/ISC"
             :distribution :repo}

-  :eval-in-leiningen true
-
-  :release-tasks [["vcs" "assert-committed"]
-                  ["change" "version" "leiningen.release/bump-version" "release"]
-                  ["vcs" "commit"]
-                  ["vcs" "tag" "template-"]
-                  ["deploy"]
-                  ["change" "version" "leiningen.release/bump-version"]
-                  ["vcs" "commit"]
-                  ["vcs" "push"]])
+  :eval-in-leiningen true)


Print no more or less than the right amount of newlines

--- src/varjocafe/view.clj
+++ src/varjocafe/view.clj
@@ -94,6 +94,11 @@
                              nil)
                  [:script html/any-node] (html/replace-vars {:tracking-id tracking-id}))

+(defn- pad-if [snippet padding]
+  (if (empty? snippet)
+    snippet
+    (html/html snippet padding)))
+
 (html/deftemplate layout "templates/layout.html"
                   [{:keys [dates today areadata settings]}]
                   [(indent-of :.date-column)] nil
@@ -104,7 +109,7 @@
                   [:.area-row.collapsed] nil
                   [:.area-row] (html/clone-for [area areadata]
                                                (html/substitute (area-restaurants area dates)))
-                  [:body] (html/append (google-analytics settings) "\n\n"))
+                  [:body] (html/append (pad-if (google-analytics settings) "\n\n")))

 (defn main-page [data today settings]
   (let [in-past? #(< (compare % today) 0)]


handler.clj (wlmmap.handler): Fix use of :import

* handler.clj (wlmmap.handler): Fix use of :import.

--- src/wlmmap/handler.clj
+++ src/wlmmap/handler.clj
@@ -1,5 +1,5 @@
 (ns wlmmap.handler
-  (import '(java.io File))
+  (:import (java.io File))
   (:require [clojure.data.json :as json]
             [clojure.string :as str]
             [cemerick.friend :as friend]


added purge function that removes :offset, :line, :col, :end-offset from custom parser's output

--- src/paredit/parser.clj
+++ src/paredit/parser.clj
@@ -179,7 +179,7 @@
 (defn remove-shit
   [state]
   state
-  #_(update-in state [:accumulated-state 0] purge))
+  (update-in state [:accumulated-state 0] purge))

 (defn parse
 	"TODO: currently the parser assumes a well formed document ... Define a policy if the parser encounters and invalid text


Implement :hang-avoid for fzprint-hang-one.

--- src/zprint/zprint.cljc
+++ src/zprint/zprint.cljc
@@ -2325,8 +2325,12 @@
   does ok as hanging, or better with flow. hindent is hang-indent, and
   findent is flow-indent, and each contains the initial separator.
   Might be nice if the fn-style actually got sent to this fn."
-  [caller {:keys [one-line?], :as options} hindent findent zloc]
-  (dbg-pr options "fzprint-hang-one:" (zstring zloc) " hindent:" hindent "findent:" findent)
+  [caller {:keys [one-line? width], {:keys [hang-avoid]} caller, :as options}
+   hindent findent zloc]
+  (dbg-pr options
+          "fzprint-hang-one:" (zstring zloc)
+          " hindent:" hindent
+          "findent:" findent)
   (when (:dbg-hang options)
     (println (dots (:pdepth options))
              "h1 caller:"
@@ -2338,9 +2342,14 @@
         ; If we don't have an hindent, we better not be trying to hang
         ; things -- in this case, we'll just flow.
         hindent (or hindent findent)
-        hanging (when (not= hindent findent)
+        hang-count (zcount zloc)
+	; This implements :hang-avoid for fzprint-hang-one, instead of just
+	; for fzprint-hang-remaining.  It didn't change the tests, but
+	; removed some silly formatting when using :arg2 and small widths.
+        hanging (when (and (not= hindent findent)
+                           (or (not hang-avoid)
+                               (< hang-count (* (- width hindent) hang-avoid))))
                   (fzprint* (in-hang local-options) hindent zloc))
-        hang-count (zcount zloc)
         hanging (concat-no-nil [[" " :none :whitespace]] hanging)
         _ (log-lines options "fzprint-hang-one: hanging:" (dec hindent) hanging)
         hr-lines (style-lines options (dec hindent) hanging)]


Fixup incorrect console error from deref-input-signals

Introduced in 64f858c4e33f68b1da5d6f9532defd8a73345b0b

--- src/re_frame/subs.cljc
+++ src/re_frame/subs.cljc
@@ -176,7 +176,7 @@
     (sequential? signals) (map f signals)
     (map? signals) (map-vals f signals)
     (deref? signals) (f signals)
-    :else nil))
+    :else '()))

 (defn to-seq
   "Coerces x to a seq if it isn't one already"
@@ -188,8 +188,11 @@
 (defn- deref-input-signals
   [signals query-id]
   (let [dereffed-signals (map-signals deref signals)]
-    (when (nil? dereffed-signals)
-      (console :error "re-frame: in the reg-sub for " query-id ", the input-signals function returns:" signals))
+    (cond
+      (sequential? signals) (map deref signals)
+      (map? signals) (map-vals deref signals)
+      (deref? signals) (deref signals)
+      :else (console :error "re-frame: in the reg-sub for" query-id ", the input-signals function returns:" signals))
     (trace/merge-trace! {:tags {:input-signals (doall (to-seq (map-signals reagent-id signals)))}})
     dereffed-signals))


validate floor price in `validate`

validate floor price in `validate`

--- src/s7p/slave/core.clj
+++ src/s7p/slave/core.clj
@@ -20,24 +20,55 @@
   (let [{:keys [status body]} @res]
     {:dsp dsp :status status :body body}))

-(defn validate [request-id {dsp :dsp status :status body :body}]
+(defn over-floor? [floor-price bid-price]
+  (if floor-price
+    (<= (* 1000 floor-price) bid-price)
+    true))
+
+(defn validate [request {dsp :dsp status :status body :body}]
   ;; TODO: validate id identity
   (try
    (let [body (and body (json/parse-string body true))
          {:keys [id bidPrice advertiserId]} body
          ret (cond
-               (= status 204) {:status :no-bid}
-               (not status) {:status :timeout}
-               (not (= status 200)) {:status :invalid :reason "response status" :code status}
-               (not body) {:status :invalid :reason "no body"}
-               (not id) {:status :invalid :invalid "no bid id"}
-               (not (instance? String id)) {:status :invalid :reason "id not string" :id id}
-               (not (= id request-id)) {:status :invalid :reason "bid id differs from request-id" :id id :request-id request-id}
-               (not bidPrice) {:status :invalid :reason "no bid price"}
-               (not (instance? Double bidPrice)) {:status :invalid :reason "bidPrice not double" :bidPrice bidPrice}
-               (not advertiserId) {:status :invalid :reason "no advertiser id"}
-               (not (instance? String advertiserId)) {:status :invalid :reason "advertiserId not string" :advertiserId advertiserId}
-               true   {:status :valid :response body})]
+               (= status 204)
+               {:status :no-bid}
+
+               (not status)
+               {:status :timeout}
+
+               (not (= status 200))
+               {:status :invalid :reason "response status" :code status}
+
+               (not body)
+               {:status :invalid :reason "no body"}
+
+               (not id)
+               {:status :invalid :invalid "no bid id"}
+
+               (not (instance? String id))
+               {:status :invalid :reason "id not string" :id id}
+
+               (not (= id (:id request)))
+               {:status :invalid :reason "bid id differs from request-id" :id id :request-id (:id request)}
+
+               (not bidPrice)
+               {:status :invalid :reason "no bid price"}
+
+               (not (instance? Double bidPrice))
+               {:status :invalid :reason "bidPrice not double" :bidPrice bidPrice}
+
+               (not (over-floor? (:floorPrice request) bidPrice))
+               {:status :invalid :reason "bid price under floor price" :floorPrice (:floorPrice request) :bidPrice bidPrice}
+
+               (not advertiserId)
+               {:status :invalid :reason "no advertiser id"}
+
+               (not (instance? String advertiserId))
+               {:status :invalid :reason "advertiserId not string" :advertiserId advertiserId}
+
+               true
+               {:status :valid :response body})]
      (assoc ret :dsp dsp))
    (catch JsonParseException e {:status :invalid :reason "invalid JSON"})
    (catch Exception          e {:status :invalid :reason (format "validation process raised unexpected error: %s" e)})))
@@ -52,11 +83,6 @@
 (defn succeed? [v]
   (= :valid (:status v)))

-
-(defn over-floor? [floor-price {res :response}]
-  (if floor-price
-    (<= (* 1000 floor-price) (:bidPrice res))
-    true))

 (defn auction [floor-price resps]
   (case  (count resps)
@@ -99,11 +125,10 @@
        (sequence (comp
                   (map (fn [dsp] {:dsp dsp :response (http/post (:url dsp) (json-request-option req))}))
                   (map destruct)
-                  (map #(validate (:id req) %))
+                  (map #(validate req %))
                   (map #(log-validated test %))
                   (filter succeed?)
-                  (map (fn [{dsp :dsp res :response}] {:dsp dsp :response res}))
-                  (filter #(over-floor? (:floorPrice req) %))))
+                  (map (fn [{dsp :dsp res :response}] {:dsp dsp :response res}))))
        (auction (:floorPrice req))
        (non-nil #(to-winnotice result %))
        (log-winnotice-option test)


Unifies let form for date, currency-format und number-format

Uses locale in let form the same way for the three filters

--- src/selmer/filters.clj
+++ src/selmer/filters.clj
@@ -124,9 +124,9 @@
      :date
      (fn [d fmt & [locale]]
        (let [fixed-date (fix-date d)
-             locale (or locale "en")
+             locale (java.util.Locale. (or locale "en"))
              ^DateTimeFormatter fmt (.withLocale (or (valid-date-formats fmt)
-                                                  (DateTimeFormat/forPattern fmt)) (java.util.Locale. locale))]
+                                                  (DateTimeFormat/forPattern fmt)) locale)]
          (.print fmt fixed-date)))

      ;;; Default if x is falsey


Switched to KeyAdapter and constrained panel and frame to main

--- src/tile_game/core.clj
+++ src/tile_game/core.clj
@@ -2,7 +2,7 @@
   (:require (clojure.contrib seq math))
   (:import (javax.swing JFrame JPanel )
            (java.awt Color Graphics Graphics2D Dimension Font)
-           (java.awt.event KeyListener KeyEvent)))
+           (java.awt.event KeyAdapter KeyEvent)))

 (set! *warn-on-reflection* true)

@@ -38,7 +38,7 @@
         empty-pos piece
         pos 0)))

-(def dir-delta {:up [0 1] :down [0 -1]
+(def dir-delta {:up [0 -1] :down [0 1]
                 :left [-1 0] :right [1 0]})

 (defn move-direction [board direction]
@@ -128,39 +128,37 @@

 (def *board* (ref (shuffle (vec (range 0 (* dim dim))))))

-(declare process-key)
-(def panel
+(defn main []
   (let [size (* dim scale)
-        panel (proxy [JPanel KeyListener] []
-                (paint [g]
-                       (dorun (for [x (range dim) y (range dim)]
-                                (render-tile g @*board* [x y]))))
-                (keyPressed [#^KeyEvent e] (process-key (.getKeyCode e)))
-                (keyReleased [e]) ; do nothing
-                (keyTyped [e]) ; do nothing
-                )]
+        #^JFrame frame (JFrame.)
+        #^JPanel panel (proxy [JPanel] []
+                         (paint [g]
+                                (dorun (for [x (range dim) y (range dim)]
+                                         (render-tile g @*board* [x y])))))
+        move! (fn
+                ([piece]
+                   (dosync (when (can-move? @*board* piece)
+                             (alter *board* move piece)))
+                   (.repaint panel))
+                ([piece & moves]
+                   (doseq [m (cons piece moves)]
+                     (move! m)
+                     (Thread/sleep 100))))]
     (doto panel
       (.setPreferredSize (Dimension. size size))
       (.setFocusable true)
-      (.addKeyListener panel))))
+      (.addKeyListener
+       (proxy [KeyAdapter] []
+         (keyPressed [e]
+                     (let [dir-move (comp move! (partial move-direction @*board*))]
+                       (condp = (.getKeyCode e)
+                           KeyEvent/VK_LEFT  (dir-move :left)
+                           KeyEvent/VK_RIGHT (dir-move :right)
+                           KeyEvent/VK_UP    (dir-move :up)
+                           KeyEvent/VK_DOWN  (dir-move :down)
+                           KeyEvent/VK_Q     (.dispose #^JFrame frame)
+                           true))))))
+    (doto frame (.setContentPane panel) .pack .show)
+    move!))

-(defn render-move [piece]
-  (dosync (when (can-move? @*board* piece)
-            (alter *board* move piece)))
-  (. #^JPanel panel (repaint)))
-
-(defn process-key [code]
-  (let [dir-move (comp render-move (partial move-direction @*board*))]
-       (condp = code
-           KeyEvent/VK_LEFT  (dir-move :left)
-           KeyEvent/VK_RIGHT (dir-move :right)
-           KeyEvent/VK_UP    (dir-move :down)
-           KeyEvent/VK_DOWN  (dir-move :up)
-           KeyEvent/VK_Q     (.dispose #^JFrame frame))))
-
-(defn execute-moves [moves]
-  (doseq [m moves]
-    (render-move m)
-    (Thread/sleep 100)))
-
-(def frame (doto (new JFrame) (.add #^JPanel panel) .pack .show))
+(def move! (main))


Prints hello message when attempting to render

--- src/tttclj/render.cljs
+++ src/tttclj/render.cljs
@@ -2,7 +2,8 @@
   (:require [chord.client :refer [ws-ch]]
             [cljs.core.async :refer [chan <! >! put! close! timeout]]
             [quiescent :as q :include-macros true]
-            [quiescent.dom :as d]))
+            [quiescent.dom :as d])
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))

 (def state {:tiles [:x :o :-
                     :x :- :o
@@ -52,7 +53,8 @@

 (enable-console-print!)

-(go
+(go
+  (prn "hello")
   (let [server-ch (<! (ws-ch "ws://localhost:8080/ws"))]
     (go
       (prn (<! server-ch)))))


Take 5000 again.

Take 5000 again.

--- src/wlmmap/handler.clj
+++ src/wlmmap/handler.clj
@@ -40,7 +40,7 @@
 (defn- generate-markers
   "return a string with the javascript code to generate addressPoints."
   [params]
-  (let [mons (take 50000 (wcar* (car/smembers "frfrim")))
+  (let [mons (take 5000 (wcar* (car/smembers "frfrim")))
         all (remove #(nil? %)
                     (for [m mons]
                       (let [res (read-string (wcar* (car/get m)))


Use "body" indentation for the ns macro

Use "body" indentation for the ns macro

By convention, namespace decls are indented with two spaces for
everything following the ns name, effectively turning the additional
args into "body" arguments.

This commit causes ns to be indented like when, even when using community
style.

--- src/zprint/config.cljc
+++ src/zprint/config.cljc
@@ -273,7 +273,7 @@
 ;;

 (def zfnstyle
-  {"ns" :arg1,
+  {"ns" :arg1-body,
    "let" :binding,
    "if" :arg1-body,
    "if-not" :arg1-body,


core: comp

core: comp

--- data/core.clj
+++ data/core.clj
@@ -1185,9 +1185,38 @@
          (let [~form temp#]
            ~@body)))))

-
 (defn find-var
   "Returns the global var named by the namespace-qualified symbol, or
   nil if no var with that name."
   {:added "1.0"}
   [sym] (find-var* sym))
+
+(defn comp
+  "Takes a set of functions and returns a fn that is the composition
+  of those fns.  The returned fn takes a variable number of args,
+  applies the rightmost of fns to the args, the next
+  fn (right-to-left) to the result, etc."
+  {:added "1.0"}
+  ([] identity)
+  ([f] f)
+  ([f g]
+   (fn
+     ([] (f (g)))
+     ([x] (f (g x)))
+     ([x y] (f (g x y)))
+     ([x y z] (f (g x y z)))
+     ([x y z & args] (f (apply g x y z args)))))
+  ([f g h]
+   (fn
+     ([] (f (g (h))))
+     ([x] (f (g (h x))))
+     ([x y] (f (g (h x y))))
+     ([x y z] (f (g (h x y z))))
+     ([x y z & args] (f (g (apply h x y z args))))))
+  ([f1 f2 f3 & fs]
+   (let [fs (reverse (list* f1 f2 f3 fs))]
+     (fn [& args]
+       (loop [ret (apply (first fs) args) fs (next fs)]
+         (if fs
+           (recur ((first fs) ret) (next fs))
+           ret))))))


Factored out compilation, loading, and running unit tests

--- jvm-runner/src/clojure/codewars/runner/java.clj
+++ jvm-runner/src/clojure/codewars/runner/java.clj
@@ -6,26 +6,40 @@
            [java.net URLClassLoader]
            [javax.tools ToolProvider]
            [org.junit.runner JUnitCore]
-           [codewars.java CwRunListener]))
+           [codewars.java CwRunListener]
+           [java.io IOException]))

-(defn- write-code-and-load! [class-loader dir code]
-  (let [{:keys [:file-name :class-name]}
-        (util/write-code! "java" dir code)]
-    (-> (ToolProvider/getSystemJavaCompiler)
-        (.run nil nil nil
-              (into-array [(str file-name)])))
-    (Class/forName (str class-name) true class-loader)))
+(defn- compile! [& files]
+  ;; TODO: Add classpath option, other goodies
+  (let [compilation-result
+        (-> (ToolProvider/getSystemJavaCompiler)
+            (.run nil nil nil
+                  (into-array (map str files))))]
+    (if (zero? compilation-result)
+      0
+      (throw (IOException. "Java compilation error")))))
+
+(defn- load-class [dir class-name]
+  "Load a java class in a specified directory"
+  ;; TODO: Make the classpath include all the classes on the system classpath
+  (let [class-loader
+        (URLClassLoader/newInstance
+         (into-array [(-> dir .toURI .toURL)]))]
+    (Class/forName (name class-name) true class-loader)))
+
+(defn- run-junit-tests [fixture-class]
+  (let [runner (JUnitCore.)]
+    (.addListener runner (CwRunListener.))
+    (.run runner (into-array [fixture-class]))))

 (defmethod run "java"
-  [{:keys [:setup :fixture :solution]}]
+  [{:keys [:fixture :setup :solution]}]
   (let [dir (TempDir/create "java")
-        class-loader (URLClassLoader/newInstance
-                      (into-array [(-> dir .toURI .toURL)]))
-        fixture-class (write-code-and-load!
-                       class-loader dir fixture)
-        runner (JUnitCore.)]
-    (when (not (nil? setup)) (write-code-and-load! class-loader dir setup))
-    (write-code-and-load! class-loader dir solution)
-
-    (.addListener runner (CwRunListener.))
-    (.run runner (into-array [fixture-class]))))
+        fixture (util/write-code! "java" dir fixture)
+        setup (when (not (empty? setup)) (util/write-code! "java" dir setup))
+        solution (util/write-code! "java" dir solution)
+        files (for [{:keys [:file-name]} [fixture setup solution]
+                    :when (not (nil? file-name))]
+                file-name)]
+    (apply compile! files)
+    (->> fixture :class-name (load-class dir) run-junit-tests)))


Update to ClojureScript 0.0-3196

Update to ClojureScript 0.0-3196

--- Clojure/project.clj
+++ Clojure/project.clj
@@ -4,7 +4,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-3165"]
+                 [org.clojure/clojurescript "0.0-3196"]
                  [com.github.rickyclarkson/jmdns "3.4.2-r353-1"]]
   :source-paths ["src"]
   :main ambly.repl.jsc)


make the token transformer play nice with advanced optimization

--- frontend/history.cljs
+++ frontend/history.cljs
@@ -12,19 +12,26 @@
 ;; see this.transformer_ at http://goo.gl/ZHLdwa
 (def ^{:doc "Custom token transformer that preserves hashes"}
   token-transformer
-  (clj->js {:retrieveToken (fn [path-prefix location]
-                             ;; XXX may break with advanced compilation
-                             (str (subs (.-pathname location) (count path-prefix))
-                                  (when-let [hash (second (string/split (.-href location) #"#"))]
-                                    (str "#" hash))))
-            :createUrl (fn [token path-prefix location]
-                         (let [[path hash] (string/split token #"#")]
-                           (str path-prefix
-                                path
-                                ;; comment out for now, need to figure out how to combine
-                                ;; location search and the search already in the token
-                                ;; (.-search location)
-                                (when hash (str "#" hash)))))}))
+  (let [transformer (js/Object.)]
+    (set! (.-retrieveToken transformer)
+          (fn [path-prefix location]
+            ;; XXX may break with advanced compilation
+            (utils/inspect location)
+            (str (subs (.-pathname location) (count path-prefix))
+                 (when-let [hash (second (string/split (.-href location) #"#"))]
+                   (str "#" hash)))))
+
+    (set! (.-createUrl transformer)
+          (fn [token path-prefix location]
+            (let [[path hash] (string/split token #"#")]
+              (str path-prefix
+                   path
+                   ;; comment out for now, need to figure out how to combine
+                   ;; location search and the search already in the token
+                   ;; (.-search location)
+                   (when hash (str "#" hash))))))
+
+    transformer))

 (defn setup-dispatcher! [history-imp]
   (events/listen history-imp goog.history.EventType.NAVIGATE


Clean code.

Clean code.

--- web-server/src/cljs/hatnik/web/client/components.cljs
+++ web-server/src/cljs/hatnik/web/client/components.cljs
@@ -3,6 +3,9 @@
             [om.dom :as dom :include-macros true]
             [hatnik.web.client.app-state :as state])
   (:use [jayq.core :only [$]]))
+
+(defn test-action []
+  (js/alert "Hoooo!"))

 (defn accordion-panel [& {:keys [body-id header body]}]
@@ -11,16 +14,18 @@
    (dom/div
     #js {:className "panel-heading"}
     (dom/div
-     nil
-     (dom/h4 #js {:className "panel-title"}
-             (dom/a #js
-                    {:data-parent "#accrodion"
-                     :data-toggle "collapse"
-                     :href (str "#" body-id)} header))))
-           (dom/div #js {:className "panel-collapse collapse in"
-                         :id body-id}
-                    (dom/div #js {:className "panel-body"}
-                             body))))
+     nil
+     (dom/h4
+      #js {:className "panel-title"}
+      (dom/a
+       #js {:data-parent "#accrodion"
+            :data-toggle "collapse"
+            :href (str "#" body-id)}
+       header))))
+   (dom/div #js {:className "panel-collapse collapse in"
+                 :id body-id}
+            (dom/div #js {:className "panel-body"}
+                     body))))

 (defn render-action [project-id action]
   (dom/div nil
@@ -50,16 +55,23 @@
     (apply dom/div #js {:className "row"}
            (concat rendered
                    [(dom/div #js {:className "col-sm-6 col-md-4 col-lg-2"}
-                             (add-new-action id))]))))
+                             (add-new-action id))]))))
+
+(defn project-header-menu-button [project]
+  (dom/div #js {:className "dropdown"}
+           (dom/button
+            #js {:className "btn btn-default"
+                 :type "button"}
+            (dom/span #js {:className "glyphicon glyphicon-pencil pull-right"}))))

 (defn project-header [project]
   (dom/div #js {:className "row"}
    (dom/div
     #js {:className "col-sm-2 col-md-1 col-lg-1"}
     (dom/p nil (get project "name")))
-   (dom/div #js {:className "col-sm-2 col-md-1 col-lg-1 pull-right"}
-            (dom/span
-             #js {:className "glyphicon glyphicon-pencil pull-right"}))))
+   (dom/div
+    #js {:className "col-sm-2 col-md-1 col-lg-1 pull-right"}
+    (project-header-menu-button project))))

 (defn project-list [data owner]
   (reify


Writes nREPL port to target/repl-port; override via :nrepl-port-file [IMMUTANT-255]

--- modules/core/src/main/clojure/immutant/repl.clj
+++ modules/core/src/main/clojure/immutant/repl.clj
@@ -85,17 +85,27 @@
      (when-let [server ((util/try-resolve 'clojure.tools.nrepl.server/start-server)
                         :handler ((util/try-resolve 'clojure.tools.nrepl.server/default-handler) #'nrepl-init-handler)
                         :port (fix-port port) :bind interface-address)]
-       (log/info "Bound to " (str interface-address ":" (-> server deref :ss .getLocalPort)))
        (util/at-exit (partial stop-nrepl server))
        server))
   ([port]
      (start-nrepl (util/management-interface-address) port)))
+
+(defn ^:private spit-nrepl-file
+  [server file]
+  (let [ss (-> server deref :ss)
+        port (.getLocalPort ss)
+        host (-> ss .getInetAddress .getHostAddress)
+        file (util/app-relative (or file "target/repl-port"))]
+    (log/info "Bound to" (str host ":" port))
+    (.mkdirs (.getParentFile file))
+    (spit file port)
+    (.deleteOnExit file)))

 (defn ^{:internal true :no-doc true} init-repl
   "Looks for nrepl-port and swank-port values in the given config, and starts
 the appropriate servers."
   [config]
   (when-let [port (config "nrepl-port")]
-    (start-nrepl port))
+    (spit-nrepl-file (start-nrepl port) (config "nrepl-port-file")))
   (when-let [port (config "swank-port")]
     (start-swank port)))


add trigger new

add trigger new

--- backend/src/lambdaui/core.clj
+++ backend/src/lambdaui/core.clj
@@ -1,6 +1,6 @@
 (ns lambdaui.core
   (:require
-    [compojure.core :refer [routes GET context]]
+    [compojure.core :refer [routes GET context POST]]
     [lambdaui.api :as new-api]
     [lambdacd-git.core :as git]
     [lambdacd.core :as lambdacd]
@@ -14,6 +14,15 @@
     [compojure.route :as route])
   (:gen-class)
   )
+
+
+(defn get-trigger-id [pipeline]
+  (((val (last (lambdacd.internal.pipeline-state/get-all (get-in pipeline [:context :pipeline-state-component])))) '(1 1)) :trigger-id)
+  )
+
+(defn trigger-new [pipeline]
+  (let [ctx (:context pipeline)]
+    (manualtrigger/post-id ctx (get-trigger-id pipeline) {})))

 (defn try-parse-int [port default-fn]
   (try (Integer/parseInt port) (catch NumberFormatException e (default-fn e))))
@@ -31,6 +40,7 @@
 (defn pipeline-routes [pipeline]
   (ring-json/wrap-json-response
     (routes (context "/lambdaui/api" [] (new-api/api-routes pipeline))
+            (POST "/lambdaui/api/triggerNew" [] (do (trigger-new pipeline) {}))
             (context "/api" [] (old-api/rest-api pipeline))
             (GET "/old" [] (old-ui/ui-page pipeline))
             (route/resources "/" {:root "public"})
@@ -39,12 +49,9 @@
             (route/resources "/ui" {:root "public/target"})
             )))

-(defonce pipe (atom nil))
-
 (defn start-server [port]
   (git/init-ssh!)
   (let [pipeline (lambdacd/assemble-pipeline pipe/pipeline-structure {:home-dir "tmp/foo"})]
-    (reset! pipe pipeline)
     (runners/start-one-run-after-another pipeline)
     (reset! server (http/run-server (pipeline-routes pipeline) {:port port}))))

@@ -53,10 +60,3 @@
     (println "Started Server on port " port ". CTRL+C to abort.")
     (start-server port)))

-(defn get-trigger-id []
-  (((val (last (lambdacd.internal.pipeline-state/get-all (get-in @pipe [:context :pipeline-state-component])))) '(1 1)) :trigger-id)
-  )
-
-(defn trigger-new []
-  (let [ctx (:context @pipe)]
-    (manualtrigger/post-id ctx (get-trigger-id) {})))


Switch to boxlayout

Switch to boxlayout

now you can see the icons

--- reorganize.clj
+++ reorganize.clj
@@ -1,8 +1,8 @@
-(import '(javax.swing JFrame JLabel JButton JPanel)
+(import '(javax.swing JFrame JLabel JButton JPanel BoxLayout)
         '(java.awt.event ActionListener)
         '(javax.imageio ImageIO)
         '(java.io File)
-        '(java.awt GridBagLayout GridBagConstraints Color Font RenderingHints))
+        '(java.awt Color Font RenderingHints))

 (defn create-model [] (ref "Useless data"))

@@ -36,36 +36,17 @@
     panel))

 (defn create-gui-panel [model]
-  (defn create-image-constraints []
-    (let [c (GridBagConstraints.)]
-      (set! (.fill c) (. GridBagConstraints BOTH))
-      (set! (.gridx c) 1)
-      (set! (.weightx c) 10)
-      c))

-  (defn create-panel-constraints []
-    (let [c (GridBagConstraints.)]
-      (set! (.gridy c) 1)
-      (set! (.weighty c) 1)
-      (set! (.fill c) (. GridBagConstraints BOTH))
-      c))
-
-  (let [gridbag (GridBagLayout.)
+  (let [pane (JPanel.)
+        box (BoxLayout. pane (. BoxLayout X_AXIS))
         image1 (create-image "/usr/share/icons/Faenza/apps/32/AdobeReader.png")
         image2 (create-image "/usr/share/icons/Faenza/apps/32/Thunar.png")
         image3 (create-image "/usr/share/icons/Faenza/apps/48/WorldOfGoo.png")
         ;panel (create-graphics-panel model)
         ]
-    ;set up the gridbag constraints
-    (doto gridbag
-      (.setConstraints image1 (create-image-constraints))
-      (.setConstraints image2 (create-image-constraints))
-      (.setConstraints image3 (create-image-constraints))
-      ;(.setConstraints panel (create-panel-constraints))
-      )
     ;add the components to the panel and return it
-    (doto (JPanel.)
-      (.setLayout gridbag)
+    (doto pane
+      (.setLayout box)
       (.add image1)
       (.add image2)
       (.add image3)


fix devcards example

fix devcards example

--- examples/counter-devcards/project.clj
+++ examples/counter-devcards/project.clj
@@ -23,7 +23,7 @@
                                        "../../contrib/reagent/src"
                                        "../../contrib/atom-sync/src"
                                        "../../contrib/logging/src"
-                                       "../counter/src-spec"]
+                                       "../counter/src-public"]
                         :compiler     {:main                 app.core
                                        :devcards             true
                                        :asset-path           "js/compiled/out"
@@ -41,7 +41,7 @@
                                        "../../contrib/reagent/src"
                                        "../../contrib/atom-sync/src"
                                        "../../contrib/logging/src"
-                                       "../counter/src-spec"]
+                                       "../counter/src-public"]
                         :compiler     {:main           app.core
                                        :devcards       true
                                        :output-to      "resources/public/js/compiled/frontend.js"


bump version

bump version

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.45.1"
+(defproject cook "1.45.2-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


delaney.clj: reverted 0a5a43cf13b0c26fead9dd91fc2df218df24cdee and fixed another bug


Add initial saucelabs page

Add initial saucelabs page

--- frontend/components/integrations.cljs
+++ frontend/components/integrations.cljs
@@ -167,7 +167,9 @@
                       {:title "Watch how to get started in minutes"
                        :text [:span "This video shows step-by-step how to configure CircleCI to test your application and deploy to Heroku, and how CircleCI keeps defects from getting into production. "
                     "See our docs for a " [:a {:href "/docs/continuous-deployment-with-heroku#part-2-multiple-environments"} "followup video"] " showing how to setup a more robust continuous delivery pipeline with staging and prod environments."]
-                       :graphic [:div {:dangerouslySetInnerHTML {:__html ""}}]}]}})
+                       :graphic [:div {:dangerouslySetInnerHTML {:__html ""}}]}]}
+   :saucelabs {:hero {:header [:span "Test with " [:img {:src (utils/cdn-path "/img/outer/integrations/sauce.png") :style {:width "300px"}}] " on CircleCI"]
+                      :text "Test with as many browsers as you want, in parallel."}}})

 (defrender integration [app owner]
   (let [integration (get-in app [:navigation-data :integration])]


Fix bug causing all users loop to fail Cause: insert-update-metric-request was called outside let

--- jar-async/src/slipstream/async/collector.clj
+++ jar-async/src/slipstream/async/collector.clj
@@ -144,8 +144,8 @@
       (<!! (timeout timeout-all-users-loop))
       (let [users (users)]
         (log/log-info "inserting all users requests")
-        (insert-collection-requests users))
-        (insert-update-metric-requests users))))
+        (insert-collection-requests users)
+        (insert-update-metric-requests users)))))

 (defn -start
   []


Add send event timeout, and send retry

Add send event timeout, and send retry


Upgrade redl and add lein-expectations dep in profiles.clj.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,7 +1,7 @@
 {:user {:dependencies [[clj-stacktrace "0.2.5"]
                        [org.clojure/tools.trace "0.7.6"]
                        [org.clojure/tools.namespace "0.2.4"]
-                       [redl "0.1.0"]
+                       [redl "0.2.2"]
                        [speclj-tmux "1.0.0"]
                        [spyscope "0.1.4"]
                        [com.aphyr/prism "0.1.1"]
@@ -14,6 +14,7 @@
                   [lein-kibit "0.0.8"]
                   [lein-clojars "0.9.1"]
                   [lein-pprint "1.1.1"]
+                  [lein-expectations "0.0.7"]
                   [com.cemerick/austin "0.1.3"]
                   [lein-ring "0.8.0"]
                   [lein-cljsbuild "0.3.2"]


Use tree-seq in flatten-array.

Use tree-seq in flatten-array.

--- exercises/flatten-array/src/example.clj
+++ exercises/flatten-array/src/example.clj
@@ -1,16 +1,9 @@
 (ns flatten-array
   (:refer-clojure :exclude [flatten]))

-(defn flatten
-  "Flattens the given list and removes any nil values"
-  [coll]
-  (loop
-   [results nil
-    [elem & remaining] coll]
-    (if (or elem remaining)
-      (if (coll? elem)
-        (if (empty? elem)
-          (recur results remaining)
-          (recur results (conj remaining (rest elem) (first elem))))
-        (recur (conj results elem) remaining))
-      (reverse (remove nil? results)))))
+(defn flatten [s]
+  (->> s
+       (tree-seq sequential? seq)
+       rest
+       (remove sequential?)
+       (remove nil?)))


Fixes transducers usage.

Fixes transducers usage.

--- src/fr/tedoldi/lichess/game/retriever/lichess.clj
+++ src/fr/tedoldi/lichess/game/retriever/lichess.clj
@@ -100,6 +100,7 @@
                                            (> timestamp since-timestamp)))))

                           (map #(-games-url->games url max-per-page % total-pages)))]
-      (lazy-cat
-        (sequence page-nb->game
-                  (range total-pages))))))
+      (flatten
+        (lazy-seq
+          (sequence page-nb->game
+                    (range total-pages)))))))


Bind *compile-path*, not sure how it becomes unbound.

--- src/leiningen/compile.clj
+++ src/leiningen/compile.clj
@@ -7,7 +7,10 @@
   "Compile the namespaces specified in build.clj or all namespaces in src/
   if none are provided."
   [project]
-  (.mkdir (file (:root project) "classes"))
-  (doseq [n (or (:namespaces project)
-                (find-namespaces-in-dir (file (:root project) "src")))]
-    (compile n)))+  ;; TODO: not sure why this is necessary
+  (binding [*compile-path* "classes/"]
+    (.mkdir (file (:root project) "classes"))
+    (doseq [n (or (:namespaces project)
+                  (find-namespaces-in-dir (file (:root project) "src")))]
+      (println "Compiling" n)
+      (clojure.core/compile n))))


Redirect to upcoming lunches on login.

Redirect to upcoming lunches on login.

--- src/lunchlotto/routes.clj
+++ src/lunchlotto/routes.clj
@@ -38,6 +38,6 @@
       (not-found "Page not found."))
     {:login-uri "/login"
      :login-failure-handler auth/failed-login
-     :default-landing-uri "/"
+     :default-landing-uri "/lunches/upcoming"
      :credential-fn auth/authenticate
      :workflows [(workflows/interactive-form)]}))


optimize shadow.json a bit

optimize shadow.json a bit

--- src/main/shadow/json.cljs
+++ src/main/shadow/json.cljs
@@ -22,19 +22,18 @@
      (into [] (map #(to-clj % opts)) (array-seq x))

      :else ;; object
-     (reduce
-       (fn [result key]
-         (let [value
-               (gobj/get x key)
-
-               key-fn
-               (get opts :key-fn keyword)]
-
-           (assoc result (key-fn (to-clj key opts)) (to-clj value opts))
-           ))
-       {}
-       (gobj/getKeys x)
-       ))))
+     (let [key-fn (get opts :key-fn keyword)]
+       (->> (gobj/getKeys x)
+            (reduce
+              (fn [result key]
+                (let [value (gobj/get x key)]
+                  (assoc! result
+                    (if (string? key)
+                      (key-fn key)
+                      (to-clj key opts))
+                    (to-clj value opts))))
+              (transient {}))
+            (persistent!))))))

 (defn read-str [str opts]
   (to-clj (js/JSON.parse str) opts))


temp fix for REPL with :npm-module and webpack

can't think of a clean fix right now. this will still break
in many areas but will at least have the regular namespaces
accessible. just not new "roots".

--- src/main/shadow/cljs/devtools/client/browser.cljs
+++ src/main/shadow/cljs/devtools/client/browser.cljs
@@ -225,9 +225,12 @@
              :asset-root (get-asset-root))))

 (defn global-eval [js]
-  ;; hack to force eval in global scope
-  ;; goog.globalEval doesn't have a return value so can't use that for REPL invokes
-  (js* "(0,eval)(~{});" js))
+  (if (not= "undefined" (js* "typeof(module)"))
+    ;; don't eval in the global scope in case of :npm-module builds running in webpack
+    (js/eval js)
+    ;; hack to force eval in global scope
+    ;; goog.globalEval doesn't have a return value so can't use that for REPL invokes
+    (js* "(0,eval)(~{});" js)))

 (defn repl-invoke [{:keys [id js]}]
   (let [result (env/repl-call #(global-eval js) repl-error)]


can clone channels!

can clone channels!

--- src/mediakeys/sockets.clj
+++ src/mediakeys/sockets.clj
@@ -1,22 +1,27 @@
 (ns mediakeys.sockets
     (:use [mediakeys.utils :only [defcurried dochan]]
-          [clojure.core.async :only [put!]])
+          [clojure.core.async :only [put! chan mult tap]])
     (:import [org.webbitserver WebSocketHandler]))

 (defcurried send! [c message]
     (.send c message))

+(defn clone [channel]
+    (let [return (chan)]
+        (tap (mult channel) return)
+        return))
+
 (defn keypresses [incoming]
     (proxy [WebSocketHandler] []
         (onOpen [c]
-            (dochan incoming (send! c)))
+            (dochan (clone incoming) (send! c)))
         (onClose [c] (println "closed" c))
         (onMessage [c j] )))

 (defn controls [new-keys incoming-changes]
     (proxy [WebSocketHandler] []
         (onOpen [c]
-            (dochan incoming-changes (send! c)))
+            (dochan (clone incoming-changes) (send! c)))
         (onClose [c] (println "closed changes" c))
         (onMessage [c message]
             (put! new-keys message))))
@@ -24,6 +29,6 @@
 (defn errors [incoming-errors]
     (proxy [WebSocketHandler] []
         (onOpen [c]
-            (dochan incoming-errors (send! c)))
+            (dochan (clone incoming-errors) (send! c)))
         (onClose [c])
         (onMessage[c j])))


Fix params for saved card csv downloading

--- src/metabase/api/card.clj
+++ src/metabase/api/card.clj
@@ -1,5 +1,6 @@
 (ns metabase.api.card
   (:require [clojure.data :as data]
+            [cheshire.core :as json]
             [compojure.core :refer [GET POST DELETE PUT]]
             [schema.core :as s]
             (metabase.api [common :refer :all]
@@ -273,9 +274,11 @@
   (run-query-for-card card-id parameters))

 (defendpoint POST "/:card-id/query/csv"
-  "Run the query associated with a Card, and return its results as CSV."
-  [card-id :as {{:keys [parameters]} :body}]
-  (dataset-api/as-csv (run-query-for-card card-id parameters)))
+  "Run the query associated with a Card, and return its results as CSV. Note that this expects the query as serialized JSON in the 'query' parameters."
+  [card-id query]
+  {query (s/maybe su/JSONString)}
+  (dataset-api/as-csv (run-query-for-card card-id (when query
+                                                    (:parameters (json/parse-string query keyword))))))

 (defendpoint GET "/:card-id/json"
   "Fetch the results of a Card as JSON."


Start refactor no blockin in go (loop)

Start refactor no blockin in go (loop)

--- src/neovim_client/rpc.clj
+++ src/neovim_client/rpc.clj
@@ -85,9 +85,9 @@
                    :in-chan in-chan
                    :message-table message-table
                    :method-table method-table}]
-    (async/go-loop
+    (future (loop
       []
-      (when-let [msg (async/<! in-chan)]
+      (when-let [msg (async/<!! in-chan)]
         (condp = (msg-type msg)

           msg/+response+
@@ -100,7 +100,7 @@
                 result (f msg)]
             (send-message-async!
               component (->response-msg (id msg) result) nil)))
-        (recur)))
+        (recur))))
     component))

 (defn new


JC | #27 | Remove unused let binding

JC | #27 | Remove unused let binding

--- src/stonecutter/controller/forgotten_password.clj
+++ src/stonecutter/controller/forgotten_password.clj
@@ -14,7 +14,6 @@
             [stonecutter.util.uuid :as uuid]
             [stonecutter.db.user :as user]
             [stonecutter.config :as config]
-            [stonecutter.util.ring :as ring-util]
             [stonecutter.routes :as r]
             [stonecutter.db.token :as token]))

@@ -62,7 +61,7 @@
         new-password (request->new-password request)]
     (when-let [forgotten-password-record (cl-store/fetch forgotten-password-store forgotten-password-id)]
       (let [email-address (:login forgotten-password-record)]
-        (when-let [user (user/retrieve-user user-store email-address)]
+        (when (user/retrieve-user user-store email-address)
           (if (empty? err)
             (let [updated-user (user/change-password! user-store email-address new-password)]
               (cl-store/revoke! forgotten-password-store forgotten-password-id)


Fix error.

Fix error.

--- src/onyx_starter/core.clj
+++ src/onyx_starter/core.clj
@@ -34,7 +34,7 @@

 ;;;;; Configuration ;;;;;

-;;;            input
+;;;             in
 ;;;              |
 ;;;       split-by-spaces
 ;;;              |
@@ -45,7 +45,7 @@
 ;;;    loud-output    question-output

 (def workflow
-  [[:input :split-by-spaces]
+  [[:in :split-by-spaces]
    [:split-by-spaces :mixed-case]
    [:mixed-case :loud]
    [:mixed-case :question]
@@ -74,7 +74,7 @@
 (def batch-size 10)

 (def catalog
-  [{:onyx/name :input
+  [{:onyx/name :in
     :onyx/ident :core.async/read-from-chan
     :onyx/type :input
     :onyx/medium :core.async


update

update

--- src/panpan/supplement.clj
+++ src/panpan/supplement.clj
@@ -38,5 +38,5 @@
     #(if-let [x (brain/get SNOOZE_KEY)]
        (->> SUPPLEMENT_REMINDER_TEXTS
             rand-nth
-            (str "uochan ")
+            (str "uochan: ")
             adapter/out))))


Remove types namespace bacause types are now specs.

--- src/bytebuf/types.clj
+++ src/bytebuf/types.clj
@@ -1,72 +0,0 @@
-(ns bytebuf.types
-  (:refer-clojure :exclude [read])
-  (:require [bytebuf.buffer :as buffer]))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Abstraction definition
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defprotocol IDynamicType
-  "Dynamic spec type mark.")
-
-(defprotocol IStaticType
-  "Static spec type mark.")
-
-(defprotocol IReadableType
-  (read [_ buff pos] "Read self corresponding data from the specified buffer."))
-
-(defprotocol IWritableType
-  (write [_ buff pos value] "Write value to the specified buffer and return the written bytes."))
-
-(defprotocol ITypeSize
-  (size [_] [_ data] "Read the size of the type. In static type data is optional."))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Types implementation
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn int32
-  "Create a int32 indexed data type."
-  ([] (int32 0))
-  ([default]
-   (reify
-     IStaticType
-     IReadableType
-     (read [_ buff pos]
-       [(buffer/read-int buff pos)
-        (Integer/BYTES)])
-
-     IWritableType
-     (write [_ buff pos value]
-       (let [value (or value default)]
-         (buffer/write-int buff pos value)
-         (Integer/BYTES)))
-
-    ITypeSize
-    (size [_]
-      (Integer/BYTES))
-    (size [_ _]
-      (Integer/BYTES)))))
-
-(defn int64
-  "Create a int64 indexed data type."
-  ([] (int64 0))
-  ([default]
-   (reify
-     IStaticType
-     IReadableType
-     (read [_ buff pos]
-       [(buffer/read-long buff pos)
-        (Long/BYTES)])
-
-     IWritableType
-     (write [_ buff pos value]
-       (let [value (or value default)]
-         (buffer/write-long buff pos value)
-         (Long/BYTES)))
-
-     ITypeSize
-     (size [_]
-       (Long/BYTES))
-     (size [_ _]
-       (Long/BYTES)))))


Better support for face-up and rezzed installs. Fix events on hosted cards becoming unhooked when the host moves zones.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -172,7 +172,10 @@
                           (fn [i s]
                             (if (< i n) s
                                 {:content (vec (for [c (:content s)]
-                                                 (update-in c [:zone] #(assoc (vec %) 2 i))))
+                                                 (let [c (update-in c [:zone] #(assoc (vec %) 2 i))]
+                                                   (assoc c :hosted
+                                                            (for [h (:hosted c)]
+                                                               (assoc-in h [:host :zone] (:zone c)))))))
                                  :ices (vec (for [c (:ices s)]
                                               (update-in c [:zone] #(assoc (vec %) 2 i))))}))
                           (get-in @state [:corp :servers :remote]))))
@@ -181,7 +184,11 @@
                (when (:rezzed c)
                  (when-let [events (:events (card-def c))]
                    (unregister-events state side c)
-                   (register-events state side events c))))))
+                   (register-events state side events c)))
+               (doseq [h (:hosted c)]
+                 (when-let [events (:events (card-def h))]
+                   (unregister-events state side h)
+                   (register-events state side events h))))))
          (trigger-event state side :card-moved card moved-card)
          moved-card)))))

@@ -420,7 +427,9 @@
         (resolve-ability state side ability card targets))))
   (swap! state update-in [:turn-events] #(cons [event targets] %)))

-(defn card-init [state side card]
+(defn card-init
+  ([state side card] (card-init state side card true))
+  ([state side card resolve]
   (let [cdef (card-def card)
         abilities (if (:recurring cdef)
                     (conj (:abilities cdef) {:msg "Take 1 [Recurring Credits]"})
@@ -445,8 +454,9 @@
     (update! state side c)
     (when-let [events (:events cdef)]
       (register-events state side events c))
-    (resolve-ability state side cdef c nil)
-    (get-card state c)))
+    (when resolve
+      (resolve-ability state side cdef c nil))
+    (get-card state c))))

 (defn ice-strength-bonus [state side n]
   (swap! state update-in [:bonus :ice-strength] (fnil #(+ % n) 0)))
@@ -796,6 +806,7 @@
       (when-let [name (:title c)]
         (when-let [access-effect (:access cdef)]
           (resolve-ability state (to-keyword (:side c)) access-effect c nil))
+        (trigger-event state side :access c)
         (when (not= (:zone c) [:discard])
           (trigger-event state side :pre-trash c)
           (if-let [trash-cost (trash-cost state side c)]
@@ -819,8 +830,7 @@
                                                    (steal c))} nil)
                 (when (or (not (:steal-req cdef)) ((:steal-req cdef) state :runner c nil))
                   (steal state :runner c))))
-            (prompt! state :runner c (str "You accessed but cannot steal " (:title c)) ["OK"] {})))
-        (trigger-event state side :access c)))))
+            (prompt! state :runner c (str "You accessed but cannot steal " (:title c)) ["OK"] {})))))))

 (defn max-access [state side n]
   (swap! state assoc-in [:run :max-access] n))
@@ -1229,7 +1239,7 @@

 (defn corp-install
   ([state side card server] (corp-install state side card server nil))
-  ([state side card server {:keys [extra-cost no-install-cost rezzed] :as args}]
+  ([state side card server {:keys [extra-cost no-install-cost install-state] :as args}]
      (if-not server
        (prompt! state side card (str "Choose a server to install " (:title card))
                 (server-list state card) {:effect (effect (corp-install card target args))})
@@ -1240,7 +1250,8 @@
                  slot (conj (server->zone state server) (if (= (:type c) "ICE") :ices :content))
                  dest-zone (get-in @state (cons :corp slot))
                  install-cost (if (and (= (:type c) "ICE") (not no-install-cost))
-                                (count dest-zone) 0)]
+                                (count dest-zone) 0)
+                 install-state (or install-state (:install-state cdef))]
              (when (and (not (and (has? c :subtype "Region")
                                   (some #(has? % :subtype "Region") dest-zone)))
                         (pay state side card extra-cost :credit install-cost))
@@ -1249,7 +1260,8 @@
                    (system-msg state side (str "trashes " (if (:rezzed prev-card)
                                                             (:title prev-card) "a card") " in " server))
                    (trash state side prev-card {:keep-server-alive true})))
-               (let [card-name (if (or rezzed (:rezzed c) (= (:install-state cdef) :face-up)) (:title card) "a card")]
+               (let [card-name (if (or (= :rezzed install-state) (= :face-up install-state) (:rezzed c))
+                                 (:title card) "a card")]
                  (if (> install-cost 0)
                    (system-msg state side (str "pays " install-cost " [Credits] to install "
                                                card-name " in " server))
@@ -1258,11 +1270,10 @@
                  (trigger-event state side :corp-install moved-card)
                  (when (= (:type c) "Agenda")
                    (update-advancement-cost state side moved-card))
-                 (when (or rezzed (= (:install-state cdef) :rezzed))
+                 (when (= install-state :rezzed)
                    (rez state side moved-card {:no-cost true}))
-                 (when (= (:install-state cdef) :face-up)
-                   (do (card-init state side (assoc (get-card state moved-card) :rezzed true))
-                       (resolve-ability state side cdef (get-card state moved-card) nil))))))))))
+                 (when (= install-state :face-up)
+                   (card-init state side (assoc (get-card state moved-card) :rezzed true) false)))))))))

 (defn play [state side {:keys [card server]}]
   (case (:type card)


moved keeping abilities after desactivate

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -338,13 +338,13 @@
                         (not (:facedown c)))
                  (desactivate state side c) c)
              c (if (= dest [:rig :facedown]) (assoc c :facedown true :installed true) (dissoc c :facedown))
-             c (if (and (= (second dest) :scored) (:has-abilities-when-stolen (card-def c)))
-                 (merge c {:abilities (:abilities (card-def c))}) c)
              moved-card (assoc c :zone dest :host nil :hosted nil :previous-zone (:zone c))
              moved-card (if (and (:facedown moved-card) (:installed moved-card))
                           (desactivate state side moved-card) moved-card)
              moved-card (if (and (= side :corp) (#{:hand :deck} (first dest)))
-                          (dissoc moved-card :seen) moved-card)]
+                          (dissoc moved-card :seen) moved-card)
+             moved-card (if (and (= (first (:zone moved-card)) :scored) (:has-abilities-when-stolen (card-def moved-card)))
+                          (merge moved-card {:abilities (:abilities (card-def moved-card))}) moved-card)]
          (if front
            (swap! state update-in (cons side dest) #(cons moved-card (vec %)))
            (swap! state update-in (cons side dest) #(conj (vec %) moved-card)))


Fix for trash costs on multi-access.

Fix for trash costs on multi-access.

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -660,8 +660,8 @@

 (defn handle-access [state side cards]
   (swap! state assoc :access true)
-  (swap! state update-in [:bonus] dissoc :trash)
   (doseq [c cards]
+    (swap! state update-in [:bonus] dissoc :trash)
     (let [cdef (card-def c)
           c (assoc c :seen true)]
       (when-let [name (:title c)]


Add concise system record class.

Add concise system record class.

--- src/clj/pfrt/core.clj
+++ src/clj/pfrt/core.clj
@@ -1,7 +1,21 @@
-(ns pfrt.core)
+(ns pfrt.core
+  (:require [swiss.arrows :refer [-<>]]))

-(defprotocol Lifecycle
+(defprotocol IComponentLifecycle
   (init [_ system] "Initialize method")
   (start [_ system] "Start service")
   (stop [_ system] "Stop service"))

+(defprotocol ISystemLifecycle
+  (init [_] "Initialize method")
+  (start [_] "Start service")
+  (stop [_] "Stop service"))
+
+(defrecord System [components]
+  ISystemLifecycle
+  (init [this]
+    (-<> this (reduce #(init %1 %2) <> components)))
+  (start [this]
+    (-<> this (reduce #(start %1 %2) <> components)))
+  (stop [this]
+    (-<> this (reduce #(stop %1 %2) <> components))))


Add some utility functions

Add some utility functions

--- src/cljs/d4/core.cljs
+++ src/cljs/d4/core.cljs
@@ -1,4 +1,15 @@
 (ns d4.core
   (:require [clojure.browser.repl]))

-(.log js/console js/d3)
+(defonce d3 js/d3)
+
+(defn log
+  [x]
+  (.log js/console x))
+
+(defn tc
+  "Helper function to test brepl connection"
+  []
+  (js/alert "Connected"))
+
+(log d3)


framework added

framework added

--- src/crawler/crawl.clj
+++ src/crawler/crawl.clj
@@ -227,3 +227,14 @@
                      new-lim
                      new-globals))))))
     {:visited visited}))
+
+(defn crawl
+  [start crawler-type num-docs]
+  (cond (= :richness crawler-type)
+        (crawl-richest {:content [{:url start}]
+                        :pagination []}
+                       (set [])
+                       1
+                       0
+                       num-docs
+                       {})))


Deprecate some duplicated fns

Deprecate some duplicated fns

--- src/detritus/pred.clj
+++ src/detritus/pred.clj
@@ -47,14 +47,16 @@
 ;; Missing type predicates
 ;;--------------------------------------------------------------------

-(defn seqable? [x]
-  (or (instance? clojure.lang.ISeq x)
-      (instance? clojure.lang.Seqable x)
-      (instance? Iterable x)
-      (instance? CharSequence x)
-      (instance? java.util.Map x)
-      (nil? x)
-      (.. x getClass isArray)))
+(defn seqable?
+  {:depricated  "0.3.1"
+   :replaced-by t/seqable?}
+  [x]
+  (.write *err* "Calling deprecated detritus.pred/seqable?\n")
+  (t/seqable? x))

-(defn atom? [x]
-  (instance? clojure.lang.Atom x))
+(defn atom?
+  {:depricated  "0.3.1"
+   :replaced-by t/atom?}
+  [x]
+  (.write *err* "Calling deprecated detritus.pred/atom?\n")
+  (t/atom? x))


Sometimes, there's no "transient_lastDdlTime".

--- src/drake/fs/hive.clj
+++ src/drake/fs/hive.clj
@@ -48,29 +48,30 @@
     (doall (for [_ (range) :while (.next tables)]
              (.getString tables 3)))))

-(defn table-exists? [ds db table]
-  (boolean (first (list-tables ds db table))))
+(defn table-exists? [path]
+  (let [{ds :datasource db :database table :table} (hive-path path)]
+    (boolean (first (list-tables ds db table)))))

 (defn table-info [path]
-  (let [{ds :datasource db :database table :table} (hive-path path)]
-    (when (table-exists? ds db table)
-      (let [sql (format "describe extended %s.%s" db table)
-            [_ meta] (->> (jdbc/query ds [sql] :as-arrays? true)
-                          (rest)
-                          (filter #(= "Detailed Table Information" (first %)))
-                          (first))
-            [_ mtime] (re-find #"transient_lastDdlTime=(\d+)\b" meta)
-            [_ numrw] (re-find #"numRows=(\d+)\b" meta)]
-        {:mod-time (* 1000 (Long/parseLong mtime))
-         :num-rows (Long/parseLong numrw)
-         :path path
-         :directory false}))))
+  (when (table-exists? path)
+    (let [{ds :datasource db :database table :table} (hive-path path)
+          sql (format "describe extended %s.%s" db table)
+          [_ meta] (->> (jdbc/query ds [sql] :as-arrays? true)
+                        (rest)
+                        (filter #(= "Detailed Table Information" (first %)))
+                        (first))
+          [_ ctime] (re-find #"createTime:(\d+)\b" meta)
+          [_ mtime] (re-find #"transient_lastDdlTime=(\d+)\b" meta)
+          [_ numrw] (re-find #"numRows=(\d+)\b" meta)]
+      {:mod-time (* 1000 (Long/parseLong (or mtime ctime)))
+       :num-rows (and numrw (Long/parseLong numrw))
+       :path path
+       :directory false})))

 (defn hive []
   (reify FileSystem
     (exists? [_ path]
-      (let [{ds :datasource db :database table :table} (hive-path path)]
-        (table-exists? ds db table)))
+      (table-exists? path))
     (directory? [_ path]
       false)
     (mod-time [_ path]
@@ -82,7 +83,7 @@
     (file-info-seq [_ path]
       [(table-info path)])
     (data-in? [_ path]
-      (pos? (or (:num-rows (table-info path)) 0)))
+      (table-exists? path))
     (normalized-filename [_ path]
       (:path (hive-path path)))
     (rm [_ _]


Add a few more docstrings

Add a few more docstrings

--- src/rosado/processing.clj
+++ src/rosado/processing.clj
@@ -830,6 +830,36 @@
  (.noFill *applet*))

 (defn noise
+  "Returns the Perlin noise value at specified coordinates. Perlin
+  noise is a random sequence generator producing a more natural
+  ordered, harmonic succession of numbers compared to the standard
+  random function. It was invented by Ken Perlin in the 1980s and
+  been used since in graphical applications to produce procedural
+  textures, natural motion, shapes, terrains etc.
+
+  The main difference to the random function is that Perlin noise is
+  defined in an infinite n-dimensional space where each pair of
+  coordinates corresponds to a fixed semi-random value (fixed only for
+  the lifespan of the program). The resulting value will always be
+  between 0.0 and 1.0. Processing can compute 1D, 2D and 3D noise,
+  depending on the number of coordinates given. The noise value can be
+  animated by moving through the noise space as demonstrated in the
+  example above. The 2nd and 3rd dimension can also be interpreted as
+  time.
+
+  The actual noise is structured similar to an audio signal, in
+  respect to the function's use of frequencies. Similar to the concept
+  of harmonics in physics, perlin noise is computed over several
+  octaves which are added together for the final result.
+
+  Another way to adjust the character of the resulting sequence is the
+  scale of the input coordinates. As the function works within an
+  infinite space the value of the coordinates doesn't matter as such,
+  only the distance between successive coordinates does (eg. when
+  using noise() within a loop). As a general rule the smaller the
+  difference between coordinates, the smoother the resulting noise
+  sequence will be. Steps of 0.005-0.03 work best for most
+  applications, but this will differ depending on use."
   ([x] (.noise *applet* (float x)))
   ([x y] (.noise *applet* (float x) (float y)))
   ([x y z] (.noise *applet* (float x) (float y) (float z))))
@@ -896,7 +926,14 @@

 (defn pop-matrix [] (.popMatrix *applet*))

-(defn pow [a b] (PApplet/pow (float a) (float b)))
+(defn pow
+  "Facilitates exponential expressions. The pow() function is an
+  efficient way of multiplying numbers by themselves (or their
+  reciprocal) in large quantities. For example, (pow 3 5) is
+  equivalent to the expression (* 3 3 3 3 3) and (pow 3 -5) is
+  equivalent to (/ 1 (* 3 3 3 3 3))."
+  [num exponent]
+  (PApplet/pow (float num) (float exponent)))

 ;; $$print

@@ -923,7 +960,15 @@
          (float x3) (float y3)
          (float x4) (float y4)))

-(defn radians [deg] (PApplet/radians (float deg)))
+(defn radians
+  "Converts a degree measurement to its corresponding value in
+  radians. Radians and degrees are two ways of measuring the same
+  thing. There are 360 degrees in a circle and 2*PI radians in a
+  circle. For example, 90° = PI/2 = 1.5707964. All trigonometric
+  methods in Processing require their parameters to be specified in
+  radians."
+  [degrees]
+  (PApplet/radians (float degrees)))

 (defn random
   ([max] (.random *applet* (float max)))


Exercise 3.52

Exercise 3.52

--- src/sicp/chapter3/5_1.clj
+++ src/sicp/chapter3/5_1.clj
@@ -22,3 +22,23 @@
 (def x (map show (range 0 (inc 10))))
 #_(nth x 5)
 #_(nth x 7)
+
+;; Exercise 3.52
+(defn display-stream [s]
+  (run! println s))
+
+(def sum (atom 0))
+#_@sum
+(defn accum [x]
+  (swap! sum + x))
+#_@sum
+(def seq' (map accum (range 1 (inc 20))))
+#_@sum
+(def y (filter even? seq'))
+#_@sum
+(def z (filter #(zero? (rem % 5)) seq'))
+#_@sum
+#_(nth y 7)
+#_@sum
+#_(display-stream z)
+#_@sum


Add a SQL utility function for extracting a scalar from a result set.

--- src/sql_file/sql_util.clj
+++ src/sql_file/sql_util.clj
@@ -33,11 +33,24 @@
   (log/debug "query-first:" query-spec)
   (first (jdbc/query db-connection query-spec)))

-(defn query-scalar [ db-connection query-spec ]
-  (log/debug "query-scalar:" query-spec)
-  (let [first-row (first (jdbc/query db-connection query-spec))
-        row-keys (keys first-row)]
-    (when (> (count row-keys) 1)
-      (log/warn "Queries used for query-scalar should only return one field per row:" query-spec))
-    (get first-row (first row-keys))))
+(defn scalar-result
+  ([ query-result default ]
+   (or
+    (let [first-row (first query-result)
+          row-keys (keys first-row)]
+      (when (> (count row-keys) 1)
+        (log/debug "Queries used for query-scalar should only return one field per row."))
+      (get first-row (first row-keys)))
+    default))

+  ([ query-result ]
+   (scalar-result query-result nil)))
+
+(defn query-scalar
+  ([ db-connection query-spec default ]
+   (log/debug "query-scalar:" query-spec)
+   (scalar-result (jdbc/query db-connection query-spec) default))
+
+  ([ db-connection query-spec ]
+   (query-scalar db-connection query-spec nil)))
+


Set log pane font to monospace.

Set log pane font to monospace.

--- src/sqls/ui/worksheet.clj
+++ src/sqls/ui/worksheet.clj
@@ -59,7 +59,10 @@
         query-text-area-scrollable (seesaw.core/scrollable query-text-area)
         results-panel (seesaw.core/vertical-panel :id :results-panel
                                                   :preferred-size [800 :by 400])
-        log-text (seesaw.core/text :id :log :multi-line? true :editable? false)
+        log-text (seesaw.core/text :id :log
+                                   :multi-line? true
+                                   :editable? false
+                                   :font (seesaw.font/font :monospaced))
         log-panel (seesaw.core/vertical-panel :id :log-panel
                                               :items [(seesaw.core/scrollable log-text
                                                                               :id :log-scrollable)])


very simply application main() function which starts up embedded jetty server on port 3000.

--- src/metabase/core.clj
+++ src/metabase/core.clj
@@ -1,26 +1,22 @@
 (ns metabase.core
   (:gen-class)
   (:require [clojure.tools.logging :as log]
-            [clojure.java.jdbc :as jdbc]
+            [medley.core :as medley]
+            [metabase.config :as config]
+            [metabase.db :as db]
+            (metabase.middleware [auth :as auth]
+                                 [log-api-call :refer :all]
+                                 [format :refer :all])
+            [metabase.routes :as routes]
+            [metabase.util :as util]
+            [ring.adapter.jetty :as ring-jetty]
             (ring.middleware [cookies :refer [wrap-cookies]]
                              [json :refer [wrap-json-response
                                            wrap-json-body]]
                              [keyword-params :refer [wrap-keyword-params]]
                              [params :refer [wrap-params]]
-                             [session :refer [wrap-session]])
-            (metabase.middleware [auth :as auth]
-                                 [log-api-call :refer :all]
-                                 [format :refer :all])
-            [metabase.routes :as routes]
-            [metabase.db :as db]))
+                             [session :refer [wrap-session]])))

-(defn liquibase-sql []
-  (db/migrate :up))
-
-(defn -main
-  "I don't do a whole lot ... yet."
-  [& args]
-  (liquibase-sql))

 (def app
   "The primary entry point to the HTTP server"
@@ -36,3 +32,16 @@
       wrap-cookies            ; Parses cookies in the request map and assocs as :cookies
       wrap-session            ; reads in current HTTP session and sets :session/key
       ))
+
+
+(defn -main
+  "Launch Metabase in standalone mode."
+  [& args]
+  (log/info "Launching Metabase in STANDALONE mode")
+
+  ;; TODO - startup database.  validates connection & runs any necessary migrations
+
+  ;; startup webserver
+  ;; TODO - allow for env configuration
+  (let [jetty-config {:port 3000}]
+    (ring-jetty/run-jetty app jetty-config)))


Make comment shorter

Make comment shorter

--- src/musicbox/one.cljs
+++ src/musicbox/one.cljs
@@ -101,8 +101,9 @@
       instrument (update-size (create-instrument (scales/c-minor)) canvas-id)
       c-touch-start (util/listen (dom/getElement canvas-id) :touchstart)
       c-touch-end (util/listen (dom/getElement canvas-id) :touchend)]
+
   (go
-   (<! c-touch-start) (<! c-touch-end) ;; do not start until get first touch, otherwise will break sound
+   (<! c-touch-start) (<! c-touch-end) ;; start after first touch so don't break sound

    (loop [instrument instrument]
      (draw draw-ctx instrument)


formatting

formatting

--- src/overtone/util.clj
+++ src/overtone/util.clj
@@ -170,4 +170,4 @@

    (invert-map {:a 1, :b 2, :c 3}) ;=> {1 :a, 2 :b, 3 :c}"
   [m]
-  (apply hash-map (reverse (flatten (seq m))))  )
+  (apply hash-map (reverse (flatten (seq m)))))


replaced info footer text with the new-todo placehoder text

--- src/penjat/views.cljs
+++ src/penjat/views.cljs
@@ -74,7 +74,7 @@
   (fn start-page-render
     []
     [choose-word-input {:class "new-todo"
-                        :placeholder ""
+                        :placeholder "Escull una paraula"
                         :on-save #(dispatch [:set-word %])}]))

 (defn play-page
@@ -94,32 +94,15 @@
         guesses (subscribe [:guesses])]
       (fn end-page-render
         []
-        [:div
-         [:div (if (win-game? @word @guesses)
+        (let [text (if (win-game? @word @guesses)
                  "HAS GUANYAT :D !!!!"
                  [:div "Has perdut :'(  --> La paraula era " [:b @word]])]
-         [replay]])))
-
-(defn start-footer
-  []
-  [:p "Escull una paraula"])
-
-(defn play-footer
-  []
-  [:p "Adivina la paraula"])
-
-(defn end-footer
-  []
-  [:p "Prem qualsevol tecla per tornar a jugar."])
+          [:div.new-todo text]))))

 (def body-by-page {:start start-page
                    :end end-page
                    :play play-page})
-
-(def footer-by-page {:start start-footer
-                     :end end-footer
-                     :play play-footer})

 (defn penjat-app
@@ -130,6 +113,4 @@
        [:section.todoapp
         [:header#header
          [:h1 "penjat"]]
-        [(get body-by-page @current-page)]]
-       [:footer.info
-        [(get footer-by-page @current-page)]]])))
+        [(get body-by-page @current-page)]]])))


Printing: Don't use my own hardcoded hostname.

--- src/pepa/printing.clj
+++ src/pepa/printing.clj
@@ -72,7 +72,7 @@
           (let [server (-> (lpd-server lpd lpd-config)
                            (lpd/start-server))
                 ;; TODO: Use IP from config?
-                ip (InetAddress/getByName "moritz-x230")
+                ip (InetAddress/getLocalHost)
                 jmdns (JmDNS/create ip nil)]
             (doseq [service (service-infos lpd-config)]
               (log/info lpd "Registering service:" (str service))


Clarify nil-test

Clarify nil-test

--- src/protobuf/core.clj
+++ src/protobuf/core.clj
@@ -24,8 +24,7 @@
        def
        (protodef def PersistentProtocolBufferMap$Def/convertUnderscores)))
   ([def ^PersistentProtocolBufferMap$Def$NamingStrategy naming-strategy]
-     (if (nil? def)
-       def
+     (when def
        (let [^Descriptors$Descriptor descriptor
              (if (instance? Descriptors$Descriptor def)
                def


Pass the aggregated reactions instead of the plain reactions list to the render-entry-for-collection function.

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -65,7 +65,7 @@
                      :previous-count (count previous-activity)
                      :next-count (count next-activity)
                      :entries (map #(entry-rep/render-entry-for-collection org board %
-                                     (entry-rep/comments %) (entry-rep/reactions %)
+                                     (entry-rep/comments %) (reaction-res/aggregate-reactions (entry-rep/reactions %))
                                      access-level user-id)
                                (concat (reverse previous-activity) next-activity))})

@@ -75,7 +75,7 @@
                     {:direction :previous
                      :previous-count (count previous-activity)
                      :entries (map #(entry-rep/render-entry-for-collection org board %
-                                     (entry-rep/comments %) (entry-rep/reactions %)
+                                     (entry-rep/comments %) (reaction-res/aggregate-reactions (entry-rep/reactions %))
                                      access-level user-id)
                                 (reverse previous-activity))})

@@ -85,7 +85,7 @@
                     {:direction :next
                      :next-count (count next-activity)
                      :entries (map #(entry-rep/render-entry-for-collection org board %
-                                     (entry-rep/comments %) (entry-rep/reactions %)
+                                     (entry-rep/comments %) (reaction-res/aggregate-reactions (entry-rep/reactions %))
                                      access-level user-id)
                                next-activity)}))
         fixed-activities (update activities :entries #(map (fn [activity] (merge activity {


Fix rates. It's should used only on Birthdays.

--- src/ombs/handler/addevent.clj
+++ src/ombs/handler/addevent.clj
@@ -31,6 +31,25 @@
   ;valudation
   (if (isvalid/new-event? event price date users)
     (let [user-rates (db/get-rates (core/as-vec users))
+          party-pay (/ (read-string price) (count users)) ]
+      (db/add-event event (read-string price) date)
+      ;use 'dorun' for execute lazy function 'db/credit-payment'
+      (dorun
+        (map
+          #(db/credit-payment (db/get-uid %) (db/get-eid event date) party-pay)
+          (core/as-vec users)))
+      (println (str "rates " user-rates " pp " party-pay " users " users))
+      (redirect "/user"))
+    (addevent-page)
+
+    )
+  )
+
+(defn add-birthday [ {event :name price :price date :date users :participants :as params} ]
+  "Add event in events table, with adding participants, and calculating debts."
+  ;valudation
+  (if (isvalid/new-event? event price date users)
+    (let [user-rates (db/get-rates (core/as-vec users))
           party-pay (/ (read-string price) (reduce + user-rates)) ]
       (db/add-event event (read-string price) date)
       ;use 'dorun' for execute lazy function 'db/credit-payment'


Syntax error.

Syntax error.

--- resources/leiningen/new/onyx_app/project.clj
+++ resources/leiningen/new/onyx_app/project.clj
@@ -6,6 +6,6 @@
   :dependencies [[org.clojure/clojure "1.7.0-beta2"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [com.mdrogalis/onyx "0.6.0-beta1"]
-                 [com.stuartsierra/component "0.2.3"]
+                 [com.stuartsierra/component "0.2.3"]]
   :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.10"]]
                    :source-paths ["env/dev" "src"]}})


print out number of retry

print out number of retry

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -360,7 +360,7 @@
            (rm-rf! path)
            (Thread/sleep wait-t)
            (when *verbose-overtone-file-helpers*
-             (println "Download timed out. Retrying:" url ))
+             (println (str "Download timed out. Retry " attempts-made ": " url )))
            (download-file* url path timeout n-retries wait-t (inc attempts-made)))))))

 (defn- print-download-file


Add convenience mapping function.

Add convenience mapping function.

--- src/overtone/music/tuning.clj
+++ src/overtone/music/tuning.clj
@@ -42,6 +42,9 @@
 (defmethod perfn :midi [[symb]]
     (perfn (list :edo 12 69 440)))

+(defmethod perfn :default [[& contents]]
+    (perfn (list :midi)))
+
 (defmethod perfn :arabic [[symb initial freq]]
     (perfn (list :edo 24 initial freq)))

@@ -69,3 +72,13 @@
         (perfmap note initial freq qcmeantone)))

 (defn perform [[opts & notes]] (map (perfn (flatten (list opts))) notes))
+
+
+
+(defn get-or-fn [map key func]
+    (if-let [result (map key)]
+        result
+        (func key)))
+
+(defn map-or-fn [m keys func]
+    (map #(get-or-fn m % func) keys))


splice sexpr: more tests added. Some edge cases do not pass. They've been left commented out, since they're not totally relevant either.

--- src/paredit/core_commands.clj
+++ src/paredit/core_commands.clj
@@ -441,8 +441,14 @@
        "|   \nfoo" "'|   \nfoo"
        }]
      ["M-s"       :paredit-splice-sexp
-               {"(foo (bar| baz) quux)"
-                "(foo bar| baz quux)"}]
+               {"(foo (bar| baz) quux)" "(foo bar| baz quux)"
+                "(foo (b|ar baz) quux)" "(foo b|ar baz quux)"
+                "(bar| baz)" "bar| baz"
+                "(bar | baz)" "bar | baz"
+                ; TODO Following edge case tests do not pass
+                ;"(foo (|) baz)" "(foo | baz)"
+                ;"(foo (bar|) baz)" "(foo bar| baz)"
+                }]
      ;[("M-<up>" "ESC <up>")
      ;           paredit-splice-sexp-killing-backward
      ;           ("(foo (let ((x 5)) |(sqrt n)) bar)"
@@ -452,13 +458,13 @@
      ;           ("(a (b c| d e) f)"
      ;            "(a b c f)"))
      ["M-r"       :paredit-raise-sexp
-                {"(dynamic-wind in (lambda () |body|) out)" "(dynamic-wind in |body out)"
-                 "(dynamic-wind in |body| out)" "|body"
+                {"(dynamic-wind in (lambda () |body|) out)" "(dynamic-wind in |body| out)"
+                 "(dynamic-wind in |body| out)" "|body|"
                  "(foo bar|)" "(foo bar|)"
-                 "(foo |bar)" "|bar"
-                 "(foo |(bar))" "|(bar)"
+                 "(foo |bar)" "|bar|"
+                 "(foo |(bar))" "|(bar)|"
                  "(foo |(bar]|)" "(foo |(bar]|)"
-                 "(foo |(bar])|" "|(bar])"
+                 "(foo |(bar])|" "|(bar])|"
                  ; (|foo|) => |foo|
                  }]
      ]


namespace utils

namespace utils

--- src/tabby/cluster.clj
+++ src/tabby/cluster.clj
@@ -1,21 +1,21 @@
 (ns tabby.cluster
   (:require [tabby.server :as server]
             [clojure.tools.logging :refer :all]
-            [tabby.utils :refer :all]))
+            [tabby.utils :as utils]))

 ;;; Testing and Development things for cluster testing
 (defn foreach-server
   ([state f]
-   (update state :servers mapf f))
+   (update state :servers utils/mapf f))
   ([state f & args]
-   (apply update state :servers mapf f args)))
+   (apply update state :servers utils/mapf f args)))

 (defn- find-peers [id servers]
   (into {} (map (fn [[k v]]
                   [k (select-keys v [:hostname :port])]) (filterv (fn [[k v]] (not= k id)) servers))))

 (defn- set-peers [servers]
-  (mapf servers (fn [v]
+  (utils/mapf servers (fn [v]
                   (server/set-peers v (find-peers (:id v) servers)))))

 (defn write [k cluster]
@@ -37,12 +37,12 @@
                   (filter (partial valid-packet-for cluster id) (:tx-queue s))) (:servers cluster))))

 (defn collect-rx-packets [system]
-  (update-in system [:servers] mapf
+  (update-in system [:servers] utils/mapf
              (fn [v]
                (update-in v [:rx-queue] concat (collect-packets system (:id v))))))

 (defn clear-tx-packets [system]
-  (update-in system [:servers] mapf assoc :tx-queue '()))
+  (update-in system [:servers] utils/mapf assoc :tx-queue '()))

 (defn pump-transmit-queues [system]
   (-> system
@@ -52,7 +52,7 @@
 (defn step [dt system]
   (-> system
       (pump-transmit-queues)
-      (update :servers mapf (partial server/update-state dt))
+      (update :servers utils/mapf (partial server/update-state dt))
       (update :time + dt)))

 (defn step-times [dt times system]
@@ -76,7 +76,7 @@
   (select-keys (get (:servers cluster) id) [:tx-queue :rx-queue]))

 (defn print-fields [cluster & rest]
-  (mapf (:servers cluster) #(select-keys % (reverse rest))))
+  (utils/mapf (:servers cluster) #(select-keys % (reverse rest))))

 (defn ps [cluster]
   (print-fields cluster :id :type :election-timeout :current-term :commit-index))


Starting to hook up clj-gpio to rpi impl

--- src/clj_bots/pin_ctrl_rpi/implementation.clj
+++ src/clj_bots/pin_ctrl_rpi/implementation.clj
@@ -19,7 +19,7 @@

 (defmulti unset-mode*
   "Inner method for unsetting a pin mode, in particular for being run before moving to another mode or turned off"
-  pc/pin-mode)
+  (fn [board pin-n mode] mode))

 (defmulti set-mode*
   "Inner method for setting the mode of a pin on the board"
@@ -30,6 +30,8 @@
   (fn [board pin-n mode val] mode))

+;; Now let's hook these into the actual protocol implementations
+
 (defrecord RPiBoard
   [edge-channels config]
   pcp/PBoard
@@ -37,7 +39,6 @@

   pcp/PPinConfigure
   (set-mode! [board pin-n mode]
-    (unset-mode* board pin-n)
     (set-mode* board pin-n mode))

   pcp/PReadablePin
@@ -69,4 +70,43 @@
   )

+;; Now time to set up implementations for the multi-methods

+(def memoized-open-port
+  (memoize (fn [board pin-n]
+             (let [n (get-in (:pin-modes board) [pin-n :gpio-pin])]
+               (gpio/open-port n)))))
+
+(defmethod read-pin* :input
+  [board pin-n mode]
+  (gpio/read-value (memoized-open-port board pin-n)))
+
+(defmethod read-pin* :output
+  [board pin-n mode]
+  ;; Just defer to the :input method; gpio is generally fine with you trying to read fromj an output pin
+  (read-pin* board pin-n :input))
+
+(defmethod write-value* :output
+  [board pin-n mode val]
+  (gpio/write-value! (memoized-open-port board pin-n) val))
+
+(defn- set-gpio-mode
+  "This helper function takes care of some common logic for gpio :input and :output setting"
+  [direction]
+  (let [p (memoized-open-port board pin-n)]
+    (gpio/export! p)
+    (gpio/set-direction! p direction)))
+
+(defmethod set-mode* :input
+  [board pin-n mode]
+  (set-gpio-mode :in))
+
+(defmethod set-mode* :output
+  [board pin-n mode]
+  (set-gpio-mode :out))
+
+(defmethod unset-mode* :input
+  [board pin-n mode]
+  (gpio/unexport! (memoized-open-port board pin-n)))
+
+


Revert "timeout async tests after 2 seconds"

This reverts commit 1ee795e0be613ae79da4af6dd7e3c1b7b4051629.

--- src/cljx/jamesmacaulay/async_tools/test.cljx
+++ src/cljx/jamesmacaulay/async_tools/test.cljx
@@ -1,17 +1,7 @@
-#+clj
 (ns jamesmacaulay.async-tools.test
-  (:require [clojure.core.async :as async :refer [go go-loop >! <! chan]]
-            [jamesmacaulay.async-tools.core :as tools]
+  (:require [jamesmacaulay.async-tools.core :as tools]
             [cemerick.cljs.test]
-            [clojure.test]))
-
-#+cljs
-(ns jamesmacaulay.async-tools.test
-  (:require [cljs.core.async :as async :refer [>! <! chan]]
-            [jamesmacaulay.async-tools.core :as tools]
-            [cemerick.cljs.test])
-  (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
-
+            #+clj [clojure.test]))

 #+clj
 (defmacro deftest-async
@@ -22,13 +12,5 @@
     `(~deftest-sym
        ~(with-meta name {:async true})
        (-> (do ~@body)
-           (as-> ch#
-                 (if (tools/readport? ch#)
-                   (go
-                     (let [t# (async/timeout 2000)]
-                       (async/alt!
-                         ch# ([v#] v#)
-                         t# ([_#] (throw (ex-info (str "timeout in " ~name) {}))))))
-                   ch#))
            tools/cast-as-readport
-           cemerick.cljs.test/block-or-done))))+           cemerick.cljs.test/block-or-done))))


Made changes for bootstrap app to fix out of memory error.

--- src/cmr/metadata_db/data/oracle/concepts.clj
+++ src/cmr/metadata_db/data/oracle/concepts.clj
@@ -261,13 +261,13 @@
                                     (when-not (empty? params)
                                       (where (find-params->sql-clause params)))
                                     (order-by :concept-id))]
-                  (doall (map (partial db-result->concept-map concept-type conn provider-id)
-                              (sql-utils/find-batch conn istmt start-index batch-size))))))
+                  (mapv (partial db-result->concept-map concept-type conn provider-id)
+                              (sql-utils/find-batch conn istmt start-index batch-size)))))
             (lazy-find
               [start-index]
               (let [batch (find-batch start-index)]
                 (when-not (empty? batch)
-                  (concat batch (lazy-seq (lazy-find (+ start-index (count batch))))))))]
+                  (cons batch (lazy-seq (lazy-find (+ start-index (count batch))))))))]
       (lazy-find 0)))

   (save-concept


Mostly complete postgres backend

Mostly complete postgres backend

Returns things with real, mostly-correctly-set response bodies from the DB!

--- src/doctopus/storage/impls/postgres_impl.clj
+++ src/doctopus/storage/impls/postgres_impl.clj
@@ -1,9 +1,17 @@
 (ns doctopus.storage.impls.postgres-impl
-  (:require [doctopus.db :as db]
-            [doctopus.files :as f])
-  (:import [java.nio.file Files Paths]))
+  (:require [doctopus.configuration :as configuration]
+            [doctopus.db :as db]
+            [doctopus.files :as f]
+            [ring.util.mime-type :as ring-mime]
+            [ring.util.response :as response]
+            [taoensso.timbre :as log])
+  (:import [java.io ByteArrayInputStream]
+           [java.nio.file Files Paths]))

 (def is-img-regex #"^image")
+
+(defn count-fn [tentacle]
+  (count (db/get-all-documents-for-tentacle tentacle)))

 (defn get-mime-type
   [f]
@@ -11,8 +19,9 @@
     (Files/probeContentType path)))

 (defn assign-body-and-image
-  [base-doc doc-path mime-type]
-  (let [doc-content (slurp doc-path)]
+  [base-doc doc-file mime-type]
+  (log/debug base-doc)
+  (let [doc-content (slurp doc-file)]
     (if (re-find is-img-regex mime-type)
       (assoc base-doc :body :image :image (.getBytes doc-content))
       (assoc base-doc :body doc-content :image nil))))
@@ -26,23 +35,47 @@
   update's `where' clause.

   Also note: there are two kinds of files to be loaded: text and images (binary)."
-  [tentacle src-dir]
-  (let [relpath-file-pairs (f/list-files-with-relative-paths src-dir)
-        tent-name (:name tentacle)]
+  [tent-name src-dir]
+  (let [relpath-file-pairs (f/list-files-with-relative-paths src-dir)]
     (doseq [[relpath doc-file] relpath-file-pairs
-            :let [doc-mime-type (get-mime-type doc-file)
+            :let [doc-mime-type (ring-mime/ext-mime-type relpath)
                   base-doc {:name (str tent-name "-" (.getName doc-file))
                             ;; :path doc-file
                             :mime-type doc-mime-type
-                            :uri (str tent-name "/" relpath)
+                            :uri (str configuration/docs-uri-prefix "/" tent-name relpath)
                             :tentacle-name tent-name}
                   new-doc (assign-body-and-image base-doc doc-file doc-mime-type)]]
+      (log/debug "Reading doc from:" relpath)
+      (log/debug "Giving doc URI:" (:uri new-doc))
       (db/save-document! new-doc false))
     (db/update-document-index)))

+(defn- build-body
+  "Examine a DB result to see if it's an image; if so, build a ByteArrayInputStream
+  and use it as the response body."
+  [res]
+  (if (nil? (:image res))
+    res
+    (let [bais (ByteArrayInputStream. (:image res))]
+      (-> res
+          (assoc :body bais)
+          (dissoc :image)))))
+
+(defn- make-response
+  [res]
+  (response/response (:body res)))
+
+(defn- set-content-type
+  [res]
+  (response/content-type (dissoc res :mime-type) (:mime-type res)))
+
 (defn load-fn
   [uri]
-  (db/get-document-by-uri uri))
+  (if-let [res (first (db/get-document-by-uri uri))]
+    (-> res
+        (build-body)
+        (make-response)
+        (set-content-type))))

 (defn remove-fn
   [document]


Implement equals for TaggedValue

Implement equals for TaggedValue

--- src/transit/write.clj
+++ src/transit/write.clj
@@ -255,7 +255,12 @@

 (defn quoted [o] (Quote. o))

-(deftype TaggedValue [tag rep])
+(deftype TaggedValue [tag rep]
+  java.lang.Object
+  (equals [t o]
+    (and (= (type o) (type t))
+         (= (.tag ^TaggedValue t) (.tag ^TaggedValue o))
+         (= (.rep ^TaggedValue t) (.rep ^TaggedValue o)))))

 (defn tagged-value [tag rep] (TaggedValue. tag rep))


Remove iterable, way too broad

Remove iterable, way too broad

--- src/transit/write.clj
+++ src/transit/write.clj
@@ -423,12 +423,6 @@
    (rep [_ l] (if (seq? l) (as-tag "array" l nil) l))
    (str-rep [_ _] nil))

- java.lang.Iterable
- (reify Handler
-   (tag [_ _] "array")
-   (rep [_ i] i)
-   (str-rep [_ _] nil))
-
  AsTag
  (reify Handler
    (tag [_ e] (.tag ^AsTag e))


doc string

doc string

--- src/ruuvi_server/launcher.clj
+++ src/ruuvi_server/launcher.clj
@@ -1,4 +1,5 @@
 (ns ruuvi-server.launcher
+  "Starting point of RuuviTracker server. Parses command line parameters, executes migrations and starts server."
   (:require [clojure.tools.cli :as cli]
             [ruuvi-server.configuration :as conf]
             [aleph.http :as aleph]
@@ -9,6 +10,7 @@
             [clojure.tools.nrepl.server :as nrepl]
             )
   (:use [clojure.tools.logging :only (debug info warn error)])
+  (:gen-class)
   )

 (defn- parse-env [value]


Add some more profiling that might not be useful

--- src/search/wrappers/graph.clj
+++ src/search/wrappers/graph.clj
@@ -18,7 +18,9 @@
   "Modify graph spec g, producing a new graph spec.

   If any node produces a function, it wraps that function to log when
-  it is called."
+  it is called.
+
+  This is useful when debugging where your application is spending time."
   [g :- utils/Graph]
   (let [indent (atom 0)]
     (utils/map-leaf-fns
@@ -28,11 +30,28 @@
           (utils/wrap-after (fn [_] (swap! indent dec) (println-level @indent "Finished" ks)))))
       g)))

+
+(s/defn profile-wrap :- utils/Graph
+  "Print timbre profiling after each graph key is generated"
+  [g :- utils/Graph]
+  (plumbing.map/map-leaves-and-path
+    (fn [ks f]
+      (utils/wrap
+        f
+        (fn [& args]
+          (profiling/profile :info :Graph
+            (profiling/p (str ks) (apply f args))))))
+    g))
+
+(defn wrap-fn-profile
+  [label f]
+  (utils/wrap f (fn [& args] (profiling/p label (apply f args)))))
+
 (def profile-fns-wrap
   "Add timbre profile to each function"
   (partial utils/map-leaf-fns
-    (fnk profile-wrap-inner [f ks]
-      (utils/wrap f (fn [& args] (profiling/p (str ks) (apply f args)))))))
+    (fnk profile-wrap-inner [ks f]
+      (wrap-fn-profile (str ks :inner) f))))

 (s/defn print-profile-gen-wrap :- search/SearchGraph
   "Prints the total profiling after each generation"


Must add trailing slash to dir entries

Must add trailing slash to dir entries

--- boot/pod/src/boot/jar.clj
+++ boot/pod/src/boot/jar.clj
@@ -36,6 +36,10 @@
   (and (instance? ZipException t)
        (.startsWith (.getMessage t) "duplicate entry:")))

+(defn jarentry [path f & [dir?]]
+  (doto (JarEntry. (str (.replaceAll path "\\\\" "/") (when dir? "/")))
+    (.setTime (.lastModified f))))
+
 (defn spit-jar! [jarpath files attr main]
   (let [manifest  (create-manifest main attr)
         jarfile   (io/file jarpath)
@@ -47,12 +51,12 @@
     (io/make-parents jarfile)
     (with-open [s (JarOutputStream. (io/output-stream jarfile) manifest)]
       (doseq [[jarpath srcpath] files :let [f (io/file srcpath)]]
-        (let [entry (doto (JarEntry. jarpath) (.setTime (.lastModified f)))]
+        (let [e (jarentry jarpath f)]
           (try
-            (doseq [d (parents jarpath)]
+            (doseq [d (parents jarpath) :let [f (io/file d)]]
               (swap! dirs conj d)
-              (doto s (.putNextEntry (JarEntry. d)) .closeEntry))
-            (doto s (.putNextEntry entry) (write! (io/input-stream srcpath)) .closeEntry)
+              (doto s (.putNextEntry (jarentry d f true)) .closeEntry))
+            (doto s (.putNextEntry e) (write! (io/input-stream srcpath)) .closeEntry)
             (catch Throwable t
               (if-not (dupe? t) (throw t) (util/warn "%s\n" (.getMessage t))))))))))


committing before implementing changes dsapala made.

--- src/trend_compliance/core.clj
+++ src/trend_compliance/core.clj
@@ -40,10 +40,11 @@
 (defn create-log-map
   "take a line from detail and put into map using an atom"
   [user-map]
-  (swap! log-map assoc :ip (get user-map :ip))
-  (swap! log-map assoc :user-name (get user-map :user-name))
-  (swap! log-map assoc :mac-ad (get user-map :mac-ad))
-  (swap! log-map assoc :date (get user-map :date)))
+  (swap! log-map assoc (keyword (get user-map :ip)) user-map))
+  ;; (swap! log-map assoc :ip (get user-map :ip))
+  ;; (swap! log-map assoc :user-name (get user-map :user-name))
+  ;; (swap! log-map assoc :mac-ad (get user-map :mac-ad))
+  ;; (swap! log-map assoc :date (get user-map :date)))

 (defn create-user-map
   "parse each line of a large file"
@@ -64,12 +65,13 @@
   [file-name]
   (with-open [rdr (io/reader file-name)]
     (let [line (line-seq rdr)
-          pop-user-map (doall (map create-user-map line))
+          _ (doall (map create-user-map line))
           user-map {:ip (get @user-map :Framed-IP-Address)
                     :user-name (get @user-map :User-Name)
                     :mac-ad (get @user-map :Acct-Session-Id)
                     :date (get @user-map :date)}]
-    (create-log-map user-map))))
+    (when (= (count (keys user-map)) 4)
+    (create-log-map user-map)))))

 (defn read-csv
   "read in a csv file"


changed message printed when not in check time

--- src/trend_compliance/core.clj
+++ src/trend_compliance/core.clj
@@ -78,7 +78,7 @@
 (defn check-time-range [item]
   (let [date (:date (second item))
         parse-date (f/parse (f/formatter "EEE MMM dd HH:mm:ss yyyy") date)]
-    (if (and (>= (t/hour parse-date) 20) (<= (t/hour parse-date) 22)) item "deny")))
+    (if (and (>= (t/hour parse-date) 20) (<= (t/hour parse-date) 22)) item "not between 20:00 - 22:00.")))

 (defn -main [& args]
   (println "Files (<path/to/WIRED.csv> <path/to/WIRELSS.csv> <path/to/DETAIL>): ")


delete stray comment

delete stray comment

--- src/voke/system/movement.cljs
+++ src/voke/system/movement.cljs
@@ -14,8 +14,6 @@

 (def friction-value 0.80)
 (def min-velocity 0.05)
-
-; TODO namespace keywords

 (defn should-update-velocity?
   "Entities' velocity should be updated if they're intending to move somewhere


Remove unused model-ns

Remove unused model-ns

--- src/yetibot/core/db/alias.clj
+++ src/yetibot/core/db/alias.clj
@@ -1,8 +1,6 @@
 (ns yetibot.core.db.alias
   (:require
     [yetibot.core.db.util :as db.util]))
-
-(def model-ns :alias)

 (def schema {:schema/table "alias"
              :schema/specs (into [[:user-id :text "NOT NULL"]


Fixed anti-forgery token problem

Fixed anti-forgery token problem

--- src/freecoin/views/transaction_form.clj
+++ src/freecoin/views/transaction_form.clj
@@ -52,7 +52,7 @@
                    :method "POST"}
             [:input {:name "__anti-forgery-token"
                      :type "hidden"
-                     :value (get-in ctx [:session "__anti-forgery-token"])}]
+                     :value (get-in ctx [:request :session "__anti-forgery-token"])}]
             [:input {:name "recipient"
                      :type "hidden"
                      :value email}]


fix home page like

fix home page like

--- server/src/gratefulplace/controllers/topics.clj
+++ server/src/gratefulplace/controllers/topics.clj
@@ -13,7 +13,7 @@
         gratefulplace.utils))

 (def query-mapify-options
-  {:include (merge {:first-post {:only [:content :likers]}}
+  {:include (merge {:first-post {:only [:content :likers :id]}}
                    author-inclusion-options)})

 (defmapifier query-record mr/ent->topic query-mapify-options)


generators.clj: (traversal) takes predicate to determine when to skip branches.

--- clojure/org/gavrog/clojure/generators.clj
+++ clojure/org/gavrog/clojure/generators.clj
@@ -1,21 +1,27 @@
 (ns org.gavrog.clojure.generators)

 (defprotocol SubstepGenerator
+  (current [_])
   (result [_])
-  (step [_]))
+  (step [_])
+  (skip [_]))

-(defn traverse [gen]
-  (when gen
-    (if-let [next (step gen)]
-      (lazy-seq (cons gen (traverse next)))
-      (list gen))))
+(defn traverse
+  ([gen]
+    (traverse gen (constantly true)))
+  ([gen pred]
+    (when gen
+      (if (pred (current gen))
+        (if-let [next (step gen)]
+          (lazy-seq (cons gen (traverse next)))
+          (list gen))
+        (recur (skip gen) pred)))))

-(defn results [gen]
-  (remove nil? (map result (traverse gen))))
+(defn results [& args]
+  (remove nil? (map result (apply traverse args))))

 (defprotocol SplittableGenerator
-  (sub-generator [_])
-  (skip [_]))
+  (sub-generator [_]))

 (defprotocol Resumable
   (checkpoint [_])
@@ -23,12 +29,21 @@

 (deftype BacktrackingGenerator [extract make-children stack]
   SubstepGenerator
-  (result [_] (extract (first (first stack))))
+  (current [_] (first (first stack)))
+  (result [gen] (extract (current gen)))
   (step [gen]
         (if-let [children (seq (make-children (first (first stack))))]
           (let [stack (conj stack [(first children) (rest children) 0])]
             (BacktrackingGenerator. extract make-children stack))
           (skip gen)))
+  (skip [_]
+        (when-let [stack (seq (drop-while #(empty? (second %)) stack))]
+          (let [[node siblings-left branch-nr] (first stack)
+                stack (conj (rest stack)
+                            [(first siblings-left)
+                             (rest siblings-left)
+                             (inc branch-nr)])]
+            (BacktrackingGenerator. extract make-children stack))))
   Resumable
   (checkpoint [_] (rest (reverse (map #(nth % 2) stack))))
   (resume [_ checkpoint]
@@ -43,15 +58,7 @@
   SplittableGenerator
   (sub-generator [gen]
                  (let [stack (list [(first (first stack)) nil 0])]
-                   (BacktrackingGenerator. extract make-children stack)))
-  (skip [_]
-        (when-let [stack (seq (drop-while #(empty? (second %)) stack))]
-          (let [[node siblings-left branch-nr] (first stack)
-                stack (conj (rest stack)
-                            [(first siblings-left)
-                             (rest siblings-left)
-                             (inc branch-nr)])]
-            (BacktrackingGenerator. extract make-children stack)))))
+                   (BacktrackingGenerator. extract make-children stack))))

 (defn make-backtracker [spec]
   (BacktrackingGenerator. (:extract spec)


Update lein profiles.clj

Update lein profiles.clj

--- tag-clojure/lein/profiles.clj
+++ tag-clojure/lein/profiles.clj
@@ -1,10 +1,9 @@
-{:repl {:plugins [[cider/cider-nrepl "0.14.0"]
-                  [refactor-nrepl "2.3.1"]]
-        :dependencies [[alembic "0.3.2"]
+{:repl {:dependencies [[alembic "0.3.2"]
                        [org.clojure/tools.namespace "0.2.11"]
                        [org.clojure/tools.nrepl "0.2.13"]]}}

-{:user {:plugins [[lein-dotenv "RELEASE"]
+{:user {:plugins [[cider/cider-nrepl "0.16.0"]
+                  [lein-dotenv "RELEASE"]
                   [lein-exec "0.3.7"]
                   [lein-pprint "1.2.0"]
                   [lein-ancient "0.6.0-SNAPSHOT"]