move eval-step inside to take effect one step earlier

--- src/neuseg/db.clj
+++ src/neuseg/db.clj
@@ -25,12 +25,12 @@

 (defn load-db [name]
   (with-open [rdr (clojure.java.io/reader (str "data" "/" name))]
-    (map (partial reg-wd-neglect name)
+    (matrix (map (partial reg-wd-neglect name)
          (partition 2
            (interleave (map splited-line (rest (line-seq rdr)))
-                       (iterate inc 1))))))
+                       (iterate inc 1)))))))

-(def unigram  (matrix (load-db "unigram")))
-(def bigram   (matrix (load-db "bigram")))
-(def trigram  (matrix (load-db "trigram")))
-(def quadgram (matrix (load-db "quadgram")))
+(def unigram  (load-db "unigram"))
+(def bigram   (load-db "bigram"))
+(def trigram  (load-db "trigram"))
+(def quadgram (load-db "quadgram"))


Typehint return value of {lower,upper}-case?

--- src/str/core.clj
+++ src/str/core.clj
@@ -338,7 +338,7 @@
         start (if (upper-exists? first-char) (upper-case first-char) first-char)]
     (str start (lower-case (.substring s 1)))))

-(defn upper-case?
+(defn ^String upper-case?
   "Return s if s is all upper case.

   Characters without case, e.g. numbers, are considered to be trivially
@@ -352,7 +352,7 @@
          true s)
     s))

-(defn lower-case?
+(defn ^String lower-case?
   "Return s if s is all lower case.

   Characters without case, e.g. numbers, are considered to be trivially


log could be ugly here

log could be ugly here

--- src/runtime/q.clj
+++ src/runtime/q.clj
@@ -246,8 +246,15 @@
 (defn moo [] (get {:a 1} :a :not-found)
   )

+(defn currentLogLevel []
+  (:current-level @timbre/config)
+  )
+
+
 (defmacro pri [& all]
-  `(print (str ~@all))
+  `(cond (timbre/sufficient-level? :info)
+     (print (str ~@all));too ugly to use timbre logging here
+     )
   )

 (defmacro priln [& all]


Handle stderr, out and errors

Handle stderr, out and errors

--- src/ui/core.cljs
+++ src/ui/core.cljs
@@ -15,12 +15,15 @@

 (defonce proc (js/require "child_process"))

+(defn prepend-to-out [out]
+  (swap! shell-result (fn [v] (str out v))))
+
 (defn run-process []
   (let [[cmd & args] (string/split @command #"\s")
         p (.spawn proc cmd (clj->js args))]
-    (.on (.-stdout p)
-         "data"
-         #(swap! shell-result (fn [v] (str % v)))))
+    (.on p "error" prepend-to-out)
+    (.on (.-stderr p) "data" prepend-to-out)
+    (.on (.-stdout p) "data" prepend-to-out))
   (reset! command ""))

 (defn root-component []


Fix an issue where cljs.core is being loaded twice

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -177,12 +177,14 @@
          (set-print-fn! js/out.write)))
     ;; redef goog.require to track loaded libs
     (repl/evaluate-form repl-env env "<cljs repl>"
-      '(set! (.-require js/goog)
-         (fn [name reload]
-           (when (or (not (contains? *loaded-libs* name)) reload)
-             (set! *loaded-libs* (conj (or *loaded-libs* #{}) name))
-             (js/CLOSURE_IMPORT_SCRIPT
-               (aget (.. js/goog -dependencies_ -nameToPath) name))))))))
+      '(do
+         (set! *loaded-libs* #{"cljs.core"})
+         (set! (.-require js/goog)
+           (fn [name reload]
+             (when (or (not (contains? *loaded-libs* name)) reload)
+               (set! *loaded-libs* (conj (or *loaded-libs* #{}) name))
+               (js/CLOSURE_IMPORT_SCRIPT
+                 (aget (.. js/goog -dependencies_ -nameToPath) name)))))))))

 (defrecord JscEnv [host port socket response-promise]
   repl/IParseStacktrace


Better logging (and tracing) in the server module

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -29,9 +29,9 @@
           new-user-name (get params "user-name")
           old-user-name (get (get cookies "user-name") :value)
           user-name     (or new-user-name old-user-name)]
-        (println "old" old-user-name)
-        (println "new" new-user-name)
-        (println "-> " user-name)
+        (log/info "old user name" old-user-name)
+        (log/info "new user name" new-user-name)
+        (log/info "effective -> " user-name)
         user-name))

 (defn get-title
@@ -61,7 +61,7 @@
           url-prefix    (get-url-prefix request)]
         (log/info "Incoming cookies: " cookies)
         (log/info "Word to search: " word)
-        (log/info "Search results: " search-results)
+        (log/trace "Search results: " search-results)
         (if user-name
             (-> (http-response/response (html-renderer/render-front-page word user-name search-results message url-prefix title emender-page mode))
                 (http-response/set-cookie :user-name user-name {:max-age 36000000})
@@ -96,14 +96,14 @@
 (defn store-word
     "Store one word into the dictionary."
     [word description user-name dictionary-type]
-    (println "About to store following word:" word " with description: " description
+    (log/info "About to store following word:" word " with description: " description
              " into dictionary: " (str dictionary-type))
     (db-interface/add-new-word-into-dictionary word description (or user-name "(*unknown*)") dictionary-type))

 (defn store-words
     "Store sequence of words into the dictionary."
     [words user-name dictionary-type]
-    (println "About to store following words:" words)
+    (log/info "About to store following words:" words)
     (doseq [word words]
         (db-interface/add-new-word-into-dictionary word user-name dictionary-type)))

@@ -164,8 +164,8 @@
     [request mode]
     (let [to-delete   (-> (:params request) (get "delete"))
           to-undelete (-> (:params request) (get "undelete"))]
-          (println "to delete" to-delete)
-          (println "to undelete" to-undelete)
+          (log/info "to delete" to-delete)
+          (log/info "to undelete" to-undelete)
           (if to-delete
               (db-interface/delete-word to-delete mode))
           (if to-undelete
@@ -210,8 +210,8 @@
           changes           (read-changes)
           user-name         (get-user-name request)
           url-prefix        (get-url-prefix request)]
-        (println "stat"    changes-statistic)
-        (println "changes" changes)
+        (log/info "stat"    changes-statistic)
+        (log/info "changes" changes)
         (if user-name
             (-> (http-response/response (html-renderer/render-users user-name changes-statistic changes url-prefix title mode))
                 (http-response/set-cookie :user-name user-name {:max-age 36000000})
@@ -267,7 +267,7 @@
 (defn words->vector
     [words]
     (for [word words]
-        (vals word)))
+            (vals word)))

 (defn process-wordlist-json
     [request dictionary-type]


Always reindex after batch import in sample

--- dev/user.clj
+++ dev/user.clj
@@ -67,6 +67,7 @@

     @(d/transact conn (map tx-fn actors))
     (kevin.loader/add-years-to-movies conn)
+    (d/request-index conn)
     :ok))

 (comment


spec to fix

spec to fix

--- src/latte/equal.clj
+++ src/latte/equal.clj
@@ -163,7 +163,7 @@
 ;;     ;;       :by (((eq-trans T a c d) <a>) H3))
 ;;     (qed <a>)))

-(defthm eq-subst
+(defthm eq-subst%
   "Substitutivity property of equality."
   [[T :type] [P (==> T :type)] [x T] [y T]]
   (==> (equal T x y)


Fix field-fn to work with different syntaxes for field definitions

--- src/luaclj/core.clj
+++ src/luaclj/core.clj
@@ -37,7 +37,7 @@
                (map #(vector %1 %2) (range) items))))

 (comment
-  (let [s [[{:a 1} ['(set! a 3) :b #{'('(set! b 4))}]] ['(['(set! a 6)])]]
+(let [s [[{:a 1} ['(set! a 3) :b #{'('(set! b 4))}]] ['(['(set! a 6)])]]
         walker-fn #(safe-some->> %1 (some (fn [arg] (= arg 'set!))))
         t-fn (fn [arg] (println "t-fn:" arg))]
     #_(select (walker walker-fn) s)
@@ -259,11 +259,14 @@
   (into [:namelist] args))

 (defn field-fn [& args]
-  (cond (= (safe-some-> args first first) "[")
-        [(nth args 1) (nth args 4)]
-        (= (count args) 3)
-        [(first args) (third args)]
-    :else (first args)))
+  (println "field-fn:" args)
+  (let [r (cond (= (safe-some-> args first) "[")
+                [(nth args 1) (nth args 4)]
+                (= (count args) 3)
+                [(str (first args)) (third args)]
+                :else (first args))]
+    (println "field-fn r:" r)
+    r))

 (defn fieldsep-fn [& args]
   (first args))


wip - mkdir

wip - mkdir

--- src/luffer/core.clj
+++ src/luffer/core.clj
@@ -114,7 +114,9 @@

 (defn -main [& args]
   (let [batch-size  (parse-int (nth args 0))
-        concurrency (parse-int (nth args 1))]
+        concurrency (parse-int (nth args 1))
+        out-dir     ((nth args 2))]
+    (.mkdirs (java.io.File. out-dir))
     (println (format "starting workers batch-size=%,d concurrency=%d" batch-size concurrency))
     (start-workers batch-size concurrency)
     ))


Use multimethod for question and answer

Use multimethod for question and answer

--- src/juzi/core.clj
+++ src/juzi/core.clj
@@ -21,10 +21,12 @@
 (defn say [chinese]
   (future (sh "/usr/bin/say" chinese)))

-(defn question [{:keys [en]}]
+(defmulti question :mode)
+(defmethod question :en->zh [{:keys [en]}]
   (str "What's Chinese for \"" en "\"?"))

-(defn answer [{:keys [pi zh]}]
+(defmulti answer :mode)
+(defmethod answer :en->zh [{:keys [pi zh]}]
   (str pi (when zh (do (say zh) (str " (" zh ")")))))

 (defn start []
@@ -33,18 +35,18 @@
     (clear-screen)
     (loop [s (s/make-session (expand-data (load-sources)))]
       (if-let [w (s/next-word s)]
-        (let [{:keys [id en pi zh]} w]
-          (println (question w))
+        (let [r (assoc w :mode :en->zh)]
+          (println (question r))
           (println)
           (println "Press any key to see the answer ...")
           (.readCharacter cr)
           (println)
-          (println "Answer:" (answer w))
+          (println "Answer:" (answer r))
           (println)
           (println "Were you correct ? [y/n]")
           (let [i (.readCharacter cr)]
             (clear-screen)
             (if (= \y (char i))
-              (recur (s/mark-passed s id))
+              (recur (s/mark-passed s (:id r)))
               (recur s))))
         (println "Finish! Gōngxǐ. Zàijiàn.")))))


Added a :process-ast option to modify templates at compile time.

The :process-ast option expects a function that transforms the
enlive-style template, right after parsing from HTML. This allows the
programmer to inject arbitrary ClojureScript into the template before
applying transforms and passing it to the emitter functions. The
injection happens at compile time, but the transformation function can
inject clojurescript code that will run at runtime.

One use case for this is embedding a minilanguage into text nodes in the
HTML templates: the transformation function in this case traverses the
template, parsing string nodes and replacing them with suitable
clojurescript function calls.

--- src/kioo/core.clj
+++ src/kioo/core.clj
@@ -112,9 +112,13 @@

 (defn parse-html
   "parses html with a pre-processing step provided by resource-fn
-   returns an enlive compatible data structure."
-  [path resource-fn]
-  (html-resource (resource-fn path)))
+  returns an enlive compatible data structure. If provided, ast-fn
+  is applied to the parsed data structure."
+  ([path resource-fn]
+   (html-resource (resource-fn path)))
+  ([path resource-fn ast-fn]
+   (let [ast-fn (or ast-fn identity)]
+     (ast-fn (parse-html path resource-fn)))))

 (defn component*
   "this is the generic component that takes emitter
@@ -125,7 +129,8 @@
   ([path sel trans emit-opts]
      (let [path-obj (eval path)
            resource-fn (resolve-resource-fn path-obj emit-opts)
-           root (parse-html path-obj resource-fn)
+           ast-fn (:process-ast emit-opts)
+           root (parse-html path-obj resource-fn ast-fn)
            start (if (= :root sel)
                     root
                     (select root (eval-selector sel)))


fix typo in db.clj

fix typo in db.clj

--- src/metabase/db.clj
+++ src/metabase/db.clj
@@ -153,7 +153,7 @@
   (log/info (str "Verify Database Connection ... ✅")))

 (defn setup-db
-  "Do general perparation of database by validating that we can connect.
+  "Do general preparation of database by validating that we can connect.
    Caller can specify if we should run any pending database migrations."
   [& {:keys [db-details auto-migrate]
       :or   {db-details   @db-connection-details
@@ -288,7 +288,7 @@

   ENTITY may be either an entity like `User` or a vector like `[entity & field-keys]`.
   If just an entity is passed, `sel` will return `default-fields` for ENTITY.
-  Otherwise is a vector is passed `sel` will return the fields specified by FIELD-KEYS.
+  Otherwise, if a vector is passed `sel` will return the fields specified by FIELD-KEYS.

     (sel :many [OrgPerm :admin :id] :user_id 1) -> return admin and id of OrgPerms whose user_id is 1

@@ -321,7 +321,7 @@
   "Wrapper around `korma.core/insert` that renames the `:scope_identity()` keyword in output to `:id`
    and automatically passes &rest KWARGS to `korma.core/values`.

-   Returns newly created object by calling `sel`."
+   Returns a newly created object by calling `sel`."
   [entity & {:as kwargs}]
   (let [vals         (models/do-pre-insert entity kwargs)
         ;; take database-specific keys returned from a jdbc insert and map them to :id


adding functionality for rests, building out zelda functionality

--- src/music/audio.clj
+++ src/music/audio.clj
@@ -80,10 +80,11 @@
   (send-off agent play-data agent))

 (defn change-freq [agent freq]
-  (doto agent
-    pause
-    (send recalc-data freq)
-    play))
+  (pause agent)
+    (when-not (nil? freq)
+      (doto agent
+        (send recalc-data freq)
+        play)))

 (defn line-agent [line freq]
   (let [agent (agent {:line line})]
@@ -111,11 +112,34 @@
 (defn- parse-int [s] (Integer/parseInt s))

 (defn map-note-to-pitch [note]
-  (let [pitch (->> note (name) (keyword) (notes))
-        octave (->> note (namespace) (rest) (apply str) (parse-int))]
-    (->> 12
-         (* octave)
-         (+ pitch))))
+    (let [pitch (->> note (name) (keyword) (notes))
+          octave (->> note (namespace) (rest) (apply str) (parse-int))]
+      (->> 12
+           (* octave)
+           (+ pitch))))
+
+(defn play-line [agent base-tone base-duration line]
+  (doseq [[duration tone] line]
+    (change-freq agent (when-not (nil? tone)
+                         (tone-freq (+ base-tone (map-note-to-pitch tone)))))
+    (Thread/sleep (* base-duration duration)))
+  (pause agent))
+
+(defn play-lines [agent-fn base-tone base-duration song]
+  (let [start (CountDownLatch. (count song))
+        end (CountDownLatch. (count song))]
+    (doseq [line song]
+      (async/go
+        (.countDown start)
+        (.await start)
+        (play-line (agent-fn) base-tone base-duration line)
+        (.countDown end)
+        (.await end)))))
+
+(defn play-song [song pitch tempo]
+  (let [func #(line-agent (open-line popular-format) 25)
+        play-me #(play-lines func pitch tempo song)]
+    (play-me)))

 (def mk
   [[[1/8 :=4/D] [1/8 :=4/E] [1/8 :=4/F] [1/8 :=4/G]
@@ -125,29 +149,48 @@
     [1/8 :=4/D] [1/8 :=4/E] [1/8 :=4/F] [1/8 :=4/G]
     [1/8 :=5/A] [1/8 :=4/F] [1/8 :=5/A] [1/8 :=5/D]
     [1/8 :=5/C] [1/8 :=5/A] [1/8 :=4/F] [1/8 :=5/A]
-    [1/2 :=5/C]]
+    [1/4 :=5/C] [1/4]]
    [[1/4 :=3/D] [1/4 :=3/D] [1/4 :=3/D] [1/4 :=3/D]
     [1/4 :=3/D] [1/4 :=3/D] [1/4 :=3/D] [1/4 :=3/D]
     [1/4 :=3/D] [1/4 :=3/D] [1/4 :=3/D] [1/4 :=3/D]
     [1/4 :=3/F] [1/4 :=3/F] [1/4 :=3/F] [1/4 :=3/F]]])

-(defn play-line [agent base-tone base-duration latch line]
-  (.countDown latch)
-  (.await latch)
-  (doseq [[duration tone] line]
-    (change-freq agent (tone-freq (+ base-tone (map-note-to-pitch tone))))
-    (Thread/sleep (* base-duration duration)))
-  (pause agent))
-
-(defn play-song [agent-fn base-tone base-duration song]
-  (let [start (CountDownLatch. (count song))]
-    (doseq [line song]
-      (async/go
-        (play-line (agent-fn) base-tone base-duration start line)))))
-
-(defn play-song-mk [pitch tempo]
-  (let [func #(line-agent (open-line popular-format) 25)]
-    (play-song func pitch tempo (map #(apply concat (repeat 2 %)) mk))))
+(defn start-playing-mk []
+  (play-song mk 40 2000))
+
+(def zelda
+  [[[1/2 :=5/Bb] [2/12] [1/12 :=5/Bb] [1/12 :=5/Bb] [1/12 :=5/Bb] [1/12 :=5/Bb]
+    [3/16 :=5/Bb] [1/16 :=5/Ab] [1/4 :=5/Bb] [2/12] [1/12 :=5/Bb] [1/12 :=5/Bb] [1/12 :=5/Bb] [1/12 :=5/Bb]
+    [3/16 :=5/Bb] [1/16 :=5/Ab] [1/4 :=5/Bb] [2/12] [1/12 :=5/Bb] [1/12 :=5/Bb] [1/12 :=5/Bb] [1/12 :=5/Bb]
+    [1/8 :=5/Bb] [1/16 :=4/F] [1/16 :=4/F] [1/8 :=4/F] [1/16 :=4/F] [1/16 :=4/F] [1/8 :=4/F] [1/16 :=4/F] [1/16 :=4/F] [1/8 :=4/F] [1/8 :=4/F]
+
+    [1/4 :=5/Bb] [1/4 :=4/F] [3/16 :=4/F] [1/16 :=5/Bb] [1/16 :=5/Bb] [1/16 :=5/C]  [1/16 :=5/D] [1/16 :=5/Eb]
+    [1/2 :=5/F] [1/8] [1/8 :=5/F] [1/12 :=5/F] [1/12 :=5/Gb] [1/12 :=6/Ab]
+    [1/2 :=6/Bb] [1/12] [1/12 :=6/Bb] [1/12 :=6/Bb] [1/12 :=6/Bb] [1/12 :=6/Ab] [1/12 :=5/Gb]
+
+    ]
+   [[1/2 :=4/D] [2/12] [1/12 :=4/D] [1/12 :=4/D] [1/12 :=4/D] [1/12 :=4/D]
+    [3/16 :=4/C] [1/16 :=4/C] [1/4 :=4/C] [1/4] [1/12 :=4/C] [1/12 :=4/C] [1/12 :=4/C]
+    [3/16 :=4/Db] [1/16 :=4/Db] [1/4 :=4/Db] [2/12] [1/12 :=4/Db] [1/12 :=4/Db] [1/12 :=4/Db] [1/12 :=4/Db]
+    [1/8 :=4/Db] [1/16 :=4/A] [1/16 :=4/A] [1/8 :=4/A] [1/16 :=4/A] [1/16 :=4/A] [1/8 :=4/A] [1/16 :=4/A] [1/16 :=4/A] [1/8 :=4/A] [1/8 :=4/A]
+
+    [1/4 :=4/D] [1/12 :=4/D] [1/12 :=4/D] [1/12 :=4/C] [3/16 :=4/D] [1/16 :=4/D] [1/16 :=4/D] [1/16 :=4/Eb] [1/16 :=4/F] [1/16 :=4/G]
+
+
+    ]
+   [[1/4 :=2/Bb] [1/12 :=2/Bb] [1/12 :=2/Bb] [1/12 :=2/Bb] [1/4 :=2/Bb] [1/12 :=2/Bb] [1/12 :=2/Bb] [1/12 :=2/Bb]
+    [1/4 :=2/Ab] [1/12 :=2/Ab] [1/12 :=2/Ab] [1/12 :=2/Ab] [1/4 :=2/Ab] [1/12 :=2/Ab] [1/12 :=2/Ab] [1/12 :=2/Ab]
+    [1/4 :=1/Gb] [1/12 :=1/Gb] [1/12 :=1/Gb] [1/12 :=1/Gb] [1/4 :=1/Gb] [1/12 :=1/Gb] [1/12 :=1/Gb] [1/12 :=1/Gb]
+    [1/4 :=1/F] [1/4 :=1/F] [1/4 :=1/F] [1/8 :=1/G] [1/8 :=2/A]
+
+    [1/4 :=2/Bb] [1/12 :=2/Bb] [1/12 :=2/Bb] [1/12 :=2/Ab] [1/4 :=2/Bb] [1/4 :=2/Bb]
+    [1/4 :=2/Ab] [1/12 :=2/Ab] [1/12 :=2/Ab] [1/12 :=1/Gb] [1/4 :=2/Ab] [1/4 :=2/Ab]
+    [1/4 :=1/Gb] [1/12 :=1/Gb] [1/12 :=1/Gb] [1/12 :=1/E] [1/4 :=1/Gb] [1/4 :=1/Gb]
+
+    ]])
+
+(defn start-playing-zelda []
+  (play-song zelda 33 2000))

 (defn play-melody [agent base-tone base-duration melody]
   (doseq [[tone duration] melody]


[clojure] fix refresh when running all tests

--- settings/lk/scratch.clj
+++ settings/lk/scratch.clj
@@ -28,7 +28,7 @@
   If argument is passed (String) is interpreted as a regex to
   find a namespace"
   ([]
-   (refresh-all)
+   (refresh)
    (test/run-all-tests))
   ([pattern]
    (let [regex (re-pattern pattern)]


Invert link 'target' check

Invert link 'target' check

--- modules/reitit-frontend/src/reitit/frontend/history.cljs
+++ modules/reitit-frontend/src/reitit/frontend/history.cljs
@@ -92,7 +92,8 @@
                            (not (.-ctrlKey e))
                            (not (.-metaKey e))
                            (not (.-shiftKey e))
-                           (not (contains? #{"_blank" "_self"} (.getAttribute el "target")))
+                           (or (not (.hasAttribute el "target"))
+                               (contains? #{"" "_self"} (.getAttribute el "target")))
                            ;; Left button
                            (= 0 (.-button e))
                            ;; isContentEditable property is inherited from parents,


Fix reitit.frontend.easy not correctly removing old event listeners

In 0.5.0 rfe start! fn started using first on-navigate callback to get
the reference to History instance, so that user on-navigate can use rfe
functions that need this reference. History implementations called
on-navigate with the instance without event listeners set, so when stop!
was called listeners weren't removed.

--- modules/reitit-frontend/src/reitit/frontend/history.cljs
+++ modules/reitit-frontend/src/reitit/frontend/history.cljs
@@ -26,11 +26,14 @@
                     (let [path (-get-path this)]
                       (when (or (= goog.events.EventType.POPSTATE (.-type e))
                                 (not= @last-fragment path))
-                        (-on-navigate this path))))]
+                        (-on-navigate this path))))
+          ;; rfe start! uses first on-navigate call to store the
+          ;; instance so it has to see the instance with listeners.
+          this (assoc this
+                      :popstate-listener (gevents/listen js/window goog.events.EventType.POPSTATE handler false)
+                      :hashchange-listener (gevents/listen js/window goog.events.EventType.HASHCHANGE handler false))]
       (-on-navigate this (-get-path this))
-      (assoc this
-             :popstate-listener (gevents/listen js/window goog.events.EventType.POPSTATE handler false)
-             :hashchange-listener (gevents/listen js/window goog.events.EventType.HASHCHANGE handler false))))
+      this))
   (-stop [this]
     (gevents/unlistenByKey popstate-listener)
     (gevents/unlistenByKey hashchange-listener)
@@ -115,11 +118,12 @@
                                                       (when (.hasFragment uri)
                                                         (str "#" (.getFragment uri))))]
                                         (.pushState js/window.history nil "" path)
-                                        (-on-navigate this path))))))]
+                                        (-on-navigate this path))))))
+          this (assoc this
+                      :listen-key (gevents/listen js/window goog.events.EventType.POPSTATE handler false)
+                      :click-listen-key (gevents/listen js/document goog.events.EventType.CLICK ignore-anchor-click))]
       (-on-navigate this (-get-path this))
-      (assoc this
-             :listen-key (gevents/listen js/window goog.events.EventType.POPSTATE handler false)
-             :click-listen-key (gevents/listen js/document goog.events.EventType.CLICK ignore-anchor-click))))
+      this))
   (-on-navigate [this path]
     (on-navigate (rf/match-by-path router path) this))
   (-stop [this]


Remove duplicated require

Remove duplicated require

--- env/dev/cljs/asciinema_player/main.cljs
+++ env/dev/cljs/asciinema_player/main.cljs
@@ -1,6 +1,5 @@
 (ns asciinema-player.main
-  (:require [asciinema-player.core :as core]
-            [asciinema-player.core :as p]))
+  (:require [asciinema-player.core :as p]))

 (defonce snapshot-js [[["File Edit Options Buffers Tools C++ YASnippet Help                              " {"inverse" true}]] [["/" {"fg" 1, "inverse" true}] ["* Copyright (c) 2014 Vinícius dos San" {"fg" 1}] ["$" {}] ["|" {"inverse" true}] ["/* Copyright (c) 2014 Vinícius dos Sant" {"fg" 1}] ["$" {}]] [["                                       " {"fg" 1}] ["|" {"inverse" true}] ["                                        " {"fg" 1}]] [["   Distributed under the Boost Softwar" {"fg" 1}] ["$" {}] ["|" {"inverse" true}] ["   Distributed under the Boost Software" {"fg" 1}] ["$" {}]] [["   file LICENSE_1_0.txt or copy at htt" {"fg" 1}] ["$" {}] ["|" {"inverse" true}] ["   file LICENSE_1_0.txt or copy at http" {"fg" 1}] ["$" {}]] [["                                       " {}] ["|" {"inverse" true}] ["                                        " {}]] [["#ifndef" {"fg" 4, "bold" true}] [" BOOST_HTTP_EMBEDDED_SERVER_SOC$" {}] ["|" {"inverse" true}] ["#ifndef" {"fg" 4, "bold" true}] [" BOOST_HTTP_EMBEDDED_SERVER_SOCK$" {}]] [["#define" {"fg" 4, "bold" true}] [" " {}] ["BOOST_HTTP_EMBEDDED_SERVER_SOC" {"fg" 3}] ["$" {}] ["|" {"inverse" true}] ["#define" {"fg" 4, "bold" true}] [" " {}] ["BOOST_HTTP_EMBEDDED_SERVER_SOCK" {"fg" 3}] ["$" {}]] [["                                       " {}] ["|" {"inverse" true}] ["                                        " {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<cstdint>" {"fg" 2}] ["                     " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<cstdint>" {"fg" 2}] ["                      " {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<algorithm>" {"fg" 2}] ["                   " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<algorithm>" {"fg" 2}] ["                    " {}]] [["                                       " {}] ["|" {"inverse" true}] ["                                        " {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/asio/ip/tcp.hpp>" {"fg" 2}] ["       " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/asio/ip/tcp.hpp>" {"fg" 2}] ["        " {}]] [["                                       " {}] ["|" {"inverse" true}] ["                                        " {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/http/outgoing_state.hp" {"fg" 2}] ["$" {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/http/outgoing_state.hpp" {"fg" 2}] ["$" {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/http/message.hpp>" {"fg" 2}] ["      " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/http/message.hpp>" {"fg" 2}] ["       " {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/http/http_errc.hpp>" {"fg" 2}] ["    " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<boost/http/http_errc.hpp>" {"fg" 2}] ["     " {}]] [["                                       " {}] ["|" {"inverse" true}] ["                                        " {}]] [["// TODO: remove me                     " {"fg" 1}] ["|" {"inverse" true}] ["// TODO: remove me                      " {"fg" 1}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<iostream>" {"fg" 2}] ["                    " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<iostream>" {"fg" 2}] ["                     " {}]] [["#include" {"fg" 4, "bold" true}] [" " {}] ["<string>" {"fg" 2}] ["                      " {}] ["|" {"inverse" true}] ["#include" {"fg" 4, "bold" true}] [" " {}] ["<string>" {"fg" 2}] ["                       " {}]] [["                                       " {}] ["|" {"inverse" true}] ["                                        " {}]] [["-UUU:----F1  " {"inverse" true}] ["embedded_server_socket.hpp" {"bold" true, "inverse" true}] ["|-UUU:----F1  " {"inverse" true}] ["embedded_server_socket.hpp" {"bold" true, "inverse" true}] [" " {"inverse" true}]] [["                                                                                " {}]]])
 (defonce snapshot (js->clj (clj->js snapshot-js) :keywordize-keys true))


fix whitespaces

fix whitespaces

--- src/clj/lambdacd/internal/execution.clj
+++ src/clj/lambdacd/internal/execution.clj
@@ -143,8 +143,8 @@
           (recur (cons step-result result) (rest remaining-steps-with-id) new-args))))))

 (defn execute-steps [steps args ctx & {:keys [step-result-producer is-killed]
-                                           :or   {step-result-producer serial-step-result-producer
-                                                  is-killed            (atom false)}}]
+                                       :or   {step-result-producer serial-step-result-producer
+                                               is-killed            (atom false)}}]
   (let [base-ctx-with-kill-switch (assoc ctx :is-killed is-killed)
         step-results (step-result-producer args (contexts-for-steps steps base-ctx-with-kill-switch))]
     (reduce merge-two-step-results step-results)))


(PE-3443) Fix refer-clojure typo in sync.clj

Fixed typo in sync.clj in the (:refer-clojure) argument to ns.  :exclute
is now :exclude and the prior warning about references from
puppetlabs.http.client.sync/get overriding clojure.core/get is now
suppressed.

--- src/clj/puppetlabs/http/client/sync.clj
+++ src/clj/puppetlabs/http/client/sync.clj
@@ -3,7 +3,7 @@

 (ns puppetlabs.http.client.sync
   (:require [puppetlabs.http.client.async :as async])
-  (:refer-clojure :exclute (get)))
+  (:refer-clojure :exclude (get)))

 (defn request
   [req]


layout

layout

--- src/cljs/just_married/home/find_us.cljs
+++ src/cljs/just_married/home/find_us.cljs
@@ -7,7 +7,7 @@

 (defn find-us
   []
-  [:div
+  [:div.find-us
    [:h3 "Find Us"]
    [:p (translate find-us-dict :find-us-text)]
    [:div {:id "map"}]])


use texture for a bullet

use texture for a bullet


Make order-by work the other way around

Make order-by work the other way around

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

--- src/conexp/fca/many_valued_contexts.clj
+++ src/conexp/fca/many_valued_contexts.clj
@@ -193,14 +193,14 @@
      (make-context values others =)))

 (defn order-by
-  "Returns a function on two arguments a and b that returns true if and only if a occurs
-  not after b in the given sequence."
+  "Returns a function on two arguments a and b that returns true if and only if b occurs
+  not after a in the given sequence (ascending order.)"
   [sequence]
   (let [pos (zipmap sequence (range))]
     (fn [a b]
       (and (contains? pos a)
            (contains? pos b)
-           (<= (pos a) (pos b))))))
+           (>= (pos a) (pos b))))))

 (defn ordinal-scale
   "Returns the ordinal scale on the set values, optionally given an


Suppress a private var warning during build

--- planck-cljs/script/decode.cljs
+++ planck-cljs/script/decode.cljs
@@ -13,6 +13,6 @@
 (let [file (first *command-line-args*)
       sm-json (slurp file)
       decoded (sm/decode (.parse js/JSON sm-json))
-      stripped (strip-source-map decoded)
+      stripped (^:private-var-access-nowarn strip-source-map decoded)
       transit-json (cljs->transit-json stripped)]
   (spit file transit-json))


Add TOC and color to docsite.

Add TOC and color to docsite.

--- dev-resources/utils/docsite.clj
+++ dev-resources/utils/docsite.clj
@@ -13,7 +13,7 @@

 (def fn-width (px 700))
 (def gray-background "#FAFAFA")
-(def column-width (px 170))
+(def column-width (px 200))

 (def index-page-columns [["Color" "Data" "Environment"]
                          ["Image" "Transform" "Output" "Rendering" ]
@@ -25,7 +25,15 @@
   (garden.core/css

    [[:body {:color "#333"}]
+    [:a {:color "#333"}]
     [:p {:margin "0px"}]
+
+    [:.category-div :#toc
+     [:.category {:margin "0px 0px 7px 0px"}
+      [:a {:color "#990099"}]]
+     [:.subcategory {:margin "15px 0px 0px 0px"}
+      [:a {:color "#009900"}]]
+     [:.function {:margin-top "2px"}]]

     [:.index-page
      [:.wrapper {:margin "auto"
@@ -38,31 +46,33 @@
                 :float "left"}]
      [:.category-div {:background gray-background
                       :margin "10px"
-                      :padding "10px"}
-      [:.category {:margin "0px 0px 7px 0px"}]
-      [:.subcategory {:margin "7px 0px 0px 0px"}]
-      [:.function {:margin-top "2px"}]
-      [:a {:color "#333"}]]]
+                      :padding "10px"}]]

     [:.fn-page
      [:.fns-wrapper {:width fn-width
-                     :margin "auto"}]
+                     :margin "auto"}

-     [:h2 {:margin "10px 0px"}]
+      [:h2 {:margin "10px 0px"}]

-     [:div.function {:background gray-background
-                     :margin "10px auto"
-                     :padding "10px"}
-      [:code {:margin-right "10px"}]
-      [:h3 {:margin "2px 0px"}]]
+      [:div.function {:background gray-background
+                      :margin "10px auto"
+                      :padding "10px"}
+       [:code {:margin-right "10px"}]
+       [:h3 {:margin "2px 0px"}]]

-     [:pre {:margin "0px"}]
+      [:pre {:margin "0px"}]

-     [:dt {:margin-top "10px"}]
+      [:dt {:margin-top "10px"}]

-     [:dl {:margin "0px"}]
+      [:dl {:margin "0px"}]

-     [:.subcategory {:margin "30px auto 0px auto"}]]]))
+      [:.subcategory {:margin "30px auto 0px auto"}]]
+
+     [:#toc {:position "fixed"
+             :width column-width
+             :overflow-y "scroll"
+             :bottom "20px"
+             :top "0px"}]]]))

 (defn- get-page
   "Converts hiccup-style body to full-blown page and returns it as string. class is string that will be used as class of body element in the page."
@@ -91,10 +101,11 @@
   ([text to]
      (link text to nil))
   ([text to anchor]
-     (e/link-to (if anchor
-                  (str (as-filename-ext to) "#" (as-url anchor))
-                  (as-filename-ext to))
-                text)))
+     (let [page (if to (as-filename-ext to) "")]
+      (e/link-to (if anchor
+                   (str page "#" (as-url anchor))
+                   page)
+                 text))))

 (defn trim-docstring
   "Removes extra spaces in the begginning of dostringing lines."
@@ -127,11 +138,21 @@
                        (cons [:h3.subcategory
                               {:id (as-url (:name subcat))}
                               (:name subcat)]
-                             (map function->html (:fns subcat))))]
-    [:div.fns-wrapper
-     [:h2 name]
-     (map function->html fns)
-     (mapcat subcat->html (vals subcategories))]))
+                             (map function->html (:fns subcat))))
+        subcat->toc (fn [subcat]
+                      (cons [:h4.subcategory (link (:name subcat) nil (:name subcat))]
+                            (map #(vector :p.function (link % nil %)) (:fns subcat))))]
+    (list
+     [:div#toc
+      [:h3 (link "Back to index" "index")]
+      [:h3.category (link name name)]
+      (map #(vector :p.function (link % nil %)) fns)
+      (map subcat->toc (vals subcategories))]
+
+     [:div.fns-wrapper
+      [:h2 name]
+      (map function->html fns)
+      (mapcat subcat->html (vals subcategories))])))

 (defn generate-index-page [categories-map]
   (letfn [(fns->html [fns linkify]
@@ -172,3 +193,4 @@

 ;(generate-all @(resolve 'quil.core/fn-metas) "out")

+


Have each sentence add a period.

Have each sentence add a period.

--- src/hxgm30/language/syntagmata/rand.clj
+++ src/hxgm30/language/syntagmata/rand.clj
@@ -42,12 +42,14 @@
   ([stats]
     (sentence stats (rand-int 10)))
   ([stats words]
-    (->> words
-         inc
-         range
-         (map (fn [_] (word stats)))
-         (string/join " ")
-         string/capitalize)))
+    (str
+      (->> words
+           inc
+           range
+           (map (fn [_] (word stats)))
+           (string/join " ")
+           string/capitalize)
+      ".")))

 (defn paragraph
   ([stats]
@@ -57,6 +59,5 @@
       (->> sentence-count
            inc
            range
-           (map (fn [_] (sentence stats)))
-           (string/join ". "))
-      ".")))
+           (map (fn [_] (sentence stats))))
+      " ")))


working (but very messy) scroll for find in Firefox

--- frontend/controllers/post_controls.cljs
+++ frontend/controllers/post_controls.cljs
@@ -103,28 +103,33 @@
   (when-not (= (get-in previous-state [:current-build :current-container-id])
                container-id)
     (let [parent (sel1 target "#container_parent")
-          width (.-width (goog.style/getSize parent))
-          new-scroll-left (+ (.-scrollLeft parent)
-                             (.-x (goog.style.getPosition (sel1 target (str "#container_" container-id)))))
-          new-scroll-left (* width container-id)]
-      (println "new scroll left" new-scroll-left)
-      (set! (.-scrollLeft parent) new-scroll-left))))
+          container (sel1 target (str "#container_" container-id))
+          new-scroll-left (.-x (goog.style.getContainerOffsetToScrollInto container parent))]
+      (goog.style.scrollIntoContainerView container parent))))

+(defn container-id [container]
+  (int (last (re-find #"container_(\d+)" (.-id container)))))
+
+;; XXX: clean this up
 (defmethod post-control-event! :container-parent-scroll
   [target message _ previous-state current-state]
   (let [controls-ch (get-in current-state [:comms :controls])
-        current-container-id (get-in current-state [:current-build :current-container-id])
+        current-container-id (get-in current-state [:current-build :current-container-id] 0)
         parent (sel1 target "#container_parent")
-        container-width (.-width (goog.style/getSize parent))
         parent-scroll-left (.-scrollLeft parent)
-        parent-scroll-ratio (/ parent-scroll-left container-width)
-        current-selected-container-scroll-left (* container-width current-container-id)
+        current-container (sel1 target (str "#container_" current-container-id))
+        current-container-scroll-left (inspect (int (.-x (goog.style.getContainerOffsetToScrollInto current-container parent))))
+        parent-scroll-left (inspect (.-scrollLeft parent))
+        containers (sort-by (fn [c] (Math/abs (- parent-scroll-left (.-x (goog.style.getContainerOffsetToScrollInto c parent)))))
+                            (sel parent ".container-view"))
         ;; if we're scrolling left, then we want the container whose rightmost portion is showing
         ;; if we're scrolling right, then we want the container whose leftmost portion is showing
-        new-scrolled-container-id (if (> parent-scroll-left current-selected-container-scroll-left)
-                                    (js/Math.ceil parent-scroll-ratio)
-                                    (js/Math.floor parent-scroll-ratio))]
+        new-scrolled-container-id (if (= parent-scroll-left current-container-scroll-left)
+                                    current-container-id
+                                    (if (< parent-scroll-left current-container-scroll-left)
+                                      (apply min (map container-id (take 2 containers)))
+                                      (apply max (map container-id (take 2 containers)))))]
     ;; This is kind of dangerous, we could end up with an infinite loop. Might want to
     ;; do a swap here (or find a better way to structure this!)
-    (when-not (= new-scrolled-container-id current-container-id)
+    (when (not= current-container-id new-scrolled-container-id)
       (put! controls-ch [:container-selected new-scrolled-container-id]))))


Improve anonymous regex

Improve anonymous regex

--- src/obb_api/handlers/auth/anonymize.clj
+++ src/obb_api/handlers/auth/anonymize.clj
@@ -7,7 +7,7 @@
 (defn anon-username?
   "True if the given username can me considered anonymous"
   [username]
-  (re-matches #"anonymous:.*" username))
+  (re-matches #"^anonymous:.*" username))

 (defn- validate
   "Validates if the username can be anonymized"


♻ Schema for GIS changes

♻ Schema for GIS changes

Why:
- Prepare for processing GIS changes
- Validation and coercion should be useful here to avoid wrong
  expectations about what data is available

--- src/territory_bro/gis_db.clj
+++ src/territory_bro/gis_db.clj
@@ -6,8 +6,9 @@
   (:require [clojure.java.jdbc :as jdbc]
             [clojure.tools.logging :as log]
             [medley.core :refer [remove-vals]]
+            [schema.core :as s]
             [territory-bro.db :as db])
-  (:import (java.util UUID)
+  (:import (java.util UUID Date)
            (org.postgresql.util PSQLException)))

 (def ^:private query! (db/compile-queries "db/hugsql/gis.sql"))
@@ -91,8 +92,27 @@

 ;;; Changes

+(s/defschema GisFeature
+  {:id s/Str ; TODO: change to UUID
+   :location s/Str
+   (s/optional-key :name) s/Str
+   (s/optional-key :number) s/Str
+   (s/optional-key :subregion) s/Str
+   (s/optional-key :addresses) s/Str
+   (s/optional-key :meta) {s/Any s/Any}})
+
+(s/defschema GisChange
+  {:id s/Int
+   :schema s/Str
+   :table s/Str
+   :op (s/enum "INSERT" "UPDATE" "DELETE") ; TODO: change to keywords
+   :user s/Str
+   :time Date ; TODO: change to Instant
+   :old (s/maybe GisFeature)
+   :new (s/maybe GisFeature)})
+
 (defn- format-gis-change [change]
-  change)
+  (s/validate GisChange change))

 (defn get-changes
   ([conn]


(PDB-3611) Clean up unreferenced facts and paths before migration

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -1305,7 +1305,11 @@
    "create index catalogs_job_id_idx on catalogs(job_id) where job_id is not null"))

 (defn rededuplicate-facts []
-  (log/info (trs "[1/6] Creating new fact storage tables..."))
+  (log/info (trs "[1/7] Cleaning up unreferenced facts..."))
+  (jdbc/do-commands
+   "DELETE FROM facts WHERE factset_id NOT IN (SELECT id FROM factsets)")
+
+  (log/info (trs "[2/7] Creating new fact storage tables..."))
   (jdbc/do-commands
    "CREATE SEQUENCE fact_values_id_seq;"

@@ -1331,7 +1335,7 @@
        fact_value_id bigint NOT NULL
     );")

-  (log/info (trs "[2/6] Copying unique fact values into fact_values"))
+  (log/info (trs "[3/7] Copying unique fact values into fact_values"))
   (jdbc/do-commands
    "INSERT INTO fact_values (value, value_integer, value_float, value_string, value_boolean, value_type_id)
        SELECT distinct value, value_integer, value_float, value_string, value_boolean, value_type_id FROM facts")
@@ -1339,7 +1343,7 @@

   ;; Handle null fv.value separately; allowing them here leads to an intractable
   ;; query plan
-  (log/info (trs "[3/6] Reconstructing facts to refer to fact_value..."))
+  (log/info (trs "[4/7] Reconstructing facts to refer to fact_values..."))
   (jdbc/do-commands
    "INSERT INTO facts_transform (factset_id, fact_path_id, fact_value_id)
        SELECT f.factset_id, f.fact_path_id, fv.id
@@ -1362,7 +1366,7 @@
         WHERE f.value IS NULL AND fv.value IS NULL")

   ;; populate fact_values.value_hash
-  (log/info (trs "[4/6] Computing fact value hashes..."))
+  (log/info (trs "[5/7] Computing fact value hashes..."))
   (jdbc/call-with-query-rows
    ["select id, value::text from fact_values"]
    (fn [rows]
@@ -1381,7 +1385,7 @@
            (sutils/array-to-param "bytea" PGobject hashes)])))))

-  (log/info (trs "[5/6] Indexing fact_values table..."))
+  (log/info (trs "[6/7] Indexing fact_values table..."))
   (jdbc/do-commands
    "DROP TABLE facts"
    "ALTER TABLE facts_transform rename to facts"
@@ -1391,7 +1395,7 @@
    "CREATE INDEX fact_values_value_float_idx ON fact_values USING btree (value_float);"
    "CREATE INDEX fact_values_value_integer_idx ON fact_values USING btree (value_integer);")

-  (log/info (trs "[6/6] Indexing facts table..."))
+  (log/info (trs "[7/7] Indexing facts table..."))
   (jdbc/do-commands
    "ALTER TABLE facts ADD CONSTRAINT facts_factset_id_fact_path_id_fact_key UNIQUE (factset_id, fact_path_id);"
    "CREATE INDEX facts_fact_path_id_idx ON facts USING btree (fact_path_id);"


use release version of IGV (#1561)

use release version of IGV (#1561)

--- src/cljs/main/broadfcui/page/workspace/analysis/igv.cljs
+++ src/cljs/main/broadfcui/page/workspace/analysis/igv.cljs
@@ -53,7 +53,7 @@
                    :on-load #(do
                                (swap! state assoc :igv-loaded? true)
                                (this :refresh))
-                   :path "https://igv.org/web/release/2.0.0-rc5/dist/igv.min.js"}])]))
+                   :path "https://igv.org/web/release/2.0.1/dist/igv.min.js"}])]))
    :component-did-update
    (fn [{:keys [props state prev-props this]}]
      (when (and (not= (:tracks props) (:tracks prev-props)) (:igv-loaded? @state))


Add support for compilations.

Add support for compilations.

--- src/bltool/data/backloggery.clj
+++ src/bltool/data/backloggery.clj
@@ -2,6 +2,7 @@
   (:require [bltool.data.default :refer :all])
   (:require [bltool.flags :refer :all])
   (:require [clj-http.client :as http])
+  (:require [clj-http.util :refer [url-decode]])
   (:require [clojure.string :refer [split]])
   (:require [slingshot.slingshot :refer [throw+ try+]])
   (:require [crouton.html :as html]))
@@ -58,11 +59,33 @@
                             :headers {"referer" (str "http://backloggery.com/games.php?user=" user)}})]
     (-> response :body java.io.StringReader. html/parse)))

+(defn- bl-get-compilation
+  [cookies user params]
+  (let [defaults {"user" user
+                  "total" "50"
+                  "region_u" "0"
+                  "console" "" "rating" "" "status" "" "unplayed" "" "own" "" "search" ""
+                  "comments" "" "region" "" "wish" "" "alpha" ""}
+        params (conj defaults params)
+        response (http/get "http://backloggery.com/ajax_expandcomp.php"
+                           {:cookies cookies
+                            :query-params params
+                            :headers {"referer" (str "http://backloggery.com/games.php?user=" user)}})]
+    (-> response :body java.io.StringReader. html/parse)))
+
 (defn- bl-extract-params [body]
   (some->> body (tag-seq :input) first :attrs :onclick
            (re-find #"getMoreGames\(([^,]+), *'([^']+)', *'([^']+)', *([^)]+)\)")
            rest
+           (map url-decode)
            (zipmap ["aid" "temp_sys" "ajid" "total"])))
+
+(defn- bl-extract-params-for-compilation [body]
+  (some->> body (tag-seq :span) first :attrs :onclick
+           (re-find #"getComp\(([^,]+), *'([^']+)', *'([^)]+)'\)")
+           rest
+           (map url-decode)
+           (zipmap ["aid", "comp_sys", "comp"])))

 ; {:tag :a, :attrs {:href update.php?user=toxicfrog&gameid=4160408}
 (defn- gamebox-to-game [gamebox]
@@ -74,12 +97,28 @@
         progress (->> gamebox (tag-seq :img) second :attrs :alt progress-map)]
     { :id id :name name :platform platform :progress progress }))

+; extract params from collection box
+; then invoke bl-get-compilation
+(declare bl-extract-games) ; mutual recursion
+(defn- expand-collection [section]
+  (->> section
+       bl-extract-params-for-compilation
+       (bl-get-compilation *cookies* *user*)
+       bl-extract-games))
+
+; collections can be identified by the lack of <a> tags
+; and also by the first <img> tag having src="images/compilation.gif"
+(defn- games-from-section
+  [section]
+  (cond
+    (= "images/compilation.gif" (some->> section (tag-seq :img) first :attrs :src)) (expand-collection section)
+    (->> section (tag-seq :a) first) [(gamebox-to-game section)]
+    :else nil))
+
 (defn- bl-extract-games [body]
   (->> body (tag-seq :section)
        (filter #(.contains (:class (:attrs %)) "gamebox"))
-       ; filter out collections - they don't have edit links, so (first (tag-seq :a)) will be nil
-       (filter #(first (tag-seq :a %)))
-       (map gamebox-to-game)))
+       (mapcat games-from-section)))

 (defn- read-all-games [extra-params]
   (loop [games []


fix #1458

fix #1458

--- src/status_im/contacts/validations.cljs
+++ src/status_im/contacts/validations.cljs
@@ -1,11 +1,11 @@
 (ns status-im.contacts.validations
   (:require [cljs.spec.alpha :as s]
             [clojure.string :as str]
-            [status-im.data-store.contacts :as contacts]))
-
+            [status-im.data-store.contacts :as contacts]
+            [status-im.js-dependencies :as dependencies]))

 (defn is-address? [s]
-  (.isAddress web3.prototype s))
+  (.isAddress dependencies/Web3.prototype s))

 (defn contact-can-be-added? [identity]
   (if (contacts/exists? identity)


debug logging

debug logging

--- src/clj/backtype/storm/util.clj
+++ src/clj/backtype/storm/util.clj
@@ -252,12 +252,14 @@
   (.exists (File. path)))

 (defn rmr [path]
+  (log-debug "Rmr path " path)
   (when (exists-file? path)
     (FileUtils/forceDelete (File. path))))

 (defn rmpath
   "Removes file or directory at the path. Not recursive. Throws exception on failure"
   [path]
+  (log-debug "Removing path " path)
   (let [deleted? (.delete (File. path))]
     (when-not deleted?
       (throw (RuntimeException. (str "Failed to delete " path))))
@@ -265,9 +267,11 @@

 (defn local-mkdirs
   [path]
+  (log-debug "Making dirs at " path)
   (FileUtils/forceMkdir (File. path)))

 (defn touch [path]
+  (log-debug "Touching file at " path)
   (let [success? (.createNewFile (File. path))]
     (when-not success?
       (throw (RuntimeException. (str "Failed to touch " path))))


trying to use google instead of mapquest api

--- src/cljs/montheway/mmodern.cljs
+++ src/cljs/montheway/mmodern.cljs
@@ -207,7 +207,7 @@
   "Returns steps in the format
   [{:start-lat :start-lng :end-lat :end-lng}, ...]"
   (go
-   (let [lat-lngs (<! (fetch-mapquest-lat-lngs to from))
+   (let [lat-lngs (<! (fetch-google-lat-lngs to from))
          start-point (-> lat-lngs first (select-keys [:start-lat :start-lng]) vals)
          end-point (-> lat-lngs last (select-keys [:end-lat :end-lng]) vals)
          last-lat-lng (last lat-lngs)


Add notify function to browser

Add notify function to browser

--- src/cljs/openslack/browser.cljs
+++ src/cljs/openslack/browser.cljs
@@ -9,3 +9,7 @@
   (let [element (.querySelector js/document query)
         height (.-offsetHeight element)]
     (set! (.-scrollTop element) height)))
+
+(defn notify
+  [title body icon]
+  (js/Notification. title (js-obj :body body :icon icon)))


Add a country description component.

Add a country description component.

--- src/cljs/weather_demo/core.cljs
+++ src/cljs/weather_demo/core.cljs
@@ -26,6 +26,12 @@
   (if-not countries [:select [:option "Loading countries..."]]
     [bind-fields (country-selector countries) country-atom]))

+(defn country-description [countries country-id]
+  (println "Rendering country description for" country-id)
+  (if-not country-id [:p "No country selected"]
+    (let [country (first (filter #(= (:cca2 %) country-id) countries))]
+      [:p "Selected country is " (country-name country)])))
+
 (defn home-page []
   [:div [:h2 "Welcome to weather-demo"]
    [:div "You might want to check out the " [:a {:href "/weather"} "weather"]]])
@@ -38,7 +44,8 @@
        :response-format (json-response-format {:keywords? true})})
     (fn []
       [:div [:h2 "Weather page"]
-       [country-field @countries selected-country]])))
+       [country-field @countries selected-country]
+       [country-description @countries (:id @selected-country)]])))

 (defn current-page []
   [:div [(session/get :current-page)]])


Adds move-from-map function to clj-chess.board ns.

--- src/clojure/clj_chess/board.clj
+++ src/clojure/clj_chess/board.clj
@@ -149,21 +149,25 @@
     1 :wp, 2 :wn, 3 :wb, 4 :wr, 5 :wq, 6 :wk
     9 :bp, 10 :bn, 11 :bb, 12 :br, 13 :bq, 14 :bk))

+(defn move-from-map
+  "Translate a move in map notation to a move from the given board. If no
+  maching move is found, returns nil."
+  [board move-map]
+  (first
+    (filter #(and (= (Move/from %) (move-map :from))
+                  (= (Move/to %) (move-map :to))
+                  (or (not (move-map :promotion))
+                      (let [pr (Piece/make (side-to-move board)
+                                           (Move/promotion %))]
+                        (= (piece-to-keyword pr)
+                           (move-map :promotion)))))
+            (moves board))))

 (defn do-map-move
   "Execute the move given by the provided move map. For the format of this
   map, see the documentation of board-to-map."
   [board move-map]
-  (when-let [move (first
-                    (filter #(and (= (Move/from %) (move-map :from))
-                                  (= (Move/to %) (move-map :to))
-                                  (or (not (move-map :promotion))
-                                      (let [pr (Piece/make
-                                                 (side-to-move board)
-                                                 (Move/promotion %))]
-                                        (= (piece-to-keyword pr)
-                                           (move-map :promotion)))))
-                            (moves board)))]
+  (when-let [move (move-from-map board move-map)]
     (do-move board move)))

 (defn board-to-uci


Added password reset dialog

Added password reset dialog

--- src/webapp/client/views/loginpanel.cljs
+++ src/webapp/client/views/loginpanel.cljs
@@ -190,6 +190,42 @@

+(defn-html enter-new-password-html []
+  (el :form {:class "form-inline" :style "padding: 5px"}
+      [
+       (el :div {:class "form-group"} [
+        "<input  id='password-input'  type='password' placeholder='New password' class='input-small form-control'>"
+        ])
+       (el :div {:class "form-group"} [
+        "<input  id='confirm-password-input' type='password' class='input-small form-control' placeholder='Confirm new password'>"
+        ])
+        ;"

+        ;
+        ;      <input type='checkbox'> Remember me
+        ;
+        ;
"
+
+       (el :button {
+                     :id       "signup-button"
+                     :type     "button"
+                     :class    "btn btn-primary"
+                     :style    "margin-left: 10px;"
+                     :text     "Reset my password"
+                     :onclick  #(do-action "reset password entered"
+                                           {
+                                            :username    (value-of "password-input")
+                                            :password    (value-of "password-input")
+                                            })})
+
+
+      ]
+  )
+)
+
+
+
+
+
 (defn-html signup-panel-html []
   (el :form {:class "form-inline" :role "form" :style "padding: 5px"}
       [
@@ -356,27 +392,31 @@

 (redefine-action  "show login signup panel"

-                 (do
-                   (.log js/console (str "PARAMS: " (js->clj js/params) ))
-  (cond
-
-     (get  (js->clj js/params) "reset_request_id")
-
-        (let [
-            r (str (get  (js->clj js/params) "reset_request_id"))
-            ]
-            (do
-               (clear "top-right")
-               (add-to "top-right" "
Reset your password
")
-             )
-
-         )
-
-
-
-    :else
-
-    (swap-section "top-right" (login-signup-panel-html))))
+  (do
+      (.log js/console (str "PARAMS: " (js->clj js/params) ))
+      (cond
+
+           (get  (js->clj js/params) "reset_request_id")
+
+                  (let [
+                      r (str (get  (js->clj js/params) "reset_request_id"))
+                      ]
+                      (do
+                         (clear "top-right")
+                         ;(add-to "top-right" "
Reset your password
")
+                                              (popup :title "Reset your password"
+                            :body-html
+                                 (enter-new-password-html))
+                       )
+                   )
+
+
+
+
+
+      )
+
+       (swap-section "top-right" (login-signup-panel-html)))
 )


Add devtools to dependencies

Add devtools to dependencies

--- frontend/project.clj
+++ frontend/project.clj
@@ -5,17 +5,18 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}

   :min-lein-version "2.6.1"
-
+
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript "1.9.183"]
                  [org.clojure/core.async "0.2.385" :exclusions [org.clojure/tools.reader]]
                  [org.omcljs/om "1.0.0-alpha40"]
+                 [binaryage/devtools "0.8.1" :scope "dev"]
                  [cljs-ajax "0.5.8"]                        ; AJAX for om
                  [com.cognitect/transit-cljs "0.8.239"]     ; Better JSON support
                  [figwheel-sidecar "0.5.3-2" :scope "devcards"]
                  [devcards "0.2.1-7" :scope "devcards" :exclusions [org.clojure/clojurescript]]
                  [devcards-om-next "0.1.1" :scope "devcards"]]
-
+
   :plugins [[lein-figwheel "0.5.4-7"]
             [lein-cljsbuild "1.1.3" :exclusions [[org.clojure/clojure]]]
             [lein-ancient "0.6.10"]
@@ -28,16 +29,10 @@
   :cljsbuild {:builds
               [{:id "dev"
                 :source-paths ["src/cruncher"]
-                ;; the presence of a :figwheel configuration here
-                ;; will cause figwheel to inject the figwheel client
-                ;; into your build
                 :figwheel {:on-jsload "cruncher.core/on-js-reload"
-                           ;; :open-urls will pop open your application
-                           ;; in the default browser once Figwheel has
-                           ;; started and complied your application.
-                           ;; Comment this out once it no longer serves you.
                            :open-urls ["http://localhost:3449/index.html"]}
                 :compiler {:main cruncher.core
+                           :preloads [devtools.preload]
                            :asset-path "js/compiled/out"
                            :output-to "resources/public/js/compiled/cruncher.js"
                            :output-dir "resources/public/js/compiled/out"
@@ -73,7 +68,7 @@
              ;; if you want to embed a ring handler into the figwheel http-kit
              ;; server, this is for simple ring servers, if this
              ;; doesn't work for you just run your own server :) (see lien-ring)
-
+
              ;; :ring-handler hello_world.server/handler

              ;; To be able to open files in your editor from the heads up display
@@ -84,7 +79,7 @@
              ;; emacsclient -n +$2 $1
              ;;
              ;; :open-file-command "myfile-opener"
-
+
              ;; if you are using emacsclient you can just use
              ;; :open-file-command "emacsclient"

@@ -95,12 +90,12 @@
              ;; :server-logfile "tmp/logs/figwheel-logfile.log"
              }

-
+
   ;; setting up nREPL for Figwheel and ClojureScript dev
   ;; Please see:
   ;; https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl
-
-
+
+
   :profiles {:dev {:dependencies [[figwheel-sidecar "0.5.4-7"]
                                   [com.cemerick/piggieback "0.2.1"]]
                    ;; need to add dev source path here to get user.clj loaded


fix the inspect-build route

fix the inspect-build route

--- frontend/routes.cljs
+++ frontend/routes.cljs
@@ -44,8 +44,8 @@
       (open-to-dashboard! nav-ch params))
     (defroute v1-project-branch-dashboard "/gh/:org/:repo/tree/:branch" {:as params}
       (open-to-dashboard! nav-ch params))
-    (defroute v1-inspect-build #"/gh/[^/]+/[^/]+/\d+"
-      [[org-id repo-id build-num]]
+    (defroute v1-inspect-build #"/gh/([^/]+)/([^/]+)/(\d+)"
+      [org-id repo-id build-num]
       (open-build-inspector! app nav-ch org-id repo-id build-num))
     (defroute v1-project-settings "/gh/:org-id/:repo-id/edit"
       [org-id repo-id]


using latest chesire gelfino and selmer

using latest chesire gelfino and selmer

--- project.clj
+++ project.clj
@@ -5,8 +5,6 @@

   :dependencies [[org.clojure/clojure "1.6.0"]
                  [clj-config "0.2.0" ]
-                 [com.narkisr/gelfino-client "0.7.0"
-                   :exclusions [com.fasterxml.jackson.core/jackson-core]]
                  ; utils
                  [me.raynes/fs "1.4.6"]
                  [robert/hooke "1.3.0"]
@@ -17,11 +15,12 @@
                  [org.clojure/tools.macro "0.1.5"]
                  [org.clojure/java.data "0.1.1"]
                  ; templating
-                 [selmer "0.3.4"]
+                 [selmer "0.8.2"]
                  [com.palletops/stevedore "0.8.0-beta.5"]
                  [camel-snake-kebab "0.1.2"]
                  ; logging
-                 [com.taoensso/timbre "2.6.3"]
+                 [com.narkisr/gelfino-client "0.8.1"]
+                 [com.taoensso/timbre "4.0.1"]
                  [ch.qos.logback/logback-classic "1.1.3"]
                  [org.codehaus.groovy/groovy "2.4.3"]
                  ; hooks/remoting
@@ -66,7 +65,7 @@
                  [metrics-clojure-ring "2.5.1"]
                ]

-  :exclusions [org.clojure/clojure commons-codec]
+  :exclusions [org.clojure/clojure com.taoensso/timbre commons-codec]

   :plugins  [[jonase/eastwood "0.2.1"]
              [self-build "0.0.6"]


Bump deps

Bump deps

--- project.clj
+++ project.clj
@@ -11,9 +11,9 @@
                 *assert* true}
   :dependencies
   [[org.clojure/clojure        "1.5.1"]
-   [com.taoensso/encore        "1.1.0"]
-   [com.taoensso/nippy         "2.6.0"]
-   [com.amazonaws/aws-java-sdk "1.7.5" :exclusions [joda-time]]
+   [com.taoensso/encore        "1.6.0"]
+   [com.taoensso/nippy         "2.6.3"]
+   [com.amazonaws/aws-java-sdk "1.7.8" :exclusions [joda-time]]
    [joda-time                  "2.3"]]

   :test-paths ["test" "src"]


Fixed description.

Fixed description.

--- project.clj
+++ project.clj
@@ -1,6 +1,5 @@
 (defproject com.lemondronor/turboshrimp-xuggler "0.0.2-SNAPSHOT"
-  :description (str "An AR.Drone video decoder for the turboshrimp library "
-                    "that uses the xuggler H.264 decoder.")
+  :description "An AR.Drone video decoder for the turboshrimp library that uses the xuggler H.264 decoder."
   :url "https://github.com/wiseman/turboshrimp-xuggler"
   :license {:name "MIT License"
             :url "http://opensource.org/licenses/MIT"}


lein-release plugin: preparing 0.1.0 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject prismatic/fnhouse "0.1.0-SNAPSHOT"
+(defproject prismatic/fnhouse "0.1.0"
   :description "Transform lightly-annotated functions into a full-fledged web service"
   :license {:name "Eclipse Public License - v 1.0"
             :url "http://www.eclipse.org/legal/epl-v10.html"


Set deploy repositories

Set deploy repositories

--- project.clj
+++ project.clj
@@ -2,6 +2,8 @@
   :description "Leiningen template for a Reagent web app that implements the re-frame pattern."
   :url "https://github.com/Day8/re-frame-template"
   :license {:name "MIT"}
+  :deploy-repositories [["releases" :clojars]
+                        ["snapshots" :clojars]]
   :scm {:name "git"
         :url "https://github.com/Day8/re-frame-template"}
   :eval-in-leiningen true)


Prepare 0.2.1 release

Prepare 0.2.1 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject lein-droid/lein-droid "0.2.1-SNAPSHOT"
+(defproject lein-droid/lein-droid "0.2.1"
   :description "Plugin for easy Clojure/Android development and deployment"
   :url "https://github.com/clojure-android/lein-droid"
   :license {:name "Eclipse Public License"


Bump version number of gridref

Bump version number of gridref

--- project.clj
+++ project.clj
@@ -10,7 +10,7 @@
                  [ring-middleware-format "0.3.1"]
                  [org.clojure/data.json "0.2.3"]
                  [environ "0.4.0"]
-                 [gridref "0.1.1"]
+                 [gridref "0.1.2"]
                  [ring-mock "0.1.5"]]
   :min-lein-version "2.0.0"
   :plugins [[environ/environ.lein "0.3.1"]


bumped up version

bumped up version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject reagent-frontend/lein-template "0.1.45"
+(defproject reagent-frontend/lein-template "0.1.46"
   :description "A Leiningen template for a ClojureScript setup with Reagent."
   :url "https://github.com/reagent-project/reagent-frontend-template"
   :license {:name "MIT License"


Histogram example.

Histogram example.


fix top logo

fix top logo

--- frontend/components/aside.cljs
+++ frontend/components/aside.cljs
@@ -107,9 +107,9 @@
         (html/html
          ;; XXX: browser settings
          [:nav.aside-left-nav {:class (when (:slim-aside? settings) "slim")}
-          [:a.aside-item.logo
-           ;; XXX: tooltips
-           {:data-bind "tooltip: {title: 'Home', placement: 'right', trigger: 'hover'}"}
+          [:a.aside-item.logo  {:data-bind "tooltip: {title: 'Home', placement: 'right', trigger: 'hover'}"
+                                ;; XXX: tooltips
+                                :href "/"}
            [:div.logomark
             (common/ico :logo)]]
           [:div.aside-activity {:class (when-not (:slim-aside? settings) "open")}


Add tests of the lambda lifting code

Add tests of the lambda lifting code

shitty tests >> no tests, unfortunately I don't really have a better way
to test the code emitters than ensuring that the eval of the result is
equal to the eval of the source AST.

--- test/oxcart/passes/lambda_lift_test.clj
+++ test/oxcart/passes/lambda_lift_test.clj
@@ -8,34 +8,42 @@
 ;;   notice, or any other, from this software.

 (ns oxcart.passes.lambda-lift-test
-  (:require [oxcart.passes.lambda-lift :refer :all]
-            [oxcart.test-util :refer :all]
+  (:require [oxcart.passes.lambda-lift :as ll]
+            [oxcart.passes.emit-clj :as eclj]
+            [oxcart]
             [clojure.test :refer :all]))

-;; Basic test case
-;; ---------------
+(deftest lambda-lift-tests

-(def foo
-  (fn [x y]
-    (#(+ x %1) y)))
+  ;; Basic test case
+  ;; ---------------
+  (let [case '(do (def foo
+                    (fn [x y]
+                      (#(+ x %1) y)))
+                  (foo 3 5))]
+    (is (= (eval case)
+           (oxcart/eval case)
+           (-> (let [forms (atom {})]
+                 (oxcart/eval case {:forms forms})
+                 @forms)
+               (ll/lift-lambdas {})
+               (eclj/emit-clojure {})
+               (eval)))))

-;; This should lift to
+  ;; Closure of closures case
+  ;; ------------------------
+  (let [case '(let [x 1]
+                (letfn [(bar [z] (+ x z))
+                        (baz [z] (dec (bar z)))
+                        (wat [z] (* 3 z (baz z)))]
+                  ((juxt bar baz wat) x)))]

-(def fn#
-  (fn [x _1]
-    (+ x _1)))
-
-(def foo
-  (fn [x y]
-    ((partial fn# x) y)))
-
-
-;; Letfn case
-;; -------------------
-;;
-;; (defn foo [x]
-;;   (letfn [(bar [z] (+ x z))
-;;           (baz [z] (dec (bar z)))
-;;           (wat [z] (* 3 z (baz z)))]
-;;     ((juxt bar baz wat) x)))
+    (is (= (eval case)
+           (oxcart/eval case)
+           (-> (let [forms (atom {})]
+                 (oxcart/eval case {:forms forms})
+                 @forms)
+               (ll/lift-lambdas {})
+               (eclj/emit-clojure {})
+               (eval))))))


Remove unnecessary *load-fn* override

Remove unnecessary *load-fn* override

Former-commit-id: c60bcab32d5682e5cadfa64b282297137a81a0d2

--- planck-cljs/src/planck/core.cljs
+++ planck-cljs/src/planck/core.cljs
@@ -137,7 +137,6 @@
   (cljs/require
     {:*compiler*     st
      :*load-fn*      load
-     :*eval-fn*      cljs/js-eval}
     sym
     reload
     {:macros-ns  macros-ns?


More work on loading

More work on loading

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -499,6 +499,24 @@
                   (and (= *clojurescript-version* cljs-ver)
                        (= build-affecting-options (form-build-affecting-options))))))))

+;; Represents code for which the JS is already loaded (but for which the analysis cache may not be)
+(defn- skip-load-js?
+  [name]
+  ('#{cljs.analyzer
+      cljs.compiler
+      cljs.env
+      cljs.reader
+      cljs.source-map
+      cljs.source-map.base64
+      cljs.source-map.base64-vlq
+      cljs.stacktrace
+      cljs.tagged-literals
+      cljs.tools.reader.impl.utils
+      cljs.tools.reader.reader-types
+      clojure.set
+      clojure.string
+      cognitect.transit} name))
+
 (defn- cached-callback-data
   [name path cache-prefix source source-modified raw-load]
   (let [cache-prefix (if (= :calculate-cache-prefix cache-prefix)
@@ -518,7 +536,8 @@
           "for" path))
       (when (and sourcemap-json name)
         (swap! st assoc-in [:source-maps name] (transit-json->cljs sourcemap-json)))
-      (js/PLANCK_EVAL js-source path)
+      (when-not (skip-load-js? name)
+        (js/PLANCK_EVAL js-source path))
       (merge {:lang   :js
               :source ""}
         (when cache-json
@@ -558,8 +577,6 @@
 (defn- skip-load?
     [{:keys [name macros]}]
     (or
-      (= name 'cljs.core)
-      (= name 'cljs.env)
       (and (= name 'cljs.env.macros) macros)
       (and (= name 'cljs.analyzer.macros) macros)
       (and (= name 'cljs.compiler.macros) macros)
@@ -576,12 +593,23 @@
   (when-not (load-and-callback! nil file :clj :calculate-cache-prefix cb)
     (cb nil)))

+;; Represents code for which the goog JS is already loaded
+(defn- skip-load-goog-js?
+  [name]
+  ('#{goog.object
+      goog.string
+      goog.string.StringBuffer
+      goog.math.Long} name))
+
 (defn- do-load-goog
   [name cb]
-  (if-let [goog-path (get (closure-index-mem) name)]
-    (when-not (load-and-callback! name (str goog-path ".js") :js nil cb)
-      (cb nil))
-    (cb nil)))
+  (if (skip-load-goog-js? name)
+    (cb {:lang   :js
+         :source ""})
+    (if-let [goog-path (get (closure-index-mem) name)]
+      (when-not (load-and-callback! name (str goog-path ".js") :js nil cb)
+        (cb nil))
+      (cb nil))))

 (defn- do-load-other
   [name path macros cb]


Don't add slash for namespaces

Don't add slash for namespaces

--- planck-cljs/src/planck/repl.cljs
+++ planck-cljs/src/planck/repl.cljs
@@ -398,7 +398,7 @@
          (completion-candidates-for-ns (expand-typed-ns (symbol typed-ns)) false)
          (concat
            (map str keyword-completions)
-           (map #(str (drop-macros-suffix (str %)) "/") (all-ns))
+           (map #(drop-macros-suffix (str %)) (all-ns))
            (map #(str % "/") (keys (current-alias-map)))
            (completion-candidates-for-ns 'cljs.core false)
            (completion-candidates-for-ns 'cljs.core$macros false)


ARM: msm: Add msm8660-surf.dts to Makefile.boot

Add this entry to the Makefile so that we can build the dtb
automatically with 'make dtbs'.

Signed-off-by: Stephen Boyd <010521127f513270fe503d86ab8316ac5147f4b7@codeaurora.org>
Signed-off-by: David Brown <67bb63793f66c3c3797af10faa739beca3aeb927@codeaurora.org>

--- arch/arm/mach-msm/Makefile.boot
+++ arch/arm/mach-msm/Makefile.boot
@@ -1,3 +1,5 @@
   zreladdr-y		+= 0x10008000
 params_phys-y		:= 0x10000100
 initrd_phys-y		:= 0x10800000
+
+dtb-$(CONFIG_ARCH_MSM8X60) += msm8660-surf.dtb


move functions around for readability

move functions around for readability

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -18,6 +18,8 @@
 (def ^:dynamic println? false)
 (def ^:dynamic model)

+(declare assoc-children)
+(declare frontier)
 (declare gen)
 (declare get-lexemes)
 (declare grow)
@@ -37,116 +39,6 @@
    list of expressions that match the given _spec_."
   [spec]
   (grow (parent-with-head spec 0)))
-
-(defn matching-rules [spec]
-  (->> (:grammar model)
-       (map #(unify % spec))
-       (filter #(not (= :fail %)))))
-
-(defn parent-with-head
-  "Return every possible tree of depth 1 from the given spec and model."
-  [spec depth]
-  ;; get all rules that match input _spec_:
-  (if (nil? spec) (throw (Exception. (str "nope: spec was nil."))))
-  (let [matching-rules
-        (shuffle (matching-rules spec))]
-    (->> matching-rules
-         ;; 2. try to add heads to each matching rule:
-         (parent-with-head-1 spec depth)
-         (filter #(not (= % :fail)))
-         (map #(u/assoc-in! % [::started?] true)))))
-
-(defn parent-with-head-1 [spec depth parent-rules]
-  (if (not (empty? parent-rules))
-    (let [parent-rule (first parent-rules)
-          phrases-with-phrasal-head #(map (fn [child]
-                                            (u/assoc-in parent-rule [:head] child))
-                                          (:grammar model))
-          phrases-with-lexical-heads #(map (fn [child]
-                                             (u/assoc-in parent-rule [:head] child))
-                                           (get-lexemes (unify
-                                                         (u/get-in spec [:head] :top)
-                                                         (u/get-in parent-rule [:head] :top))))]
-      (log/debug (str "pwh-1:" (:rule parent-rule)))
-      (cond
-        (branch? depth)
-        (lazy-cat
-         ;; get all the things to be added
-         ;; as the head child of parent-rule:
-         ;; 1. phrases that could be the head child:
-         (phrases-with-phrasal-head)
-         ;; 2. lexemes that could be the head child:
-         (phrases-with-lexical-heads)
-         (parent-with-head-1 spec depth (rest parent-rules)))
-
-        true
-        (lazy-cat
-         ;; 1. lexemes that could be the head child:
-         (phrases-with-lexical-heads)
-         ;; 2. phrases that could be the head child:
-         (phrases-with-phrasal-head)
-         (parent-with-head-1 spec depth (rest parent-rules)))))))
-
-(defn get-lexemes [spec]
-  "Get lexemes matching the spec. Use a model's index if available, where the index
-   is a function that we call with _spec_ to get a set of indices.
-   Otherwise use the model's entire lexeme."
-  (->>
-   (if-let [index-fn (:index-fn model)]
-     (index-fn spec)
-     (do
-       (log/warn (str "get-lexemes: no index found: using entire lexicon."))
-       (flatten (vals
-                 (or (:lexicon (:generate model)) (:lexicon model))))))
-   (filter #(or (= false (u/get-in % [:exception] false))
-                (not (= :verb (u/get-in % [:synsem :cat])))))
-   (map #(unify % spec))
-   (filter #(not (= :fail %)))
-   (map #(u/assoc-in! % [::done?] true))))
-
-(defn frontier
-  "get the next path to which to adjoin within _tree_."
-  [tree]
-  (cond
-
-    (= (u/get-in tree [::done?]) true)
-    []
-
-    (and (= (u/get-in tree [:phrasal]) true)
-         (not (u/get-in tree [::done?]))
-         (= true (u/get-in tree [::started?]))
-         (not (u/get-in tree [:head ::done?])))
-    (cons :head (frontier (u/get-in tree [:head])))
-
-    (and (= (u/get-in tree [:phrasal]) true)
-         (= true (u/get-in tree [::started?])))
-    (cons :comp (frontier (u/get-in tree [:comp])))
-
-    true []))
-
-(defn assoc-each-default [tree children f]
-  (if (not (empty? children))
-    (lazy-cat
-     (let [child (first children)
-           tree-with-child (u/assoc-in tree f child)]
-       (-> tree-with-child
-           (u/assoc-in!
-            (concat (butlast f) [::done?])
-            true)
-           (u/dissoc-paths (if truncate? [f] []))
-           ((or (:default-fn model) (fn [x] [x])))))
-     (assoc-each-default tree (rest children) f))))
-
-(defn assoc-children [tree children f]
-  (if (not (empty? children))
-    (let [child (first children)
-          default-fn (or (:default-fn model)
-                         (fn [x] [x]))]
-      (lazy-cat
-       (if (= true (u/get-in child [::done?]))
-         (assoc-each-default tree (default-fn child) f)
-         [(u/assoc-in tree f child)])
-       (assoc-children tree (rest children) f)))))

 (defn grow
   "recursively generate trees given
@@ -190,3 +82,106 @@
          [tree])
        (grow (rest trees))))))

+(defn frontier
+  "get the next path to which to adjoin within _tree_."
+  [tree]
+  (cond
+    (= (u/get-in tree [::done?]) true)
+    []
+
+    (and (= (u/get-in tree [:phrasal]) true)
+         (not (u/get-in tree [::done?]))
+         (= true (u/get-in tree [::started?]))
+         (not (u/get-in tree [:head ::done?])))
+    (cons :head (frontier (u/get-in tree [:head])))
+
+    (and (= (u/get-in tree [:phrasal]) true)
+         (= true (u/get-in tree [::started?])))
+    (cons :comp (frontier (u/get-in tree [:comp])))
+
+    true []))
+
+(defn parent-with-head
+  "Return every possible tree of depth 1 from the given spec and model."
+  [spec depth]
+  ;; get all rules that match input _spec_:
+  (if (nil? spec) (throw (Exception. (str "nope: spec was nil."))))
+  (let [matching-rules
+        (shuffle (->> (:grammar model)
+                      (map #(unify % spec))
+                      (filter #(not (= :fail %)))))]
+    (->> matching-rules
+         ;; 2. try to add heads to each matching rule:
+         (parent-with-head-1 spec depth)
+         (filter #(not (= % :fail)))
+         (map #(u/assoc-in! % [::started?] true)))))
+
+(defn parent-with-head-1 [spec depth parent-rules]
+  (if (not (empty? parent-rules))
+    (let [parent-rule (first parent-rules)
+          phrases-with-phrasal-head #(map (fn [child]
+                                            (u/assoc-in parent-rule [:head] child))
+                                          (:grammar model))
+          phrases-with-lexical-heads #(map (fn [child]
+                                             (u/assoc-in parent-rule [:head] child))
+                                           (get-lexemes (unify
+                                                         (u/get-in spec [:head] :top)
+                                                         (u/get-in parent-rule [:head] :top))))]
+      (log/debug (str "pwh-1:" (:rule parent-rule)))
+      (cond
+        (branch? depth)
+        (lazy-cat
+         ;; phrases that could be the head child, then lexemes that could be the head child.
+         (phrases-with-phrasal-head)
+         (phrases-with-lexical-heads)
+         (parent-with-head-1 spec depth (rest parent-rules)))
+
+        true
+        (lazy-cat
+         ;; lexemes that could be the head child, then phrases that could be the head child.
+         (phrases-with-lexical-heads)
+         (phrases-with-phrasal-head)
+         (parent-with-head-1 spec depth (rest parent-rules)))))))
+
+(defn get-lexemes
+  "Get lexemes matching the spec. Use a model's index if available, where the index
+   is a function that we call with _spec_ to get a set of indices.
+   Otherwise use the model's entire lexeme."
+  [spec]
+  (->>
+   (if-let [index-fn (:index-fn model)]
+     (index-fn spec)
+     (do
+       (log/warn (str "get-lexemes: no index found: using entire lexicon."))
+       (flatten (vals
+                 (or (:lexicon (:generate model)) (:lexicon model))))))
+   (filter #(or (= false (u/get-in % [:exception] false))
+                (not (= :verb (u/get-in % [:synsem :cat])))))
+   (map #(unify % spec))
+   (filter #(not (= :fail %)))
+   (map #(u/assoc-in! % [::done?] true))))
+
+(defn assoc-each-default [tree children f]
+  (if (not (empty? children))
+    (lazy-cat
+     (let [child (first children)
+           tree-with-child (u/assoc-in tree f child)]
+       (-> tree-with-child
+           (u/assoc-in!
+            (concat (butlast f) [::done?])
+            true)
+           (u/dissoc-paths (if truncate? [f] []))
+           ((or (:default-fn model) (fn [x] [x])))))
+     (assoc-each-default tree (rest children) f))))
+
+(defn assoc-children [tree children f]
+  (if (not (empty? children))
+    (let [child (first children)
+          default-fn (or (:default-fn model)
+                         (fn [x] [x]))]
+      (lazy-cat
+       (if (= true (u/get-in child [::done?]))
+         (assoc-each-default tree (default-fn child) f)
+         [(u/assoc-in tree f child)])
+       (assoc-children tree (rest children) f)))))
+


cleanup

cleanup

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -61,11 +61,10 @@
                   cp2c)))))
      (remove nil?)
      (map (fn [each-bolt-and-comps]
-            (let [trellis (apply combo/cartesian-product (vals each-bolt-and-comps))]
-              (map (fn [each-path-through-trellis]
-                     (zipmap (keys each-bolt-and-comps)
-                             each-path-through-trellis))
-                   trellis))))
+            (map (fn [each-path-through-trellis]
+                   (zipmap (keys each-bolt-and-comps)
+                           each-path-through-trellis))
+                 (apply combo/cartesian-product (vals each-bolt-and-comps)))))
      flatten
      (map (fn [bolt-and-comps]
             (log/debug (str "doing defaults on: " depth "/" max-depth ":" ((:morph-ps model) (get bolt-and-comps []))))


improve readability hopefully by moving the (reduce concat)

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -119,12 +119,13 @@
                                                   (+ 1 depth) (+ 1 total-depth)
                                                   :max-total-depth max-total-depth)))
                    parents))]
-      (if (lexemes-before-phrases total-depth max-total-depth)
-        (lazy-cat lexical phrasal)
-        (lazy-cat phrasal lexical)))))
+      (reduce concat
+              (if (lexemes-before-phrases total-depth max-total-depth)
+                (lazy-cat lexical phrasal)
+                (lazy-cat phrasal lexical))))))

 ;; TODO: catch exception thrown by add-complement-by-bolt: "could generate neither phrasal nor lexical complements for bolt"
-(defn add-all-comps [bolt-groups language-model total-depth truncate-children max-total-depth]
+(defn add-all-comps [bolts language-model total-depth truncate-children max-total-depth]
   "At each point in each bolt in the list of list of bolts,
 _bolt-groups_, add all possible complements at all open nodes in the
 bolt, from deepest and working upward to the top. Return a lazy
@@ -135,7 +136,7 @@
      (add-all-comps-with-paths [bolt] language-model total-depth
                                (find-comp-paths-in (bolt-depth bolt))
                                truncate-children max-total-depth))
-   (reduce concat bolt-groups)))
+   bolts))

 (defn add-all-comps-with-paths [bolts language-model total-depth comp-paths truncate-children max-total-depth]
   (if (empty? comp-paths) bolts


more functions around

more functions around

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -184,25 +184,6 @@
      max-total-depth)
     bolts))

-(defn bolt-depth [bolt]
-  (if-let [head (get-in bolt [:head] nil)]
-    (+ 1 (bolt-depth head))
-    0))
-
-(defn find-comp-paths-in [depth]
-  (cond
-    ;; most-frequent cases done statically:
-    (= 0 depth) nil
-    (= 1 depth) [[:comp]]
-    (= 2 depth) [[:head :comp][:comp]]
-    (= 3 depth) [[:head :head :comp][:head :comp][:comp]]
-    (= 4 depth) [[:head :head :head :comp][:head :head :comp][:head :comp][:comp]]
-
-    ;;
-    true
-    (cons (vec (concat (take (- depth 1) (repeatedly (fn [] :head))) [:comp]))
-          (find-comp-paths-in (- depth 1)))))
-
 (defn add-complement-to-bolt [bolt path language-model total-depth
                               & {:keys [max-total-depth truncate-children]
                                  :or {max-total-depth max-total-depth
@@ -308,6 +289,25 @@

                             (take max-generated-complements (lazy-cat phrasal-complements lexical-complements)))))))))

+(defn bolt-depth [bolt]
+  (if-let [head (get-in bolt [:head] nil)]
+    (+ 1 (bolt-depth head))
+    0))
+
+(defn find-comp-paths-in [depth]
+  (cond
+    ;; most-frequent cases done statically:
+    (= 0 depth) nil
+    (= 1 depth) [[:comp]]
+    (= 2 depth) [[:head :comp][:comp]]
+    (= 3 depth) [[:head :head :comp][:head :comp][:comp]]
+    (= 4 depth) [[:head :head :head :comp][:head :head :comp][:head :comp][:comp]]
+
+    ;;
+    true
+    (cons (vec (concat (take (- depth 1) (repeatedly (fn [] :head))) [:comp]))
+          (find-comp-paths-in (- depth 1)))))
+
 (defn candidate-parents [rules spec]
   "find subset of _rules_ for which each member unifies successfully with _spec_"
   (log/trace (str "candidate-parents: spec: " (strip-refs spec)))


+TODO

+TODO

--- src/babel/italiano.cljc
+++ src/babel/italiano.cljc
@@ -21,6 +21,7 @@
                           show-notes true}}]
   ;; modeled after babel.english/morph:
   ;; most arguments are simply discarded for italian.
+  ;; TODO: rules should apply repeatedly until no change.
   (->
    (get-string (get-in expr [:italiano]))
    ((fn [surface-string]


Allow negative length for InputStreamEntity.

Even though the constructor requires a length, a -1 coerces HttpClient
to using a chunked encoding.

--- src/clj_http/client.clj
+++ src/clj_http/client.clj
@@ -267,9 +267,10 @@
                                                           "UTF-8")))))
        (instance? InputStream body)
        (do
-         (when-not (and length (pos? length))
+         (when-not (integer? length)
            (throw
-            (Exception. ":length key is required for InputStream bodies")))
+            (Exception. (str ":length key is required for InputStream"
+                             " bodies, and must be an integer"))))
          (client (-> req (assoc :body (InputStreamEntity. body length)))))

        (instance? (Class/forName "[B") body)


Fixed typos

Fixed typos

--- src/clj_mrazik/core.clj
+++ src/clj_mrazik/core.clj
@@ -37,17 +37,17 @@

 (defn open-window
     [config]
-    (let [message    (-> config :bot :message1)
+    (let [message    (-> config :bot    :message1)
           recipients (-> config :server :recipients)
-          channel    (-> config :server channel)]
+          channel    (-> config :server :channel)]
           (println message)
           (irc-bot/send-message recipients channel message)))

 (defn close-window
     [config]
-    (let [message    (-> config :bot :message2)
+    (let [message    (-> config :bot    :message2)
           recipients (-> config :server :recipients)
-          channel    (-> config :server channel)]
+          channel    (-> config :server :channel)]
           (println message)
           (irc-bot/send-message recipients channel message)))

@@ -65,6 +65,10 @@
                 [:window-open   :should-be-open]   (recur :window-open))
         )))

+; TODO
+; schedule displaying
+; user registration/unregistration
+
 (defn -main
     "Entry point to this bot."
     [& args]


implementation of delay

implementation of delay

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -2494,6 +2494,47 @@

 (def fixture1 1)
 (def fixture2 2)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Delay ;;;;;;;;;;;;;;;;;;;;
+
+(deftype Delay [f state]
+  IDeref
+  (-deref [_]
+    (when-not @state
+      (swap! state f))
+    @state))
+
+(defn delay
+  "Takes a body of expressions and yields a Delay object that will
+  invoke the body only the first time it is forced (with force or deref/@), and
+  will cache the result and return it on all subsequent force
+  calls."
+  [& body]
+  (Delay. (fn [] (apply identity body)) (atom nil)))
+
+(defn delay?
+  "returns true if x is a Delay created with delay"
+  [x] (instance? cljs.core.Delay x))
+
+(defn force
+  "If x is a Delay, returns the (possibly cached) value of its expression, else returns x"
+  [x]
+  (if (delay? x)
+    (deref x)
+    x))
+
+(comment
+
+  (def _ (delay (str (goog.global.Date.))))
+  (str (goog.global.Date.))
+  (deref _)
+  (deref _)
+
+  (delay? _)
+  (delay "foo")
+  (force _)
+
+  )

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Tests ;;;;;;;;;;;;;;;;


add ICloneable protocol, implement for persistent collection types, add clone function

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -223,6 +223,9 @@
     [this a b c d e f g h i j k l m n o p q s t]
     [this a b c d e f g h i j k l m n o p q s t rest]))

+(defprotocol ICloneable
+  (^clj -clone [value]))
+
 (defprotocol ICounted
   (^number -count [coll] "constant time count"))

@@ -420,6 +423,8 @@
 (deftype Symbol [ns name str ^:mutable _hash _meta]
   Object
   (toString [_] str)
+  ICloneable
+  (-clone [_] (Symbol. ns name str _hash _meta))
   IEquiv
   (-equiv [_ other]
     (if (instance? Symbol other)
@@ -457,6 +462,9 @@
 ;;;;;;;;;;;;;;;;;;; fundamentals ;;;;;;;;;;;;;;;

 (declare array-seq prim-seq IndexedSeq)
+
+(defn clone [value]
+  (-clone value))

 (defn ^seq seq
   "Returns a seq on the collection. If the collection is
@@ -665,6 +673,9 @@
   (toString [coll]
    (pr-str* coll))

+  ICloneable
+  (-clone [_] (IndexedSeq. arr i))
+
   ISeqable
   (-seq [this] this)

@@ -738,6 +749,9 @@
   Object
   (toString [coll]
     (pr-str* coll))
+
+  ICloneable
+  (-clone [_] (RSeq. ci i meta))

   IMeta
   (-meta [coll] meta)
@@ -1870,6 +1884,9 @@

   IList

+  ICloneable
+  (-clone [_] (List. meta first rest count __hash))
+
   IWithMeta
   (-with-meta [coll meta] (List. meta first rest count __hash))

@@ -1923,6 +1940,9 @@
     (pr-str* coll))

   IList
+
+  ICloneable
+  (-clone [_] (EmptyList. meta))

   IWithMeta
   (-with-meta [coll meta] (EmptyList. meta))
@@ -2001,6 +2021,9 @@

   IList

+  ICloneable
+  (-clone [_] (Cons. meta first rest __hash))
+
   IWithMeta
   (-with-meta [coll meta] (Cons. meta first rest __hash))

@@ -2051,6 +2074,9 @@
   Object
   (toString [_] (str ":" fqn))

+  ICloneable
+  (-clone [_] (Keyword. ns name fqn _hash))
+
   IEquiv
   (-equiv [_ other]
     (if (instance? Keyword other)
@@ -3240,6 +3266,9 @@
   (toString [coll]
     (pr-str* coll))

+  ICloneable
+  (-clone [_] (PersistentVector. meta cnt shift root tail __hash))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentVector. meta cnt shift root tail __hash))

@@ -3496,6 +3525,9 @@
   Object
   (toString [coll]
     (pr-str* coll))
+
+  ICloneable
+  (-clone [_] (Subvec. meta v start end __hash))

   IWithMeta
   (-with-meta [coll meta] (build-subvec meta v start end __hash))
@@ -3821,6 +3853,9 @@
   (toString [coll]
     (pr-str* coll))

+  ICloneable
+  (-clone [coll] (PersistentQueue. meta count front rear __hash))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentQueue. meta count front rear __hash))

@@ -4177,6 +4212,9 @@
   Object
   (toString [coll]
     (pr-str* coll))
+
+  ICloneable
+  (-clone [_] (PersistentArrayMap. meta cnt arr __hash))

   IWithMeta
   (-with-meta [coll meta] (PersistentArrayMap. meta cnt arr __hash))
@@ -5001,6 +5039,9 @@
   (toString [coll]
     (pr-str* coll))

+  ICloneable
+  (-clone [_] (PersistentHashMap. meta cnt root has-nil? nil-val __hash))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentHashMap. meta cnt root has-nil? nil-val __hash))

@@ -5728,7 +5769,6 @@
   (toString [coll]
     (pr-str* coll))

-  Object
   (entry-at [coll k]
     (loop [t tree]
       (if-not (nil? t)
@@ -5736,6 +5776,9 @@
           (cond (zero? c) t
                 (neg? c)  (recur (.-left t))
                 :else     (recur (.-right t)))))))
+
+  ICloneable
+  (-clone [_] (PersistentTreeMap. comp tree cnt meta __hash))

   IWithMeta
   (-with-meta [coll meta] (PersistentTreeMap. comp tree cnt meta __hash))
@@ -6069,6 +6112,9 @@
   (toString [coll]
     (pr-str* coll))

+  ICloneable
+  (-clone [_] (PersistentHashSet. meta hash-map __hash))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentHashSet. meta hash-map __hash))

@@ -6181,6 +6227,9 @@
   (toString [coll]
     (pr-str* coll))

+  ICloneable
+  (-clone [_] (PersistentTreeSet. meta tree-map __hash))
+
   IWithMeta
   (-with-meta [coll meta] (PersistentTreeSet. meta tree-map __hash))

@@ -6416,6 +6465,9 @@
   Object
   (toString [coll]
     (pr-str* coll))
+
+  ICloneable
+  (-clone [_] (Range. meta start end step __hash))

   IWithMeta
   (-with-meta [rng meta] (Range. meta start end step __hash))
@@ -7570,6 +7622,9 @@
 ;; UUID

 (deftype UUID [uuid]
+  ICloneable
+  (-clone [_] (UUID. uuid))
+
   IEquiv
   (-equiv [_ other]
     (and (instance? UUID other) (identical? uuid (.-uuid other))))


Patched apply for prop lookup

Patched apply for prop lookup

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -1336,7 +1336,7 @@
   First cut.  Not lazy.  Needs to use emitted toApply."
   ([f args]
      (let [fixed-arity (. f -cljs$lang$maxFixedArity)]
-       (if (. f cljs$lang$applyTo)
+       (if (. f -cljs$lang$applyTo)
          (if (<= (bounded-count args (inc fixed-arity))
                  fixed-arity)
            (. f apply f (to-array args))
@@ -1345,7 +1345,7 @@
   ([f x args]
      (let [arglist (list* x args)
            fixed-arity (. f -cljs$lang$maxFixedArity)]
-       (if (. f cljs$lang$applyTo)
+       (if (. f -cljs$lang$applyTo)
          (if (<= (bounded-count arglist fixed-arity)
                  fixed-arity)
            (. f apply f (to-array arglist))
@@ -1354,7 +1354,7 @@
   ([f x y args]
      (let [arglist (list* x y args)
            fixed-arity (. f -cljs$lang$maxFixedArity)]
-       (if (. f cljs$lang$applyTo)
+       (if (. f -cljs$lang$applyTo)
          (if (<= (bounded-count arglist fixed-arity)
                  fixed-arity)
            (. f apply f (to-array arglist))
@@ -1363,7 +1363,7 @@
   ([f x y z args]
      (let [arglist (list* x y z args)
            fixed-arity (. f -cljs$lang$maxFixedArity)]
-       (if (. f cljs$lang$applyTo)
+       (if (. f -cljs$lang$applyTo)
          (if (<= (bounded-count arglist fixed-arity)
                  fixed-arity)
            (. f apply f (to-array arglist))
@@ -1372,7 +1372,7 @@
   ([f a b c d & args]
      (let [arglist (cons a (cons b (cons c (cons d (spread args)))))
            fixed-arity (. f -cljs$lang$maxFixedArity)]
-       (if (. f cljs$lang$applyTo)
+       (if (. f -cljs$lang$applyTo)
          (if (<= (bounded-count arglist fixed-arity)
                  fixed-arity)
            (. f apply f (to-array arglist))


drop logging bullet

drop logging bullet

--- src/cljs/mpd/stage.cljs
+++ src/cljs/mpd/stage.cljs
@@ -22,7 +22,6 @@
           [] (seq enemies)))

 (defmethod pixi :bullet [_ bullet]
-  (log bullet)
   (let [shape (js/PIXI.Text.
                 (str "b")
                 (js-obj "fill" "red"))]


bump version of cider

bump version of cider

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,7 +1,7 @@
 {:user
  {:plugins
   [
-   [cider/cider-nrepl "0.8.1"]
+   [cider/cider-nrepl "0.9.0"]
    [lein-midje "3.1.3"]
    [lein-try "0.4.1"]
    [lein-marginalia "0.7.1"]


Add eastwood to lein profiles.

Add eastwood to lein profiles.

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -12,6 +12,7 @@
                   [org.bodil/lein-noderepl "0.1.11"]
                   [quickie "0.2.1"]
                   [lein-kibit "0.0.8"]
+                  [jonase/eastwood "0.1.4"]
                   [lein-clojars "0.9.1"]
                   [lein-pprint "1.1.1"]
                   [lein-expectations "0.0.7"]


Lein: cleanup, JVM settings, clojars releases

incl. Stop JVM from hiding stacktrace

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,8 +1,10 @@

 ;; Inspired heavily by http://dev.solita.fi/2014/03/18/pimp-my-repl.html
 ;; and a newer https://gist.github.com/rauhs/d5bb47c239b58cbf54e1d3d1de221031
-{:user {:dependencies [
-                         [org.clojure/tools.nrepl "0.2.13"]
+{:user {:signing {:gpg-key "5AA361214163F2CD"} ;; my keybase key
+        :deploy-repositories [["clojars" {:url "https://repo.clojars.org" :creds :gpg}]]
+        :dependencies [
+;?                         [org.clojure/tools.nrepl "0.2.13"]
 ;;                       [org.clojars.gjahad/debug-repl "0.3.3"]
 ;;                       [im.chit/vinyasa "0.3.4"]
 ;;                       [spyscope "0.1.5"] ;; reader macro to print forms before execution: #spy/p, d
@@ -37,12 +39,12 @@
 ;;                     (require 'spyscope.core)
                      ]
         :plugins [
-                    [lein-virgil "0.1.8"] ; auto-recompile and reload .java files from :java-source-paths into the REPL
-                    [lein-libdir "0.1.1"] ; dependencies to ./lib/
+ ;;                   [lein-virgil "0.1.8"] ; auto-recompile and reload .java files from :java-source-paths into the REPL
+ ;;                   [lein-libdir "0.1.1"] ; dependencies to ./lib/
                     ;[cider/cider-nrepl "0.9.1"]
                     ;[refactor-nrepl "1.1.0"]
                     ;[com.jakemccrary/lein-test-refresh "0.16.0"] ;; autotest
-                    [venantius/ultra "0.5.2"] ;; clj.test output and data in REPL coloring etc
+;?                    [venantius/ultra "0.5.2"] ;; clj.test output and data in REPL coloring etc
 ;;                  ;;[lein-catnip "0.5.1"]
 ;;                  ;;[codox "0.6.1"]                     ; document. generation from src
 ;;                  [lein-ring "0.9.3"]
@@ -79,13 +81,14 @@
                        [zcaudate/lucid.package "1.4.7"]
                        ;; needed for ns reload (i.e. resetting; see clojure.tools.namespace.reload [Clojure only as of 0.3.0alpha4)
                        [org.clojure/tools.namespace "0.3.0-alpha4"]]
-        :plugins [[com.gfredericks/lein-shorthand "0.4.1"]]
+ ;;       :plugins [[com.gfredericks/lein-shorthand "0.4.1"]]
         :global-vars {;*warn-on-reflection* true
                       *print-length* 200 ;; avoid infinite sequences in dev mode.
                       ;*print-namespace-maps* false
                       *assert* true}
         :jvm-opts [;"-Xms400m" ;; starting heap memory
                    ;"-Xmx8000m" ;; max heap memory
+                   "-XX:-OmitStackTraceInFastThrow" ;; Stop JVM from hiding stacktrace of repeated exceptions
                    ; Enable clojure.spec/assert (off by default)
                    "-Dclojure.spec.check-asserts=true"]
         ;:injections [(require '[lucid.core.inject :as inject])


I guess routes having the same name doesn't matter

--- frontend/routes.cljs
+++ frontend/routes.cljs
@@ -151,14 +151,14 @@

   ;; TODO: this should be stories/:company, but we'll wait for more stories
-  (defroute v1-enterprise (FragmentRoute. "/stories/shopify") {:as params}
+  (defroute v1-stories (FragmentRoute. "/stories/shopify") {:as params}
     (open-to-outer! nav-ch :shopify-story (assoc params :_title "Shopify + CircleCI Success Story")))

   ;; TODO: this should be integrations/:integration, but we'll wait for more integrations
-  (defroute v1-enterprise (FragmentRoute. "/integrations/docker") {:as params}
+  (defroute v1-integrations (FragmentRoute. "/integrations/docker") {:as params}
     (open-to-outer! nav-ch :docker-integration (assoc params :_title "CircleCI and Docker")))

-  (defroute v1-enterprise (FragmentRoute. "/changelog") {:as params}
+  (defroute v1-changelog (FragmentRoute. "/changelog") {:as params}
     (open-to-outer! nav-ch :changelog params))

   (defroute v1-root (FragmentRoute. "/") {:as params}


remove input auto focus

remove input auto focus

--- frontend/uxbox/ui/elements.cljs
+++ frontend/uxbox/ui/elements.cljs
@@ -490,12 +490,10 @@
         [:div.row-flex
           [:input#color-hex.input-text
             {:placeholder "#"
-            :type "text"
-            :auto-focus true}]
+            :type "text"}]
           [:input#color-rgb.input-text
             {:placeholder "RGB"
-            :type "text"
-            :auto-focus true}]]
+            :type "text"}]]
         [:input#project-btn.btn-primary {:value "+ Add color" :type "submit"}]]
       [:a.close {:href "#"
                 :on-click #(do (dom/prevent-default %)