cleanup old comments/commented out code

cleanup old comments/commented out code

--- src/cljs/geometer/app.cljs
+++ src/cljs/geometer/app.cljs
@@ -37,32 +37,6 @@

 (defonce shader (sh/make-shader-from-spec gl phong/shader-spec))

-;; (defn- vary-color
-;;   "Add random variance to an (r,g,b,a) sequence of colors values."
-;;   [cols]
-;;   (map #(+ (m/random -0.1 0.1) %) cols))
-
-;; (defn- set-model!
-;;   "Our model is a `mesh` that will be rendered by the animation loop started in the start function."
-;;   [mesh]
-;;   (reset! model
-;;           (let [vertices (->> (g/center mesh)
-;;                               (g/faces)
-;;                               (map gu/tessellate-3)
-;;                               flatten)
-;;                 colors (flatten (repeatedly (/ (count vertices) 3)
-;;                                             #(vary-color [0.064 0.63 0.30 0.9])))
-;;                 gl (gl/gl-context "main")]
-;;             (-> {:attribs {:position {:data (float32 vertices) :size 3}
-;;                            :color    {:data (float32 colors) :size 4}}
-;;                  :uniforms     {:proj (gl/perspective 45 @view-rect 0.1 1200.0)
-;;                                 :view (mat/look-at (v/vec3 0 0 0) (v/vec3) v/V3Y)}
-;;                  :mode         gl/triangles
-;;                  :num-vertices (/ (count vertices) 3)
-;;                  :shader       (->> (basic/make-shader-spec-3d true)
-;;                                     (sh/make-shader-from-spec gl))}
-;;                 (buf/make-attribute-buffers-in-spec gl gl/static-draw)))))
-
 (defn- set-model!
   "Our model is a `mesh` that will be rendered by the animation loop started in the start function."
   [mesh]
@@ -80,11 +54,6 @@
                           :shininess     100
                           :wrap          1
                           :useBlinnPhong true}))))
-
-;; BTW: Jack, colors can be specified as normalized RGB color vectors too
-;; no need to convert to hex ints...
-;; (apply str (map #(format "%x" (int (* 255 %))) [0.064 0.63 0.30]))
-;; "10a04c"

 (defn ^:export new-model
   "Selects a new model from a set of possibilities (or a cube if we don't recognise the request). This requires some setTimeout silliness for the browser to show a status panel."


better event loop, ops table

better event loop, ops table

--- src/cljs/unfolds/core.cljs
+++ src/cljs/unfolds/core.cljs
@@ -15,6 +15,9 @@

 ;; Link format: [[foo|blitz]]

+(defn debug [s x]
+  (. js/console (log s (pr-str x))))
+
 ;; global extra channel for outer-Om comms
  (def comm-alt (chan (sliding-buffer 1)))

@@ -89,9 +92,13 @@
                           .-value)
         new-item [(swap! id-atom inc) new-item-text]]
     (when new-item
+      ;; TODO: transact to server before stuff adding, no?
+      ;; id should be returned, not this swap! id-atom biz
+      ;; or use uuid gen on client, but not well-ordered then
+      (put! comm-alt {:tag :add-note! :value new-item})
+
       (om/transact! app :word-map #(merge-with union % (make-word-map new-item)))
       (om/transact! app :items #(conj % new-item))
-      ;; TODO: transact to server
       (secretary/dispatch! (str "#/notes/" (first new-item)))
       (set! (.-location js/window) (str "/#notes/" (first new-item))))))

@@ -141,31 +148,60 @@
                  (apply dom/div nil
                         (prepare-item item)))))))

+;; TODO: hide-all!
+;; TODO: hide!
+;; what is value? takes one
+;; more like view note?
+(defn view-note [app value]
+  (debug "view-note " value)
+  (om/transact! app :hidden #(assoc % :add true))
+  (om/transact! app :hidden #(assoc % :search true))
+  (om/transact! app :hidden #(assoc % :view false))
+  (om/transact! app :current-item (fn [_] (:id value))))
+
+(defn add-note! [app]
+  (debug "add-note!" "")
+  (om/transact! app :hidden #(assoc % :view true))
+  (om/transact! app :hidden #(assoc % :search true))
+  (om/transact! app :hidden #(assoc % :add false)))
+
+(defn view-add [app]
+  (debug "view-add" "")
+  (om/transact! app :hidden #(assoc % :view true))
+  (om/transact! app :hidden #(assoc % :search true))
+  (om/transact! app :hidden #(assoc % :add false)))
+
+(defn view-search [app]
+  (debug "search " "")
+  (om/transact! app :hidden #(assoc % :view true))
+  (om/transact! app :hidden #(assoc % :add true))
+  (om/transact! app :hidden #(assoc % :search false)))
+
+;; ! if side-effect, ie only for add I think?
+;; but we also already have search and add fn
+;; time for namespaces
+(def ops-table
+  {:add-note! {:type :ajax :func add-note!}
+   :view-add {:type :nav :func view-add}
+   :view-note {:type :nav :func view-note}
+   :view-search {:type :nav :func view-search}})
+
+(defn get-op [tag] (get ops-table tag))
+
 (defn event-loop [app event-chan]
   (go
     (while true
-      (let [[{:keys [tag value]} _] (alts! [comm-alt event-chan])]
-        (. js/console (log "tag: " (pr-str tag)))
-        (. js/console (log "value: " (pr-str value)))
-
-        ;; when tag is add or search, do that
-        ;; TODO: Generalize.
-        (condp keyword-identical? tag
-          ;; TODO: hide-all function
-          :notes ;; more like view?
-          (do (om/transact! app :hidden #(assoc % :add true))
-              (om/transact! app :hidden #(assoc % :search true))
-              (om/transact! app :hidden #(assoc % :view false))
-              (om/transact! app :current-item (fn [_] (:id value))))
-          :add
-          (do (om/transact! app :hidden #(assoc % :view true))
-              (om/transact! app :hidden #(assoc % :search true))
-              (om/transact! app :hidden #(assoc % :add false)))
-          :search
-          (do (om/transact! app :hidden #(assoc % :view true))
-              (om/transact! app :hidden #(assoc % :add true))
-              (om/transact! app :hidden #(assoc % :search false)))
-          )))))
+      (let [[{:keys [tag value]} _] (alts! [comm-alt event-chan])
+            {:keys [type func] :as ops} (get-op tag)]
+        (. js/console (log "event tag: " (pr-str tag)))
+        (. js/console (log "event val: " (pr-str value)))
+        (condp keyword-identical? type
+          :ajax
+          (do
+            (. js/console (log "AJAX: " (pr-str value)))
+            )
+          :nav
+          (if value (func app value) (func app)))))))

 (defn app-view [app owner]
@@ -218,22 +254,20 @@
                                       {:value (:text state)
                                        :ref "new-item"
                                        :rows "12" :cols "80"
-                                       :onChange #(handle-item-change % owner state)})
-                        (dom/button #js {:onClick #(add-item app owner)} "Add item"))
+                                       :onChange
+                                       #(handle-item-change % owner state)})
+                        (dom/button #js {:onClick #(add-item app owner)}
+                                    "Add item"))
                ))))

 (defroute "/notes/:id" {:as params}
-  (put! comm-alt {:tag :notes
-                  :value {:id (:id params)}}))
-
-(defroute "/add" {}
-  (put! comm-alt {:tag :add :value {}}))
-
-(defroute "/search" {}
-  (put! comm-alt {:tag :search :value {}}))
-
-(defroute "/about" {}
-  (put! comm-alt {:tag :notes :value {:id 0}}))
+  (put! comm-alt {:tag :view-note :value {:id (:id params)}}))
+
+(defroute "/add" {} (put! comm-alt {:tag :view-add :value {}}))
+
+(defroute "/search" {}(put! comm-alt {:tag :view-search :value {}}))
+
+(defroute "/about" {} (put! comm-alt {:tag :view-note :value {:id 0}}))

 (defn main []
   (om/root app-view


Fixed a bug in evolve.

Fixed a bug in evolve.

--- src/clojure_robby/core.clj
+++ src/clojure_robby/core.clj
@@ -32,7 +32,7 @@

 (defn evolve [n]
   "Returns the population after n generations, starting with a random population."
-  (evolve-from n (repeatedly individual-count rand-dna)))
+  (evolve-from (repeatedly individual-count rand-dna) n))

 (defn best [population]
   "Returns the best individual in a generation."


(PDB-3029) Restore metadata-rx indentation

--- src/puppetlabs/puppetdb/queue.clj
+++ src/puppetlabs/puppetdb/queue.clj
@@ -36,10 +36,10 @@

 (defn- metadata-rx [valid-commands]
   (re-pattern (str
-                "([0-9]+)_("
-                (str/join "|" (map #(format "(?:%s)" (re-quote-replacement %))
-                                   valid-commands))
-                ")_([0-9]+)_(.*)\\.json")))
+               "([0-9]+)_("
+               (str/join "|" (map #(format "(?:%s)" (re-quote-replacement %))
+                                  valid-commands))
+               ")_([0-9]+)_(.*)\\.json")))

 (defn metadata-parser
   ([] (metadata-parser metadata-command-names))


Citation for the fast k-medoids algorithm

--- src/rdf_path_examples/clustering.clj
+++ src/rdf_path_examples/clustering.clj
@@ -9,7 +9,10 @@

 (defn select-k-medoids
   "Select `k` medoids out of `items` based on the k-medoids clustering
-  using the distance function `distance-fn`."
+  using the distance function `distance-fn`. It uses the algorithm described
+  in PARK, Hae-Sang; JUN, Chi-Hyuck, 2009. A simple and fast algorithm for
+  K-medoids clustering. Expert Systems with Applications. Vol. 36, pp. 3336–3341.
+  DOI 10.1016/j.eswa.2008.01.039."
   [^PersistentHashSet paths
    distance-fn
    ^Number k


Fancy up the map style a bit

Fancy up the map style a bit

--- devcards/frontend/devcards/map.cljs
+++ devcards/frontend/devcards/map.cljs
@@ -178,9 +178,8 @@
   (str "A" rx "," ry "," x-axis-rotate "," large-arc-flag "," sweep-flag "," x "," y))

 (defn arrow [start end strut-pos radius]
-  [:path
-   {:stroke "black"
-    :fill "none"
+  [:path.arrow
+   {:fill "none"
     :d (cond
          (> (second start) (second end))
          (str
@@ -211,35 +210,37 @@
         x-spacing 100
         cs (coords things-in-columns)]
     (html
-     [:div {:style {:overflow "auto"}}
+     [:div {:style {;; :overflow "auto"
+                    :background "white"}}
       [:svg {:width "2000"
-             :height "300"}
-       (for [[x things] (map-indexed vector things-in-columns)]
-         (for [[y thing] (map-indexed vector things)]
-           (when thing
-             [:g {:transform (str "translate(" (* x (+ width x-spacing)) "," (* y (+ height 10)) ")")}
-              [:rect {:stroke "black"
-                      :fill "none"
-                      :width width
-                      :height height}]
-              [:text {:x 10
-                      :y 25}
-               thing]])))
-       (for [[from to] edges
-             :let [[fx fy] (get cs from)
-                   [tx ty] (get cs to)]]
-         (let [start (fn [x y]
-                       [(+ width (* x (+ width x-spacing)))
-                        (+ (/ height 2) (* y (+ height 10)))])
-               end (fn [x y]
-                     [(* x (+ width x-spacing))
-                      (+ (/ height 2) (* y (+ height 10)))])
-               steps-back (- (count (nth things-in-columns tx)) ty)
-               strut-offset (* 20 steps-back)]
-           (arrow (start fx fy)
-                  (end tx ty)
-                  (- (first (end tx ty)) strut-offset)
-                  10)))]])))
+             :height "300"
+             :style {:background "white"}}
+       [:g {:transform "translate(3,3)"}
+        (for [[from to] edges
+              :let [[fx fy] (get cs from)
+                    [tx ty] (get cs to)]]
+          (let [start (fn [x y]
+                        [(+ width (* x (+ width x-spacing)))
+                         (+ (/ height 2) (* y (+ height 10)))])
+                end (fn [x y]
+                      [(* x (+ width x-spacing))
+                       (+ (/ height 2) (* y (+ height 10)))])
+                steps-back (- (count (nth things-in-columns tx)) ty)
+                strut-offset (* 20 steps-back)]
+            (arrow (start fx fy)
+                   (end tx ty)
+                   (- (first (end tx ty)) strut-offset)
+                   10)))
+        (for [[x things] (map-indexed vector things-in-columns)]
+          (for [[y thing] (map-indexed vector things)]
+            (when thing
+              [:g {:transform (str "translate(" (* x (+ width x-spacing)) "," (* y (+ height 10)) ")")}
+               [:rect.job {:fill "none"
+                           :width width
+                           :height height}]
+               [:text {:x 10
+                       :y 25}
+                thing]])))]]])))

 (defn has-far-arrows? [graph columns node]
   (zero? (g/out-degree (g/subgraph graph (conj (apply concat (rest columns)) node))
@@ -265,24 +266,39 @@
   (let [g (transitive-reduction frontend-graph)
         columns (build-columns {:graph g
                                 :remaining-ranks (reverse (ranks g))
-                                :columns ()})]
+                                :columns ()})
+        edges (conj (g/edges g)
+                    ["cljsbuild_test" "precompile_assets"]
+                    ["npm_bower_dependencies" "cljsbuild_whitespace"])]
     (html
      [:div
-      (show-columns columns)
+      #_(show-columns columns)
       (map-svg columns (g/edges g))
       (map-svg (-> columns
                    vec
-                   (assoc 2 ["cljsbuild_test" "cljsbuild_whitespace" "cljsbuild_production" "clojure_test"]))
-               (g/edges g))
+                   (assoc 2 [nil "cljsbuild_test" "cljsbuild_whitespace" "cljsbuild_production" "clojure_test"]))
+               edges)
       (map-svg (-> columns
                    vec
+                   (update 1 conj nil)
                    (assoc 2 ["cljsbuild_whitespace" "cljsbuild_production" "cljsbuild_test" "clojure_test"])
                    (assoc 3 ["precompile_assets" "cljs_test"]))
-               (g/edges g))])))
+               edges)])))

 (defcard arrow
   (html
    [:div
+    [:style
+     "path.arrow {
+        stroke-width: 2px;
+        stroke: #CCCCCC;
+      }
+
+      rect.job {
+        stroke-width: 1px;
+        stroke: #333333;
+        fill: #FFFFFF;
+      }"]
     [:svg {:width "100%"
            :height "200"}
      (arrow [0 100] [200 10] 130 10)]


fixed the swapped scale and shape on generalized double pareto

--- src/distributions/core.clj
+++ src/distributions/core.clj
@@ -41,8 +41,8 @@
   (new GammaDistribution shape (/ 1 rate)))
 (defrecord GeneralizedDoubleParetoDistribution [shape scale])
 (defn gdp
-  [shape scale]
-  (GeneralizedDoubleParetoDistribution. shape scale))
+  [scale shape]
+  (GeneralizedDoubleParetoDistribution. scale shape))
 (defn geometric
   [p]
   (new GeometricDistribution p))


(PDB-3648) storage-utils: remove leftover warn-on-reflection

--- src/puppetlabs/puppetdb/scf/storage_utils.clj
+++ src/puppetlabs/puppetdb/scf/storage_utils.clj
@@ -19,8 +19,6 @@

 ;; SCHEMA

-(set! *warn-on-reflection* true)
-
 (defn array-to-param
   [col-type java-type values]
   (.createArrayOf ^Connection (:connection (jdbc/db))


Add line call to graphics example.

Add line call to graphics example.

--- src/quil_cljs_examples/graphics/graphics.cljs
+++ src/quil_cljs_examples/graphics/graphics.cljs
@@ -11,7 +11,8 @@
 (defn draw []
 	(q/background 255)
 	(with-graphics @g
-		(q/background 102))
+		(q/background 102)
+		(q/line 0 0 100 100))
 	(q/image @g 10 10))


Fix col-reduce arity 2 for RepositoryConnection

--- src/rdf-repository/grafter/rdf/repository.clj
+++ src/rdf-repository/grafter/rdf/repository.clj
@@ -399,8 +399,8 @@
 (extend-type RepositoryConnection
   clojure.core.protocols/CollReduce
   (coll-reduce
-    #_([this f]
-     (clojure.core.protocols/coll-reduce f init this))
+    ([this f]
+     (reduce f (f) (pr/to-statements this {})))
     ([this f val]
      (reduce f val (pr/to-statements this {}))))


Fixed bugs in updateTimeCourseVector and doesChildLearnGrammar?

--- src/research_clojure/eChild/runSimulation.clj
+++ src/research_clojure/eChild/runSimulation.clj
@@ -21,11 +21,11 @@
   value in grammar has changed after being
   processed by setParameters"
   [timeCourseVector currGrammar sentenceCount]
-  (let [it (atom 0)]
-    (while (< it 13)
-      (if (not= (get (get @timeCourseVector it) 1) (get currGrammar i))
-        (reset! timeCourseVector [(get @timeCourseVector 0) (assoc (get @timeCourseVector it) 1 (get currGrammar it)) (assoc (get @timeCourseVector it) 2 sentenceCount)]))
-      (swap! it inc))))
+  (let [i (atom 0)]
+    (while (< @i 13)
+      (if (not= (get (get @timeCourseVector i) 1) (get currGrammar i))
+        (reset! timeCourseVector [(get @timeCourseVector 0) (assoc (get @timeCourseVector i) 1 (get currGrammar i)) (assoc (get @timeCourseVector i) 2 sentenceCount)]))
+      (swap! i inc))))

 (defn doesChildLearnGrammar?
@@ -42,7 +42,7 @@
         (while (and (not @grammarLearned) (< @sentenceCount max_num))
           (let [infoList1 (consumeSentence (rand-nth sentences))]
             (reset! grammar (setParameters infoList1 grammar))
-            (reset! timeCourseVector (updateTimeCourseVector timeCourseVector))
+            (reset! timeCourseVector (updateTimeCourseVector timeCourseVector @grammar @sentenceCount))
             (reset! grammarLearned (isGrammarLearned? grammar infoList1)))
           (swap! sentenceCount inc))


Small optimisation

Small optimisation

--- src/eventure_ws/reader.clj
+++ src/eventure_ws/reader.clj
@@ -22,7 +22,7 @@
 (defn- subscribe
   [{:keys [dirreader config channels open] :as state} channel topic init]
   (when-not (get-in @channels [channel topic])
-    (let [sourcesc (async/chan (async/sliding-buffer (or (:subscribe-buffer config) 10)))]
+    (let [sourcesc (async/chan (async/sliding-buffer (get config :subscribe-buffer 10)))]
       (swap! channels assoc-in [channel topic] sourcesc)
       (async/go-loop []
         (if-let [{:keys [event topic uri]} (<! sourcesc)]


strip-refs

strip-refs

--- src/babel/francais/morphology.cljc
+++ src/babel/francais/morphology.cljc
@@ -68,7 +68,7 @@
                         replace-patterns)))]
     (if (empty? result)
       (throw (Exception. (str "nothing found to match infinitive: " infinitive " ; "
-                              " unify-with: " unify-with ".")))
+                              " unify-with: " (strip-refs unify-with) ".")))

       (first result))))


prevent '-cca' from over-matching

prevent '-cca' from over-matching

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -262,7 +262,7 @@
        (= (get-in word '(:agr :gender)) :fem)
        (= (get-in word '(:agr :number)) :plur)
        (= (get-in word '(:cat)) :noun)
-       (get-in word [:italiano]))
+       (re-find #"c[aà]$" (get-in word [:italiano])))
       (string/replace (get-in word [:italiano])
                       #"c[aà]$" "che") ;; mucca => mucche


Jump movements

Jump movements

--- src/fugue/boxes/state.cljs
+++ src/fugue/boxes/state.cljs
@@ -60,17 +60,27 @@
    ["w"] ["s - split"]
    ["x"] ["x"]})

-(defn make-actions [state eval-state]
-  {["1"] (fn [_ cb]
-           (print "action")
-           (cb (fn [s]
-                 (print "swap")
-                 (activate s 1))))
-   ["e" "b"] (partial do-eval eval-state)})
+(defn jump-action [id]
+  (fn [s] (activate s id)))
+
+(defn jump-actions [state]
+  (into {} (map #(vector [(str %)]
+                         (fn [_ cb] (cb (jump-action %))))
+                (range (:next-id state)))))
+
+(defn eval-actions [state eval-state]
+  {["e" "b"] (partial do-eval eval-state)})
+
+(defn make-actions
+  "actions take the current state and a callback, and call the callback with a function on state"
+  [state eval-state]
+  (merge
+    (jump-actions state)
+    (eval-actions state eval-state)))

 (defn on-key
-  "actions is a map of key sequences to functions that take state and cb
-   cb is a function that takes fns on state"
+  "actions is a map of key sequences to actions (see make-actions)
+   cb takes functions on state"
   [state actions key cb]
   (let [old-seq (:key-seq state)
         new-seq (conj old-seq key)]


Day 8 completed

Day 8 completed

--- src/adventofcode/solutions.clj
+++ src/adventofcode/solutions.clj
@@ -238,15 +238,31 @@
               #"(?<ascii>\\x[0-9a-f]{2})"
               #"(?<sinq>\\\")"])

+(defn- d8-resolver [acc line]
+  (let [cnt (count line)
+        content (.substring line 1 (dec cnt))
+        last-s (reduce #(st/replace % %2 "#") content filters)
+        diff (- cnt (count last-s))]
+    (+ acc diff)))
+
 (defn day8-rex []
+  (let [input (day-input-line-seq 8)]
+    (reduce d8-resolver 0 input)))
+
+(defn- enc-chars
+  "Counts actual number of chars in escaped string"
+  [str]
+  (let [cnt (count str)
+        enc (reduce #(case %2
+                      (\\ \") (+ 2 %)
+                      (inc %)) 2 str)]
+    [cnt enc]))
+
+(defn day8-p2 []
   (let [input (day-input-line-seq 8)]
     (reduce
       (fn [acc line]
-        (let [cnt (count line)
-              content (.substring line 1 (dec cnt))
-              last-s (reduce #(st/replace % %2 "#") content filters)
-              diff (- cnt (count last-s))]
-          (println last-s)
-          (+ acc diff)))
+        (let [[code enc] (enc-chars line)]
+          (+ acc (- enc code))))
       0
       input)))


Extract bucket existence check to a function

--- src/silly_image_store/handler.clj
+++ src/silly_image_store/handler.clj
@@ -20,6 +20,9 @@
   (let [base-url (request-url request)
         to-json (fn [n] {:name n :url (str base-url "/" n)})]
     (fn [names] (map to-json names))))
+
+(defn- bucket-exist? [bucket]
+  (some #{bucket} (store/list-image-dirs images-dir)))

 ; Routes
 (defn- not-found [thing]
@@ -58,7 +61,7 @@
   (GET "/random" [] (serve-random-image-route no-bucket))
   (GET "/buckets" request list-buckets-route)
   (GET "/buckets/:bucket" [bucket :as request]
-       (if (some #{bucket} (store/list-image-dirs images-dir))
+       (if (bucket-exist? bucket)
          (root-route request "/" [:images :random])
          (not-found bucket)))
   (GET "/buckets/:bucket/images" [bucket :as request] (list-images-route request bucket))


made config optional in load`

made config optional in load`

--- src/untangled/client/data_fetch.cljs
+++ src/untangled/client/data_fetch.cljs
@@ -11,7 +11,7 @@
 (defn load-params*
   "Internal function to validate and process the parameters of `load` and `load-action`."
   [server-property-or-ident SubqueryClass {:keys [target params marker refresh parallel post-mutation fallback without]
-                                  :or   {marker true parallel false refresh [] without #{}}}]
+                                           :or   {marker true parallel false refresh [] without #{}}}]
   {:pre [(or (nil? target) (vector? target))
          (or (nil? post-mutation) (symbol? post-mutation))
          (or (nil? fallback) (symbol? fallback))
@@ -75,19 +75,19 @@
   - `fallback` - A mutation (symbol) to run if there is a server/network error.
   - `without` - An optional set of keywords that should (recursively) be removed from the query.
   "
-  [app-or-comp-or-reconciler server-property-or-ident SubqueryClass config]
-  {:pre [(or (om/component? app-or-comp-or-reconciler)
-             (om/reconciler? app-or-comp-or-reconciler)
-             (instance? uc/UntangledApplication app-or-comp-or-reconciler))]}
-  (let [config (merge {:marker true :parallel false :refresh [] :without #{}} config)
-        reconciler (if (instance? uc/UntangledApplication app-or-comp-or-reconciler)
-                     (get app-or-comp-or-reconciler :reconciler)
-                     app-or-comp-or-reconciler)
-        mutation-args (load-params* server-property-or-ident SubqueryClass config)]
-    (om/transact! reconciler (load-mutation mutation-args))))
+  ([app-or-comp-or-reconciler server-property-or-ident SubqueryClass] (load app-or-comp-or-reconciler server-property-or-ident SubqueryClass {}))
+  ([app-or-comp-or-reconciler server-property-or-ident SubqueryClass config]
+   {:pre [(or (om/component? app-or-comp-or-reconciler)
+              (om/reconciler? app-or-comp-or-reconciler)
+              (instance? uc/UntangledApplication app-or-comp-or-reconciler))]}
+   (let [config (merge {:marker true :parallel false :refresh [] :without #{}} config)
+         reconciler (if (instance? uc/UntangledApplication app-or-comp-or-reconciler)
+                      (get app-or-comp-or-reconciler :reconciler)
+                      app-or-comp-or-reconciler)
+         mutation-args (load-params* server-property-or-ident SubqueryClass config)]
+     (om/transact! reconciler (load-mutation mutation-args)))))

 (defn load-action
-  [state-atom server-property-or-ident SubqueryClass config]
   "
   See `load` for descriptions of parameters and config.

@@ -104,8 +104,10 @@
     :action (fn []
        (load-action ...)
        ; other optimistic updates/state changes)}"
-  (let [config (merge {:marker true :parallel false :refresh [] :without #{}} config)]
-        (impl/mark-ready (assoc (load-params* server-property-or-ident SubqueryClass config) :state state-atom))))
+  ([state-atom server-property-or-ident SubqueryClass] (load-action state-atom server-property-or-ident SubqueryClass {}))
+  ([state-atom server-property-or-ident SubqueryClass config]
+   (let [config (merge {:marker true :parallel false :refresh [] :without #{}} config)]
+     (impl/mark-ready (assoc (load-params* server-property-or-ident SubqueryClass config) :state state-atom)))))

 (defn load-field
   "Load a field of the current component. Runs `om/transact!`.


Now you can draw n figures without selecting again the tool

--- src/uxbox/ui/workspace/drawarea.cljs
+++ src/uxbox/ui/workspace/drawarea.cljs
@@ -89,8 +89,7 @@
   (let [{:keys [x y]} (gpt/divide @wb/mouse-canvas-a @wb/zoom-l)
         props {:x1 x :y1 y :x2 (+ x 100) :y2 (+ y 100)}
         shape (ush/initialize shape props)]
-    (rs/emit! (uds/add-shape shape)
-              (udw/select-for-drawing nil))))
+    (rs/emit! (uds/add-shape shape))))

 (defn- initialize-shape-drawing
   "A drawing handler for generic shapes such as rect, circle, text, etc."
@@ -103,8 +102,7 @@
             (let [shape @drawing-shape
                   shpos @drawing-position
                   shape (ush/resize shape shpos)]
-              (rs/emit! (uds/add-shape shape)
-                        (udw/select-for-drawing nil))
+              (rs/emit! (uds/add-shape shape))
               (reset! drawing-position nil)
               (reset! drawing-shape nil)))]


jobs: Fix a typo

jobs: Fix a typo

maintenece -> maintenance

--- src/clj/clojuredocs/pages/jobs.clj
+++ src/clj/clojuredocs/pages/jobs.clj
@@ -726,7 +726,7 @@
         "About ClojureDocs Jobs"]
        [:p "Hey Everybody!"]
        [:p "So we're trying something new here in the form of a jobs board hosted here on ClojureDocs. We'll be starting slow; rolling out a few listings over the coming weeks while we track how they're doing and adjust."]
-       [:p "Ultimately, I'd like to use this as a way to fund development on the site and cover maintenece costs, so the biggest thing you can do to help out (other than switching jobs) is to get the word out. For those of you working at great Clojure shops, "
+       [:p "Ultimately, I'd like to use this as a way to fund development on the site and cover maintenance costs, so the biggest thing you can do to help out (other than switching jobs) is to get the word out. For those of you working at great Clojure shops, "
         [:a {:href "mailto:zachary.kim@gmail.com"} "drop me a line"]
         " and I'll reach out to see if we can get your company listed."]
        [:p "The goal is to make this work great for everybody. I think that's going to take a few iterations, so let me know if you have any ideas along these lines."]


Support sending nREPL a custom rendering function.

--- src/clj/reply/eval_modes/nrepl.clj
+++ src/clj/reply/eval_modes/nrepl.clj
@@ -74,7 +74,10 @@
   (let [command-id (nrepl.misc/uuid)
         session (or (:session options) @current-session)
         session-sender (nrepl/client-session client :session session)
-        message-to-send {:op "eval" :code form :id command-id}
+        message-to-send (let [msg {:op "eval" :code form :id command-id}]
+                          (if-let [renderer (:nrepl-renderer options)]
+                            (assoc msg :renderer renderer)
+                            msg))
         read-input-line-fn (:read-input-line-fn options)]
     (session-sender message-to-send)
     (reset! current-command-id command-id)


more work on collisions

more work on collisions

--- src/cljs/defender_cljs/events.cljs
+++ src/cljs/defender_cljs/events.cljs
@@ -1,6 +1,7 @@
 (ns defender-cljs.events
   (:use [defender-cljs.utils :only [log]])
-  (:require [defender-cljs.canvas.system :as system])
+  (:require [defender-cljs.canvas.system :as system]
+            [defender-cljs.collision :as collision])
   (:require-macros [defender-cljs.events
                     :refer [on-keydown on-keyup on-timeout]]))

@@ -64,8 +65,9 @@
  (.log js/console "right up!"))

-;;TODO make this register itself to a system which accumulates time
-;;through the animation delta
+;;
+;; Timed Events System
+;;

 (def timed-events (atom []))
@@ -102,6 +104,17 @@
          ;;(log id func time)
          )))))

-(on-timeout
+#_(on-timeout
  3 ;;seconds
  (log "ding!"))
+
+
+;;
+;; Collision Events System
+;;
+
+(def collision-list (atom []))
+
+(defn set-on-collision-actors [from-actor to-actor callback])
+
+(defn set-on-collision-type [from-type to-type])


Formatting.

Formatting.

--- src/cljs/town_client/analyser.cljs
+++ src/cljs/town_client/analyser.cljs
@@ -3,11 +3,10 @@

 (def data (atom {}))

-(defn counts
-  [values]
+(defn counts [values]
   (reduce
    (fn [results key]
-     (let [key     (or key 0)
+     (let [key (or key 0)
            current (or (results key) 0)]
        (assoc results key (inc current))))
     {} values))


Add sep to signature candidate.

Add sep to signature candidate.

--- src/clojure/buddy/sign/generic.clj
+++ src/clojure/buddy/sign/generic.clj
@@ -61,7 +61,7 @@

 (defn- make-stamped-signature
   [s pkey alg sep stamp]
-  (let [candidate (str s stamp)
+  (let [candidate (str s sep stamp)
         signature (make-signature candidate pkey alg)]
     (str/join sep [signature stamp])))

@@ -82,7 +82,7 @@
   [s pkey & [{:keys [sep max-age alg]
                :or {sep ":" max-age nil alg :hs256}}]]
   (let [[value sig stamp] (str/split s (re-pattern sep))
-        candidate (str value stamp)]
+        candidate (str value sep stamp)]
     (when (verify-signature candidate sig pkey alg)
       (if-not (nil? max-age)
         (let [old-stamp-value (Long/parseLong (safebase64->str stamp))


Further revisions to the go-bp rule to account for new identifier handling

--- resources/rules/post_identifier_merge/temp/goa/goa.clj
+++ resources/rules/post_identifier_merge/temp/goa/goa.clj
@@ -18,15 +18,17 @@
          ;; provenance: connect the record to the process subclass
          (?/record obo/IAO_0000219 ?/process_sc)) ; IAO:denotes

-  :body ((?/go_ice_id rdf:type ccp/IAO_EXT_0000103) ; ccp:GO_BP_concept_identifier
+  :body ((?/go_ice_id rdfs/subClassOf ccp/IAO_EXT_0000103) ; ccp:GO_BP_concept_identifier
          (?/go_ice_id obo/IAO_0000219 ?/process) ; IAO:denotes
-         (?/record obo/BFO_0000051 ?/go_ice_id) ; BFO:has_part
+         (?/id_field_value rdf/type ?/go_ice_id)
+         (?/id_field_value rdf/type ccp/IAO_EXT_0000014) ; ccp:GAF_ontology_identifier_field_value
+         (?/record obo/BFO_0000051 ?/id_field_value) ; BFO:has_part
          (?/record rdf/type ccp/IAO_EXT_0000007) ; ccp:GAF_record_v2.0
-         (?/go_ice_id rdf/type ccp/IAO_EXT_0000014) ; ccp:GAF_ontology_identifier_field_value

          ;; retrieve the process participant identifier
-         (?/record obo/BFO_0000051 ?/bioentity_ice_id) ; BFO:has_part
-         (?/bioentity_ice_id rdf/type ccp/IAO_EXT_0000010) ; ccp:database_object_identifier_field_value
+         (?/record obo/BFO_0000051 ?/bioentity_field_value) ; BFO:has_part
+         (?/bioentity_field_value rdf/type ccp/IAO_EXT_0000010) ; ccp:database_object_identifier_field_value
+         (?/bioentity_field_value rdf/type ?/bioentity_ice_id) ; ccp:database_object_identifier_field_value
          (?/bioentity_ice_id obo/IAO_0000219 ?/participating_bioentity) ; IAO:denotes

          ;;filter out the negations


bug; doc

bug; doc

--- src/clojure/zensols/dataset/db.clj
+++ src/clojure/zensols/dataset/db.clj
@@ -41,9 +41,9 @@

 (def class-label-key :class-label)

-(def stat-info-key :stat-info)
-
-(def ^:private dataset-key :dataset)
+(def ^:private dataset-index-name "dataset")
+
+(def ^:private stat-index-name "stat-info")

 (def ^:private es-class-label-key class-label-key)

@@ -107,20 +107,17 @@
    :default-set-type (atom set-type)
    :population-use (atom population-use)
    :instance-context (es/create-context
-                      ;index-name "instanceX"
-                      index-name (name dataset-key)
+                      index-name dataset-index-name
                       :url url
                       :settings {"index.mapping.ignore_malformed" true}
                       :mapping-type-defs
-                      {(name dataset-key) {:properties mapping-type-def}}
-                      ;mapping-type-def
-                      )
+                      {dataset-index-name {:properties mapping-type-def}})
    :stats-context (es/create-context
                    index-name "stats"
                    :url url
                    :settings {"index.mapping.ignore_malformed" true}
                    :mapping-type-defs
-                   {(name stat-info-key) {:properties {:stats {:type "nested"}}}})
+                   {stat-index-name {:properties {:stats {:type "nested"}}}})
    :create-instances-fn create-instances-fn})

 (defmacro with-connection
@@ -198,8 +195,7 @@
   ([id]
    (use-connection
      (with-context [instance-context]
-       (->> (es/document-by-id id)
-            dataset-key)))))
+       (->> (es/document-by-id id))))))

 (defn clear
   "Clear the in memory instance data.  If key `:wipe-persistent?` is `true` all


Display the HTTP method in upper case Slight optimization for when there are no additional handles in namespace-handler

--- src/io/aviso/rook/core.clj
+++ src/io/aviso/rook/core.clj
@@ -54,7 +54,6 @@
     (when (symbol-for-function? f) ;it has to be a function all right
       f)))

-
 (defn- success?
   [{:keys [status]}]
   (<= 200 status 399))
@@ -150,7 +149,7 @@
   (l/debugf "Scanning %s for mappable functions" namespace)
   (->> (get-available-paths namespace)
        (map (fn [[[request-method path] fun]]
-              (l/debugf "Mapping %s `%s' to %s" request-method path fun)
+              (l/debugf "Mapping %s `%s' to %s" (-> request-method name .toUpperCase) path fun)
               [[request-method (clout/route-compile path)] fun]))
        (remove nil?)
        doall))
@@ -202,12 +201,14 @@
 (defn namespace-handler
   "Helper handler, which wraps rook-handler in namespace middleware.

-  The advanced version also takes a path for compojure.core/context and a list of sub-handlers that
+  The advanced version also takes a path for compojure.core/context and an optional list of sub-handlers that
   will be invoked BEFORE rook-handler."
   ([namespace]
    (namespace-middleware rook-handler namespace))
   ([path namespace & handlers]
    (compojure/context path []
                       (namespace-middleware
-                        (apply compojure/routes (concat handlers [rook-handler]))
+                        (if (empty? handlers)
+                          rook-handler
+                          (apply compojure/routes (concat handlers [rook-handler])))
                         namespace))))


Limit 'duplicate' warnings to avoid field overflow.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -710,6 +710,12 @@
 (defmacro with-delete-status [dataset-id & body]
   `(with-delete-status* ~dataset-id (fn [] ~@body))) ; XXX need :^once?

+(def max-warnings 10)
+(defn- truncate-warnings [warnings]
+  (-> warnings
+      (update-in ["duplicate-keys" "sampleID"] #(take max-warnings %))
+      (update-in ["duplicate-probes"] #(take max-warnings %))))
+
 ; jdbcd/transaction will create a closure of our parameters,
 ; so we can't pass in the matrix seq w/o blowing the heap. We
 ; pass in a function to return the seq, instead.
@@ -744,7 +750,7 @@
                 (jdbcd/transaction
                   (jdbcd/update-values :dataset ["`id` = ?" dataset-id] {:rows rows})
                   (when warnings
-                    (merge-m-ent mname (assoc metadata :loader warnings))))))))))))
+                    (merge-m-ent mname (assoc metadata :loader (truncate-warnings warnings)))))))))))))

 (defn- dataset-by-name [dname & kprops]
   (let [props (clojure.string/join "," (map name kprops))]


chatted [with subcat <>]

chatted [with subcat <>]

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -420,7 +420,8 @@
             (unify common ;; transitive "chatted with <human>"
                    {:synsem {:subcat {:2 {:cat :prep
                                           :sem {:obj {:human true}
-                                                :pred :with}}}}}))
+                                                :pred :with}
+                                          :subcat '()}}}}))
    "charge" {:synsem {:cat :verb
                       :sem {:pred :caricare}}}


remove extra parens in :note

remove extra parens in :note

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -923,7 +923,7 @@
                       :sem {:pred :leave-behind
                             :obj {:place false}}}}

-            {:english {:note "(on a trip)"
+            {:english {:note "on a trip"
                        :past "left"}
              :synsem {:cat :verb
                       :sem {:pred :leave}}}


use (babel.lexiconfn/new-entries) to generate intransitive verbs from source forms that are not intransitive, as with Italian

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -3,7 +3,7 @@
   (:require
    [babel.encyclopedia :as encyc]
    [babel.lexiconfn :refer [compile-lex default
-                            if-then
+                            if-then new-entries
                             map-function-on-map-vals unify
                             verb-pred-defaults]]
    [babel.english.morphology :as morph]
@@ -11,7 +11,7 @@
                               intransitivize
                               subject-verb-agreement
                               transitivize]]
-   [dag_unify.core :refer [fail? get-in strip-refs unifyc]]))
+   [dag_unify.core :refer [dissoc-paths fail? get-in strip-refs unifyc]]))

 (declare edn2lexicon)

@@ -2005,7 +2005,8 @@
    "wake up"
    (let [subject-semantics (atom :top)]
      {:synsem {:cat :verb
-               :sem {:pred :wake-up}
+               :sem {:pred :wake-up
+                     :reflexive true}
                :subcat {:2 '()}}
       :english {:participle "waking up"
                 :present {:3sing "wakes up"}
@@ -2298,11 +2299,25 @@
                           {:synsem {:sem {:obj {:pred :top}}}})

+                 (new-entries ;; remove the second argument and semantic object to make verbs intransitive.
+                  {:synsem {:cat :verb
+                            :aux false
+                            :sem {:obj {:top :top}
+                                  :reflexive false}
+                            ;; likely to be :noun or :prep but could be others
+                            :subcat {:2 {:cat :top}
+                                     :3 '()}}}
+                  (fn [lexeme]
+                    (dissoc-paths lexeme [[:synsem :sem :obj]
+                                          [:synsem :subcat :2]])))
+
                  (default ;; intransitive verbs' :obj is :unspec.
-                  {:synsem {:cat :verb
+                  {:modal-with false
+                   :synsem {:cat :verb
                             :subcat {:1 {:top :top}
                                      :2 '()}
-                            :sem {:obj :unspec}}})
+                            :sem {:reflexive false
+                                  :obj :unspec}}})

                  ;; make an intransitive version of every verb which has an
                  ;; [:sem :obj] path.


for phrasal verbs e.g. "turn on", transitioning to making preposition one of the subcat arguments, and away from an atomic lexical entry e.g. "turn on"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -2231,45 +2231,48 @@
                     :subcat {:2 '()}}}]

    "turn"
-   [{:phrasal-verb true
+   [;; "turn the radio down"
+    {:phrasal-verb true
      :synsem {:cat :verb
               :sem {:pred :turn-down}
               :subcat {:2 {:cat :prep
                            :sem {:pred :down}}}}}
+    ;; TODO: add "turn down the radio"
+
+    ;; "turn the radio off"
     {:phrasal-verb true
      :synsem {:cat :verb
               :sem {:pred :turn-off}
               :subcat {:2 {:cat :prep
                            :sem {:pred :off}}}}}
+
+    ;; "turn off the radio"
+    {:phrasal-verb true
+     :synsem {:cat :verb
+              :sem {:pred :turn-off}
+              :subcat {:3 {:cat :prep
+                           :sem {:pred :off}}}}}
+
+    ;; "turn the radio on"
     {:phrasal-verb true
      :synsem {:cat :verb
               :sem {:pred :turn-on}
               :subcat {:2 {:cat :prep
                            :sem {:pred :on}}}}}
+    ;; "turn on the radio"
+    {:phrasal-verb true
+     :synsem {:cat :verb
+              :sem {:pred :turn-on}
+              :subcat {:3 {:cat :prep
+                           :sem {:pred :on}}}}}
+    ;; "turn the radio up"
     {:phrasal-verb true
      :synsem {:cat :verb
               :sem {:pred :turn-up}
               :subcat {:2 {:cat :prep
-                           :sem {:pred :up}}}}}]
-   "turn off"
-   {:synsem {:cat :verb
-             :sem {:pred :turn-off
-                   :reflexive false}
-             :subcat {:2 {:cat :noun}
-                      :3 '()}}
-    :english {:past "turned off"
-              :present {:3sing "turns off"}
-              :participle "turning off"}}
-   "turn on"
-   {:synsem {:cat :verb
-             :sem {:pred :turn-on
-                   :reflexive false}
-             :subcat {:2 {:cat :noun
-                          :pronoun false}
-                      :3 '()}}
-    :english {:past "turned on"
-               :present {:3sing "turns on"}
-              :participle "turning on"}}
+                           :sem {:pred :up}}}}}
+    ;; TODO: add "turn up the radio"
+    ]

     "understand" (let [common {:english {:past "understood"}}]
                   [(unify
@@ -2759,10 +2762,22 @@
          {:phrasal-verb true
           :synsem {:cat :verb
                    :sem {:obj object}
-                   :subcat {:3 {:cat :noun
+                   :subcat {:2 {:cat :prep}
+                            :3 {:cat :noun
                                 :pronoun false
                                 :subcat '()
                                 :sem object}}}}))
+      (default
+       (let [object (atom :top)]
+         {:phrasal-verb true
+          :synsem {:cat :verb
+                   :sem {:obj object}
+                   :subcat {:2 {:cat :noun
+                                :pronoun false
+                                :subcat '()
+                                :sem object}
+                            :3 {:cat :prep}}}}))
+
       ;; reflexive=false
       (default {:synsem {:cat :verb
                          :sem {:reflexive false}}})


s/location/place/

s/location/place/

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -99,7 +99,7 @@
    "assure" {:synsem {:cat :verb
                       :sem {:pred :assure}}}

-   "at" (let [obj (atom {:location true
+   "at" (let [obj (atom {:place true
                          :reflexive false})]
           {:synsem {:cat :prep
                     :subcat {:1 {:cat :noun


fix typo

fix typo

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -532,8 +532,8 @@
                       :subcat {:2 {:cat :prep
                                    :sem {:pred :with}}}}}
             {:synsem {:cat :verb
-                      :sem {:pred :dance
-                            :subcat {:2 '()}}}}]
+                      :sem {:pred :dance}
+                      :subcat {:2 '()}}}]

    "decide" {:synsem {:cat :verb
                       :sem {:pred :decide}}}


+{:unify [common]}

+{:unify [common]}

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -1718,7 +1718,8 @@
                              :sem {:pred :on}}}}}

       ;; "put on the shoes"
-      {:phrasal-verb true
+      {:unify [common]
+       :phrasal-verb true
        :synsem {:sem {:pred :put-on}
                 :subcat {:3 {:cat :prep
                              :sem {:pred :on}}}}}


Added API to request one bar

Added API to request one bar

Known bugs: no 404 if no bar with id

--- src/barmap/controllers/api.clj
+++ src/barmap/controllers/api.clj
@@ -8,5 +8,6 @@

 (defroutes routes
            (context "/api" []
-                    (GET "/" [] (-> (response (places/all)) ))
+                    (GET "/bars" [] (-> (response (places/all))))
+                    (GET "/bars/:id" [id] (response (places/findById id)))
                     (OPTIONS "/" [] (-> (response {:version "0.1.0-SNAPSHOT"}) (header "Allow" "OPTIONS")))))


Add "archived" class name to closed threads

--- src/braid/ui/views/thread.cljs
+++ src/braid/ui/views/thread.cljs
@@ -118,7 +118,8 @@
       (let [{:keys [dragging? uploading? focused?]} @state
             new? (thread :new?)
             private? (thread-private? thread)
-            limbo? (thread-limbo? thread)]
+            limbo? (thread-limbo? thread)
+            archived? (and (not @open?) (not new?))]

         [:div.thread
          {:class
@@ -126,7 +127,8 @@
                             (when private? "private")
                             (when limbo? "limbo")
                             (when focused? "focused")
-                            (when dragging? "dragging")])
+                            (when dragging? "dragging")
+                            (when archived? "archived")])

           :on-click (fn [e]
                       (put! focus-chan (js/Date.))


feat(core.utils): introduce (now-millis)

--- src/busa_server/core/utils.clj
+++ src/busa_server/core/utils.clj
@@ -17,3 +17,6 @@

 (defn datetime-str [date time]
   (str date "/" time))
+
+(defn now-millis
+  (.getMillis (l/local-now)))


Some type hints for conexp.tests.math.optimize

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

--- src/conexp/tests/math/optimize.clj
+++ src/conexp/tests/math/optimize.clj
@@ -13,19 +13,19 @@
 ;;;

 (defn- real= [tol a b]
-  (>= tol (Math/abs (- a b))))
+  (>= tol (Math/abs (double (- a b)))))

 (deftest test-minimize
-  (is (let [[[x] opt] (minimize #(Math/sin (aget % 0)) ;note: function gets array of doubles!
+  (is (let [[[x] opt] (minimize #(Math/sin (aget ^doubles % 0)) ;note: function gets array of doubles!
                                 (fn [k]
                                   (condp = k
-                                    0 #(Math/cos (aget % 0)),
+                                    0 #(Math/cos (aget ^doubles % 0)),
                                     (constantly 0.0)))
                                 [0.0]
                                 {})]
         (and (real= 1e-16 opt -1.0)
              (real= 1e-16 x -1.5707963267948966))))
-  (is (let [[[x] opt] (minimize #(Math/sin (aget % 0)) ;note: function gets array of doubles!
+  (is (let [[[x] opt] (minimize #(Math/sin (aget ^doubles % 0)) ;note: function gets array of doubles!
                                 [0.0]
                                 {})]
         (and (real= 1e-10 opt -1.0)


no javac on empty fileset

no javac on empty fileset

--- boot/core/src/boot/task/built_in.clj
+++ boot/core/src/boot/task/built_in.clj
@@ -61,20 +61,20 @@

 (core/deftask checkout
   "Checkout dependencies task.
-
+
   This task facilitates working on a project and its dependencies at the same
   time, by extracting the dependency jar contents into the fileset. Transitive
   dependencies will be added to the class path automatically.
-
+
   You'll need at least two boot instances---one to build the dependency jar and
   the other to build the project. For example:
-
+
       $ boot watch pom -p foo/bar -v 1.2.3-SNAPSHOT jar install
-
+
   to build the dependency jar, and
-
+
       $ boot repl -s watch checkout -d foo/bar:1.2.3-SNAPSHOT cljs serve
-
+
   to build the project with the checkout dependency [foo/bar \"1.2.3\"]."

   [d dependencies ID:VER [[sym str]] "The vector of checkout dependencies."]
@@ -579,7 +579,7 @@
                                (into-array File)
                                Arrays/asList
                                (.getJavaFileObjectsFromFiles file-mgr))]
-        (when srcs
+        (when (seq? srcs)
           (util/info "Compiling %d Java source files...\n" (count srcs))
           (-> compiler (.getTask *err* file-mgr diag-coll opts nil srcs) .call)
           (doseq [d (.getDiagnostics diag-coll) :let [k (.getKind d)]]


remove tasks from hello-gae build.boot

remove tasks from hello-gae build.boot

--- hello-gae/build.boot
+++ hello-gae/build.boot
@@ -143,16 +143,3 @@
        :version     +version+
        :description "Example code, boot, miraj, GAE"
        :license     {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}})
-
-(deftask build
-  "run all the boot-gae prep tasks"
-  []
-  (comp (gae/libs)
-        (gae/logging)
-        (gae/config)
-        (sift :move {#"(.*\.clj$)" "WEB-INF/classes/$1"})
-        (gae/servlets)
-        ;; (sift :include #{#"class$"} ;; retain transient clj files
-        ;;               :move {#"(.*class$)" "WEB-INF/classes/$1"})
-        ;; (target :no-clean true)
-        #_(gae/run)))


Replace left-over checks for HashMap with Map.

--- test/dsbdp/test/data_processing_dsl_tests.clj
+++ test/dsbdp/test/data_processing_dsl_tests.clj
@@ -97,7 +97,7 @@
                         :rules [['quotient '(/ (int16 52) (int16 50))]]}
         data-processing-fn (create-data-processing-fn dsl-expression)
         result (data-processing-fn byte-array-test-data 0)]
-    (is (instance? HashMap result))
+    (is (instance? Map result))
     (is (= expected result))))

@@ -112,7 +112,7 @@
                         :rules [['quotient '(/ (nth 1) (nth 5))]]}
         data-processing-fn (create-data-processing-fn dsl-expression)
         result (data-processing-fn input-data 0)]
-    (is (instance? HashMap result))
+    (is (instance? Map result))
     (is (= expected result))))

 (deftest clojure-list-to-java-map-with-additional-operation-and-two-data-values-test


Cleanup macros ns

Cleanup macros ns

--- src/clj/chocolatier/macros.clj
+++ src/clj/chocolatier/macros.clj
@@ -11,10 +11,6 @@
     `(when-not (.hasOwnProperty ~(symbol "js" ns) ~mname)
        (def ~vname ~expr))))

-
-;; protocols can have more than one method
-
-;; state is a list of keywords
 (defmacro defcomponent
   "Creates a component with name state and any number of methods

@@ -29,9 +25,6 @@
      ;; created protocol to a var with metadata describing it's state
      (def ~vname
        (with-meta ~vname {:fields ~state}))))
-
-(defn is-protocol? [sym]
-  (boolean (:method-map sym)))

 (defmacro defentity
   "A collection of components that represent all aspects of what
@@ -62,27 +55,3 @@
          ~@body)
       (throw (Exception. (str "Duplicate fields found across components. "
                               "Fields must all be unique."))))))
-
-
-;; Creates a defrecord with a list of methods and adds all the
-;; required state as namespaced keywords on the record
-;; :comp-id/:var
-;; :moveable/:x 1 :moveable/:y 1
-;; That way all component state for an entity can be accessed in
-;; methods via `this`
-;; Global state can be just a list of entities and systems
-
-;; (defentity Player
-;;   Movable
-;;   (move [this state component]))
-
-;; Maybe need to add meta data to the component so that the defentity
-;; knows what fields it needs to add
-;; (defcomponent Moveable
-;;   (move [this state component]))
-
-;; (defmacro defentity
-;;   [vname methods]
-;;   `(defrecord ~vname
-;;        `(for [m methods]
-;;           m)))


Fix, pass filtered map in the next step while building the edn.

--- src/clj/cljs_api/generator.clj
+++ src/clj/cljs_api/generator.clj
@@ -122,7 +122,7 @@
   keys (in the form of a req of keyseq)"
   [cljs-api-edn]
   (let [filtered-map (filter-kv api-edn-keyseqs cljs-api-edn)
-        selected-symbols (filter #(selected-namespaces (-> % second :ns)) (:symbols cljs-api-edn))
+        selected-symbols (filter #(get selected-namespaces (-> % second :ns)) (:symbols filtered-map))
         symbol-name-map (into {} (api-symbols->name-map selected-symbols))]
     (assoc filtered-map
            :symbols (reduce (fn [symbol-map [symbol-k symbol-v]]


Repl starts again

Repl starts again

--- src/clj/communitics/server.clj
+++ src/clj/communitics/server.clj
@@ -1,7 +1,7 @@
 (ns communitics.server
   (:require [clojure.java.io :as io]
             [communitics.dev :refer [is-dev? inject-devmode-html browser-repl start-figwheel]]
-            [compojure.core :refer [GET defroutes]]
+            [compojure.core :refer [GET defroutes routes]]
             [compojure.route :refer [resources]]
             [compojure.handler :refer [api]]
             [net.cgrand.enlive-html :refer [deftemplate]]
@@ -52,20 +52,35 @@
          :where [?e :db/ident ?name]]
        (d/db (:connection database))))

+(defn sum [req]
+  {:status 200
+   :body (pr-str (find-countries (::database req)))
+   :headers {"Content-Type" "application/edn"}})

-(defrecord WebServer [port]
+(defn wrap-app-component [f database]
+  "Middleware that adds component awareness"
+  (fn [req]
+    (f (assoc req ::database database))))
+
+(defn make-handler [database]
+  (-> (routes
+        (resources "/")
+        (resources "/react" {:root "react"})
+        (GET "/sum" [req] sum)
+        (GET "/*" [req] (page)))
+      (wrap-app-component database)
+      api))
+
+(defrecord WebServer [github-crawler database port]
   component/Lifecycle
   (start [this]
     (do
       (if is-dev? (start-figwheel))
       (let [port (Integer. (or port (env :port) 10555))]
         (print "Starting web server on port" port ".\n")
-        (assoc this :http-server (run-jetty http-handler {:port port
-                                                          :join? false}))))
-    )
+        (assoc this :jetty (run-jetty (make-handler database) {:port port :join? false})))))
   (stop [this]
-    (.stop (:http-server this)))
-  )
+    (.stop (:jetty this))))

 (defn new-database [uri]
   (Database. uri nil))
@@ -83,36 +98,18 @@
              [:database]))))

 (def system (prod-system {:github-address "http://github.com/api/v3"
-                         :datomic-url "datomic:dev://localhost:4334/mbrainz-1968-1973"}))
+                          :datomic-url "datomic:dev://localhost:4334/mbrainz-1968-1973"}))

-(defn run [& [port]]
+#_(defn run [& [port]]
   (defonce ^:private server
            (do
              (if is-dev? (start-figwheel))
              (let [port (Integer. (or port (env :port) 10555))]
                (print "Starting web server on port" port ".\n")
-               (run-jetty http-handler {:port port
+               (run-jetty make-handler {:port port
                                         :join? false}))))
   server)

-(defn sum [req]
-  {:status 200
-   :body (pr-str (find-countries (:database system)))
-   :headers {"Content-Type" "application/edn"}})
-
-
-
-(def http-handler [database]
-  (if is-dev?
-    (reload/wrap-reload (api #'routes))
-    (api (routes
-           (resources "/")
-           (resources "/react" {:root "react"})
-           (GET "/sum" req sum database)
-           (GET "/*" req (page))))))
-
-
-

 (defn -main [& [port]]
-  (run port))
+  (component/start system))


Prototype generic method input traces

Prototype generic method input traces

--- src/clj/introspect/visitor.clj
+++ src/clj/introspect/visitor.clj
@@ -1,4 +1,5 @@
 (ns introspect.visitor
+  (:require [introspect.stacktrace :as stacktrace])
   (:gen-class
    :name    introspect.Visitor
    :methods [#^{:static true} [methodEntered [String] void]
@@ -45,17 +46,39 @@

-(def time-stack (atom ()))
+(def method-calls (atom {}))

-(def spaces (atom 0))
+(def format-signature #(str "(" (clojure.string/join " " %) ")"))
+(def join-with-newline #(clojure.string/join "\n\t" %))

 (defn generic-method-entered
   [class-name args]
-  (println class-name "was called with" args)
-  )
+  (let [current-call-types  (map type args)
+        previous-call-types (get @method-calls class-name)]
+    (when (and (not (empty? previous-call-types))
+               (nil? (get previous-call-types current-call-types)))
+      (println
+
+       (str
+        "\nDetected unusual method call:"
+        class-name
+        "was called with arguments \n\t"
+        (format-signature current-call-types)
+        "\nprevious calls were with\n\t"
+        (join-with-newline (map format-signature previous-call-types))
+        "\nStacktrace:\n")
+       (stacktrace/format-stack-trace (.getStackTrace (Thread/currentThread)))))
+
+    (swap! method-calls
+           update-in
+           [class-name]
+           #(conj (or % #{}) current-call-types))
+    ))
+
+
 (defn -methodEntered
   ([class-name]
-     (println "no args" class-name))
+     (generic-method-entered class-name []))
   ([class-name arg1]
      (generic-method-entered class-name [arg1]))
   ([class-name arg1 arg2]
@@ -128,4 +151,12 @@

 (defn -methodLeft
   [class-name ret]
-  (println class-name "return value was" ret))
+  ;; (println class-name "return value was" ret)
+  )
+
+
+;; (Runtime/getRuntime )
+
+
+
+;; (println (format-stack-trace (.getStackTrace (Thread/currentThread))))


Fix a bug in the last bases of twobit writer.

--- src/cljam/io/twobit/writer.clj
+++ src/cljam/io/twobit/writer.clj
@@ -123,9 +123,9 @@
            unchecked-int
            (.write o)))
     (when (pos? (mod len 4))
-      (loop [b 0 i (mod len 4)]
+      (loop [b 0 i (mod len 4) j 1]
         (if (pos? i)
-          (recur (bit-or b (bit-shift-left (aget table (.get bb)) (* 2 (- 4 i)))) (dec i))
+          (recur (bit-or b (bit-shift-left (aget table (.get bb)) (* 2 (- 4 j)))) (dec i) (inc j))
           (.write o (unchecked-int b)))))))

 (defn- write-sequence!


correct shift shift (hardcoded) and nicer advanced compilation handling

--- src/cljs/devplatform/core.cljs
+++ src/cljs/devplatform/core.cljs
@@ -11,7 +11,12 @@
 (def HEIGHT-HOUR 20)
 (def HEIGHT (* 8 HEIGHT-HOUR))
 (def DAYS ["Mo" "Di" "Mi" "Do" "Fr" "Sa" "So"])
-(def HOURS (range 24))
+(def HOURS (map #(mod (+ % 6) 24) (range 24)))
+
+;; apparently those are necessary for advanced compilation :(
+(defn day [obj] (aget obj "day"))
+(defn name [obj] (aget obj "name"))
+(defn shift [obj] (aget obj "shift"))

 (defn shift-color [name]
   (let [toNumber #(-> (window/parseInt (nth (lower-case %1) %2) 36)
@@ -26,32 +31,32 @@
                     (.select "#canvas")
                     (.selectAll "g")
                     (.data jsPlan (fn [key] (str
-                                              (aget key "day")
-                                              (aget key "shift")
-                                              (aget key "name")))))
+                                              (day key)
+                                              (shift key)
+                                              (name key)))))
         enterSet (.enter dataSet)
         enterGroup (-> enterSet
                      (.append "g")
-                     (.attr "transform" #(str "translate(" (* WIDTH (aget % "day")) ",0)")))
+                     (.attr "transform" #(str "translate(" (* WIDTH (day %)) ",0)")))
         exitSet (.exit dataSet)]
     (-> enterGroup
         (.append "rect")
         (.attr #js {:width WIDTH :height 1 :class "block"})
-        (.style "fill" #(shift-color (aget % "name")))
+        (.style "fill" #(shift-color (name %)))
         (.style "stroke-width" 1)
         (.style "stroke" "black"))
     (-> enterGroup
         (.append "text")
         (.style "fill" "white")
         (.attr #js {:y (/ HEIGHT 2) :x 3})
-        (.text #(aget % "name")))
+        (.text #(name %)))
     (-> dataSet
         (.transition)
         (.duration 1000)
         (.attr "transform" #(str "translate("
-                                 (* WIDTH (aget % "day"))
+                                 (* WIDTH (day %))
                                  ","
-                                 (* HEIGHT-HOUR (dec (aget % "shift"))) ")"))
+                                 (* HEIGHT-HOUR (- (shift %) 4)) ")"))
         (.selectAll ".block")
         (.attr #js {:height HEIGHT}))


Do not return stage value to avoid bombarding the REPL.

--- src/cljx/geschichte/stage.cljx
+++ src/cljx/geschichte/stage.cljx
@@ -176,7 +176,8 @@
                                 (for [[user repos] metas
                                       [id branches] repos
                                       b branches]
-                                  [user id b])))))
+                                  [user id b]))))
+  nil)

@@ -387,8 +388,7 @@
      (debug "forking " user repo-id "for" suser)
      (<? (sync! new-stage metas))
      (cleanup-ops-and-new-values! stage metas)
-     (<? (subscribe-repos! stage (get-in new-stage [:config :subs])))
-     nil)))
+     (<? (subscribe-repos! stage (get-in new-stage [:config :subs]))))))

 (defn remove-repos!


Unsigned comparison of book keys.

Unsigned comparison of book keys.

--- src/clojure/clj_chess/book.clj
+++ src/clojure/clj_chess/book.clj
@@ -259,8 +259,14 @@
   (.seek file (+ 1 (* entry-size index)))
   (Long/reverseBytes (.readLong file)))

+(defn ^:private key> [key1 key2]
+  (pos? (Long/compareUnsigned key1 key2)))
+
+(defn ^:private key< [key1 key2]
+  (key> key2 key1))
+
 (defn ^:private find-key [key file left right entry-size]
-  (if (> left right)
+  (if (key> left right)
     nil
     (let [middle (quot (+ left right) 2)
           mid-key (read-key file middle entry-size)]
@@ -270,7 +276,7 @@
                                          entry-size))))
             middle

-            (< mid-key key)
+            (key< mid-key key)
             (recur key file (inc middle) right entry-size)

             :else


Fixed issue with unregistered parent state.

--- src/clojure/freactive/dom.cljs
+++ src/clojure/freactive/dom.cljs
@@ -70,7 +70,7 @@
         state (ElementState. node-id false element-spec nil)]
     (set! auto-node-id (inc auto-node-id))
     (set-attr! dom-node "data-freactive-id" node-id)
-    (when-let [m (-meta element-spec)]
+    (when-let [m (meta element-spec)]
       (when-let [on-disposed (get m :node-disposed)]
         (set! (.-disposed-callback state) on-disposed)))
     (aset element-state-lookup node-id state)
@@ -78,13 +78,11 @@
     state))

 (defn- register-with-parent-state [parent-state child-key state]
-  ;;(set! (.-child-states parent-state) (assoc (.-child-states parent-state) child state))
   (let [child-states (or (.-child-states parent-state)
                         (set! (.-child-states parent-state) #js {}))]
     (aset child-states child-key state)))

 (defn- unregister-from-parent-state [parent-state child-key]
-  ;;(set! (.-child-states parent-state) (dissoc (.-child-states parent-state) child))
   (when-let [child-states (.-child-states parent-state)]
     (js-delete child-states child-key)))

@@ -508,7 +506,9 @@

 (defn- register-element-with-parent [parent new-elem]
   (when-not (text-node? new-elem)
-    (when-let [parent-state (get-element-state parent)]
+    (let [parent-state (get-element-state parent)
+          parent-state (or parent-state
+                           (init-element-state! parent nil))]
       (let [state (get-element-state new-elem)]
         (set! (.-parent-state state) parent-state)
         (register-with-parent-state parent-state (get-node-id new-elem) state)))))
@@ -776,7 +776,7 @@
           (bind-attr! node k v state))
         (when children
           (append-children! node children))
-        (when-let [m (-meta virtual-dom)]
+        (when-let [m (meta virtual-dom)]
           (when-let [node-created (get m :node-created)]
             (node-created node)))
         node))))


CMR-183: Removed debug output

CMR-183: Removed debug output

--- src/cmr/indexer/api/routes.clj
+++ src/cmr/indexer/api/routes.clj
@@ -55,7 +55,6 @@
     ;; Querying cache
     (context "/caches" []
       (GET "/" {:keys [params request-context headers]}
-        (debug "Getting caches...")
         (let [context (acl/add-authentication-to-context request-context params headers)
               caches (keys (get-in context [:system :caches]))]
           (acl/verify-ingest-management-permission context :read)


delaney.clj: reimplemented (oriented-cover) via the generic (cover) function

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -579,33 +579,6 @@
   ([ds1 ds2 & xds]
     (reduce append (append ds1 ds2) xds)))

-(defn- oc-pairs [ori n D E]
-  (cond (= D E)
-        [[D (+ D n)] [(+ D n) D]],
-        (= (ori D) (ori E))
-        [[D (+ E n)] [(+ E n) D] [(+ D n) E] [E (+ D n)]],
-        :else
-        [[D E] [E D] [(+ D n) (+ E n)] [(+ E n) (+ D n)]]))
-
-(defn oriented-cover [ds]
-  (if (oriented? ds)
-    ds
-    (let [ds (dsymbol ds)
-          ori (partial-orientation ds)
-          d (dim ds)
-          n (size ds)
-          ops (into {} (for [i (range (inc d))]
-                         [i (into {} (apply concat
-                                            (for [D (elements ds)
-                                                  :let [E (s ds i D)]]
-                                              (oc-pairs ori n D E))))]))
-          vs (into {} (for [i (range d)]
-                        [i (into {} (apply concat
-                                           (for [D (elements ds)
-                                                 :let [x (v ds i (inc i) D)]]
-                                             [[D x] [(+ D n) x]])))]))]
-      (DSymbol. d (+ n n) ops vs))))
-
 (defn cover [ds nr-cosets action]
   (let [ds (dsymbol ds)
         idcs (indices ds)
@@ -621,9 +594,19 @@
                       [i (into {} (for [D (orbit-reps t [i j])
                                         :let [D0 (-> D dec (mod n) inc)
                                               v* (/ (m ds i j D0) (r t i j D))]
-                                        E (orbit t [i j] D)]
+                                        E (orbit-elements t [i j] D)]
                                     [E v*]))]))]
     (DSymbol. d (size t) ops vs)))
+
+(defn oriented-cover [ds]
+  (if (oriented? ds)
+    ds
+    (let [ds (dsymbol ds)
+          ori (partial-orientation ds)]
+      (cover ds 2 (fn [k i D]
+                    (if (= (ori D) (ori (s ds i D)))
+                      (- 1 k)
+                      k))))))

 ;; === Tests


delaney.clj: added functions (minimal?) and (self-dual?)

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -351,12 +351,17 @@
 (defn minimal [ds]
   (-> ds java-dsymbol .minimal dsymbol))

+(defn minimal? [ds]
+  (-> ds java-dsymbol .isMinimal))
+
 (defn invariant [ds]
   (into [] (.invariant (java-dsymbol ds))))

 (defn automorphisms [ds]
   (for [m (-> ds java-dsymbol DSMorphism/automorphisms)]
     (into {} (for [D (elements ds)] [D (.get m (Integer. D))]))))
+
+(defn self-dual? [ds] (= (-> ds canonical) (-> ds dual canonical)))

 ;; === Tests