(defn unify-and-log) should return result of unification

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -102,7 +102,9 @@
      (remove #(= :fail %)))))

 (defn unify-and-log [a b model]
-  (log-unification-result a b (unify a b) model))
+  (let [result (unify a b)]
+    (log-unification-result a b result model)
+    result))

 (defn comp-path-to-complements
   "return a lazy sequence of bolts for all possible complements that can be added to the end of the _path_ within _bolt_."


+(defn preprocess)

+(defn preprocess)

--- src/babel/italiano.cljc
+++ src/babel/italiano.cljc
@@ -105,38 +105,59 @@
   [parent child1 child2]
   (over/over parent child1 child2))

+(defn preprocess [input]
+  "arbitrary regexp replacements to convert Italian orthography into a parsable whitespace-delimited expression"
+  (let [processed
+        (string/join
+         " "
+         (map string/lower-case
+              (->
+               input
+               (string/replace #","   "")
+               (string/replace #"\."   "")
+               (string/replace #"\s+" " ")
+               (string/split #" "))))]
+    (log/debug (str "preprocess: " input " -> " processed))
+    processed))
+
 (defn parse
   "parse a string in Italian into zero or more (hopefully more) phrase structure trees"

   ([input]
-   (parse input medium))
+   (let [input (preprocess input)]
+     (parse input medium)))

   ([input model]
-   (cond (string? input)
-         (map (fn [tokenization]
-                {:tokens tokenization
-                 :input input
-                 :parses (parse tokenization model input)})
-              (analyze-tokens (string/trim input)))
+   (let [input (preprocess input)]
+     (cond (string? input)
+           (map (fn [tokenization]
+                  {:tokens tokenization
+                   :input input
+                   :parses (parse tokenization model input)})
+                (analyze-tokens (string/trim input)))

-         (or (seq? input) (vector? input))
-         (parse/parse input model)
+           (or (seq? input) (vector? input))
+           (parse/parse input model)

-         true
-         (str "don't know how to parse input: " (type input))))
+           true
+           (str "don't know how to parse input: " (type input)))))

   ([input model original-input]
-   (cond (string? input)
-         (map (fn [tokenization]
-                {:tokens tokenization
-                 :parses (parse tokenization model input)})
-              (analyze-tokens (string/trim input)))
+   (let [input (if (string? input)
+                 (preprocess input)
+                 input)]
+     (cond (string? input)
+           (map (fn [tokenization]
+                  {:tokens tokenization
+                   :parses (parse tokenization model input)})
+                (analyze-tokens (string/trim input)))

-         (or (seq? input) (vector? input))
-         (parse/parse input model original-input)
+           (or (seq? input) (vector? input))
+           (parse/parse input model original-input)

-         true
-         (str "don't know how to parse input: " (type input)))))
+           true
+           (str "don't know how to parse input: " (type input))))))
+


add another field to parse output: :input, which is the original input, before tokenization, to (parse)

--- src/babel/italiano.cljc
+++ src/babel/italiano.cljc
@@ -102,6 +102,7 @@
    (cond (string? input)
          (map (fn [tokenization]
                 {:tokens tokenization
+                 :input input
                  :parses (parse tokenization model input)})
               (analyze-tokens (string/trim input)))


[#111931753] Remove Weibo link

[#111931753] Remove Weibo link

--- src/homepage/index.clj
+++ src/homepage/index.clj
@@ -118,8 +118,6 @@
               :link  "http://www.linkedin.com/company/exicon-ltd-"}
              {:image "/img/footer/white-youtube.png"
               :link  "https://www.youtube.com/user/Exicon1"}
-             {:image "/img/footer/white-weibo.png"
-              :link  "http://www.weibo.com/u/3147916252"}
              {:image "/img/footer/white-pinterest.png"
               :link  "http://www.pinterest.com/exicon/pins/follow/?guid=CqzN7JCYsQQy-0"}]}])


start integrating with minibus endpoints

--- src/leftover/core.cljs
+++ src/leftover/core.cljs
@@ -92,6 +92,15 @@
                       (close! resp)))))
     resp))

+(defn POST
+  [url content]
+  (log (clj->js content))
+  (xhr/send
+    url
+    (fn [event] (let [res (-> event .-target .getResponseText)] (log res)))
+    "POST"
+    (.stringify js/JSON (clj->js content))))
+
 (def actions (chan))

 (go (loop []
@@ -116,6 +125,14 @@
         cleaned (cleanup (js->clj (.parse js/JSON data)))]
     (swap! app-state assoc :state :enter-payment :data cleaned)))

+(go
+  (loop []
+    (log (<! (GET "http://localhost:8000/conn/foo/baz")))
+    (recur)))
+
+(go
+  (POST "http://localhost:8000/conn/foo" {:foo "bar"}))
+
 (om/root
   main-view
   app-state


Remove unnecessary do form in defproject.

--- src/leiningen/core.clj
+++ src/leiningen/core.clj
@@ -19,36 +19,36 @@
   ;; This is necessary since we must allow defproject to be eval'd in
   ;; any namespace due to load-file; we can't just create a var with
   ;; def or we would not have access to it once load-file returned.
-  `(do
-     (let [m# (apply hash-map ~(cons 'list (unquote-project args)))
-           root# ~(.getParent (File. *file*))]
-       (alter-var-root #'project
-                       (fn [_#] (assoc m#
-                                 :name ~(name project-name)
-                                 :group ~(or (namespace project-name)
-                                             (name project-name))
-                                 :version ~version
-                                 :compile-path (or (:compile-path m#)
-                                                   (str root# "/classes"))
-                                 :source-path (or (:source-path m#)
-                                                  (str root# "/src"))
-                                 :library-path (or (:library-path m#)
-                                                   (str root# "/lib"))
-                                 :test-path (or (:test-path m#)
-                                                (str root# "/test"))
-                                 :resources-path (or (:resources-path m#)
-                                                     (str root# "/resources"))
-                                 :test-resources-path
-                                 (or (:test-resources-path m#)
-                                     (str root# "/test-resources"))
-                                 :jar-dir (or (:jar-dir m#) root#)
-                                 :root root#))))
+  `(let [m# (apply hash-map ~(cons 'list (unquote-project args)))
+         root# ~(.getParent (File. *file*))]
+     (alter-var-root #'project
+                     (fn [_#] (assoc m#
+                               :name ~(name project-name)
+                               :group ~(or (namespace project-name)
+                                           (name project-name))
+                               :version ~version
+                               :compile-path (or (:compile-path m#)
+                                                 (str root# "/classes"))
+                               :source-path (or (:source-path m#)
+                                                (str root# "/src"))
+                               :library-path (or (:library-path m#)
+                                                 (str root# "/lib"))
+                               :test-path (or (:test-path m#)
+                                              (str root# "/test"))
+                               :resources-path (or (:resources-path m#)
+                                                   (str root# "/resources"))
+                               :test-resources-path
+                               (or (:test-resources-path m#)
+                                   (str root# "/test-resources"))
+                               :jar-dir (or (:jar-dir m#) root#)
+                               :root root#)))
      (def ~(symbol (name project-name)) project)))

 (defn exit
   "Call System/exit. Defined as a function so that rebinding is possible."
-  [code]
-  (System/exit code))
+  ([code]
+     (System/exit code))
+  ([] (exit 0)))

 (defn abort [& msg]
   (binding [*out* *err*]


London fixtures

London fixtures

--- src/lights/my_show.clj
+++ src/lights/my_show.clj
@@ -80,7 +80,7 @@
               (chan/functions :shutter 3 0 "Shutter Closed" 255 "Shutter Open")
               (chan/dimmer 7)
               ]
-    :pan-center 86 :pan-half-circle 0 :tilt-center 35 :tilt-half-circle 224
+    :pan-center 86 :pan-half-circle 170 :tilt-center 35 :tilt-half-circle 224
     })

@@ -140,7 +140,7 @@
 (use-london-show)

 ; Debug level
-(:timbre/with-level :WARN)
+(timbre/set-config! {:level :warn})

 (defn global-color-effect
   "Make a color effect which affects all lights in the sample show.
@@ -246,7 +246,7 @@

 (defn light-sine
   "Change light according to sine osc"
-  [beat-ratio]
+  []
   (let [light-param (params/build-oscillated-param
     (oscillators/sine-beat :beat-ratio :osc-beat-ratio :down? true :phase 0.5) :max :max-lightness)]
     (show/add-effect! :color (global-color-effect


Remove stray testing line

Remove stray testing line

--- src/lt/objs/files.cljs
+++ src/lt/objs/files.cljs
@@ -80,8 +80,6 @@
       (if (empty? parts)
         acc
         (recur (rest parts) (conj acc (string/join "." parts)))))))
-
-(get-file-parts "index.cljs.hl")

 (defn ext [path]
   (let [i (.lastIndexOf path ".")]


Handle errors otherwise they're lost

Handle errors otherwise they're lost

--- src/layzee/adapters/web/api.clj
+++ src/layzee/adapters/web/api.clj
@@ -10,6 +10,17 @@
                  :status  200
                  :headers content-type-json
                  :body    body})
+
+(defn- err[body] {
+                 :status  500
+                 :headers content-type-json
+                 :body    body})
+
+(defn- xxx[]
+  (try
+   (println settings/oauth-credential)
+   (ok (search/lazy-web settings/oauth-credential))
+   (catch Exception e (err (str "caught exception: " (.getMessage e))))))

 (defn reply
   ;; (
@@ -30,6 +41,5 @@
   ([request]
      (reply request {}))
   ([request opts]
-     (let [result (search/lazy-web settings/oauth-credential)]
-       (ok result))))
+     (xxx)))


upgrade to support microservices

upgrade to support microservices

--- src/migae/boot_gae.clj
+++ src/migae/boot_gae.clj
@@ -543,18 +543,18 @@
                             (boot/commit!)))))))

 (boot/deftask build-sift
-  [u unit-test bool "sift for unit-test config"]
+  []
+  ;; [u unit-test bool "sift for unit-test config"]
   (fn middleware [next-handler]
     (fn handler [fileset]
-      (let [module (if unit-test "default" (get-module-name fileset false))
+      (let [;; module (if unit-test "default" (get-module-name fileset false))
+            module (get-module-name fileset false)
             target-middleware (comp
                                (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
                                (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
-                               (builtin/sift :move {#"(.+$)" (str module "/$1")})
                                )
             target-handler (target-middleware next-handler)]
         (target-handler fileset)))))
-

 (boot/deftask build
   "Configure and build servlet or service app"
@@ -1088,7 +1088,8 @@
    v verbose bool "verbose"]
   (fn middleware [next-handler]
     (fn handler [fileset]
-      (let [target-dir (get-target-dir fileset servlet)
+      (let [servlet true
+            target-dir (get-target-dir fileset servlet)
             target-dir (if unit-test "target/default" (if dir (str dir "/" target-dir) target-dir))
             _ (println "TARGET DIR: " target-dir)
             target-middleware (comp (builtin/watch)


refactored term insertion build proper index

--- src/ontrail/search.clj
+++ src/ontrail/search.clj
@@ -40,24 +40,22 @@
                      ))

 (defn get-ex-terms [exercise]
-  (let [ex-date (:creationDate exercise)
-        ex-distance (:distance exercise)
-        bare-term-list (to-bare-term-list exercise)
+  (let [bare-term-list (to-bare-term-list exercise)
         term-list (filter not-too-short-term? bare-term-list)]
     term-list))

 (def inverted-index (atom {}))

-(defn insert-term [assoc-fn index ex-id term]
+(defn insert-term [assoc-fn ex-id index term]
   (if-let [postings (index term)]
-    (assoc-fn index term #{ex-id})
-    (let [new-val (conj (index term) ex-id)]
-      (assoc-fn index term new-val))))
+    (let [new-val (conj postings ex-id)]
+      (assoc-fn index term new-val))
+    (assoc-fn index term #{ex-id})))

 (defn insert-exercise-to-index [assoc-fn index ex]
   (let [terms (get-ex-terms ex)
-        ex-id (str (:_id ex))]
-    (reduce (partial insert-term assoc-fn index) terms)))
+        ex-id (str (:_id ex))]
+    (reduce (partial insert-term assoc-fn ex-id) index terms)))

 (def insert-exercise-inmem-index
   (partial insert-exercise-to-index assoc @inverted-index))
@@ -69,7 +67,7 @@
 (defn search-ids [& terms]
   (let [filtered-terms (filter not-too-short-term? terms)]
     (if (> (count filtered-terms) 0)
-      (take search-limit (apply clojure.set/intersection (map #(get @inverted-index (.toLowerCase %)) filtered-terms)))
+      (take search-limit (apply clojure.set/intersection (map #(@inverted-index %) filtered-terms)))
       '())))

 (defn search [& terms]


Fix spacing on not-found message

Fix spacing on not-found message

Not familiar with hiccup, but I see similar spacing on https://github.com/witch-house/pronoun.is/blob/master/src/pronouns/pages.clj#L78 so figured I'd roll with it.

--- src/pronouns/pages.clj
+++ src/pronouns/pages.clj
@@ -167,7 +167,7 @@
       [:body
        (header-block title)
       [:div {:class "section examples"}
-       [:p [:h2 (str "We couldn't find those pronouns in our database."
+       [:p [:h2 (str "We couldn't find those pronouns in our database. "
                      "If you think we should have them, please reach out!")]]]
        (footer-block)]])))


(PDB-3611) Fix migration test post-rebase

--- test/puppetlabs/puppetdb/scf/migrate_test.clj
+++ test/puppetlabs/puppetdb/scf/migrate_test.clj
@@ -904,10 +904,10 @@
                                    :same nil}]}
                schema-diff))))))

-(deftest migration-62-rededuplicate-facts
+(deftest migration-64-rededuplicate-facts
   (jdbc/with-db-connection *db*
     (clear-db-for-testing!)
-    (fast-forward-to-migration! 61)
+    (fast-forward-to-migration! 63)

     (jdbc/insert! :environments {:id 0 :environment "testing"})

@@ -952,7 +952,7 @@
                                (:value_null :value_json) row
                                (assoc row value_key value)))))

-    (apply-migration-for-testing! 62)
+    (apply-migration-for-testing! 64)

     (is (= 6 (:count (first (jdbc/query-to-vec "select count(*) from fact_values")))))
     (is (= 12 (:count (first (jdbc/query-to-vec "select count(*) from facts")))))))


Use need function, fix drop 1 between rets

--- services/strm-take.clj
+++ services/strm-take.clj
@@ -15,11 +15,11 @@
              inc-add    (fn[v]
                           (vswap! cnt #(inc %))
                           (vswap! chunk #(conj % v))
-                          (pg/more))]
+                          (pg/need))]
          (fn[n v]
            (cond
              (pg/eoi? v) (if (> @cnt 0) (reset-send) (pg/done))
-             (= @cnt n) (reset-send)
+             (= @cnt n) (let [ret (reset-send)] (inc-add v) ret)
              :else
              (inc-add v))))


Get rid of norun

Get rid of norun

--- src/reagent/ratom.cljs
+++ src/reagent/ratom.cljs
@@ -208,8 +208,7 @@

 (deftype Reaction [f ^:mutable state ^:mutable ^number dirtyness
                    ^:mutable watching ^:mutable watches
-                   auto-run on-set on-dispose ^:mutable ^boolean norun?
-                   ^boolean nocache?]
+                   ^:mutable auto-run on-set on-dispose ^boolean nocache?]
   IAtom
   IReactiveAtom

@@ -218,7 +217,8 @@
     (reduce-kv (fn [_ key f]
                  (f key this oldval newval)
                  nil)
-               nil watches))
+               nil watches)
+    nil)

   (-add-watch [this key f]
     (set! watches (check-watches watches (assoc watches key f))))
@@ -258,14 +258,16 @@

   (-check-clean [this]
     (when (== dirtyness maybe-dirty)
-      (set! norun? true)
-      (doseq [w watching]
-        (when (and (instance? Reaction w)
-                   (not (-check-clean w)))
-          (if-some [ar (.-auto-run w)]
-            (ar w)
-            (run w))))
-      (set! norun? false)
+      (let [ar auto-run]
+        ;; TODO: try/catch
+        (set! auto-run nil)
+        (doseq [w watching]
+          (when (and (instance? Reaction w)
+                     (not (-check-clean w)))
+            (if-some [ar (.-auto-run w)]
+              (ar w)
+              (run w))))
+        (set! auto-run ar))
       (when (== dirtyness maybe-dirty)
         (set! dirtyness clean)))
     (== dirtyness clean))
@@ -278,12 +280,12 @@
                       dirty)]
       (when (> new-dirty old-dirty)
         (set! dirtyness new-dirty)
-        (if-some [arun auto-run]
-          (when-not norun?
-            (when-not (and (identical? arun run)
+        (when (== old-dirty clean)
+          (if-some [ar auto-run]
+            (when-not (and (identical? ar run)
                            (-check-clean this))
-              (arun this)))
-          (-notify-watches this state state))))
+              (ar this))
+            (-notify-watches this state state)))))
     nil)

   (-update-watching [this derefed]
@@ -338,7 +340,8 @@
     (set! state nil)
     (set! dirtyness dirty)
     (when (some? on-dispose)
-      (on-dispose)))
+      (on-dispose))
+    nil)

   IEquiv
   (-equiv [o other] (identical? o other))
@@ -357,7 +360,7 @@
         dirty (if (nil? derefed) dirty clean)
         nocache (if (nil? no-cache) false no-cache)
         reaction (Reaction. f nil dirty nil nil
-                            runner on-set on-dispose false nocache)]
+                            runner on-set on-dispose nocache)]
     (when-not (nil? derefed)
       (-update-watching reaction derefed))
     reaction))


remove debug code

remove debug code

--- src/s7p/slave/main.clj
+++ src/s7p/slave/main.clj
@@ -42,7 +42,6 @@
         workers (manage/make-workers ch 1024)
         [command-addr req-addr] args
         ]
-    (log/info "called")
     (with-open [sub (doto (zmq/socket context :sub)
                       (zmq/connect command-addr)
                       (zmq/subscribe ""))


Fix #52 WebDAV mount point revealed in stack trace

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -303,13 +303,20 @@
     (raw-stacktrace->canonical-stacktrace stacktrace build-options))
   repl/IPrintStacktrace
   (-print-stacktrace [_ stacktrace _ build-options]
-    (doseq [{:keys [function file url line column]}
-            (repl/mapped-stacktrace stacktrace build-options)]
-      (let [url (when url (string/trim (.toString url)))
-            file (when file (string/trim (.toString file)))]
-       ((println-fn repl/*repl-opts*)
-        "\t" (str (when function (str function " "))
-               "(" (str (or url file)) (when line (str ":" line)) (when column (str ":" column)) ")")))))
+    (let [source (fn [url file]
+                   (if url
+                     (str url)
+                     (let [file-path (str file)]
+                       (if (.startsWith file-path @webdav-mount-point)
+                         (subs file-path (inc (count @webdav-mount-point)))
+                         file-path))))]
+      (doseq [{:keys [function file url line column]}
+              (repl/mapped-stacktrace stacktrace build-options)]
+        (let [url (when url (string/trim (.toString url)))
+              file (when file (string/trim (.toString file)))]
+          ((println-fn repl/*repl-opts*)
+            "\t" (str (when function (str function " "))
+                      "(" (source url file) (when line (str ":" line)) (when column (str ":" column)) ")"))))))
   repl/IJavaScriptEnv
   (-setup [repl-env opts]
     (setup repl-env opts))


basic user login

basic user login

--- src/greybear/server.clj
+++ src/greybear/server.clj
@@ -1,11 +1,12 @@
 (ns greybear.server
+  (:import org.mindrot.jbcrypt.BCrypt)
   (:require [compojure.route :as route]
             [compojure.handler :as handler])
-  (:use
-        [ring.middleware.session :only [wrap-session]]
+  (:use [ring.middleware.session :only [wrap-session]]
         [hiccup core element page]
         [hiccup.middleware :only [wrap-base-url]]
-        [compojure.core :only [defroutes GET]]
+        [compojure.core :only [defroutes GET POST]]
+        [cemerick.friend.credentials :only [hash-bcrypt bcrypt-verify]]
         [greybear.model :only [read-game]]))

 (defn stones-to-js
@@ -32,7 +33,7 @@
        (javascript-tag (format "goboard.draw(\"goBoard\", %s, 1, function(x, y) {console.log(x, y)}, 18, 17);"
                                (stones-to-js (game :stones))))])}))

-(def login
+(def login-page
   (html5
    [:body
     [:div#login
@@ -41,10 +42,27 @@
               [:div#password (password-field "password")]
               (submit-button "login"))]]))

+(def users
+  {"foo" (hash-bcrypt "bar")})
+
+(defn login
+  [request]
+  (let [creds (get request :params)]
+    (if creds
+      (let [{:keys [username password]} creds]
+        (if (bcrypt-verify password (users username))
+          ;; TODO redirect to where the user came from
+          (-> (redirect-after-post "/")
+              (assoc :session {:user username}))
+          {:body (html5 "Failed authentication.")}))
+      {:body (html5 "no-params")})))
+
 (defroutes main-routes
   (GET "/games/:id" [id :as {session :session}]
        (games-page session (Integer. id)))
-  (GET "/login" [] login)
+  (GET "/login" [] login-page)
+  (POST "/login" request (login request))
+  (GET "/" request (html5 request))
   (route/resources "/")
   (route/not-found "Page not found"))


added heading to classify functions in model, added reimann sum

--- src/hydrofoil/model.clj
+++ src/hydrofoil/model.clj
@@ -2,6 +2,14 @@
   ;;(:require [clojure.algo.generic.math-functions :as trig])
   )

+;;---------------- Utilities ---------------
+(defn round-double
+  "Takes a double and returns a double with four points of accuracy"
+  [n]
+  (double (/ (int (+ (* n 10000) 0.5)) 10000)))
+
+
+;;---------------- NACA Functions ---------------
 (defn thickness-function
   "Take a corrected thickness and returns the function of thickess around the camber line.
   The thickness equation is (T/.2)(a-0x^.5 + a-1x + a-2x^2 + a-3x^3 + a-4x^4)
@@ -18,8 +26,6 @@
               (* a-2 (Math/pow x 2))
               (* a-3 (Math/pow x 3))
               (* a-4 (Math/pow x 4))))))
-
-(thickness-function (hash-map :corrected-thickness 40) 0)

 (defn camber-function
   "Takes in a corrected maxiumum camber, corrected camber position, and an x value.
@@ -49,18 +55,13 @@
       (* (/ (* 2 max-camber) (Math/pow position-camber 2)) (- position-camber x)) ;;; (2M/P^2)(P-x)
       (* (/ (* 2 max-camber) (Math/pow (- 1 position-camber) 2)) (- position-camber x))))) ;;; (2M/(1-P)^2)(P-x)

-(defn round-double
-  "Takes a double and returns a double with four points of accuracy"
-  [n]
-  (double (/ (int (+ (* n 10000) 0.5)) 10000)))
-

 (defn upper-surface-x-function
   "takes an x  and gives an x coordinate on the paremetric upper-surface-x-function
   (theta =  atan(G)), x - thickness-function * sin(theta)."
   [individual x]
   (let [thickness (individual :corrected-thickness)]
-  (- x (* (thickness-function thickness x)
+    (- x (* (thickness-function thickness x)
           (Math/sin (Math/atan (gradient-function individual x)))))))

@@ -69,7 +70,7 @@
   (theta =  atan(G)), x + thickness-function * sin(theta)."
   [individual x]
   (let [thickness (individual :corrected-thickness)]
-  (+ x (* (thickness-function thickness x)
+    (+ x (* (thickness-function thickness x)
           (Math/sin (Math/atan (gradient-function individual x)))))))

@@ -78,7 +79,7 @@
   (theta =  atan(G)), camber-function + thickness-function * cos(theta)."
   [individual x]
   (let [thickness (individual :corrected-thickness)]
-  (+ camber-function (* (thickness-function thickness x)
+    (+ camber-function (* (thickness-function thickness x)
                         (Math/cos (Math/atan (gradient-function individual x)))))))

@@ -87,10 +88,37 @@
   (theta =  atan(G)), camber-function - thickness-function * cos(theta)."
   [individual x]
   (let [thickness (individual :corrected-thickness)]
-  (- camber-function (* (thickness-function thickness x)
+    (- camber-function (* (thickness-function thickness x)
           (Math/cos (Math/atan (gradient-function individual x)))))))

+;;;---------------- Area Functions ---------------

-(defn lift-function
-  []
-  MATH)
+(defn left-rule
+  "Creates a lazy seque of points to evaluate a function at for a left rule riemann sum
+  Takes a number of particians"
+  [pieces]
+  (range 0 1 (/ 1 pieces)))
+
+(defn right-rule
+  "Creates a lazy seque of points to evaluate a function at for a left rule riemann sum
+  Takes a number of particians"
+  [pieces]
+  (range (/ 1 pieces) (+ (/ 1 pieces) 1) (/ 1 pieces)))
+
+(defn riemann-sum-abstracted
+  "Will do a riemann sum on the function:
+  State will be a function, either left, right, or middle, based on the style of riemann sum.
+  Pices is how boxes it makes, aka the resolution of the riemann sum"
+  [function state pieces]
+  (reduce #(+ %1 (* (/ 1 pieces) (function %2))) 0 (state pieces)))
+
+(defn riemann-sum-production
+  "same as riemann sum but if might be faster, you need to figure our left, right, middle
+  functions on your own"
+  [function start-x end-x increment pieces]
+  (reduce #(+ %1 (* (/ 1 pieces) (function %2))) 0 (range start end increment)))
+
+;;(defn lift-function
+;;  [])
+(right-rule 4)
+


Adjusted cl function to pass symetric tests

--- src/hydrofoil/model.clj
+++ src/hydrofoil/model.clj
@@ -201,14 +201,13 @@
 ;;;---------------- Coefficantof lift ----------------
 (defn symetric-coefficient-of-lift
   [individual run-constants]
-  (let [attack-angle (run-constants :angle-of-attack)
+  (let [attack-angle (run-constants :angle-of-attack-radians)
         camber-position (individual :corrected-position-camber)]
-    (* (* 2 (Math/PI))
-       (+ attack-angle (* 2 camber-position)))))
+    (* 2 (Math/PI) attack-angle)))

 (defn cambered-coefficient-of-lift
   [individual run-constants]
-  (let [attack-angle (run-constants :angle-of-attack)
+  (let [attack-angle (run-constants :angle-of-attac-radians)
         theta-switch-constant (theta-switch individual)]
     (- (* 2 (Math/PI))
        (* 2 (+ (integral-production individual gradient-forward-polar-function 0 theta-switch-constant (/ theta-switch-constant 90) 90)
@@ -237,4 +236,4 @@

 ;;(integral-abstracted (hash-map :corrected-max-camber 0 :corrected-position-camber 0 :corrected-thickness 0.45) upper-surface-y-function left-rule 100)

-;(upper-surface-y-function (hash-map :corrected-max-camber 0 :corrected-position-camber 0.5 :corrected-thickness 0.45) 0)
+;;(upper-surface-y-function (hash-map :corrected-max-camber 0 :corrected-position-camber 0.5 :corrected-thickness 0.45) 0)


Update tests

Update tests

--- library/test/clj/test/doo/core.clj
+++ library/test/clj/test/doo/core.clj
@@ -48,7 +48,7 @@
     (are [js-env] (doo/valid-js-env? js-env)
       :rhino :nashorn :slimer :phantom :node
       :chrome :safari :firefox :opera :ie :electron
-      :karma-phantom :karma-slimer))
+      :karma-phantom :karma-slimer :chrome-headless))
   (testing "We can resolve aliases"
     (are [alias js-envs] (= (doo/resolve-alias alias {}) js-envs)
          :phantom [:phantom]


add 'lein run compile' option to only compile all templates

--- src/one_hyde/server.clj
+++ src/one_hyde/server.clj
@@ -22,7 +22,7 @@
 (defn start-watcher
   []
   (watcher
-    [*template*]
+    [*template-dir*]
     (rate 50)
     (file-filter ignore-dotfiles)
     (file-filter (extensions :clj))
@@ -30,8 +30,11 @@

 (defroutes handler (files "/"))

-(defn -main []
-  (let [port (Integer/parseInt (get (System/getenv) "PORT" "8080"))]
-    (start-watcher)
-    (run-jetty handler {:port port})))
+(defn -main [& [option]]
+  (case option
+    "compile" (compile-all-templates)

+    (let [port (Integer/parseInt (get (System/getenv) "PORT" "8080"))]
+      (start-watcher)
+      (run-jetty handler {:port port}))))
+


hotfix

hotfix

--- src/ontrail/formats.clj
+++ src/ontrail/formats.clj
@@ -47,9 +47,9 @@
       (time-format/unparse date-format date-time))))

 (defn seconds-part [seconds hundreds]
-  (if ((and false (> hundreds 0)))
-    (str seconds "," (format "%02d" hundreds) " s")
-    (str seconds " s")))
+;  (if (and false (> hundreds 0)))
+;    (str seconds "," (format "%02d" hundreds) " s")
+    (str seconds " s"))

 (defn minutes-part [minutes seconds]
   (if (> seconds 0)


Inverse function generator for monotone increasing functions

--- src/paulkrake/goals.clj
+++ src/paulkrake/goals.clj
@@ -15,17 +15,19 @@
     (d/cdf (d/poisson-distribution (* 2  1.36) ) (* 2 goals-as-number)) ;; * 2 to smooth the poisson distribution
     ))

+;;(def score-to-goals-fn (p/inverse-fn goals-to-score-fn))
+
 (defn score-to-goals-fn [score]
   (as-> (range -1 100) x
-        (partition 2 1 x)
-        (filter (fn [[a b]]
-                  (and (<= (goals-to-score-fn a) score )
-                       (<= score (goals-to-score-fn b)))) x)
-        (map (fn [[a b]]
-               (+ a (*  (/ (- score (goals-to-score-fn a))
-                           (- (goals-to-score-fn b) (goals-to-score-fn a)))
-                        (- b a)))) x)
-        (first x)))
+    (partition 2 1 x)
+    (filter (fn [[a b]]
+              (and (<= (goals-to-score-fn a) score )
+                   (<= score (goals-to-score-fn b)))) x)
+    (map (fn [[a b]]
+           (+ a (*  (/ (- score (goals-to-score-fn a))
+                       (- (goals-to-score-fn b) (goals-to-score-fn a)))
+                    (- b a)))) x)
+    (first x)))

 (defn new-rating-goals [data games]
   (s/new-rating data games goals-to-score-fn))


update record-buf arg docstring

update record-buf arg docstring

--- src/overtone/sc/machinery/ugen/metadata/buf_io.clj
+++ src/overtone/sc/machinery/ugen/metadata/buf_io.clj
@@ -72,7 +72,7 @@
               {:name "run", :default 1.0 :doc "If zero, then recording stops, otherwise recording proceeds."}
               {:name "loop", :default 1.0 :doc "If zero then don't loop, otherwise do.  This is modulate-able. "}
               {:name "trigger", :default 1.0 :doc "a trigger causes a jump to the offset position in the Buffer. A trigger occurs when a signal changes from <= 0 to > 0."}
-              {:name "action", :default 0}]
+              {:name "action", :default 0 :doc "an integer representing an action to be executed when the buffer is finished playing. This can be used to free the enclosing synth. Action is only evaluated if loop"}]
        :doc "record a stream of values into a buffer. If recLevel is 1.0 and preLevel is 0.0 then the new input overwrites the old data. If they are both 1.0 then the new data is added to the existing data. (Any other settings are also valid.) Note that the number of channels must be fixed for the SynthDef, it cannot vary depending on which buffer you use."}

       {:name "ScopeOut",


clojurify ugen arg-names

clojurify ugen arg-names

--- src/overtone/sc/machinery/ugen/metadata/buf_io.clj
+++ src/overtone/sc/machinery/ugen/metadata/buf_io.clj
@@ -4,11 +4,11 @@
 (def specs
      [
       {:name "PlayBuf",
-       :args [{:name "numChannels" :mode :num-outs :doc "The number of channels that the buffer will be. This must be a fixed integer. The architechture of the SynthDef cannot change after it is compiled. Warning: if you supply a bufnum of a buffer that has a different numChannels then you have specified to the play-buf, it will fail silently."}
+       :args [{:name "num-channels" :mode :num-outs :doc "The number of channels that the buffer will be. This must be a fixed integer. The architechture of the SynthDef cannot change after it is compiled. Warning: if you supply a bufnum of a buffer that has a different numChannels then you have specified to the play-buf, it will fail silently."}
               {:name "bufnum", :default 0 :doc "The index of the buffer to use."}
               {:name "rate", :default 1.0 :doc "1.0 is the server's sample rate, 2.0 is one octave up, 0.5 is one octave down -1.0 is backwards normal rate ... etc. Interpolation is cubic. Note:  if the buffer's sample rate is different from the server's, you will need to multiply the desired playback rate by (file's rate / server's rate). The UGen (buf-rate-scale bufnum) returns this factor."}
               {:name "trigger", :default 1.0 :doc "A trigger causes a jump to the startPos. A trigger occurs when a signal changes from <= 0 to > 0."}
-              {:name "startPos", :default 0.0 :doc "Sample frame to start playback."}
+              {:name "start-pos", :default 0.0 :doc "Sample frame to start playback."}
               {:name "loop", :default 0.0 :doc "1 means true, 0 means false. This is modulateable."}
               {:name "action", :default 0}]
        :doc "Plays back a sample resident in a buffer"}
@@ -16,11 +16,11 @@

       {:name "TGrains",
-       :args [{:name "numChannels" :mode :num-outs :default 2 :doc "number of output channels"}
+       :args [{:name "num-channels" :mode :num-outs :default 2 :doc "number of output channels"}
               {:name "trigger", :default 0 :doc "at each trigger, the following arguments are sampled and used as the arguments of a new grain. A trigger occurs when a signal changes from <= 0 to > 0. If the trigger is audio rate then the grains will start with sample accuracy."}
               {:name "bufnum", :default 0 :doc "the index of the buffer to use. It must be a one channel (mono) buffer."}
               {:name "rate", :default 1 :doc "1.0 is normal, 2.0 is one octave up, 0.5 is one octave down -1.0 is backwards normal rate. Unlike PlayBuf, the rate is multiplied by BufRate, so you needn't do that yourself."}
-              {:name "centerPos", :default 0 :doc "the position in the buffer in seconds at which the grain envelope will reach maximum amplitude."}
+              {:name "center-pos", :default 0 :doc "the position in the buffer in seconds at which the grain envelope will reach maximum amplitude."}
               {:name "dur", :default 0.1 :doc "duration of the grain in seconds"}
               {:name "pan", :default 0.0 :doc "a value from -1 to 1. Determines where to pan the output in the same manner as PanAz."}
               {:name "amp", :default 0.1 :doc "amplitude of the grain."}
@@ -56,7 +56,7 @@
        :doc "reads the contents of a buffer at a given index."}

       {:name "BufWr",
-       :args [{:name "inputArray", :mode :append-sequence :doc "input ugens (channelArray)"}
+       :args [{:name "input-array", :mode :append-sequence :doc "input ugens (channelArray)"}
               {:name "bufnum", :default 0 :doc "the index of the buffer to use"}
               {:name "phase", :default 0.0 :doc "modulatable index into the buffer (has to be audio rate)."}
               {:name "loop", :default 1.0 :doc "1 means true, 0 means false.  This is modulatable"}]
@@ -64,7 +64,7 @@
        :doc "writes to a buffer at a given index. Note, buf-wr (in difference to buf-rd) does not do multichannel expansion, because input is an array."}

       {:name "RecordBuf",
-       :args [{:name "inputArray", :mode :append-sequence :doc "an Array of input channels"}
+       :args [{:name "input-array", :mode :append-sequence :doc "an Array of input channels"}
               {:name "bufnum", :default 0 :doc "the index of the buffer to use"}
               {:name "offset", :default 0.0 :doc "an offset into the buffer in frames,"}
               {:name "rec-level", :default 1.0 :doc "value to multiply by input before mixing with existing data."}
@@ -72,11 +72,11 @@
               {:name "run", :default 1.0 :doc "If zero, then recording stops, otherwise recording proceeds."}
               {:name "loop", :default 1.0 :doc "If zero then don't loop, otherwise do.  This is modulate-able. "}
               {:name "trigger", :default 1.0 :doc "a trigger causes a jump to the offset position in the Buffer. A trigger occurs when a signal changes from <= 0 to > 0."}
-              {:name "action", :default 0 :doc "an integer representing an action to be executed when the buffer is finished playing. This can be used to free the enclosing synth. Action is only evaluated if loop"}]
+              {:name "action", :default 0 :doc "an integer representing an action to be executed when the buffer is finished playing. This can be used to free the enclosing synth. Action is only evaluated if loop is 0"}]
        :doc "record a stream of values into a buffer. If recLevel is 1.0 and preLevel is 0.0 then the new input overwrites the old data. If they are both 1.0 then the new data is added to the existing data. (Any other settings are also valid.) Note that the number of channels must be fixed for the SynthDef, it cannot vary depending on which buffer you use."}

       {:name "ScopeOut",
-       :args [{:name "inputArray", :mode :append-sequence}
+       :args [{:name "input-array", :mode :append-sequence}
               {:name "bufnum", :default 0.0}],
        :rates #{:ar}
        :num-outs 0}
@@ -120,8 +120,8 @@
       ;; }

       {:name "LocalBuf"
-       :args [{:name "numFrames" :default 1}
-              {:name "numChannels" :mode :num-outs :default 1}]}
+       :args [{:name "num-frames" :default 1}
+              {:name "num-channels" :mode :num-outs :default 1}]}

       ;; MaxLocalBufs : UGen {
       ;; 	*new {


[#12599] Clicking on 3 word user name does nothing

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

--- src/status_im/ui/screens/chat/toolbar_content.cljs
+++ src/status_im/ui/screens/chat/toolbar_content.cljs
@@ -44,7 +44,8 @@
                      :number-of-lines     1
                      :accessibility-label :chat-name-text}
          chat-name]
-        [one-to-one-name chat-id])
+        [react/touchable-highlight {:on-press #(re-frame/dispatch [:chat.ui/show-profile chat-id])}
+         [one-to-one-name chat-id]])
       (when-not group-chat
         [contact-indicator chat-id])
       (when (and group-chat (not invitation-admin) (not= chat-type constants/community-chat-type))


reduce touching area for Privacy Policy link

--- src/status_im/ui/screens/privacy_policy/views.cljs
+++ src/status_im/ui/screens/privacy_policy/views.cljs
@@ -5,11 +5,10 @@
             [re-frame.core :as re-frame]))

 (defn privacy-policy-button []
-  [react/touchable-highlight
-   {:on-press #(re-frame/dispatch [:privacy-policy/privacy-policy-button-pressed])}
-   [react/view styles/privacy-policy-button-container
-    [react/text {:style styles/privacy-policy-button-text-gray}
-     (i18n/label :t/agree-by-continuing)
-     [react/text
-      {:style styles/privacy-policy-button-text}
-      (i18n/label :t/privacy-policy)]]]])
+  [react/view styles/privacy-policy-button-container
+   [react/text {:style    styles/privacy-policy-button-text-gray
+                :on-press #(re-frame/dispatch [:privacy-policy/privacy-policy-button-pressed])}
+    (i18n/label :t/agree-by-continuing)
+    [react/text
+     {:style styles/privacy-policy-button-text}
+     (i18n/label :t/privacy-policy)]]])


Bugfix: On-screen keyboard should not trig on modifiers or input fields

--- src/alder/ui/components/screen_keyboard.cljs
+++ src/alder/ui/components/screen_keyboard.cljs
@@ -30,7 +30,12 @@
                {:data [0x80 index 0x00]}))

             (on-key-down [e]
-              (when-not (.-repeat e)
+              (when-not (or (.-altKey e)
+                            (.-ctrlKey e)
+                            (.-metaKey e)
+                            (.-shiftKey e)
+                            (.-repeat e)
+                            (not= (.toLowerCase (.-tagName (.-target e))) "body"))
                 (when-let [index (key-name->index (om/get-state owner :root-note)
                                                   (char (.-keyCode e)))]
                   (on-key-mouse-down index e))))


refactored track to be agnostic to whether you have the owner or a current-state

--- src-cljs/frontend/analytics/core.cljs
+++ src-cljs/frontend/analytics/core.cljs
@@ -20,16 +20,12 @@
 (def AnalyticsEvent
   (merge
     CoreAnalyticsEvent
-    {:owner s/Any}))
-
-(def AnalyticsEventForControllers
-  (merge
-    CoreAnalyticsEvent
-    {:current-state {s/Any s/Any}}))
+    (s/either {:owner s/Any}
+              {:current-state {s/Any s/Any}})))

 (def PageviewEvent
   (merge
-    AnalyticsEventForControllers
+    AnalyticsEvent
     {:navigation-point s/Keyword}))

 (def ExternalClickEvent
@@ -39,7 +35,7 @@

 (def BuildEvent
   (merge
-    AnalyticsEventForControllers
+    AnalyticsEvent
     {:build {s/Keyword s/Any}}))

 ;; Below are the lists of our supported events.
@@ -137,20 +133,25 @@
 (defmulti track (fn [data]
                   (when (frontend.config/analytics-enabled?)
                     (cond
-                      (supported-click-and-impression-events (:event-type data)) :track-click-and-impression-event
-                      (supported-controller-events (:event-type data)) :track-controller-events
-                      :else (:event-type data)))))
+                      (or (supported-click-and-impression-events (:event-type data))
+                          (supported-controller-events (:event-type data)))
+                      :event
+
+                      :else
+                      (:event-type data)))))

 (defmethod track :default [data]
   (when (frontend.config/analytics-enabled?)
     (merror-unsupported-event (:event-type data))))

-(s/defmethod track :track-click-and-impression-event [event-data :- AnalyticsEvent]
-  (let [{:keys [event-type properties owner]} event-data]
-    (segment/track-event event-type (supplement-tracking-properties-from-owner properties owner))))
+(s/defmethod track :event [event-data :- AnalyticsEvent]
+  (let [{:keys [event-type properties owner current-state]} event-data]
+    (if owner
+      (segment/track-event event-type (supplement-tracking-properties-from-owner properties owner))
+      (segment/track-event event-type (supplement-tracking-properties-from-state properties current-state)))))

 ;; Gotta finish this + add schema event
-(s/defmethod track :track-controller-events [event-data :- AnalyticsEventForControllers]
+(s/defmethod track :track-controller-events [event-data :- AnalyticsEvent]
   (let [{:keys [event-type properties current-state]} event-data]
     (segment/track-event event-type (supplement-tracking-properties-from-state properties current-state))))

@@ -182,5 +183,5 @@
                       {:vcs-url (vcs-url/project-name (:vcs_url build))
                        :outcome (:outcome build)}))))

-(s/defmethod track :init-user [event-data :- AnalyticsEventForControllers]
+(s/defmethod track :init-user [event-data :- AnalyticsEvent]
   (segment/identify (get-user-properties-from-state (:current-state event-data))))


log the command used to launch workers

log the command used to launch workers

--- src/clj/backtype/storm/daemon/supervisor.clj
+++ src/clj/backtype/storm/daemon/supervisor.clj
@@ -374,6 +374,7 @@
                        " -Dlog4j.configuration=storm.log.properties"
                        " -cp " classpath " backtype.storm.daemon.worker "
                        storm-id " " supervisor-id " " port " " worker-id)]
+      (log-message "Launching worker with command: " command)
       (launch-process command)
       ))


new features

new features

--- src/clojure/zensols/nlparse/feature/char.clj
+++ src/clojure/zensols/nlparse/feature/char.clj
@@ -2,13 +2,20 @@
       :author "Paul Landes"}
     zensols.nlparse.feature.char
   (:import com.zensols.util.StringUtils)
-  (:require [clojure.string :as s])
+  (:require [clojure.string :as s]
+            [clojure.set :refer (union)])
   (:require [clojure.core.matrix.stats :as stat])
   (:require [zensols.nlparse.locale :as lc]))
+
+(defn- divide-by-zero-or-neg [a b]
+  (if (= 0 b)
+    -1
+    (/ a b)))

 ;; (longest) repeating characters
 (defn- lrs-unique-feature-metas [unique-idx]
   [[(keyword (format "lrs-occurs-%d" unique-idx)) 'numeric]
+   [(keyword (format "lrs-occurs-ratio-%d" unique-idx)) 'numeric]
    [(keyword (format "lrs-length-%d" unique-idx)) 'numeric]])

 (defn lrs-feature-metas
@@ -81,7 +88,8 @@
                                  {:lrs-len length
                                   :lrs-unique-chars unique}))
                           first)
-        rng (range 1 (inc unique-char-repeats))]
+        rng (range 1 (inc unique-char-repeats))
+        text-len (count text)]
     ;(clojure.pprint/pprint reps)
     (->> rng
          (map (fn [ucr]
@@ -91,10 +99,14 @@
               rng)
          (map (fn [{:keys [length occurs unique]}]
                 (zipmap (map first (lrs-unique-feature-metas unique))
-                        [(or occurs -1) (or length -1)])))
+                        [(or occurs -1)
+                         (if occurs
+                           (/ occurs text-len)
+                           -1)
+                         (or length -1)])))
          (apply merge lrs-features))))

-;; chararcter distribution
+;; character distribution
 (defn char-dist-feature-metas
   "See [[char-dist-features]]."
   []
@@ -116,13 +128,53 @@
   (let [char-dist (->> (StringUtils/uniqueCharCounts text) vals)
         len (count text)]
    {:char-dist-unique (count char-dist)
-    :char-dist-unique-ratio (if (= len 0) -1 (/ (count char-dist) len))
+    :char-dist-unique-ratio (divide-by-zero-or-neg (count char-dist) len)
     :char-dist-count len
     :char-dist-variance (if (= len 0) -1 (->> char-dist stat/variance))
     :char-dist-mean (if (= len 0) -1 (->> char-dist stat/mean))}))

+;; punctuation
+(def punctuation
+  "Natural language punctuation and several languages."
+  (set ".!¿?,:;"))
+
+(def latin-non-alpha-numeric
+  "Latin character set but not alpha numeric"
+  (union punctuation (set "~@#$%^&*(){}[]<>|\\/-+_")))
+
+(defn punctuation-features
+  "Return the following features from **text**:
+
+   * **:punctuation-count** the count of [[punctuation]
+   * **:punctuation-ratio** the ratio of count of [[punctuation]] to the length
+   * **:latin-non-alpha-numeric-count** like **:punctuation-count**but with [[latin-non-alpha-numeric]]
+   * **:latin-non-alpha-numeric-ratio** like **:punctuation-ratio**but with [[latin-non-alpha-numeric]]"
+  [text]
+  (let [feats (reduce (fn [{:keys [punc latin-nan]} char]
+                        {:punc (+ punc (if (contains? punctuation char) 1 0))
+                         :latin-nan (+ latin-nan
+                                       (if (contains? latin-non-alpha-numeric char)
+                                         1 0))})
+                      {:punc 0 :latin-nan 0}
+                      text)
+        len (count text)]
+    {:punctuation-count (:punc feats)
+     :punctuation-ratio (divide-by-zero-or-neg (:punc feats) len)
+     :latin-non-alpha-numeric-count (:latin-nan feats)
+     :latin-non-alpha-numeric-ratio (divide-by-zero-or-neg (:latin-nan feats) len)}))
+
+(defn punctuation-metas
+  "See [[punctuation-features]]."
+  []
+  [[:punctuation-count 'numeric]
+   [:punctuation-ratio 'numeric]
+   [:latin-non-alpha-numeric-count 'numeric]
+   [:latin-non-alpha-numeric-ratio 'numeric]])
+
+

+;; unicode
 (defn- unicode-variance [text ucounts]
  (let [total (count text)]
    (->> ucounts


Perform garbage collection at startup

Perform garbage collection at startup

This simply re-orders the sleep vs the garbage collection in
the garbage collection thread.

--- src/com/puppetlabs/puppetdb/cli/services.clj
+++ src/com/puppetlabs/puppetdb/cli/services.clj
@@ -98,11 +98,11 @@
    (fn [exception]
      (log/error exception "Error during DB compaction"))

-   (Thread/sleep (* 60 1000 interval))
    (log/info "Beginning database compaction")
    (with-transacted-connection db
      (scf-store/garbage-collect!)
-     (log/info "Finished database compaction"))))
+     (log/info "Finished database compaction"))
+   (Thread/sleep (* 60 1000 interval))))

 (defn configure-commandproc-threads
   "Update the supplied config map with the number of


Fixed Concept Approximation Exploration

Fixed Concept Approximation Exploration

which did not use the keyword arguments correctly.

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

--- src/conexp/contrib/concept_approximation.clj
+++ src/conexp/contrib/concept_approximation.clj
@@ -15,14 +15,14 @@

 (defn- apprx-handler
   "Special handler for concept approximation exploration."
-  [ctx new-impl new-objs new-handler]
-  (when-let [counterexamples (default-handler ctx new-impl)]
-    (doseq [[new-att new-att-objs] counterexamples]
+  [ctx new-impl new-objs cross-handler]
+  (let [counterexamples (default-handler ctx new-impl)]
+    (doseq [new-att (map first counterexamples)]
       (let [att-objs (ask (str "Which of the objs " new-objs " definitively has the attribute " new-att "? ")
                           #(read-string (str "#{" (read-line) "}"))
                           #(subset? % new-objs)
                           "Please enter only objects mentioned: ")]
-        (new-handler (map #(vector % new-att) att-objs))))
+        (cross-handler (map #(vector % new-att) att-objs))))
     counterexamples))

 (defn explore-approximations
@@ -42,8 +42,7 @@
         obj-explored-ctx (dual-context
                           (:context (explore-attributes
                                      (dual-context context)
-                                     #{}
-                                     handler)))]
+                                     :handler handler)))]
     (context-subposition
      (context-apposition context obj-explored-ctx)
      (context-apposition att-explored-ctx


Implement size-limited crossover. Fixes #7.

--- src/algebolic/expression/genetics.clj
+++ src/algebolic/expression/genetics.clj
@@ -102,4 +102,22 @@
                   (tree/random-nonterminal-index expr2))
         subtree1 (tree/sub-tree expr1 target1)
         subtree2 (tree/sub-tree expr2 target2)]
-    [(tree/tree-replace expr1 target1 subtree2) (tree/tree-replace expr2 target2 subtree1)]))+    [(tree/tree-replace expr1 target1 subtree2) (tree/tree-replace expr2 target2 subtree1)]))
+
+;; TODO: this could conceivably be a generic function in algebolic.evolution.reproduction
+(defn size-limited-crossover
+  "Takes a crossover operation and makes a size-limited version of it. If a product is larger
+  than the size limit then it is replaced with the corresponding parent. Note that this will
+  result in expressions over the size limit being locked out of crossover. So long as there is
+  some mutation in the system that can reduce the size, then this should not be a problem."
+  [max-size crossover-func expr1 expr2]
+  (let [crossover-result (crossover-func expr1 expr2)
+        new-expr1 (first crossover-result)
+        new-expr2 (second crossover-result)]
+    [(if (> (tree/count-nodes new-expr1) max-size) expr1 new-expr1)
+     (if (> (tree/count-nodes new-expr2) max-size) expr2 new-expr2)]))
+
+(defn ninety-ten-sl-crossover
+  "A helper for making a size-limited 90:10 crossover, which you'll probably want to use."
+  [max-size]
+  (partial size-limited-crossover max-size ninety-ten-crossover))


Resolve source name and word class name in DB interface

--- src/zg/db_interface.clj
+++ src/zg/db_interface.clj
@@ -141,10 +141,27 @@
     (try
         (if dictionary-type
             (jdbc/query db-spec/zg-db
-                ["select * from dictionary where dictionary=? order by word"
+                ["select word, description,
+                    class,
+                    source,
+                    (select class from classes where classes.id=dictionary.class) as class_name,
+                    use, incorrect_forms, correct_forms, see_also, internal, verified, copyrighted,
+                    (select source from sources where sources.id=dictionary.source-1) as source_name,
+                    (select product from products where products.id=dictionary.product) as product
+                  from dictionary
+                  where dictionary=?
+                  order by word"
                     (dictionary-type->char dictionary-type)])
             (jdbc/query db-spec/zg-db
-                ["select * from dictionary order by word"]))
+                ["select word, description,
+                    class,
+                    source,
+                    (select class from classes where classes.id=dictionary.class) as class_name,
+                    use, incorrect_forms, correct_forms, see_also, internal, verified, copyrighted,
+                    (select source from sources where sources.id=dictionary.source-1) as source_name,
+                    (select product from products where products.id=dictionary.product) as product
+                 from dictionary
+                    order by word"]))
         (catch Exception e
             (log/error e "read all words")
             [])))


Try marking java files as a "resource"

Try marking java files as a "resource"

The previous version couldn't find them after I tried to reference
from clojars. This was the first solution that came to mind.

--- build.boot
+++ build.boot
@@ -3,7 +3,7 @@

 ;; TODO: Add a dependency on weald and refactor away the local copy
 ;; of shared.logging.
-(set-env! :resource-paths #{"src/clojure"}
+(set-env! :resource-paths #{"src/clojure" "src/java"}
           :dependencies '[[adzerk/bootlaces "0.1.13" :scope "test"]
                           [adzerk/boot-test "RELEASE" :scope "test"]
                           ;; Stick with whichever version of netty this inherits.
@@ -32,7 +32,7 @@
                           ;; (sadly, it isn't a straight copy/paste)
                           [samestep/boot-refresh "0.1.0" :scope "test" :exclusions [org.clojure/clojure]]
                           [tolitius/boot-check "0.1.11" :scope "test" :exclusions [org.clojure/clojure]]]
-          :source-paths   #{"src/java"})
+          :source-paths   #{#_"src/java"})

 (task-options!
  aot {:namespace   #{'frereth-cp.server 'frereth-cp.client}}


-c/--class-name option for boot test task

--- build.boot
+++ build.boot
@@ -50,9 +50,11 @@

 (deftask test
   "Compile and run jUnit tests."
-  []
-  (comp (javac)
-        (junit :listeners #{"alda.testutils.AldaJunitRunListener"})))
+  [c class-names CLASSNAME #{str} "The set of Java class names to run tests from."]
+  (comp
+    (javac)
+    (junit :listeners   #{"alda.testutils.AldaJunitRunListener"}
+           :class-names class-names)))

 (deftask dev
   "Runs the Alda client for development.


Add the notify task

Add the notify task

--- build.boot
+++ build.boot
@@ -1,10 +1,12 @@
 (set-env!
  :source-paths #{"src"}
- :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]])
+ :dependencies '[[radicalzephyr/boot-junit "0.1.0" :scope "test"]
+                 [jeluard/boot-notify "0.1.2"      :scope "test"]])

 (def +version+ "0.1.0-SNAPSHOT")

-(require '[radicalzephyr.boot-junit :refer [junit]])
+(require '[radicalzephyr.boot-junit :refer [junit]]
+         '[jeluard.boot-notify      :refer [notify]])

 (task-options!
  pom {:project 'http-server


WIP refactor transactions/update

WIP refactor transactions/update

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -185,7 +185,7 @@
                                           {:transaction-id id
                                            :transaction-date transaction-date}
                                           {:sort [[:action :desc] [:amount :desc]]})
-                (map after-item-read)))))
+                (mapv after-item-read)))))

 (defn- append-lot-items
   [transaction storage]
@@ -696,7 +696,18 @@
     (let [validated (validate storage ::existing-transaction transaction)]
       (if (validation/has-error? validated)
         validated
-        (let [dereferenced-base-items (process-removals
+        (let [existing (find-by-id storage (:id validation) (:transaction-date validated))
+              dereferenced-items (remove (fn [{validated-item-id :id}]
+                                           (some #(= validated-item-id
+                                                     (:id existing-item))
+                                                 (:items validated)))
+                                         (:items existing))
+              dereferenced-base-items (map #())
+              updated (update-transaction storage validated)
+              ])
+        )
+
+        #_(let [dereferenced-base-items (process-removals
                                         storage
                                         validated)
               upserted-items (->> (:items validated)
@@ -712,7 +723,7 @@
                                     (concat upserted-items
                                             dereferenced-base-items)
                                     (:transaction-date validated))
-          (reload storage validated))))))
+          (reload storage validated)))))

 (defn- get-preceding-items
   "Returns the items that precede each item in the


Fix viewport id in styles

Fix viewport id in styles

--- src/gol/react/components/viewport/styles.clj
+++ src/gol/react/components/viewport/styles.clj
@@ -7,7 +7,7 @@
 (def cell-size 20)

 (defstyles styles
-  [:#app {:display        "table-cell"
+  [:#viewport {:display        "table-cell"
           :vertical-align "middle"
           :text-align     "center"
           :float          :left}]


Simplify format determination

Simplify format determination

The re-find and the map lookup were basically doing the same thing. So
only do map lookup now.

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -257,14 +257,6 @@
       trim-punctuation
       normalize-name))

-(defn get-format
-  "Find the given format for a string `s`. If the string doesn't
-  correspond to any of BR, DVD, DY, ER, GD, LU, MN or TB return nil"
-   [s]
-  (->> s
-   (re-find #"^(?:BR|DVD|DY|ER|GD|LU|MN|TB)$")
-   format-raw-to-format))
-
 (defn get-accompanying-material
   "Get the accompanying material for `item`. Use
   `accompanying-material` and `accompanying-material-legacy`. If
@@ -296,7 +288,7 @@
            braille-music-grade ismn] :as raw-item
     :or {genre "" ; an invalid genre
          genre-code ""}}] ; an invalid genre-code
-  (let [fmt (get-format format)
+  (let [fmt (format-raw-to-format format)
         ;; tactile books aren't properly tagged in the format field.
         ;; They are tagged as :ludo and their library signature starts
         ;; with "TB"


logging uncaught errors

logging uncaught errors

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -127,7 +127,9 @@
   (fn [req]
     (try
       (app req)
-      (catch Throwable e {:body (.getMessage e) :status 500}))))
+      (catch Throwable e
+        (error e)
+        {:body (<< "Unexpected error ~(.getMessage e) of type ~(class e) contact celestial admin for more info") :status 500}))))

 (defn force-https [rs]
   (binding [friend/*default-scheme-ports* {:http (get! :celestial :port) :https (get! :celestial :https-port)}]


Update quil version

Update quil version

--- src/clojure/leiningen/new/graphics_clojure/project.clj
+++ src/clojure/leiningen/new/graphics_clojure/project.clj
@@ -2,5 +2,5 @@
   :description "FIXME: write description"
   :url "http://example.com/FIXME"
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [quil "2.2.0"]]
+                 [quil "2.2.1"]]
   :main {{namespace}})


Fix CSS reloading.

Fix CSS reloading.

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -280,12 +280,13 @@
   (install-om debug-state (find-app-container (find-top-level-node)) (:comms @debug-state)))

 (defn refresh-css! []
-  (let [is-app-css? #(re-matches #"/assets/css/app.*?\.css(?:\.less)?" (dommy/attr % :href))
-        old-link (->> (sel [:head :link])
-                      (filter is-app-css?)
-                      first)]
-        (dommy/append! (sel1 :head) [:link {:rel "stylesheet" :href "/assets/css/app.css"}])
-        (dommy/remove! old-link)))
+  (let [is-app-css? (fn [elem]
+                      (let [href (inspect (dommy/attr elem :href))]
+                         (re-find #"/assets/css/app.*?\.css(?:\.less)?" href)))
+        potential-links (sel [:head :link])
+        old-links (filter is-app-css? potential-links)]
+        (dommy/append! (sel1 :head) [:link {:rel "stylesheet" :href (str "/assets/css/app.css?t=" (.getTime (js/Date.)))}])
+        (map #(dommy/remove! %) old-links)))

 (defn update-ui! []
   (reinstall-om!)


Intertype declarations, the members they declare and the types to which they are added.

--- EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
+++ EkekoAspectJ/src/damp/ekeko/aspectj/weaverworld.clj
@@ -15,8 +15,9 @@
        [org.aspectj.weaver.patterns Declare DeclarePrecedence]
        [damp.ekeko EkekoModel]
        [damp.ekeko.aspectj AspectJProjectModel]
-       [org.aspectj.weaver World]
-       [org.aspectj.asm IProgramElement IProgramElement$Kind]))
+       [org.aspectj.weaver World ResolvedTypeMunger ConcreteTypeMunger UnresolvedType ResolvedType  Member]
+       [org.aspectj.asm AsmManager IProgramElement IProgramElement$Kind IHierarchy ]
+       [org.aspectj.weaver.bcel BcelTypeMunger]))

 ;(set! *warn-on-reflection* true)
@@ -212,21 +213,22 @@

 ;; Advice

+(defn
+  aspect-advice
+  "Relation between an aspect and one of the advices it declares."
+  [?aspect ?advice]
+  (fresh [?members]
+         (aspect-crosscuttingmembers ?aspect ?members)
+         (contains (.getShadowMungers ?members) ?advice)))
+
+; Prefer the above because going through the CrosscuttingMembersSet has proven more reliable for intertype declarations
 ;(defn
 ;  aspect-advice
 ;  "Relation between an aspect and one of the advices it declares."
 ;  [?aspect ?advice]
-;  (fresh [?members]
-;         (aspect-crosscuttingmembers ?aspect ?members)
-;         (contains (.getShadowMungers ?members) ?advice)))
-
-(defn
-  aspect-advice
-  "Relation between an aspect and one of the advices it declares."
-  [?aspect ?advice]
-  (all
-    (aspect ?aspect)
-    (contains (.getDeclaredAdvice ?aspect) ?advice)))
+;  (all
+;    (aspect ?aspect)
+;    (contains (.getDeclaredAdvice ?aspect) ?advice)))

 (defn
   advice
@@ -254,7 +256,115 @@
     (equals ?handle
             (AsmRelationshipProvider/getHandle  (-> ?aspect .getWorld .getModel) ?advice))))

-
+
+;; Intertype declarations
+
+;Only returned one ITD of XCutTest
+;(defn
+;  aspect-intertype
+; "Relation between an aspect and one of its intertype declarations."
+; [?aspect ?intertype]
+;  (all
+;    (aspect ?aspect)
+;    (contains (.getInterTypeMungers ?aspect) ?intertype)))
+
+
+
+(defn
+  aspect-intertype
+  "Relation between an aspect and one of its intertype declarations (a ConcreteTypeMunger)."
+  [?aspect ?intertype]
+  (fresh [?members]
+    (aspect-crosscuttingmembers ?aspect ?members)
+    (contains (.getTypeMungers ?members) ?intertype)))
+
+
+(defn
+  intertype
+  [?intertype]
+  "Relation of intertype declarations."
+  (conda
+    [(v+ ?intertype)
+     (succeeds (instance? ConcreteTypeMunger ?intertype))]
+    [(v- ?intertype)
+     (fresh [?aspect]
+         (aspect-intertype ?aspect ?intertype))]))
+
+;note: ConcreteTypeMunger.getMunger returns a ResolvedTypeMunger (from a previous weaving stage)
+
+(defn
+  intertype-kind
+  "Relation between an intertype declaration and its kind."
+  [?intertype ?kind]
+  (all
+    (intertype ?intertype)
+    (equals ?kind (-> ?intertype .getMunger .getKind))))
+
+(defn
+  intertype-field
+  "Relation of field intertype declarations."
+  [?intertype]
+  (fresh [?kind]
+         (intertype-kind ?intertype ?kind)
+         (equals ?kind (ResolvedTypeMunger/Field))))
+
+(defn
+  intertype-method
+  "Relation of method intertype declarations."
+  [?intertype]
+  (fresh [?kind]
+         (intertype-kind ?intertype ?kind)
+         (equals ?kind (ResolvedTypeMunger/Method))))
+
+(defn
+  intertype-constructor
+  "Relation of constructor intertype declarations."
+  [?intertype]
+  (fresh [?kind]
+         (intertype-kind ?intertype ?kind)
+         (equals ?kind (ResolvedTypeMunger/Constructor))))
+
+
+(defn
+  intertype-member-type
+  "Relation between an intertype declaration, the field/method/constructor member it declares
+  (a ResolvedMemberImpl), and the type to which this member is added (a ResolvedType). "
+  [?intertype ?member ?type]
+  (fresh [?unresolved]
+    (intertype ?intertype)
+    (equals ?member (.getSignature ?intertype))
+    (equals ?unresolved (.getDeclaringType ?member))
+    (equals ?type (.resolve ?unresolved (.getWorld ?intertype)))))
+
+
+;; implemented in this manner because I don't know how to create a handle for a ConcreteTypeMunger / ResolvedMemberImpl
+;; AsmRelationShipProviver.createIntertypeDeclaredChild(AsmManager model, ResolvedType aspect, BcelTypeMunger itd) {
+(defn
+  intertype-element
+  "Relation between an intertype declaration and its resulting member element (a ProgramElement)
+   in the program element hierarchy.
+   These are of the same type as the shadows we return for an advice.
+
+   Prefer to use the above intertype-type-member instead, as it does not escape the weaver world."
+  [?intertype ?member]
+  (fresh [?equivalentmember ?signaturestring]
+         (intertype ?intertype)
+         (equals
+           ?equivalentmember
+           (interop/call-invisible-method
+             AsmRelationshipProvider
+             'createIntertypeDeclaredChild
+             [AsmManager ResolvedType BcelTypeMunger]
+             nil
+             (-> ?intertype .getWorld .getModel)
+             (-> ?intertype .getAspectType)
+             ?intertype))
+         (equals ?signaturestring (.toSignatureString ?equivalentmember))
+         (element-signature ?member ?signaturestring)))
+
+
+
+
 ;; Pointcuts

 (defn
@@ -503,6 +613,20 @@
                       (!= ?advice1 ?advice2))

+
+  (damp.ekeko/ekeko* [?aspect ?intertype] (aspect-intertype ?aspect ?intertype))
+
+  (damp.ekeko/ekeko* [?intertype ?member ?type] (intertype-member-type ?intertype ?member))
+
+  ;;intertype declarations that add a member to an aspect
+
+  (damp.ekeko/ekeko* [?declaringaspect ?intertype ?member ?targetaspect]
+                     (aspect-intertype ?declaringaspect ?intertype)
+                     (intertype-member-type ?intertype ?member ?targetaspect)
+                     (aspect ?targetaspect))
+
+
+
   )


optimize case keyword mode - emit case* over the fully qualified keyword name

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -1170,10 +1170,13 @@
         `(let [~esym ~e] (case* ~esym ~tests ~thens ~default)))

       (every? core/keyword? tests)
-      `(let [~esym ~e]
-         (cond
-           ~@(mapcat (fn [[m c]] `((cljs.core/keyword-identical? ~m ~esym) ~c)) pairs)
-           :else ~default))
+      (let [tests (->> tests
+                       (map #(.substring (core/str %) 1))
+                       vec
+                       (mapv #(if (seq? %) (vec %) [%])))
+            thens (vec (vals pairs))]
+        `(let [~esym (if (keyword? ~e) (.-fqn ~e) ~default)]
+           (case* ~esym ~tests ~thens ~default)))

       ;; equality
       :else


inline list & hash-set

inline list & hash-set

--- src/clj/cljs/core.clj
+++ src/clj/cljs/core.clj
@@ -16,7 +16,7 @@
                             when when-first when-let when-not while with-bindings with-in-str
                             with-loading-context with-local-vars with-open with-out-str with-precision with-redefs
                             satisfies? identical? true? false? number? nil? instance? symbol? keyword? string? str get
-                            make-array vector
+                            make-array vector list hash-map array-map hash-set

                             aget aset
                             + - * / < <= > >= == zero? pos? neg? inc dec max min mod
@@ -78,14 +78,14 @@
                            (if (seq bs)
                              (core/let [firstb (first bs)]
                                (cond
-                                 (= firstb '&) (recur (pb ret (second bs) (list `nthnext gvec n))
+                                 (= firstb '&) (recur (pb ret (second bs) (core/list `nthnext gvec n))
                                                       n
                                                       (nnext bs)
                                                       true)
                                  (= firstb :as) (pb ret (second bs) gvec)
                                  :else (if seen-rest?
                                          (throw (new Exception "Unsupported binding form, only :as can follow & parameter"))
-                                         (recur (pb ret firstb  (list `nth gvec n nil))
+                                         (recur (pb ret firstb (core/list `nth gvec n nil))
                                                 (core/inc n)
                                                 (next bs)
                                                 seen-rest?))))
@@ -95,7 +95,7 @@
                        (core/let [gmap (gensym "map__")
                                   defaults (:or b)]
                          (core/loop [ret (-> bvec (conj gmap) (conj v)
-                                             (conj gmap) (conj `(if (seq? ~gmap) (apply hash-map ~gmap) ~gmap))
+                                             (conj gmap) (conj `(if (seq? ~gmap) (apply core/hash-map ~gmap) ~gmap))
                                              ((fn [ret]
                                                 (if (:as b)
                                                   (conj ret (:as b) gmap)
@@ -106,14 +106,14 @@
                                                     (dissoc bes (key entry))
                                                     ((key entry) bes)))
                                           (dissoc b :as :or)
-                                          {:keys #(keyword (core/str %)), :strs core/str, :syms #(list `quote %)})]
+                                          {:keys #(keyword (core/str %)), :strs core/str, :syms #(core/list `quote %)})]
                            (if (seq bes)
                              (core/let [bb (key (first bes))
                                         bk (val (first bes))
                                         has-default (contains? defaults bb)]
                                (recur (pb ret bb (if has-default
-                                                   (list `get gmap bk (defaults bb))
-                                                   (list `get gmap bk)))
+                                                   (core/list `get gmap bk (defaults bb))
+                                                   (core/list `get gmap bk)))
                                       (next bes)))
                              ret))))]
                     (cond
@@ -241,68 +241,68 @@

 ;; internal - do not use.
 (defmacro coercive-not [x]
-  (bool-expr (list 'js* "(!~{})" x)))
+  (bool-expr (core/list 'js* "(!~{})" x)))

 ;; internal - do not use.
 (defmacro coercive-not= [x y]
-  (bool-expr (list 'js* "(~{} != ~{})" x y)))
+  (bool-expr (core/list 'js* "(~{} != ~{})" x y)))

 ;; internal - do not use.
 (defmacro coercive-= [x y]
-  (bool-expr (list 'js* "(~{} == ~{})" x y)))
+  (bool-expr (core/list 'js* "(~{} == ~{})" x y)))

 ;; internal - do not use.
 (defmacro coercive-boolean [x]
-  (with-meta (list 'js* "~{}" x)
+  (with-meta (core/list 'js* "~{}" x)
     {:tag 'boolean}))

 ;; internal - do not use.
 (defmacro truth_ [x]
   (assert (clojure.core/symbol? x) "x is substituted twice")
-  (list 'js* "(~{} != null && ~{} !== false)" x x))
+  (core/list 'js* "(~{} != null && ~{} !== false)" x x))

 ;; internal - do not use
 (defmacro js-arguments []
-  (list 'js* "arguments"))
+  (core/list 'js* "arguments"))

 (defmacro js-delete [obj key]
-  (list 'js* "delete ~{}[~{}]" obj key))
+  (core/list 'js* "delete ~{}[~{}]" obj key))

 (defmacro true? [x]
-  (bool-expr (list 'js* "~{} === true" x)))
+  (bool-expr (core/list 'js* "~{} === true" x)))

 (defmacro false? [x]
-  (bool-expr (list 'js* "~{} === false" x)))
+  (bool-expr (core/list 'js* "~{} === false" x)))

 (defmacro array? [x]
-  (bool-expr (list 'js* "~{} instanceof Array" x)))
+  (bool-expr (core/list 'js* "~{} instanceof Array" x)))

 (defmacro string? [x]
-  (bool-expr (list 'js* "typeof ~{} === 'string'" x)))
+  (bool-expr (core/list 'js* "typeof ~{} === 'string'" x)))

 ;; TODO: x must be a symbol, not an arbitrary expression
 (defmacro exists? [x]
   (bool-expr
-    (list 'js* "typeof ~{} !== 'undefined'"
+    (core/list 'js* "typeof ~{} !== 'undefined'"
       (vary-meta x assoc :cljs.analyzer/no-resolve true))))

 (defmacro undefined? [x]
-  (bool-expr (list 'js* "(void 0 === ~{})" x)))
+  (bool-expr (core/list 'js* "(void 0 === ~{})" x)))

 (defmacro identical? [a b]
-  (bool-expr (list 'js* "(~{} === ~{})" a b)))
+  (bool-expr (core/list 'js* "(~{} === ~{})" a b)))

 (defmacro instance? [t o]
   ;; Google Closure warns about some references to RegExp, so
   ;; (instance? RegExp ...) needs to be inlined, but the expansion
   ;; should preserve the order of argument evaluation.
   (bool-expr (if (clojure.core/symbol? t)
-               (list 'js* "(~{} instanceof ~{})" o t)
+               (core/list 'js* "(~{} instanceof ~{})" o t)
                `(let [t# ~t o# ~o]
                   (~'js* "(~{} instanceof ~{})" o# t#)))))

 (defmacro number? [x]
-  (bool-expr (list 'js* "typeof ~{} === 'number'" x)))
+  (bool-expr (core/list 'js* "typeof ~{} === 'number'" x)))

 (defmacro symbol? [x]
   (bool-expr `(instance? Symbol ~x)))
@@ -312,14 +312,14 @@

 (defmacro aget
   ([a i]
-     (list 'js* "(~{}[~{}])" a i))
+     (core/list 'js* "(~{}[~{}])" a i))
   ([a i & idxs]
      (let [astr (apply core/str (repeat (count idxs) "[~{}]"))]
       `(~'js* ~(core/str "(~{}[~{}]" astr ")") ~a ~i ~@idxs))))

 (defmacro aset
   ([a i v]
-    (list 'js* "(~{}[~{}] = ~{})" a i v))
+    (core/list 'js* "(~{}[~{}] = ~{})" a i v))
   ([a idx idx2 & idxv]
     (let [n    (core/dec (count idxv))
           astr (apply core/str (repeat n "[~{}]"))]
@@ -328,7 +328,7 @@
 (defmacro +
   ([] 0)
   ([x] x)
-  ([x y] (list 'js* "(~{} + ~{})" x y))
+  ([x y] (core/list 'js* "(~{} + ~{})" x y))
   ([x y & more] `(+ (+ ~x ~y) ~@more)))

 (defmacro byte [x] x)
@@ -385,49 +385,49 @@
   ([& xs] `(- ~@xs)))

 (defmacro -
-  ([x] (list 'js* "(- ~{})" x))
-  ([x y] (list 'js* "(~{} - ~{})" x y))
+  ([x] (core/list 'js* "(- ~{})" x))
+  ([x y] (core/list 'js* "(~{} - ~{})" x y))
   ([x y & more] `(- (- ~x ~y) ~@more)))

 (defmacro *
   ([] 1)
   ([x] x)
-  ([x y] (list 'js* "(~{} * ~{})" x y))
+  ([x y] (core/list 'js* "(~{} * ~{})" x y))
   ([x y & more] `(* (* ~x ~y) ~@more)))

 (defmacro /
   ([x] `(/ 1 ~x))
-  ([x y] (list 'js* "(~{} / ~{})" x y))
+  ([x y] (core/list 'js* "(~{} / ~{})" x y))
   ([x y & more] `(/ (/ ~x ~y) ~@more)))

 (defmacro divide
   ([x] `(/ 1 ~x))
-  ([x y] (list 'js* "(~{} / ~{})" x y))
+  ([x y] (core/list 'js* "(~{} / ~{})" x y))
   ([x y & more] `(/ (/ ~x ~y) ~@more)))

 (defmacro <
   ([x] true)
-  ([x y] (bool-expr (list 'js* "(~{} < ~{})" x y)))
+  ([x y] (bool-expr (core/list 'js* "(~{} < ~{})" x y)))
   ([x y & more] `(and (< ~x ~y) (< ~y ~@more))))

 (defmacro <=
   ([x] true)
-  ([x y] (bool-expr (list 'js* "(~{} <= ~{})" x y)))
+  ([x y] (bool-expr (core/list 'js* "(~{} <= ~{})" x y)))
   ([x y & more] `(and (<= ~x ~y) (<= ~y ~@more))))

 (defmacro >
   ([x] true)
-  ([x y] (bool-expr (list 'js* "(~{} > ~{})" x y)))
+  ([x y] (bool-expr (core/list 'js* "(~{} > ~{})" x y)))
   ([x y & more] `(and (> ~x ~y) (> ~y ~@more))))

 (defmacro >=
   ([x] true)
-  ([x y] (bool-expr (list 'js* "(~{} >= ~{})" x y)))
+  ([x y] (bool-expr (core/list 'js* "(~{} >= ~{})" x y)))
   ([x y & more] `(and (>= ~x ~y) (>= ~y ~@more))))

 (defmacro ==
   ([x] true)
-  ([x y] (bool-expr (list 'js* "(~{} === ~{})" x y)))
+  ([x y] (bool-expr (core/list 'js* "(~{} === ~{})" x y)))
   ([x y & more] `(and (== ~x ~y) (== ~y ~@more))))

 (defmacro dec [x]
@@ -458,63 +458,63 @@
   ([x y & more] `(min (min ~x ~y) ~@more)))

 (defmacro js-mod [num div]
-  (list 'js* "(~{} % ~{})" num div))
+  (core/list 'js* "(~{} % ~{})" num div))

 (defmacro bit-not [x]
-  (list 'js* "(~ ~{})" x))
+  (core/list 'js* "(~ ~{})" x))

 (defmacro bit-and
-  ([x y] (list 'js* "(~{} & ~{})" x y))
+  ([x y] (core/list 'js* "(~{} & ~{})" x y))
   ([x y & more] `(bit-and (bit-and ~x ~y) ~@more)))

 ;; internal do not use
 (defmacro unsafe-bit-and
-  ([x y] (bool-expr (list 'js* "(~{} & ~{})" x y)))
+  ([x y] (bool-expr (core/list 'js* "(~{} & ~{})" x y)))
   ([x y & more] `(unsafe-bit-and (unsafe-bit-and ~x ~y) ~@more)))

 (defmacro bit-or
-  ([x y] (list 'js* "(~{} | ~{})" x y))
+  ([x y] (core/list 'js* "(~{} | ~{})" x y))
   ([x y & more] `(bit-or (bit-or ~x ~y) ~@more)))

 (defmacro int [x]
   `(bit-or ~x 0))

 (defmacro bit-xor
-  ([x y] (list 'js* "(~{} ^ ~{})" x y))
+  ([x y] (core/list 'js* "(~{} ^ ~{})" x y))
   ([x y & more] `(bit-xor (bit-xor ~x ~y) ~@more)))

 (defmacro bit-and-not
-  ([x y] (list 'js* "(~{} & ~~{})" x y))
+  ([x y] (core/list 'js* "(~{} & ~~{})" x y))
   ([x y & more] `(bit-and-not (bit-and-not ~x ~y) ~@more)))

 (defmacro bit-clear [x n]
-  (list 'js* "(~{} & ~(1 << ~{}))" x n))
+  (core/list 'js* "(~{} & ~(1 << ~{}))" x n))

 (defmacro bit-flip [x n]
-  (list 'js* "(~{} ^ (1 << ~{}))" x n))
+  (core/list 'js* "(~{} ^ (1 << ~{}))" x n))

 (defmacro bit-test [x n]
-  (list 'js* "((~{} & (1 << ~{})) != 0)" x n))
+  (core/list 'js* "((~{} & (1 << ~{})) != 0)" x n))

 (defmacro bit-shift-left [x n]
-  (list 'js* "(~{} << ~{})" x n))
+  (core/list 'js* "(~{} << ~{})" x n))

 (defmacro bit-shift-right [x n]
-  (list 'js* "(~{} >> ~{})" x n))
+  (core/list 'js* "(~{} >> ~{})" x n))

 (defmacro bit-shift-right-zero-fill [x n]
-  (list 'js* "(~{} >>> ~{})" x n))
+  (core/list 'js* "(~{} >>> ~{})" x n))

 (defmacro bit-set [x n]
-  (list 'js* "(~{} | (1 << ~{}))" x n))
+  (core/list 'js* "(~{} | (1 << ~{}))" x n))

 ;; internal
 (defmacro mask [hash shift]
-  (list 'js* "((~{} >>> ~{}) & 0x01f)" hash shift))
+  (core/list 'js* "((~{} >>> ~{}) & 0x01f)" hash shift))

 ;; internal
 (defmacro bitpos [hash shift]
-  (list 'js* "(1 << ~{})" `(mask ~hash ~shift)))
+  (core/list 'js* "(1 << ~{})" `(mask ~hash ~shift)))

 ;; internal
 (defmacro caching-hash [coll hash-fn hash-key]
@@ -591,7 +591,7 @@
        (new ~t ~@locals nil))))

 (defmacro ^:private js-this []
-  (list 'js* "this"))
+  (core/list 'js* "this"))

 (defmacro this-as
   "Defines a scope where JavaScript's implicit \"this\" is bound to the name provided."
@@ -649,7 +649,7 @@
   `(.. ~tsym -prototype ~(to-property sym)))

 (defn adapt-obj-params [type [[this & args :as sig] & body]]
-  (list (vec args)
+  (core/list (vec args)
     (list* 'this-as (vary-meta this assoc :tag type) body)))

 (defn adapt-ifn-params [type [[this & args :as sig] & body]]
@@ -875,7 +875,7 @@
                                                 (not-empty (dissoc ~'__extmap k#))
                                                 nil)))
                   'ISeqable
-                  `(~'-seq [this#] (seq (concat [~@(map #(list `vector (keyword %) %) base-fields)]
+                  `(~'-seq [this#] (seq (concat [~@(map #(core/list `vector (keyword %) %) base-fields)]
                                                 ~'__extmap)))

                   'IPrintWithWriter
@@ -883,7 +883,7 @@
                                  (let [pr-pair# (fn [keyval#] (pr-sequential-writer writer# pr-writer "" " " "" opts# keyval#))]
                                    (pr-sequential-writer
                                     writer# pr-pair# ~pr-open ", " "}" opts#
-                                    (concat [~@(map #(list `vector (keyword %) %) base-fields)]
+                                    (concat [~@(map #(core/list `vector (keyword %) %) base-fields)]
                                             ~'__extmap))))
                   ])
           [fpps pmasks] (prepare-protocol-masks env impls)
@@ -910,7 +910,7 @@
     `(let []
        ~(emit-defrecord &env rsym r fields impls)
        (set! (.-cljs$lang$type ~r) true)
-       (set! (.-cljs$lang$ctorPrSeq ~r) (fn [this#] (list ~(core/str r))))
+       (set! (.-cljs$lang$ctorPrSeq ~r) (fn [this#] (core/list ~(core/str r))))
        (set! (.-cljs$lang$ctorPrWriter ~r) (fn [this# writer#] (-write writer# ~(core/str r))))
        ~(build-positional-factory rsym r fields)
        ~(build-map-factory rsym r fields)
@@ -1015,7 +1015,7 @@
         tempnames (map (comp gensym name) names)
         binds (map core/vector names vals)
         resets (reverse (map core/vector names tempnames))
-        bind-value (fn [[k v]] (list 'set! k v))]
+        bind-value (fn [[k v]] (core/list 'set! k v))]
     `(let [~@(interleave tempnames names)]
        (try
         ~@(map bind-value binds)
@@ -1095,11 +1095,11 @@
                         (cond
                          (seq? test) (reduce (fn [m test]
                                                (let [test (if (core/symbol? test)
-                                                            (list 'quote test)
+                                                            (core/list 'quote test)
                                                             test)]
                                                  (assoc-test m test expr)))
                                              m test)
-                         (core/symbol? test) (assoc-test m (list 'quote test) expr)
+                         (core/symbol? test) (assoc-test m (core/list 'quote test) expr)
                          :else (assoc-test m test expr)))
                       {} (partition 2 clauses))
         esym (gensym)]
@@ -1276,9 +1276,18 @@
   [size]
   `(js/Array. ~size))

+(defmacro list
+  ([] ())
+  ([x & xs]
+    `(-conj (list ~@xs) ~x)))
+
 (defmacro vector
   [& xs]
   `[~@xs])
+
+(defmacro hash-set
+  [& xs]
+  `#{~@xs})

 (defmacro js-obj [& rest]
   (let [kvs-str (->> (repeat "~{}:~{}")
@@ -1288,10 +1297,10 @@
     (list* 'js* (core/str "{" kvs-str "}") rest)))

 (defmacro alength [a]
-  (list 'js* "~{}.length" a))
+  (core/list 'js* "~{}.length" a))

 (defmacro aclone [a]
-  (list 'js* "~{}.slice()" a))
+  (core/list 'js* "~{}.slice()" a))

 (defmacro amap
   "Maps an expression across an array a, using an index named idx, and
@@ -1337,7 +1346,7 @@
   "Throws an exception if the given option map contains keys not listed
   as valid, else returns nil."
   [options & valid-keys]
-  (when (seq (apply disj (apply hash-set (keys options)) valid-keys))
+  (when (seq (apply disj (apply core/hash-set (keys options)) valid-keys))
     (throw
      (apply core/str "Only these options are valid: "
 	    (first valid-keys)
@@ -1374,7 +1383,7 @@
                       m)]
     (when (= (count options) 1)
       (throw (Exception. "The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)")))
-    (let [options   (apply hash-map options)
+    (let [options   (apply core/hash-map options)
           default   (core/get options :default :default)]
       (check-valid-options options :default :hierarchy)
       `(def ~(with-meta mm-name m)
@@ -1461,4 +1470,4 @@

   (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))"
   [& colls]
-  `(concat ~@(map #(list `lazy-seq %) colls)))
+  `(concat ~@(map #(core/list `lazy-seq %) colls)))


* src/clj/cljs/core.clj: fix single arity +,-,*


* src/clj/cljs/core.clj: fix numeric comparison compiler macros


resolved conflict

resolved conflict

--- src/clj/game/core.clj
+++ src/clj/game/core.clj
@@ -1,10 +1,6 @@
 (ns game.core
   (:require [game.utils :refer [remove-once has? merge-costs zone make-cid to-keyword capitalize
-<<<<<<< HEAD
-                                costs-to-symbol vdissoc distinct-by abs]]
-=======
-                                costs-to-symbol vdissoc distinct-by String->Num safe-split]]
->>>>>>> 640c209... Added commands to manually change the game state
+                                costs-to-symbol vdissoc distinct-by abs String->Num safe-split]]
             [game.macros :refer [effect req msg]]
             [clojure.string :refer [split-lines split join]]))


action clustering done

action clustering done

--- src/crawler/model.clj
+++ src/crawler/model.clj
@@ -10,6 +10,11 @@
   (with-open [rdr (io/reader a-model-file)]
     (-> rdr PushbackReader. read)))

+(defn read-corpus
+  [a-corpus-file]
+  (with-open [rdr (io/reader a-corpus-file)]
+    (-> rdr PushbackReader. read)))
+
 (defn plan
   "Plan of execution for the model"
   [a-model]
@@ -17,3 +22,97 @@
     (sort-by (juxt
               #(-> % first count)
               #(- total (second %))) a-model)))
+
+(defn cluster-actions
+  [infos]
+  (let [state-actions (map (fn [x] [(first x) (-> x second :state-action)]) infos)
+        action-sets   (map
+                       (fn [[u s]]
+                         [u (set (map :xpath s))])
+                       (map (fn [[u x]] [u (-> x :xpath-nav-info)]) state-actions))]
+    (reduce
+     (fn [acc [u x]]
+       (let [assign (.indexOf
+                     (map
+                      (fn [acc-x]
+                        (or (= (clojure.set/intersection acc-x x)
+                               acc-x)
+                            (= (clojure.set/intersection acc-x x)
+                               x)))
+                      (map :action acc))
+                     true)]
+         (if (<= 0 assign)
+           (assoc acc assign {:action (:action (nth acc assign))
+                              :urls   (conj (:urls (nth acc assign)) u)})
+           (conj acc {:action x :urls [u]}))))
+     []
+     action-sets)))
+
+(defn refine-xpath
+  [x urls infos]
+  '*)
+
+(defn cluster-results
+  "Do we need to add position info
+   to refine a particular model"
+  [a-model corpus]
+  (let [grouped (group-by
+                 (fn [[url s]] (:src-xpath s))
+                 corpus)
+
+        cluster-cands (filter
+                       (fn [[p n]]
+                         (< 1 n))
+                       (map
+                        (fn [[p xs]]
+                          (let [clustered (cluster-actions xs)]
+                            [p
+                             (count clustered)
+                             (map :urls clustered)]))
+                        grouped))]
+    (map
+     (fn [[x n us]]
+       (let [items
+             (map
+              (fn [[p xs]]
+                (let [action (first p)
+                      urls   (distinct
+                              (map
+                               (fn [[url info]]
+                                 (:src-url info))
+                               xs))
+                      url-infos (map
+                                 #(corpus %)
+                                 urls)]
+                  [urls us]
+                  ;(refine-xpath action urls url-infos)
+                  ))
+              (filter
+               #(= (first %) x)
+               grouped))]
+         items))
+     cluster-cands)))
+
+(defn refine-same-action-model
+  "Discover paths that exhibit pagination
+   or filter like characteristics
+
+   2 consecutive same actions for instance
+   are a pagination or a filter candidate"
+  [a-model a-corpus]
+  (map
+   (fn [[action-seq n]]
+     (let [reversed (reverse action-seq)
+           consecs  (map vector reversed (rest reversed))
+           posn     (+ 1 (.indexOf
+                          (map (fn [[x y]] (= x y)) consecs)
+                          true))]
+       posn))
+
+   ; retrieve only repetitions
+   (filter
+    (fn [[action-seq n]]
+      (let [reversed (reverse action-seq)
+            consecs  (map vector reversed (rest reversed))]
+        (some (fn [[x y]] (= x y)) consecs)))
+    a-model)))


Removed a debug line

Removed a debug line

--- src/demogorgon/nh.clj
+++ src/demogorgon/nh.clj
@@ -395,7 +395,6 @@
      (let [key (.take (:watch-service @watcher))]
        (.debug logger "Got events")
        (doseq [event (.pollEvents key)]
-         (.debug logger (str "context " (.context event)))
          (let [fn (.toString (.context event))
                file (get (var-get files) fn)]
            (if file


bumped up dependencies

bumped up dependencies

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -3,9 +3,9 @@
             :url "https://github.com/lacarmen/cryogen"
             :license {:name "Eclipse Public License"
                       :url "http://www.eclipse.org/legal/epl-v10.html"}
-            :dependencies [[org.clojure/clojure "1.6.0"]
-                           [ring/ring-devel "1.3.2"]
-                           [compojure "1.3.4"]
+            :dependencies [[org.clojure/clojure "1.7.0"]
+                           [ring/ring-devel "1.4.0"]
+                           [compojure "1.4.0"]
                            [ring-server "0.4.0"]
                            [cryogen-markdown "0.1.1"]
                            [cryogen-core "0.1.24"]]


Fixed version

Fixed version

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -1,4 +1,4 @@
-(defproject cryogen "0.1.1-SNAPSHOT"
+(defproject cryogen "0.1.0"
             :description "Simple static site generator"
             :url "https://github.com/lacarmen/cryogen"
             :license {:name "Eclipse Public License"
@@ -7,7 +7,7 @@
                            [ring/ring-devel "1.3.2"]
                            [compojure "1.3.1"]
                            [ring-server "0.3.1"]
-                           [cryogen-core "0.1.9-SNAPSHOT"]]
+                           [cryogen-core "0.1.8"]]
             :plugins [[lein-ring "0.8.13"]]
             :main cryogen.core
             :ring {:init cryogen.server/init


Refactor the transactions->FinancialRecord function

--- src/expenses/card.clj
+++ src/expenses/card.clj
@@ -1,9 +1,7 @@
 (ns expenses.card
   (:require [expenses.financial-record :refer :all]
             [ofx-clj.core :as ofx]
-            [clj-time.coerce :as c])
-  (:import [net.sf.ofx4j.domain.data.creditcard CreditCardResponseMessageSet
-                                                CreditCardStatementResponseTransaction
+            [clj-time.coerce :as c]) (:import [net.sf.ofx4j.domain.data.creditcard CreditCardResponseMessageSet CreditCardStatementResponseTransaction
                                                 CreditCardStatementResponse]))

 (defmethod ofx/parse-data CreditCardResponseMessageSet
@@ -49,16 +47,10 @@

 (defn transactions->FinancialRecord [transactions]
   (let [trans-map (fn [transaction]
-                    (-> {}
-                        (assoc :date (c/from-long (:date-posted transaction)))
-                        (assoc :origin nil)
-                        (assoc :description (:memo transaction))
-                        (assoc :balance-date nil)
-                        (assoc :doc-number nil)
-                        (assoc :value (:amount transaction))))]
+                    {:date (c/from-long (:date-posted transaction))
+                     :origin nil
+                     :description (:memo transaction)
+                     :balance-date nil
+                     :doc-number nil
+                     :value (:amount transaction)})]
     (map trans-map transactions)))
-
-(def transacs (credit-card-transactions (parse-file the-file)))
-(clojure.pprint/pprint (parse-file the-file))
-
-(transactions->FinancialRecord transacs)


name .xml, minor naming changes

name .xml, minor naming changes

--- src/gitmirth/core.clj
+++ src/gitmirth/core.clj
@@ -47,43 +47,43 @@
   [dirname xmlloc name-predicate]
   (let [name (apply zx/xml1-> xmlloc name-predicate)
         xml-str (xml/indent-str (zip/node xmlloc))
-        file-path (str "target/tmpfoo/" dirname (File/separator) "/" name)]
+        file-path (str "target/tmpfoo/" dirname (File/separator) "/" name ".xml")]
     (io/make-parents file-path)
     (spit file-path xml-str)))

 (def config
-  {:channel {:element-preds [:list :channel]
-             :id-preds [:id zip/down zip/node]
-             :name-preds [:name zip/down zip/node]
+  {:channel {:find-elements [:list :channel]
+             :find-id [:id zip/down zip/node]
+             :find-name [:name zip/down zip/node]
              :path "channels"}

-   :codeTemplate {:element-preds [:list :codeTemplate]
-                  :id-preds [:id zip/down zip/node]
-                  :name-preds [:name zip/down zip/node]
+   :codeTemplate {:find-elements [:list :codeTemplate]
+                  :find-id [:id zip/down zip/node]
+                  :find-name [:name zip/down zip/node]
                   :path "codeTemplates"}

-   :configurationMap {:element-preds [:map]
-                      :id-preds [(fn [_] "")]
-                      :name-preds [(fn [_] "configurationMap")]
+   :configurationMap {:find-elements [:map]
+                      :find-id [(fn [_] nil)]
+                      :find-name [(fn [_] "configurationMap")]
                       :path "server/configurationMap"}

-   :globalScripts {:element-preds [:map]
-                   :id-preds [(fn [_] "")]
-                   :name-preds [(fn [_] "globalScripts")]
+   :globalScripts {:find-elements [:map]
+                   :find-id [(fn [_] nil)]
+                   :find-name [(fn [_] "globalScripts")]
                    :path "server/globalScripts"}
    })

 (defn download
   "Serializes all xml found at the api path using the supplied config"
-  [base-url {:keys [element-preds name-preds path]}]
-  (doseq [loc (fetch-all (str base-url (str "/" path)) element-preds)]
-    (serialize-node path loc name-preds)))
+  [base-url {:keys [find-elements find-name path]}]
+  (doseq [loc (fetch-all (str base-url (str "/" path)) find-elements)]
+    (serialize-node path loc find-name)))

 (defn upload-node
   ""
-  [base-url path id-preds xmlloc]
-  (let [id (apply zx/xml1-> xmlloc id-preds)]
+  [base-url path find-id xmlloc]
+  (let [id (apply zx/xml1-> xmlloc find-id)]
     (client/put (str base-url "/" path "/" id)
                 {:insecure? true
                  :body (xml/indent-str (zip/node xmlloc))
@@ -91,9 +91,9 @@

 (defn upload
   ""
-  [base-url {:keys [id-preds path]}]
+  [base-url {:keys [find-id path]}]
   (doseq [f (.listFiles (io/file (str "target/tmpfoo/" path "/")))]
-    (upload-node base-url path id-preds (to-zip (slurp f)))))
+    (upload-node base-url path find-id (to-zip (slurp f)))))

 (defn makeitso
   "App logic"


* src/cljs/cljs/core.cljs: CLJS-175: js->clj should not try to convert anything but Objects.

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -3439,9 +3439,9 @@
              (seq? x) (doall (map thisfn x))
              (coll? x) (into (empty x) (map thisfn x))
              (goog.isArray x) (vec (map thisfn x))
-             (goog.isObject x) (into {} (for [k (js-keys x)]
-                                          [(keyfn k)
-                                           (thisfn (aget x k))]))
+             (identical? (type x) js/Object) (into {} (for [k (js-keys x)]
+                                                        [(keyfn k)
+                                                         (thisfn (aget x k))]))
              :else x))]
     (f x)))


Delete dead code

Delete dead code

--- src/io/perun/site.clj
+++ src/io/perun/site.clj
@@ -30,7 +30,6 @@
 (defn perun-logo [size]
   [:svg {:viewBox "0 0 100 100" :version "1.1"
          :width (str size "px") :height (str size "px")
-         ;; :style (str "transform: scale(" size ")")
          :xmlns "http://www.w3.org/2000/svg" :xmlns:xlink "http://www.w3.org/1999/xlink"}

    [:polygon#triangle-1
@@ -46,10 +45,8 @@
 (defn triangle [size color]
   #_[:img {:src "/perun-triangles.svg"}]
   [:svg {:viewBox "0 0 100 100" :width (str size "px") :height (str size "px")
-         ;; :style (str "transform: scale(" size ")")
          :stroke-width "40px" :fill color}
    [:use {:xmlns:xlink "http://www.w3.org/1999/xlink"
-          ;; :mask "url(/perun-triangles.svg#mask)"
           :xlink:href  "/perun-triangles.svg#page-1"}]])

@@ -125,21 +122,6 @@
                        [:p "As things are, at some point you'll get stuck. In this case you can reach out to fellow users on the Clojurians Slack or just open an issue. We're happy to help."]]})]]]))

-    ;; [:section.max-width-4.mx-auto.py4
-    ;;  [:h2#plugins "Plugins"]
-    ;;  [:p "Perun comes with a set of bundled plugins but what important is that you can also
-    ;;          use Boot plugins and easily create your own."]
-    ;;  [:p "Here is the list of the current plugins:"]
-    ;;  [:ul.list-reset.flex.flex-wrap
-    ;;   (->> (:plugins global-meta)
-    ;;        (map (fn [plugin]
-    ;;               [:li.col.col-4.p2.border--silver.border
-    ;;                [:span (:name plugin)]
-    ;;                [:p (:description plugin)]])))]
-    ;;  [:div.py4.border--silver.border-top (:content (first posts))]]
-
-
-
 (defn with-top-nav [& contents]
   (base
    [:div.mw7.center.lh-copy.relative


Use 'characters' instead of 'text' in -main to keep the WordPress code plug-in happy

--- clojure/src/com/coniferproductions/ucdump.clj
+++ clojure/src/com/coniferproductions/ucdump.clj
@@ -33,6 +33,6 @@
 (defn -main
   [& args]
   (when (not= (count args) 0)
-    (let [text (slurp (nth args 0) :encoding "UTF-8")]
-      (doseq [line (character-lines text)] (println line)))))
+    (let [characters (slurp (nth args 0) :encoding "UTF-8")]
+      (doseq [line (character-lines characters)] (println line)))))


Missing revisions link addition in r/w links.

--- src/open_company/representations/section.clj
+++ src/open_company/representations/section.clj
@@ -46,6 +46,7 @@
   ([company-slug section-name section true]
   (assoc section :links (flatten [
     (self-link company-slug section-name)
+    (revisions-link company-slug section-name)
     (update-link company-slug section-name)]))))

 (defn section-for-rendering