Untabified conexp.fca.contexts

Untabified conexp.fca.contexts

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -41,7 +41,7 @@
   "Orders things for proper output of formal contexts."
   [x y]
   (if (and (= (class x) (class y))
-	   (instance? Comparable x))
+           (instance? Comparable x))
     (> 0 (compare x y))
     (> 0 (compare (str (class x)) (str (class y))))))

@@ -51,8 +51,8 @@
   [x y]
   (cond
     (and (vector? x)
-	 (vector? y)
-	 (= 2 (count x) (count y)))
+         (vector? y)
+         (= 2 (count x) (count y)))
     (if (= (second x) (second y))
       (compare-order (first x) (first y))
       (compare-order (second x) (second y)))
@@ -64,8 +64,8 @@
   [x y]
   (cond
     (and (vector? x)
-	 (vector? y)
-	 (= 2 (count x) (count y)))
+         (vector? y)
+         (= 2 (count x) (count y)))
     (if (= (first x) (first y))
       (compare-order (second x) (second y))
       (compare-order (first x) (first y)))
@@ -77,25 +77,25 @@
   [ctx order-on-objects order-on-attributes]
   (let [str #(if (= % nil) "nil" (str %))

-	attributes (vec (sort order-on-objects (attributes ctx)))
-	objects    (vec (sort order-on-attributes (objects ctx)))
-	incidence  (incidence ctx)
-
-	max-att (reduce #(max %1 (count (str %2))) 0 attributes)
-	max-obj (reduce #(max %1 (count (str %2))) 0 objects)]
+        attributes (vec (sort order-on-objects (attributes ctx)))
+        objects    (vec (sort order-on-attributes (objects ctx)))
+        incidence  (incidence ctx)
+
+        max-att (reduce #(max %1 (count (str %2))) 0 attributes)
+        max-obj (reduce #(max %1 (count (str %2))) 0 objects)]
     (with-str-out
       (ensure-length "" max-obj " ") " |" (for [att attributes]
-					    [(print-str att) " "]) "\n"
+                                            [(print-str att) " "]) "\n"
       (ensure-length "" max-obj "-") "-+" (for [att attributes]
-					    (ensure-length "" (inc (count (print-str att))) "-")) "\n"
+                                            (ensure-length "" (inc (count (print-str att))) "-")) "\n"
       (for [obj objects]
-	[(ensure-length (print-str obj) max-obj)
-	 " |"
-	 (for [att attributes]
-	   [(ensure-length (if (incidence [obj att]) "x" ".")
-			   (count (print-str att)))
-	    " "])
-	 "\n"]))))
+        [(ensure-length (print-str obj) max-obj)
+         " |"
+         (for [att attributes]
+           [(ensure-length (if (incidence [obj att]) "x" ".")
+                           (count (print-str att)))
+            " "])
+         "\n"]))))

 (defmethod print-method Formal-Context [ctx out]
   (.write ^java.io.Writer out
@@ -120,10 +120,10 @@
   (when-not (and (not (map? objects)) (not (map? attributes)))
     (illegal-argument "Objects and attributes should not be given as a map."))
   (let [objs (set objects)
-	atts (set attributes)
-	inz  (set-of [g m] [[g m] incidence
-			    :when (and (contains? objs g)
-				       (contains? atts m))])]
+        atts (set attributes)
+        inz  (set-of [g m] [[g m] incidence
+                            :when (and (contains? objs g)
+                                       (contains? atts m))])]
     (Formal-Context. objs atts inz)))

 (defmethod make-context [clojure-coll clojure-coll clojure-fn]
@@ -159,8 +159,8 @@
   "Returns tuple of number of objects, number of attributes and fill rate."
   [ctx]
   (let [obj-cnt (count (objects ctx)),
-	att-cnt (count (attributes ctx)),
-	inz-cnt (count (incidence ctx))]
+        att-cnt (count (attributes ctx)),
+        inz-cnt (count (incidence ctx))]
     [obj-cnt, att-cnt, (if (or (zero? obj-cnt)
                                (zero? att-cnt))
                          Double/NaN
@@ -170,14 +170,14 @@
   "Rename objects in ctx by given hash old-to-new."
   [ctx old-to-new]
   (let [objs (map old-to-new (objects ctx))
-	inz (set-of [(old-to-new g) m] [[g m] (incidence ctx)])]
+        inz (set-of [(old-to-new g) m] [[g m] (incidence ctx)])]
     (make-context-nc objs (attributes ctx) inz)))

 (defn rename-attributes
   "Rename attributes in ctx by given hash old-to-new."
   [ctx old-to-new]
   (let [atts (map old-to-new (attributes ctx))
-	inz (set-of [g (old-to-new m)] [[g m] (incidence ctx)])]
+        inz (set-of [g (old-to-new m)] [[g m] (incidence ctx)])]
     (make-context-nc (objects ctx) atts inz)))

 (defn make-context-from-matrix
@@ -201,21 +201,21 @@
   "Tests whether ctx-1 is a subcontext ctx-2 or not."
   [ctx-1 ctx-2]
   (let [objs-1 (objects ctx-1)
-	objs-2 (objects ctx-2)
-	atts-1 (attributes ctx-1)
-	atts-2 (attributes ctx-2)]
+        objs-2 (objects ctx-2)
+        atts-1 (attributes ctx-1)
+        atts-2 (attributes ctx-2)]
     (and (subset? objs-1 objs-2)
-	 (subset? atts-1 atts-2)
-	 (forall [[g m] (incidence ctx-1)]
-	   (=> (and (contains? objs-1 g)
-		    (contains? atts-1 m))
-	       (contains? (incidence ctx-2) [g m]))))))
+         (subset? atts-1 atts-2)
+         (forall [[g m] (incidence ctx-1)]
+           (=> (and (contains? objs-1 g)
+                    (contains? atts-1 m))
+               (contains? (incidence ctx-2) [g m]))))))

 (defn object-derivation
   "Computes set of attributes common to all objects in context."
   [ctx objects]
   (let [inz  (incidence ctx),
-	atts (attributes ctx)]
+        atts (attributes ctx)]
     (set-of m [m atts :when (forall [g objects] (inz [g m]))])))

 (defn attribute-derivation
@@ -237,14 +237,14 @@
   "Clarifies objects in context ctx."
   [ctx]
   (let [prime (memoize (partial object-derivation ctx))
-	new-objs (set (distinct-by-key (objects ctx) #(prime #{%})))]
+        new-objs (set (distinct-by-key (objects ctx) #(prime #{%})))]
     (make-context new-objs (attributes ctx) (incidence ctx))))

 (defn clarify-attributes
   "Clarifies attributes in context ctx."
   [ctx]
   (let [prime (memoize (partial attribute-derivation ctx))
-	new-atts (set (distinct-by-key (attributes ctx) #(prime #{%})))]
+        new-atts (set (distinct-by-key (attributes ctx) #(prime #{%})))]
     (make-context (objects ctx) new-atts (incidence ctx))))

 (defn clarify-context
@@ -257,16 +257,16 @@
   [ctx]
   (let [prime (memoize (partial object-derivation ctx))]
     (not (exists [g (objects ctx)
-		  h (objects ctx)]
-	   (and (not= g h) (= (prime #{g}) (prime #{h})))))))
+                  h (objects ctx)]
+           (and (not= g h) (= (prime #{g}) (prime #{h})))))))

 (defn attribute-clarified?
   "Tests whether given context ctx is attribute clarified."
   [ctx]
   (let [prime (memoize (partial attribute-derivation ctx))]
     (not (exists [m (attributes ctx)
-		  n (attributes ctx)]
-	   (and (not= m n) (= (prime #{m}) (prime #{n})))))))
+                  n (attributes ctx)]
+           (and (not= m n) (= (prime #{m}) (prime #{n})))))))

 (defn clarified?
   "Tests whether given context ctx is clarified."
@@ -278,31 +278,31 @@
   "Computes the down arrow relation of ctx."
   [ctx]
   (let [obj   (objects ctx),
-	att   (attributes ctx),
-	inz   (incidence ctx),
-	prime (map-by-fn #(object-derivation ctx #{%}) obj)]
+        att   (attributes ctx),
+        inz   (incidence ctx),
+        prime (map-by-fn #(object-derivation ctx #{%}) obj)]
     (set-of [g m]
-	    [g obj
-	     m att
-	     :when (and (not (inz [g m]))
-			(forall [h obj]
-			  (=> (proper-subset? (prime g) (prime h))
-			      (inz [h m]))))])))
+            [g obj
+             m att
+             :when (and (not (inz [g m]))
+                        (forall [h obj]
+                          (=> (proper-subset? (prime g) (prime h))
+                              (inz [h m]))))])))

 (defn up-arrows
   "Computes the up arrow relation of ctx."
   [ctx]
   (let [obj   (objects ctx),
-	att   (attributes ctx),
-	inz   (incidence ctx),
-	prime (map-by-fn #(attribute-derivation ctx #{%}) att)]
+        att   (attributes ctx),
+        inz   (incidence ctx),
+        prime (map-by-fn #(attribute-derivation ctx #{%}) att)]
     (set-of [g m]
-	    [g obj,
-	     m att
-	     :when (and (not (inz [g m]))
-			(forall [n att]
-			  (=> (proper-subset? (prime m) (prime n))
-			      (inz [g n]))))])))
+            [g obj,
+             m att
+             :when (and (not (inz [g m]))
+                        (forall [n att]
+                          (=> (proper-subset? (prime m) (prime n))
+                              (inz [g n]))))])))

 (defn up-down-arrows
   "Returns up-down-arrow relation of ctx."
@@ -313,8 +313,8 @@
   "Reduces context ctx assuming it is clarified."
   [ctx]
   (let [uda     (up-down-arrows ctx),
-	new-obj (set (map first uda)),
-	new-att (set (map second uda))]
+        new-obj (set (map first uda)),
+        new-att (set (map second uda))]
     (make-context-nc new-obj new-att (incidence ctx))))

 (defn reduce-context-objects
@@ -343,14 +343,14 @@
   [ctx]
   (and (clarified? ctx)
        (let [obj (objects ctx),
-	     att (attributes ctx),
-	     uda (up-down-arrows ctx)]
-	 (and (forall [g obj]
-		(exists [[h _] uda]
-		  (= g h)))
-	      (forall [m att]
-		(exists [[_ n] uda]
-		  (= m n)))))))
+             att (attributes ctx),
+             uda (up-down-arrows ctx)]
+         (and (forall [g obj]
+                (exists [[h _] uda]
+                  (= g h)))
+              (forall [m att]
+                (exists [[_ n] uda]
+                  (= m n)))))))

 (defn context-object-closure
   "Computes double prime in context ctx for the given set-of-objects."
@@ -416,29 +416,29 @@
   "Inverts context ctx, that is $(G,M,I)$ gets $(G,M,(G\\times M)\\setminus I)$."
   [ctx]
   (make-context-nc (objects ctx) (attributes ctx) (set-of [g m] [g (objects ctx)
-								 m (attributes ctx)
-								 :when (not ((incidence ctx) [g m]))])))
+                                                                 m (attributes ctx)
+                                                                 :when (not ((incidence ctx) [g m]))])))

 (defn context-union
   "Returns context union of ctx1 and ctx2."
   [ctx1 ctx2]
   (let [new-objs (union (set-of [g_1 1] [g_1 (objects ctx1)])
-			(set-of [g_2 2] [g_2 (objects ctx2)]))
-	new-atts (union (set-of [m_1 1] [m_1 (attributes ctx1)])
-			(set-of [m_2 2] [m_2 (attributes ctx2)]))
-	new-inz  (set-of [[g idx-g] [m idx-m]]
-			 [[g idx-g] new-objs
-			  [m idx-m] new-atts
-			  :when (or ((incidence ctx1) [g m])
-				    ((incidence ctx2) [g m]))])]
+                        (set-of [g_2 2] [g_2 (objects ctx2)]))
+        new-atts (union (set-of [m_1 1] [m_1 (attributes ctx1)])
+                        (set-of [m_2 2] [m_2 (attributes ctx2)]))
+        new-inz  (set-of [[g idx-g] [m idx-m]]
+                         [[g idx-g] new-objs
+                          [m idx-m] new-atts
+                          :when (or ((incidence ctx1) [g m])
+                                    ((incidence ctx2) [g m]))])]
     (make-context-nc new-objs new-atts new-inz)))

 (defn context-intersection
   "Returns context intersection of ctx1 and ctx2."
   [ctx1 ctx2]
   (make-context-nc (intersection (objects ctx1) (objects ctx2))
-		   (intersection (attributes ctx1) (attributes ctx2))
-		   (intersection (incidence ctx1) (incidence ctx2))))
+                   (intersection (attributes ctx1) (attributes ctx2))
+                   (intersection (incidence ctx1) (incidence ctx2))))

 (defn context-composition
   "Returns context composition of ctx-1 and ctx-2, that is
@@ -447,14 +447,14 @@
   \\]."
   [ctx-1 ctx-2]
   (make-context-nc (objects ctx-1)
-		   (attributes ctx-2)
-		   (set-of [g m]
-			   [g (objects ctx-1)
-			    m (attributes ctx-2)
-			    :when (exists [x (intersection (attributes ctx-1)
-							   (objects ctx-2))]
-					  (and ((incidence ctx-1) [g x])
-					       ((incidence ctx-2) [x m])))])))
+                   (attributes ctx-2)
+                   (set-of [g m]
+                           [g (objects ctx-1)
+                            m (attributes ctx-2)
+                            :when (exists [x (intersection (attributes ctx-1)
+                                                           (objects ctx-2))]
+                                          (and ((incidence ctx-1) [g x])
+                                               ((incidence ctx-2) [x m])))])))

 (defn context-apposition
   "Returns context apposition of ctx-1 and ctx-2, that is
@@ -465,9 +465,9 @@
   (if (not= (objects ctx-1) (objects ctx-2))
     (illegal-argument "Cannot do context apposition, since object sets are not equal."))
   (let [new-atts (union (set-of [m 1] [m (attributes ctx-1)])
-			(set-of [m 2] [m (attributes ctx-2)]))
-	new-inz  (union (set-of [g [m 1]] [[g m] (incidence ctx-1)])
-			(set-of [g [m 2]] [[g m] (incidence ctx-2)]))]
+                        (set-of [m 2] [m (attributes ctx-2)]))
+        new-inz  (union (set-of [g [m 1]] [[g m] (incidence ctx-1)])
+                        (set-of [g [m 2]] [[g m] (incidence ctx-2)]))]
     (make-context-nc (objects ctx-1) new-atts new-inz)))

 (defn context-subposition
@@ -479,9 +479,9 @@
   (if (not= (attributes ctx-1) (attributes ctx-2))
     (illegal-argument "Cannot do context subposition, since attribute sets are not equal."))
   (let [new-objs (union (set-of [g 1] [g (objects ctx-1)])
-			(set-of [g 2] [g (objects ctx-2)]))
-	new-inz  (union (set-of [[g 1] m] [[g m] (incidence ctx-1)])
-			(set-of [[g 2] m] [[g m] (incidence ctx-2)]))]
+                        (set-of [g 2] [g (objects ctx-2)]))
+        new-inz  (union (set-of [[g 1] m] [[g m] (incidence ctx-1)])
+                        (set-of [[g 2] m] [[g m] (incidence ctx-2)]))]
     (make-context-nc new-objs (attributes ctx-1) new-inz)))

 (defn context-transitive-closure
@@ -534,19 +534,19 @@
   where all set unions are disjoint set unions."
   [ctx-1 ctx-2]
   (let [new-objs (union (set-of [g_1 1] [g_1 (objects ctx-1)])
-			(set-of [g_2 2] [g_2 (objects ctx-2)]))
-	new-atts (union (set-of [m_1 1] [m_1 (attributes ctx-1)])
-			(set-of [m_2 2] [m_2 (attributes ctx-2)]))
-	new-inz  (union (set-of [[g_1 1] [m_1 1]]
-				[[g_1 m_1] (incidence ctx-1)])
-			(set-of [[g_2 2] [m_2 2]]
-				[[g_2 m_2] (incidence ctx-2)])
-			(set-of [[g_1 1] [m_2 2]]
-				[g_1 (objects ctx-1)
-				 m_2 (attributes ctx-2)])
-			(set-of [[g_2 2] [m_1 1]]
-				[g_2 (objects ctx-2)
-				 m_1 (attributes ctx-1)]))]
+                        (set-of [g_2 2] [g_2 (objects ctx-2)]))
+        new-atts (union (set-of [m_1 1] [m_1 (attributes ctx-1)])
+                        (set-of [m_2 2] [m_2 (attributes ctx-2)]))
+        new-inz  (union (set-of [[g_1 1] [m_1 1]]
+                                [[g_1 m_1] (incidence ctx-1)])
+                        (set-of [[g_2 2] [m_2 2]]
+                                [[g_2 m_2] (incidence ctx-2)])
+                        (set-of [[g_1 1] [m_2 2]]
+                                [g_1 (objects ctx-1)
+                                 m_2 (attributes ctx-2)])
+                        (set-of [[g_2 2] [m_1 1]]
+                                [g_2 (objects ctx-2)
+                                 m_1 (attributes ctx-1)]))]
     (make-context-nc new-objs new-atts new-inz)))

 (defn context-product
@@ -561,14 +561,14 @@
   \\]"
   [ctx-1 ctx-2]
   (let [new-objs (cross-product (objects ctx-1) (objects ctx-2))
-	new-atts (cross-product (attributes ctx-1) (attributes ctx-2))
-	inz-1    (incidence ctx-1)
-	inz-2    (incidence ctx-2)
-	new-inz  (set-of [[g_1, g_2], [m_1, m_2]]
-			 [[g_1, g_2] new-objs
-			  [m_1, m_2] new-atts
-			  :when (or (inz-1 [g_1, m_1])
-				    (inz-2 [g_2, m_2]))])]
+        new-atts (cross-product (attributes ctx-1) (attributes ctx-2))
+        inz-1    (incidence ctx-1)
+        inz-2    (incidence ctx-2)
+        new-inz  (set-of [[g_1, g_2], [m_1, m_2]]
+                         [[g_1, g_2] new-objs
+                          [m_1, m_2] new-atts
+                          :when (or (inz-1 [g_1, m_1])
+                                    (inz-2 [g_2, m_2]))])]
     (make-context-nc new-objs new-atts new-inz)))

 (defn context-semiproduct
@@ -584,12 +584,12 @@
   \\]"
   [ctx-1 ctx-2]
   (let [new-objs (cross-product (objects ctx-1) (objects ctx-2))
-	new-atts (disjoint-union (attributes ctx-1) (attributes ctx-2))
-	inzs     [(incidence ctx-1) (incidence ctx-2)]
-	new-inz  (set-of [g, [m, idx]]
-			 [g new-objs
-			  [m, idx] new-atts
-			  :when ((inzs idx) [(g idx) m])])]
+        new-atts (disjoint-union (attributes ctx-1) (attributes ctx-2))
+        inzs     [(incidence ctx-1) (incidence ctx-2)]
+        new-inz  (set-of [g, [m, idx]]
+                         [g new-objs
+                          [m, idx] new-atts
+                          :when ((inzs idx) [(g idx) m])])]
     (make-context-nc new-objs new-atts new-inz)))

 (defn context-xia-product
@@ -604,19 +604,19 @@
   \\]."
   [ctx-1 ctx-2]
   (let [G_1 (objects ctx-1)
-	G_2 (objects ctx-2)
-	M_1 (attributes ctx-1)
-	M_2 (attributes ctx-2)
-	I_1 (incidence ctx-1)
-	I_2 (incidence ctx-2)
-
-	new-objs (cross-product G_1 G_2)
-	new-atts (cross-product M_1 M_2)
-	new-inz  (set-of [[g_1, g_2], [m_1, m_2]]
-			 [[g_1,g_2] new-objs
-			  [m_1,m_2] new-atts
-			  :when (<=> (I_1 [g_1,m_1])
-				     (I_2 [g_2,m_2]))])]
+        G_2 (objects ctx-2)
+        M_1 (attributes ctx-1)
+        M_2 (attributes ctx-2)
+        I_1 (incidence ctx-1)
+        I_2 (incidence ctx-2)
+
+        new-objs (cross-product G_1 G_2)
+        new-atts (cross-product M_1 M_2)
+        new-inz  (set-of [[g_1, g_2], [m_1, m_2]]
+                         [[g_1,g_2] new-objs
+                          [m_1,m_2] new-atts
+                          :when (<=> (I_1 [g_1,m_1])
+                                     (I_2 [g_2,m_2]))])]
     (make-context-nc new-objs new-atts new-inz)))

 ;;;


Remove println

Remove println

--- src/grimoire/api/web/read.clj
+++ src/grimoire/api/web/read.clj
@@ -24,7 +24,6 @@
   (:body result))

 (defn make-request [config thing op]
-  (println config (:uri thing) op)
   (str (-> config :datastore :host)
        baseurl (:uri thing)
        "?op=" op "&type=edn"))


Revert "Support slurp url w/o explicit require planck.http"

This reverts commit 1f5cfa44f92c2055eb61eb23217b27da98026e10.

--- planck-cljs/src/planck/io.cljs
+++ planck-cljs/src/planck/io.cljs
@@ -160,6 +160,3 @@
 (set! planck.core/*reader-fn* reader)
 (set! planck.core/*writer-fn* writer)
 (set! planck.core/*as-file-fn* as-file)
-
-;; Ensure planck.http is loaded so that HTTP Uri facilities are available
-(js/goog.require "planck.http")


Ability to close files

Ability to close files

--- planck-cljs/src/planck/io.cljs
+++ planck-cljs/src/planck/io.cljs
@@ -38,13 +38,19 @@
       (as-file (.getPath u))
       (throw (js/Error. (str "Not a file: " u))))))

+(defprotocol IClosaeable
+  (-close [this]))
+
 (defprotocol IReader
   (-read [this] "Returns available characters as a string or nil of EOF."))

 (defrecord Reader [raw-read raw-close]
   IReader
   (-read [_]
-    (raw-read)))
+    (raw-read))
+  IClosaeable
+  (-close [_]
+    (raw-close)))

 (defrecord Writer [raw-write raw-flush]
   IWriter


Reflect time zone to updated date time

Reflect time zone to updated date time

--- src/halake_api/routes/api.clj
+++ src/halake_api/routes/api.clj
@@ -4,9 +4,17 @@
             [ring.util.response :as response]
             [taoensso.timbre :as timbre]
             [ring.middleware.format-response :refer [wrap-json-response]]
+            [clj-time
+             [core :as t]
+             [coerce :as coerce]]
             [halake-api.db.status :as status]))

 (def halake-api-key (env :halake-api-key))
+
+(defn to-date-str [date]
+  (-> (coerce/from-date date)
+      (t/to-time-zone (t/time-zone-for-id "Asia/Tokyo"))
+      str))

 ;;
 ;; Unauthorized routes
@@ -14,6 +22,7 @@
 (defn retrieve-latest [key]
   (if-let [status (-> (status/retrieve-latest-status key)
                       (select-keys [key :updated-at])
+                      (update-in [:updated-at] to-date-str)
                       (assoc :status :ok))]
     (response/response status)))


typo

typo

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@9332 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- plugins/SlideExplorer2/src/slide_explorer/display.clj
+++ plugins/SlideExplorer2/src/slide_explorer/display.clj
@@ -73,7 +73,7 @@
     [(.x p) (.y p)]))

 (defn stage-to-pixels [^AffineTransform transform [x y]]
-  (let [p (.inverseTransform trasnform (Point2D$Double. x y) nil)]
+  (let [p (.inverseTransform transform (Point2D$Double. x y) nil)]
     [(.x p) (.y p)]))

 ;; tile image handling


Moving functions around in the dalap.html.selector ns

All the functions related to TreeSelector (match-selector, match-selector*)
were moved near the protocol impl for PersistentVectors, this way
you can see the purpose of the functions right away.

--- src/dalap/html/selector.clj
+++ src/dalap/html/selector.clj
@@ -13,6 +13,66 @@
 (defn- span [p xs]
   ((juxt (partial take-while p)
          (partial drop-while p)) xs))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; NodeSelector/TreeSelector/NodeVisitor protocols
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defprotocol NodeSelector
+  "This protocol provides a function that returns another
+  function that accepts a node from the dalap Tree and checks
+  if it matches with the given implementing type."
+  (to-node-selector [spec]))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn- dom-matches-tag-selector?
+  "Tells if a DomNode instance matches a given selector."
+  [dom-node tag-selector]
+  (let [[_ tag id class] (re-matches html/re-tag (name tag-selector))]
+    (and (html/has-tag-name? dom-node tag)
+         (if (nil? id)
+           true
+           (html/has-id? dom-node id))
+         (if (nil? class)
+           true
+           (html/has-class? dom-node class)))))
+
+
+(extend-protocol NodeSelector
+  ;; On Keywords it will try to match to DomNode instances.
+  clojure.lang.Keyword
+  (to-node-selector [dom-node-kw]
+    (fn dom-node-matcher [node]
+      (if (html/dom-node? node)
+        (dom-matches-tag-selector? node dom-node-kw))))
+
+  ;; Something that behaves like function will always match
+  ;; and return itself.
+  clojure.lang.IFn
+  (to-node-selector [sfn] sfn)
+
+  ;; Anything else, it will check the dalap node type is
+  ;; equal to the object.
+  Object
+  (to-node-selector [type_]
+    (fn type-matcher [node]
+      (= (type node) type_))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defprotocol TreeSelector
+  "This protocol provides a function that returns another
+  function that matches the given implementing type
+  to nodes on the dalap tree.
+
+  NOTE: This is currently only being used on vectors of NodeSelector and
+  function like types."
+  (to-tree-selector [spec]))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (defn match-selector
   "Grabs a node from history that matches the given
@@ -52,64 +112,6 @@

 (defn- matching-node [selector history]
   (first (match-selector* selector history)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Node/Tree/NodeVisitor protocols
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defprotocol NodeSelector
-  "This protocol provides a function that returns another
-  function that accepts a node from the dalap Tree and checks
-  if it matches with the given implementing type."
-  (to-node-selector [spec]))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn- dom-matches-tag-selector?
-  "Tells if a DomNode instance matches a given selector."
-  [dom-node tag-selector]
-  (let [[_ tag id class] (re-matches html/re-tag (name tag-selector))]
-    (and (html/has-tag-name? dom-node tag)
-         (if (nil? id)
-           true
-           (html/has-id? dom-node id))
-         (if (nil? class)
-           true
-           (html/has-class? dom-node class)))))
-
-
-(extend-protocol NodeSelector
-  ;; On Keywords it will try to match to DomNode instances.
-  clojure.lang.Keyword
-  (to-node-selector [dom-node-kw]
-    (fn dom-node-matcher [node]
-      (if (html/dom-node? node)
-        (dom-matches-tag-selector? node dom-node-kw))))
-
-  ;; Something that behaves like function will always match
-  ;; and return itself.
-  clojure.lang.IFn
-  (to-node-selector [sfn] sfn)
-
-  ;; Anything else, it will check the dalap node type is
-  ;; equal to the object.
-  Object
-  (to-node-selector [type_]
-    (fn type-matcher [node]
-      (= (type node) type_))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defprotocol TreeSelector
-  "This protocol provides a function that returns another
-  function that matches the given implementing type
-  to nodes on the dalap tree.
-
-  NOTE: This is currently only being used on vectors of NodeSelector and
-  function like types."
-  (to-tree-selector [spec]))

 (extend-protocol TreeSelector


Intermediary work on REST API

Intermediary work on REST API

--- src/icecap/rest.clj
+++ src/icecap/rest.clj
@@ -1,10 +1,12 @@
 (ns icecap.rest
   "The REST API for icecap."
-  (:require [clojure.core.async :refer [<!!]]
+  (:require [clojure.core.async :refer [<!! <! go] :as async]
             [compojure.core :refer [defroutes context GET POST DELETE]]
-            [icecap.codec :refer [safebase64-decode]]
+            [icecap.codec :refer [safebase64-encode safebase64-decode]]
             [icecap.crypto :as crypto]
+            [icecap.handlers.core :refer [execute]]
             [icecap.store.api :refer [create! retrieve delete!]]
+            [taoensso.timbre :refer [info spy]]
             [taoensso.nippy :as nippy]
             [prone.debug :refer [debug]]
             [prone.middleware :refer [wrap-exceptions]]
@@ -13,34 +15,42 @@
             [ring.middleware.reload :refer [wrap-reload]]))

 (defn create-cap
-  [cap & {store :store kdf :kdf scheme :scheme}]
+  [plan & {store :store kdf :kdf scheme :scheme}]
+  (info plan)
   (let [cap (crypto/make-cap)
         {index :index key :key} (crypto/hardcoded-derive kdf cap)
-        encoded-plan (nippy/freeze)
-        encrypted-plan (crypto/encrypt scheme key encoded-plan)
-        ]))
+        encoded-plan (nippy/freeze plan)
+        blob (crypto/encrypt scheme key encoded-plan)
+        ch (create! store index blob)]
+    (async/into {:cap cap} ch)))

 (defn get-cap
   [cap & {store :store kdf :kdf scheme :scheme}]
-  (let [{index :index key :key} (crypto/hardcoded-derive kdf cap)
-        blob (<!! (retrieve store index))
-        encoded-plan (crypto/decrypt scheme key blob)
-        plan (nippy/thaw encoded-plan)
-        sub-results nil] ;; (execute plan)
-    ;; FIXME: maybe it would be better to write this with ->>?
-    (into [] sub-results)))
+  (go (let [{index :index key :key} (crypto/hardcoded-derive kdf cap)
+            blob (<! (retrieve store index))
+            encoded-plan (crypto/decrypt scheme key blob)
+            plan (spy (nippy/thaw encoded-plan))
+            sub-results (execute plan)]
+      (async/into {} sub-results))))

 (defn delete-cap
   [cap & {store :store}]
-  (delete! store cap))
+  (async/into {} (delete! store cap)))

 (defroutes routes
-  (context "/v0/caps" []
-           (POST "/" request (debug))
-           (context "/:encoded-cap" [encoded-cap :as {store :store kdf :kdf scheme :scheme}]
-                    (GET "/" [] (<!! (get-cap (safebase64-decode encoded-cap)
-                                              :store store :kdf kdf :scheme scheme)))
-                    (DELETE "/" [] (<!! (delete-cap (safebase64-decode encoded-cap)
+  (context "/v0/caps" {store :store kdf :kdf scheme :scheme}
+           (POST "/" {plan :body-params :as request}
+                 (let [{cap :cap} (<!! (create-cap plan :store store :kdf kdf :scheme scheme))
+                       encoded-cap (safebase64-encode cap)
+                       url (str "http://" (:server-name request) ":" (:port request)
+                                (:uri request) "/" encoded-cap)]
+                   {:body {:cap encoded-cap :url url}}))
+           (context "/:encoded-cap" [encoded-cap]
+                    (GET "/" []
+                         (<!! (get-cap (safebase64-decode encoded-cap)
+                                       :store store :kdf kdf :scheme scheme)))
+                    (DELETE "/" []
+                            (<!! (delete-cap (safebase64-decode encoded-cap)
                                                     :store store))))))

 (defn ^:private wrap-components


Add correct action to 'Send Invites' button

--- src-cljs/frontend/components/pages/team.cljs
+++ src-cljs/frontend/components/pages/team.cljs
@@ -138,11 +138,13 @@
                                    "bitbucket" [:i.fa.fa-bitbucket]
                                    nil)])
                    :action  (html
-                                (let [users (remove :circle_member (:github-users (:invite-data app)))
+                                (let [invite-data (:invite-data app)
+                                      users (remove :circle_member (:github-users invite-data))
+                                      opts {:vcs_type (:vcs_type invite-data)
+                                            :org-name (:org invite-data)}
                                       count-users (count users)
                                       count-with-email (count (filter #(utils/valid-email? (:email %)) users))
                                       count-selected (count (filter #(:checked %) users))]
-                                    ;; TODO -ac You can turn all of this vvvvv into an :action for the title of the card!
                                     [:div (when (:invite-teammates? (om/get-render-state owner))
                                               (component
                                                   (modal/modal-dialog {:title "Invite Teammates"
@@ -197,8 +199,11 @@
                                                                        :actions [(button/button {:on-click #(om/set-state! owner :invite-teammates? false)} "Cancel")
                                                                                (forms/managed-button
                                                                                [:button.btn.btn-success {:data-success-text "Sent"
-                                                                                ;; :on-click #(raise! owner [:invited-github-users {:invitees (invitees users)}])
-                                                                                :on-click #(.log js/console "Send the emails in this on-click!" (seq (invitees users)))
+                                                                                :on-click #(raise! owner [:invited-github-users (merge {:invitees (invitees users)
+                                                                                :vcs_type (:vcs_type opts)}
+                                                                                (if (:project-name opts)
+                                                                                {:project-name (:project-name opts)}
+                                                                                {:org-name (:org-name opts)}))])
                                                                                :disabled (or (empty? (invitees users))
                                                                                (not (every? #(utils/valid-email? (:email %)) (invitees users))))}
                                                                                "Send Invites "


Reindent Clojure code

Reindent Clojure code

--- atlasdb-jepsen-tests/src/jepsen/atlasdb/lock.clj
+++ atlasdb-jepsen-tests/src/jepsen/atlasdb/lock.clj
@@ -8,8 +8,8 @@
             [jepsen.util :refer [timeout]]
             [knossos.history :as history]
             [clojure.java.io :refer [writer]])
-    (:import com.palantir.atlasdb.jepsen.JepsenHistoryChecker)
-    (:import com.palantir.atlasdb.http.LockClient))
+  (:import com.palantir.atlasdb.jepsen.JepsenHistoryChecker)
+  (:import com.palantir.atlasdb.http.LockClient))

 (def lock-names ["bob" "sarah" "alfred" "shelly"])

@@ -37,36 +37,36 @@
     (setup!
       [this test node]
       "Factory that returns an object implementing client/Client"
-        (create-client
-          (LockClient/create '("n1" "n2" "n3" "n4" "n5"))
-          (name node)
-          (create-token-store)))
+      (create-client
+        (LockClient/create '("n1" "n2" "n3" "n4" "n5"))
+        (name node)
+        (create-token-store)))

     (invoke!
       [this test op]
       "Run an operation on our client"
       (timeout (* 30 1000)
-          (assoc op :type :fail :error :timeout)
-          (try
-            (let [lock-name (:value op)
-                  token-store-key (str client-name lock-name)]
-              (case (:f op)
-                :lock
-                  (let [response (LockClient/lock lock-service client-name lock-name)]
-                    (do (replace-token token-store token-store-key response)
-                        (assoc-ok-value op response [client-name lock-name])))
-                :unlock
-                  (let [token (@token-store token-store-key)
-                        response (LockClient/unlock lock-service token)]
-                    (do (replace-token token-store token-store-key nil)
-                        (assoc-ok-value op response token)))
-                :refresh
-                  (let [token (@token-store token-store-key)
-                        response (LockClient/refresh lock-service token)]
-                    (do (replace-token token-store token-store-key token)
-                        (assoc-ok-value op response token)))))
-          (catch Exception e
-            (assoc op :type :fail :error (.toString e))))))
+        (assoc op :type :fail :error :timeout)
+        (try
+          (let [lock-name (:value op)
+                token-store-key (str client-name lock-name)]
+            (case (:f op)
+              :lock
+                (let [response (LockClient/lock lock-service client-name lock-name)]
+                  (do (replace-token token-store token-store-key response)
+                      (assoc-ok-value op response [client-name lock-name])))
+              :unlock
+                (let [token (@token-store token-store-key)
+                      response (LockClient/unlock lock-service token)]
+                  (do (replace-token token-store token-store-key nil)
+                      (assoc-ok-value op response token)))
+              :refresh
+                (let [token (@token-store token-store-key)
+                      response (LockClient/refresh lock-service token)]
+                  (do (replace-token token-store token-store-key token)
+                      (assoc-ok-value op response token)))))
+        (catch Exception e
+          (assoc op :type :fail :error (.toString e))))))

     (teardown! [_ test])))


If you think it's a good idea, it's probably already in core

--- src/themis/core.clj
+++ src/themis/core.clj
@@ -104,13 +104,13 @@
   available cores, and validates the chunks in parallel."
   [t rule-set]
   (let [normalized-rules (rules/normalize rule-set)
-        chunks (.availableProcessors (Runtime/getRuntime))
+        chunks (+ 2  (.. Runtime getRuntime availableProcessors))
         rule-count (count normalized-rules)
         chunked-rules (vec (partition-all (/ rule-count chunks) normalized-rules))
         validate-vec-fn #(validate-vec t %)]
     (when (rules/balanced? normalized-rules)
-      (into [] (mapcat deref
-                       (map #(future (mapcat validate-vec-fn %))
+      (into [] (apply concat
+                      (pmap #(mapcat validate-vec-fn %)
                             chunked-rules))))))

 (defn pvalidation


add recur skeleton

add recur skeleton

--- ohack/src/ohack/core.clj
+++ ohack/src/ohack/core.clj
@@ -182,4 +182,16 @@

       ]
   ;; now we have all the indices of lines we care about
-  (map first index-line-list))
+  ;; and we need to group them into blocks of 6 lines.
+  ;; blocks of 6 lines must occur with consecutive line
+  ;; indexes, so lets detect that.
+
+  ;; set up our recursion skeleton.
+  ;; it returns a copy of the original list
+  (loop [input (map first index-line-list)
+         rtn []]
+    (if (empty? input)
+      rtn
+      (recur (rest input)
+             (conj rtn (first input)))))
+  )


Fix error message in JSON object parsing

--- src/main/clojure/clojure/data/json_new.clj
+++ src/main/clojure/clojure/data/json_new.clj
@@ -62,7 +62,7 @@
   (loop [key nil, result (transient {})]
     (let [c (.read stream)]
       (when (neg? c)
-        (throw (EOFException. "JSON error (end-of-file inside array)")))
+        (throw (EOFException. "JSON error (end-of-file inside object)")))
       (codepoint-case c
         :whitespace (recur key result)


Throw if hornetq ns is used in-container [IMMUTANT-544]

--- messaging/src/immutant/messaging/hornetq.clj
+++ messaging/src/immutant/messaging/hornetq.clj
@@ -26,8 +26,10 @@
 (defn ^JMSServerManager server-manager
   "Retrieves the local JMS server mananger instance."
   []
-  (when-let [^HQMessaging broker (broker nil)]
-    (.jmsServerManager broker)))
+  (if (pu/in-container?)
+    (throw (IllegalStateException. "immutant.messaging.hornetq functions can't be used in-container"))
+    (when-let [^HQMessaging broker (broker nil)]
+      (.jmsServerManager broker))))

 (defn ^:private ^String jms-name [dest]
   (if-let [wd (-> dest meta :wrapped-destination)]


calling controller ns from model causes a compilation problem with :advanced mode

--- src/app/cljs/one/sample/model.cljs
+++ src/app/cljs/one/sample/model.cljs
@@ -1,7 +1,6 @@
 (ns ^{:doc "Contains client-side state, validators for input fields
   and functions which react to changes made to the input fields."}
   one.sample.model
-  (:use [one.sample.controller :only [load-local-docs]])
   (:require [one.dispatch :as dispatch]
             [local        :as local]))

@@ -53,5 +52,5 @@
 (dispatch/react-to #{:storage-updated}
                    (fn [_ _]
                      (.log js/console ":storage-updated")
-                     (comment (load-local-docs)
+                     (comment
                               (dispatch/fire (keyword (:document @state))))))


Improve rendition of hue, saturation gauges.

--- src/afterglow/controllers/ableton_push_2.clj
+++ src/afterglow/controllers/ableton_push_2.clj
@@ -770,15 +770,15 @@
   [controller index encoder-count value active?]
   (let [graphics (create-graphics controller)
         x-center (+ (* index button-cell-width) (* encoder-count 0.5 button-cell-width))
-        arc (java.awt.geom.Arc2D$Double. (- x-center 20.0) 50.0 40.0 40.0 270.0 -1.0 java.awt.geom.Arc2D/OPEN)]
-    (dotimes [i 360]
-      (.setAngleStart arc (- 270.0 i))
-      (set-graphics-color graphics (colors/create-color :h i :s 70.0 :l 35.0))
+        arc (java.awt.geom.Arc2D$Double. (- x-center 20.0) 50.0 40.0 40.0 270.0 -5.0 java.awt.geom.Arc2D/OPEN)]
+    (dotimes [i 72]
+      (.setAngleStart arc (- 270.0 (* i 5)))
+      (set-graphics-color graphics (colors/create-color :h (* i 5) :s 100.0 :l 50.0))
       (.draw graphics arc))
     (.setStroke graphics (java.awt.BasicStroke. 6.0 java.awt.BasicStroke/CAP_ROUND java.awt.BasicStroke/JOIN_ROUND))
     (if active?
       (set-graphics-color graphics (colors/create-color :h value :s 100.0 :l 50.0))
-      (set-graphics-color graphics (colors/create-color :h value :s 70.0 :l 35.0)))
+      (set-graphics-color graphics (colors/create-color :h value :s 100.0 :l 25.0)))
     (.setAngleStart arc (- 270.0 value))
     (.setAngleExtent arc 0.0)
     (.draw graphics arc)))
@@ -793,13 +793,13 @@
         arc (java.awt.geom.Arc2D$Double. (- x-center 20.0) 50.0 40.0 40.0 240.0 -3.0 java.awt.geom.Arc2D/OPEN)]
     (dotimes [i 100]
       (.setAngleStart arc (- 240.0 (* i 3)))
-      (set-graphics-color graphics (colors/create-color :h hue :s i :l 35.0))
+      (set-graphics-color graphics (colors/create-color :h hue :s i :l 50.0))
       (.draw graphics arc))
     (.setStroke graphics (java.awt.BasicStroke. 5.0 java.awt.BasicStroke/CAP_ROUND java.awt.BasicStroke/JOIN_ROUND))
-    (dotimes [i (math/round value)]
+    (dotimes [i (max (math/round value) 1)]
       (if active?
         (set-graphics-color graphics (colors/create-color :h hue :s i :l 50.0))
-        (set-graphics-color graphics (colors/create-color :h value :s i :l 35.0)))
+        (set-graphics-color graphics (colors/create-color :h hue :s i :l 25.0)))
       (.setAngleStart arc (- 240.0 (* i 3)))
       (.draw graphics arc))))


fix Italian morphology for nouns ending in "-io"

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -230,7 +230,9 @@
        (string? (get-in word '(:plur))))
       (get-in word '(:plur))

-      ;; regular masculine nouns
+      ;; regular masculine nouns.
+      ;; dottore => dottori; medico => medici
+      ;; note the 'i?': figlio => figli, not *figlii.
       (and
        (string? (get-in word [:italiano]))
        (= (get-in word '(:agr :gender)) :masc)
@@ -239,7 +241,7 @@
        (not (= true (get-in word '(:pronoun))))
        (get-in word [:italiano]))
       (string/replace (get-in word [:italiano])
-                      #"[eo]$" "i") ;; dottore => dottori; medico => medici
+                      #"i?[eo]$" "i")

       ;; regular feminine nouns ending in 'e':
       (and


~(def patterns): add word boundary conditions

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -23,8 +23,8 @@
    [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unify)]))

 (def patterns
-  [[#"(c)i ([eè])"      "$1'$2"]  ;; ci è -> c'è
-   [#"l[ao] ([aeiouh])" "l'$1"]   ;; io la ho visto-> l'ho visto
+  [[#"\b(c)i ([eè])"      "$1'$2"]  ;; ci è -> c'è
+   [#"\bl[ao] ([aeiouh])" "l'$1"]   ;; io la ho visto-> l'ho visto
    ])

 ;; TODO: move this to morphology/prepositions.edn,


cleanup: remove dead code

cleanup: remove dead code

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -30,15 +30,6 @@
    determiners/replace-patterns
    nouns/replace-patterns
    verbs/replace-patterns))
-
-(defn phrase-is-finished? [phrase]
-  (cond
-   (string? phrase) true
-   (map? phrase)
-   (or (phrase-is-finished? (get-in phrase '(:italiano)))
-       (and (phrase-is-finished? (get-in phrase '(:a)))
-            (phrase-is-finished? (get-in phrase '(:b)))))
-   :else false))

 (defn suffix-of [word]
   "compute the final character given a lexical entry and agreement info in :agr."
@@ -1261,128 +1252,6 @@
       )
      concat)))

-(defn stem-for-passato-prossimo [infinitive]
-  "_infinitive_ should be a string (italian verb infinitive form)"
-  (string/replace infinitive #"^(.*)([aei])(re)$" (fn [[_ prefix vowel suffix]] (str prefix))))
-
-(defn passato-prossimo [infinitive]
-  (str (stem-for-passato-prossimo infinitive) "ato"))
-
-;; allows reconstruction of the infinitive form from the inflected form
-(def future-to-infinitive-irreg1
-  {
-   ;; future
-   #"cherò$"
-   {:replace-with "care"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :sing
-                                  :person :1st}}}}
-   #"cherai$"
-   {:replace-with "care"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :sing
-                                  :person :2nd}}}}
-   #"cherà$"
-   {:replace-with "care"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :sing
-                                  :person :3rd}}}}
-   #"cheremo$"
-   {:replace-with "care"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :plur
-                                  :person :1st}}}}
-   #"cherete$"
-   {:replace-with "care"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :plur
-                                  :person :2nd}}}}
-   #"cheranno$"
-   {:replace-with "care"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :plur
-                                  :person :3rd}}}}})
-
-;; allows reconstruction of the infinitive form from the inflected form
-(def future-to-infinitive
-  {
-   ;; future
-   #"ò$"
-   {:replace-with "e"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :sing
-                                  :person :1st}}}}
-   #"ai$"
-   {:replace-with "e"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :sing
-                                  :person :2nd}}}}
-   #"à$"
-   {:replace-with "e"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :sing
-                                  :person :3rd}}}}
-   #"emo$"
-   {:replace-with "e"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :plur
-                                  :person :1st}}}}
-   #"ete$"
-   {:replace-with "e"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :plur
-                                  :person :2nd}}}}
-   #"anno$"
-   {:replace-with "e"
-    :unify-with {:italiano {:infl :future
-                            :agr {:number :plur
-                                  :person :3rd}}}}})
-
-(def imperfect-to-infinitive-irreg1
-  {
-   ;; e.g.: "bevevo/bevevi/..etc" => "bere"
-   #"vevo$"
-   {:replace-with "re"
-    :unify-with {:italiano {:infl :imperfect
-                            :agr {:number :sing
-                                  :person :1st}}}}
-
-   #"vevi$"
-   {:replace-with "re"
-    :unify-with {:italiano {:infl :imperfect
-                            :agr {:number :sing
-                                  :person :2nd}}}}
-
-   #"veva$"
-   {:replace-with "re"
-    :unify-with {:italiano {:infl :imperfect
-                            :agr {:number :sing
-                                  :person :3rd}}}}
-   })
-
-(def past-to-infinitive
-  {#"ato$"
-   {:replace-with "are"
-    :unify-with {:italiano {:infl :past}}}
-
-   #"ito$"
-   {:replace-with "ire"
-    :unify-with {:italiano {:infl :past}}}
-
-   #"uto$"
-   {:replace-with "ere"
-    :unify-with {:italiano {:infl :past}}}})
-
-(def identity-analyzers
-  {:infinitive-verbs
-   {:unify-with {:synsem {:cat :verb
-                          :infl :infinitive}}}
-   :singular-nouns
-   {:unify-with {:synsem {:cat :noun
-                          :agr {:number :sing}}}}
-   :determiners
-   {:unify-with {:synsem {:cat :det}}}})
-
 (defn analyze-regular [surface-form lexicon]
   "do regular (i.e. non-exceptional) morphological analysis to determine lexical information for a conjugated surface-form"
   (mapcat


switched from Weather.com to WeatherSpark.com for !weather

--- src/xebang/apps.clj
+++ src/xebang/apps.clj
@@ -20,7 +20,7 @@

 (def catalog
   {'!bible   "http://www.bible.com/search?q={{{s}}}"
-   '!weather "http://www.weather.com/weather/hourbyhour/graph/{{{s}}}"
+   '!weather "http://weatherspark.com/#!dashboard;q={{{s}}}"
    '!devdocs "http://devdocs.io/#q={{{s}}}"
    '!js      "http://devdocs.io/#q=js {{{s}}}"
    '!css     "http://devdocs.io/#q=css {{{s}}}"


Add Make admin button

Add Make admin button

--- src/braid/users/client/views/users_page.cljs
+++ src/braid/users/client/views/users_page.cljs
@@ -5,7 +5,12 @@
 (defn user-view
   [user]
   (let [nickname (:nickname user)]
-    [:tr.user [:td.nickname nickname]]))
+    [:tr.user
+     [:td.nickname nickname]
+     [:td.action [:button.make-admin
+                  {:on-click
+                   (fn [_])}
+                  "Make Admin"]]]))

 (defn users-page-view []
   (let [users @(subscribe [:users])]
@@ -23,7 +28,8 @@
         [:table.users
          [:thead
           [:tr
-           [:th "Nickname"]]]
+           [:th "Nickname"]
+           [:th "Action"]]]
          [:tbody
           (doall
            (for [user users]


Add some comments on the use of wrap

Add some comments on the use of wrap

--- src/cljs/cglossa/search_inputs/cwb/core.cljs
+++ src/cljs/cglossa/search_inputs/cwb/core.cljs
@@ -272,9 +272,26 @@
                                                     #(vec (concat (subvec % 0 i)
                                                                   (subvec % (inc i))))))]
             (doall (for [index (range nqueries)]
-                     (let [wrapped-query       (reagent/wrap
-                                                 (nth @search-queries index)
-                                                 wrapped-query-changed search-queries index)
+                     ;; Use wrap rather than cursor to send individual queries down to
+                     ;; child components (and in the extended view, we do the same for
+                     ;; individual terms). When a query (or query term) changes, the wrap
+                     ;; callbacks are called all the way up to the one setting the top-level
+                     ;; search-queries ratom, and all query views (potentially) re-render.
+                     ;;
+                     ;; By using cursors we could have restricted re-rendering to smaller
+                     ;; sub-views, but we need to do some processing of the query (such as
+                     ;; changing " .* " to []) before updating it in the search-queries ratom.
+                     ;; We could do this with a getter/setter-style cursor, but then we would
+                     ;; have to update the search-queries ratom anyway, causing the same potential
+                     ;; re-rendering of all query views.
+                     ;;
+                     ;; Probably the most efficient approach would be to use a standard cursor
+                     ;; (which only re-renders the view that derefs it) and explicitly call the
+                     ;; query processing function before updating the cursor, but then we would
+                     ;; have to make sure to do that every time we change a query...
+                     (let [wrapped-query      (reagent/wrap
+                                                (nth @search-queries index)
+                                                wrapped-query-changed search-queries index)
                            selected-language  (-> @wrapped-query :query :lang)
                            remove-row-handler (partial remove-query index)]
                        ^{:key index}


fix human enrichment errors

fix human enrichment errors

--- src/cljs/gointermod/enrichment/handlers.cljs
+++ src/cljs/gointermod/enrichment/handlers.cljs
@@ -13,12 +13,17 @@

 (defn get-ids [organism]
+  (.log js/console "%corganism" "color:hotpink;font-weight:bold;" (clj->js organism) organism)
   (let [results (re-frame/subscribe [:multi-mine-results])
         active-filter (re-frame/subscribe [:active-filter])
         this-resultset (organism @results)]
-    (distinct (reduce (fn [new-vec result]
-      (conj new-vec (:ortho-db-id result) )
-) [] this-resultset))))
+    (filter number? ;exludes n/a and blank string results
+      (distinct (reduce (fn [new-vec result]
+        (conj new-vec (:ortho-db-id result)
+          ;add original genes if this is a human query.
+          (cond (= organism :human)
+            (:original-db-id result)))
+) [] this-resultset)))))

 (defn sort-by-pval [server-response]
   (let [results (:results server-response)]


fix dateinput errors

fix dateinput errors

--- src/cljs/re_form/inputs/date_input_impl.cljs
+++ src/cljs/re_form/inputs/date_input_impl.cljs
@@ -14,7 +14,7 @@
   (when x
     (if (= "us" fmt)
       (when-let [[_ m d y] (re-matches (get regexps "us") x)]
-        (str d "-" m "-" y))
+        (str y "-" m "-" d))
       (when (re-matches (get regexps "iso") x)
         x))))

@@ -35,21 +35,21 @@
                                           (dissoc :value)
                                           (assoc :show-error false)))))
         my-on-blur (fn [event on-blur]
-                     (swap! state assoc :show-error true)
+                     (when (:errors @state)
+                       (swap! state assoc :show-error true))
                      (on-blur))
         my-onchange (fn [event on-change]
                       (let [v (.. event -target -value)]
                         (swap! state assoc :value v)
                         (if-let [vv (parse fmt v)]
-                          (on-change vv)
+                          (do
+                            (on-change vv)
+                            (swap! state dissoc :errors))
                           (do
                             (swap! state assoc :errors
                                    (str "The format is: " (formats fmt)))))))]
     (r/create-class
-     {#_(:component-did-mount
-         (fn [this] (.log js/console "Mount")))
-
-      :component-will-receive-props
+     {:component-will-receive-props
       (fn [_ nextprops]
         (when-let [{v :value} (second nextprops)]
           (when-not (= v (:lastValue @state))


Logging.

Logging.

--- src/kixi/hecuba/data/misc.clj
+++ src/kixi/hecuba/data/misc.clj
@@ -219,7 +219,9 @@
    (hayt/logged false)))

 (defn insert-batch [session batch]
-  (db/execute session (prepare-batch batch)))
+  (let [batch-statement (prepare-batch batch)]
+    (log/debugf "Batch Statement: %s" batch-statement)
+    (db/execute session batch-statement)))

 (defn insert-measurements
   "Takes store, lazy sequence of measurements and
@@ -229,6 +231,5 @@
     (doseq [batch (partition-all page measurements)]
       (let [{:keys [min-date max-date]} (min-max-dates batch)]
         (log/debugf "Inserting %s records for dates between %s and %s for batch for Sensor: %s" (count batch) min-date max-date sensor)
-        (log/debugf "Batch %s" batch)
         (insert-batch session batch)
         (update-sensor-metadata store sensor min-date max-date)))))


Add transient method benchmarks

Add transient method benchmarks

--- src/bench/cljs/lean_map/bench.cljs
+++ src/bench/cljs/lean_map/bench.cljs
@@ -27,6 +27,12 @@
       (recur (assoc m (get test-keys i) i) (inc i))
       m)))

+(defn transient-sized-map [m n]
+  (loop [m (transient m) i 0]
+    (if (< i n)
+      (recur (assoc! m (get test-keys i) i) (inc i))
+      (persistent! m))))
+
 (defmulti map-bench
   (fn [benchmark _ _] benchmark))

@@ -34,6 +40,11 @@
   (println "Assoc")
   (doseq [[size sample] size->sample]
     (simple-benchmark [] (sized-map m size) sample)))
+
+(defmethod map-bench :transient-assoc [_ m _]
+  (println "Transient Assoc")
+  (doseq [[size sample] size->sample]
+    (simple-benchmark [] (transient-sized-map m size) sample)))

 (defmethod map-bench :dissoc [_ _ {:keys [small-map medium-map large-map]}]
   (println "Dissoc")
@@ -46,6 +57,18 @@
          (when (> i 0)
            (recur (dissoc m (get test-keys i)) (dec i))))
        sample))))
+
+(defmethod map-bench :transient-dissoc [_ _ {:keys [small-map medium-map large-map]}]
+  (println "Transient Dissoc")
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (simple-benchmark
+        []
+        (loop [m (transient m) i (count m)]
+          (when (> i 0)
+            (recur (dissoc! m (get test-keys i)) (dec i))))
+        sample))))

 (defmethod map-bench :dissoc-fail [_ _ {:keys [small-map medium-map large-map]}]
   (println "Dissoc Fail")
@@ -129,7 +152,7 @@
                      (range large-map-size)))

 (println "Current Maps")
-(let [benchmarks  [:assoc :dissoc :dissoc-fail :hash :equals :equals-fail :worst-equals :sequence :reduce]
+(let [benchmarks  [:assoc :transient-assoc :dissoc :transient-dissoc :dissoc-fail :hash :equals :equals-fail :worst-equals :sequence :reduce]
       empty-map cem
       data {:small-map (sized-map empty-map small-map-size)
             :medium-map (sized-map empty-map medium-map-size)
@@ -137,7 +160,7 @@
   (run-benchmarks benchmarks empty-map data))

 (println "Lean Maps")
-(let [benchmarks  [:assoc :dissoc :dissoc-fail :hash :equals :equals-fail :worst-equals :sequence :reduce]
+(let [benchmarks  [:assoc :transient-assoc :dissoc :transient-dissoc :dissoc-fail :hash :equals :equals-fail :worst-equals :sequence :reduce]
       empty-map lem
       data {:small-map (sized-map empty-map small-map-size)
             :medium-map (sized-map empty-map medium-map-size)


Got rid of the atom in dom->transaction

Got rid of the atom in dom->transaction

--- src/datascript_dom/core.clj
+++ src/datascript_dom/core.clj
@@ -70,17 +70,15 @@
   (concat (take 2 node) children))

 (defn dom->transaction [dom]
-  (let [id   (atom 0)
-        walk (fn walk [zipper]
+  (let [walk (fn walk [zipper id]
                (when-not (zip/end? zipper)
                  (let [zipper (zip/replace zipper
-                                           (assoc-in (as-node (zip/node zipper)) [1 ::id]
-                                                     (swap! id dec)))
+                                           (assoc-in (as-node (zip/node zipper)) [1 ::id] id))
                        parent (some-> zipper zip/up zip/node html/attributes ::id)
                        prev (some-> zipper zip/left zip/node html/attributes ::id)]
                    (cons (node-to-transaction (zip/node zipper) parent prev)
-                         (lazy-seq (walk (zip/next zipper)))))))]
-    (walk (zip/zipper has-children? html/children set-children dom))))
+                         (lazy-seq (walk (zip/next zipper) (dec id)))))))]
+    (walk (zip/zipper has-children? html/children set-children dom) -1)))

 (defn- dump [dom]
   (let [z (zip/zipper has-children? html/children set-children dom)]


oops, leftover conf

oops, leftover conf

--- src/random/learning/hermes/graphtests1.clj
+++ src/random/learning/hermes/graphtests1.clj
@@ -22,9 +22,6 @@
 (set!
   *warn-on-reflection*
   true)
-
-(def conf {:storage {:backend "berkeleydb"
-                     :hostname "127.0.0.1"}})

 (defn beforeTests [aVar graphVar]
   (var-set aVar (q/getUniqueFolder))
@@ -58,6 +55,7 @@
   )

 (defn testsFixture [testsHere]
+  ;XXX: tests better cannot be run on parallel or stuff will fail
   (with-local-vars [avar1 nil avar2 nil];(q/getUniqueFolder)]
     (try
       (do


Remove empty ns

Remove empty ns

--- src/rill/event_store/atom_store/client.clj
+++ src/rill/event_store/atom_store/client.clj
@@ -1,2 +0,0 @@
-(ns rill.event-store.atom-store.client)
-


Minor: maximize the canvas in the init function so we don't get an ugly small blue rectangle on first rendering

--- src/cljs/mandelbrot_cljs/core.cljs
+++ src/cljs/mandelbrot_cljs/core.cljs
@@ -184,6 +184,9 @@

     (start-event-handler! messages)

+    (maximize-canvas-dimensions! (:overlay-canvas @app-state))
+    (maximize-canvas-dimensions! (:canvas @app-state))
+
     (put! messages [:log {:level 1 :message "Initialisation function called..."}])

     (set! (.-onresize js/window) (fn [] (put! messages [:render])))


Vocabs - oops forgot theme

Vocabs - oops forgot theme

--- src/grafter/rdf/ontologies/ons_geography.clj
+++ src/grafter/rdf/ontologies/ons_geography.clj
@@ -18,6 +18,7 @@
 (def statistical-entity:lastinstancechange   (statistical-entity "lastinstancechange"))
 (def statistical-entity:code                 (statistical-entity "code"))
 (def statistical-entity:crossborderinstances (statistical-entity "crossborderinstances"))
+(def statistical-entity:theme                (statistical-entity "theme"))

 (def statistical-geography (prefixer "http://statistics.data.gov.uk/def/statistical-geography#"))
 (def statistical-geography:officialname      (statistical-entity "officialname"))


CMR-1383 Removes unnecessary let binding.

--- system-int-test/src/cmr/system_int_test/utils/ingest_util.clj
+++ system-int-test/src/cmr/system_int_test/utils/ingest_util.clj
@@ -74,14 +74,13 @@
 (defn update-ingest-provider
   "Updates the cmr-only attribute of an ingest provider."
   [provider-id cmr-only]
-  (let [response (client/put (url/ingest-provider-url provider-id)
-                             {:throw-exceptions false
-                              :body (json/generate-string {:provider-id provider-id
-                                                           :cmr-only cmr-only})
-                              :content-type :json
-                              :connection-manager (s/conn-mgr)
-                              :headers {transmit-config/token-header (transmit-config/echo-system-token)}})]
-    response))
+  (client/put (url/ingest-provider-url provider-id)
+              {:throw-exceptions false
+               :body (json/generate-string {:provider-id provider-id
+                                            :cmr-only cmr-only})
+               :content-type :json
+               :connection-manager (s/conn-mgr)
+               :headers {transmit-config/token-header (transmit-config/echo-system-token)}}))

 (defn reindex-collection-permitted-groups
   "Tells ingest to run the reindex-collection-permitted-groups job"


Derive x-axis markers in buffer plots from the plot size n

--- src/main/audio_utils/viz.cljs
+++ src/main/audio_utils/viz.cljs
@@ -13,8 +13,8 @@
   {:x-axis (viz/linear-axis
             {:domain      [0 n]
              :range       [50 (- width 10)]
-             :major       100
-             :minor       10
+             :major       (Math.ceil (* n 0.2))
+             :minor       (Math.ceil (* n 0.1))
              :pos         (- height 50)})
    :y-axis (viz/linear-axis
             {:domain      [-1.0 1.0]


Fix send-value! for false

Fix send-value! for false

--- src/asciinema/player/view.cljs
+++ src/asciinema/player/view.cljs
@@ -21,7 +21,7 @@

 (defn send-value! [ch f]
   (fn [dom-event]
-    (when-let [msg (f dom-event)]
+    (when-some [msg (f dom-event)]
       (put! ch msg)
       (.stopPropagation dom-event))))


Make utils/response more useful

Make utils/response more useful

--- src/io/aviso/rook/utils.clj
+++ src/io/aviso/rook/utils.clj
@@ -14,10 +14,15 @@

 (defn response
-  "Construct Ring response for success or other status."
-  ([body] (r/response body))
+  "Construct Ring response for success or other status.  If the status code is omitted, it defaults
+  to 200.  If only the body is provided, but it is numeric, then it is treated as a status code with
+  an empty body."
+  ([body]
+   (if (number? body)
+     (response body nil)
+     (r/response body)))
   ([status body] (->
-                   (response body)
+                   (r/response body)
                    (r/status status))))

 (defn pretty-print


{:pred :run}: subcat

{:pred :run}: subcat

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -1560,7 +1560,8 @@
                     :participle "running"
                     :past-participle "run"}
           :synsem {:cat :verb
-                   :sem {:pred :run}}}
+                   :sem {:pred :run}
+                   :subcat {:2 '()}}}

    "s" [(let [of (atom :top)]
           {:synsem {:agr {:number :sing}


fix comment

fix comment

--- src/metabase/models/query.clj
+++ src/metabase/models/query.clj
@@ -14,7 +14,7 @@
   (table :query_query))

-;; default fields to return for `sel Query
+;; default fields to return for `sel` Query
 (defmethod default-fields Query [_]
   [:id
    :created_at


Add a workaround for bug in Leiningen 1.6.2.

--- src/leiningen/bootstrap.clj
+++ src/leiningen/bootstrap.clj
@@ -1,10 +1,38 @@
 (ns leiningen.bootstrap
   "Bootstrap the project by running lein deps and lein git-deps."
-  (:require leiningen.deps
-            leiningen.git-deps))
+  (:use [leiningen.git-deps :only [git-deps]]
+        [leiningen.core :only [default-repos]]
+        [leiningen.deps :only [deps]]
+        [leiningen.util.maven :only [container make-remote-artifact
+                                     make-remote-repo make-local-repo]])
+  (:import (org.apache.maven.artifact.resolver ArtifactResolver)))
+
+;; There is a bug in Leiningen 1.6.2 which requires that you have
+;; Clojure 1.2.1 in the local maven repository when you are working on a
+;; Clojure 1.3 project. If the first project that someone works on
+;; with Leiningen is a Clojure 1.3 based project then they will
+;; encounter this problem.
+
+;; A lot of people have run into this with ClojureScript One so we
+;; have added a workaround.
+
+;; Leiningen includes an `install` task which, for some unknown reason,
+;; takes a long time to run. Below, we have extracted just the part
+;; of that task that we need to get a dependency from a maven repository.
+
+(defn- standalone-download
+  "Download a dependency from a maven repository."
+  [name group version]
+  (.resolveAlways (.lookup container ArtifactResolver/ROLE)
+                  (make-remote-artifact name group version)
+                  (map make-remote-repo default-repos)
+                  (make-local-repo)))

 (defn bootstrap
   "Bootstrap the project by running lein deps and lein git-deps."
   [project]
-  (leiningen.deps/deps project)
-  (leiningen.git-deps/git-deps project))
+  ;; Workarond for Leiningen 1.6.2 bug. Ensure that we have Clojure 1.2.1 in
+  ;; the local maven repository.
+  (standalone-download "clojure" "org.clojure" "1.2.1")
+  (git-deps project)
+  (deps project))


elevio Fix bug where users see two support links

--- src-cljs/frontend/elevio.cljs
+++ src-cljs/frontend/elevio.cljs
@@ -40,9 +40,9 @@
         user-info (-> js/window
                       (aget "elevSettings")
                       (aget "user"))
-        support-module-id "2968"
-        discuss-link-module-id "3003"
-        discuss-support-link-module-id "3762"]
+        support-module-id 2968
+        discuss-link-module-id 3003
+        discuss-support-link-module-id 3762]
     (if user/support-eligible?
       ;; enable zendesk support, disable discuss support
       (set-elev! "disabledModules" #js [discuss-support-link-module-id])


:include-macros is redundant with :refer-macros.

http://dev.clojure.org/jira/browse/CLJS-721
https://github.com/clojure/clojurescript/commit/de6ee41b3b0e26020e01b409f97e513bce87456d

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -2,7 +2,7 @@
   (:require [clojure.string :as str]
             [frontend.async :refer [put!]]
             [frontend.config :as config]
-            [secretary.core :as sec :include-macros true :refer-macros [defroute]])
+            [secretary.core :as sec :refer-macros [defroute]])
   (:require-macros [cljs.core.async.macros :as am :refer [go go-loop alt!]]))


Cleaning up

Cleaning up

--- src/hasta_la_vista/core.clj
+++ src/hasta_la_vista/core.clj
@@ -25,7 +25,11 @@
     ;[narrator.query         :as narr-query  ]
     )
   (:import
-    [java.io File])
+    [java.io File]
+    [java.util UUID]
+    [clojure.lang PersistentHashMap PersistentArrayMap]
+    [clojure.core.async.impl.channels ManyToManyChannel]
+    [couchbase_clj.client CouchbaseCljClient])
   (:gen-class))

 ;; HELPERS
@@ -77,7 +81,7 @@
 (defn uuid
   "Returns a new java.util.UUID as string"
   []
-  (str (java.util.UUID/randomUUID)))
+  (str (UUID/randomUUID)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@@ -93,7 +97,7 @@

 (defn exit [n]
   (log/info "init :: stop")
-  (java.lang.System/exit n))
+  (System/exit n))

 ;; Getting better names for the async functions

@@ -131,9 +135,9 @@

   https://forums.couchbase.com/t/how-does-stale-query-work/870"
   [& args]
-  (let [  ^clojure.core.async.impl.channels.ManyToManyChannel stat-chan (chan)
-          ^clojure.core.async.impl.channels.ManyToManyChannel work-chan (chan)
-          ^clojure.lang.PersistentHashMap                     config    (read-config "conf/app.edn") ]
+  (let [  ^ManyToManyChannel stat-chan (chan)
+          ^ManyToManyChannel work-chan (chan)
+          ^PersistentHashMap config    (read-config "conf/app.edn") ]
     ;; INIT
     (log/info "init :: start")
     (log/info "checking config...")
@@ -143,16 +147,21 @@
       :else
         ;; exit 1 here
         (config-err config))
-    ;; Initializing CB connections
-    (let [  ^clojure.lang.PersistentHashMap           client-config         (get-in config [:ok :couchbase-client])
-            ^couchbase_clj.client.CouchbaseCljClient  client                (connect client-config)
-            ^clojure.lang.PersistentArrayMap          view-config           (get-in config [:ok :couchbase-view])
-            ^java.lang.String                         design-document-name  (:design-document-name view-config)
-            ^java.lang.String                         view-name             (:view-name view-config)
-            ^clojure.lang.PersistentHashMap           query-options         (:query-options view-config)
-            ^java.lang.Long                           batch-size            (:batch-size view-config)
-            ^java.lang.Long                           thread-count          (get-in config [:ok :hasta-la-vista :thread-count])
-            ^java.lang.Long                           thread-wait           (get-in config [:ok :hasta-la-vista :thread-wait]) ]
+
+    ;; Initializing CB connections and everything
+    (let [
+            ^ManyToManyChannel    stat-chan             (chan)
+            ^ManyToManyChannel    work-chan             (chan)
+            ^PersistentHashMap    client-config         (get-in config [:ok :couchbase-client])
+            ^CouchbaseCljClient   client                (connect client-config)
+            ^PersistentArrayMap   view-config           (get-in config [:ok :couchbase-view])
+            ^String               design-document-name  (:design-document-name view-config)
+            ^String               view-name             (:view-name view-config)
+            ^PersistentHashMap    query-options         (:query-options view-config)
+            ^Long                 batch-size            (:batch-size view-config)
+            ^Long                 thread-count          (get-in config [:ok :hasta-la-vista :thread-count])
+            ^Long                 thread-wait           (get-in config [:ok :hasta-la-vista :thread-wait])
+                                                                                ]

       (log/info (client/get-available-servers client))

@@ -163,9 +172,9 @@
             (Thread/sleep thread-wait)
               (go-loop []
                 (let [  ids       (blocking-consumer work-chan)
-                        start     (. java.lang.System (clojure.core/nanoTime))
+                        start     (. System (nanoTime))
                         _         (doall (pmap #(client/delete client-del %) ids))
-                        exec-time (with-precision 3 (/ (- (. java.lang.System (clojure.core/nanoTime)) start) 1000000.0))
+                        exec-time (with-precision 3 (/ (- (. System (nanoTime)) start) 1000000.0))
                         perf      (/ (count ids) exec-time) ]
                   ;; send results to stat-chan
                   (blocking-producer stat-chan {:thread-name (.getName (Thread/currentThread)) :first_id (first ids) :time exec-time :perf perf})


Revert "bringing back the container id default in navigation path"

This reverts commit 2f815979d8d9a1f3e9c32598b75d7768a79b551f.

--- src-cljs/frontend/routes.cljs
+++ src-cljs/frontend/routes.cljs
@@ -32,9 +32,10 @@
         container-id (some-> container-num js/parseInt)
         tab (some-> tab-name keyword)
         action-id (some-> action-id js/parseInt)]
-    {:container-id (or container-id 0)
-     :tab tab
-     :action-id action-id}))
+    (merge {:tab tab
+            :action-id action-id}
+           (when container-id
+             {:container-id container-id}))))

 (defn build-page-fragment [tab container-id action-id]
   (cond


added enlive version

added enlive version

--- src/crawler/tree_edit_distance.clj
+++ src/crawler/tree_edit_distance.clj
@@ -1,7 +1,8 @@
-(ns crawler.tree-edit-distance
-  (:use [clojure.pprint])
-  (:import (org.htmlcleaner HtmlCleaner DomSerializer CleanerProperties)
-           (org.w3c.dom Document)))
+(ns tree-edit-distance.enlive-core
+  "A version of RTDM that operates on a tree produced by
+   enlive."
+  (:require [clj-http.client :as client]
+            [net.cgrand.enlive-html :as html]))

 (defn init
   "Perform the correct initialization"
@@ -15,56 +16,57 @@
                         (* ins-cost c2)))))
       M)))

-(defn num-children
-  "Expects a html tree"
-  [a-tree]
-  (if(.hasChildNodes a-tree)
-    (.getLength (.getChildNodes a-tree)) 0))
+(defn load-tree
+  "Fetches a link's content and builds an enlive-tree with it"
+  [a-link]
+  (->> a-link
+       client/get
+       :body
+       java.io.StringReader.
+       html/html-resource
+       (filter (fn [x] (:tag x))) ; pick out the tree and not the docstring
+       first))

 (defn tree-children
-  "Return level 1 children"
   [a-tree]
-  (let [n  (num-children a-tree)
-        cs (.getChildNodes a-tree)]
-    (map
-     #(.item cs %)
-     (range n))))
+  (->> a-tree :content (filter map?)))
+
+(defn num-children
+  [a-tree]
+  (-> a-tree tree-children count))

 (defn tree-descendants
   [a-tree]
-  (if (.hasChildNodes a-tree)
-    (concat (tree-children a-tree)
-            (flatten (map tree-descendants (tree-children a-tree))))
-    []))
+  (if (-> a-tree tree-children seq)
+    (+ (num-children a-tree)
+       (apply + (map tree-descendants (tree-children a-tree))))
+    0))

-(declare rtdm-edit-distance)
+(declare tree-edit-distance)

 (defn invert-cost
-  [t1 t2 del-cost ins-cost sub-cost]
-  (let [t1-desc (tree-descendants t1)
-        t2-desc (tree-descendants t2)]
-    (- (+ (* del-cost (count t1-desc))
-          (* ins-cost (count t2-desc)))
-       (rtdm-edit-distance t1 t2 del-cost ins-cost sub-cost))))
+  [tree1 tree2 del-cost ins-cost sub-cost]
+  (let [t1-desc (tree-descendants tree1)
+        t2-desc (tree-descendants tree2)]
+    (- (+ (* del-cost t1-desc)
+          (* ins-cost t2-desc))
+       (tree-edit-distance tree1 tree2 del-cost ins-cost sub-cost))))

-(defn rtdm-edit-distance
-  "The RTDM algorithm for computing edit-distance.
-   The trees are assumed to be org.w3c.dom.Documents"
-  [tree-1 tree-2 del-cost ins-cost sub-cost]
+(defn tree-edit-distance
+  [tree1 tree2 del-cost ins-cost sub-cost]
+  (let [m (num-children tree1)
+        n (num-children tree2)

-  (let [m (num-children tree-1)
-        n (num-children tree-2)
+        t1-children (tree-children tree1)
+        t2-children (tree-children tree2)

-        t1-children (tree-children tree-1)
-        t2-children (tree-children tree-2)
-
-        t1-desc (tree-descendants tree-1)
-        t2-desc (tree-descendants tree-2)
+        t1-desc (tree-descendants tree1)
+        t2-desc (tree-descendants tree2)

-        M (init m n (count t1-desc) (count t2-desc) del-cost ins-cost)]
+        M (init m n t1-desc t2-desc del-cost ins-cost)]

     (doseq [i (range m)
-            j (range n)]
+            j (range n)]
       (let [c-i (nth t1-children i)
             c-j (nth t2-children j)

@@ -78,24 +80,16 @@
                      del-cost
                      ins-cost)

-            sub (if (.isEqualNode c-i c-j)
+            sub (if (= c-i c-j)
                   (- sub-i
-                     (* ins-cost (count c-j-desc))
-                     (* del-cost (count c-i-desc)))
+                     (* ins-cost c-j-desc)
+                     (* del-cost c-i-desc))
                   (cond
-                   (or (not (.hasChildNodes c-i))
-                       (not (.hasChildNodes c-j)))
+                   (or (not (-> c-i :content (filter map?)))
+                       (not (-> c-j :content (filter map?))))
                    (+ sub-i sub-cost)

-                   (and (= (.getNodeName c-i) (.getNodeName c-j))
-                        (try
-                          (= (.getNodeValue (.getNamedItem (.getAttributes c-i) "id"))
-                             (.getNodeValue (.getNamedItem (.getAttributes c-j) "id")))
-                          (catch Exception e true))
-                        (try
-                          (= (.getNodeValue (.getNamedItem (.getAttributes c-i) "class"))
-                             (.getNodeValue (.getNamedItem (.getAttributes c-j) "class")))
-                          (catch Exception e true)))
+                   (or (= (-> c-i :tag) (-> c-j :tag)))
                    (- sub-i (invert-cost c-i c-j del-cost ins-cost sub-cost))

                    :else
@@ -103,32 +97,12 @@
         (aset M (inc i) (inc j) (int (min del ins sub)))))
     (aget M m n)))

-(defn rtdm-edit-distance-sim
-  [tree-1 tree-2 del-cost ins-cost sub-cost]
-  (let [t1-desc (tree-descendants tree-1)
-        t2-desc (tree-descendants tree-2)]
+(defn tree-edit-distance-link
+  "load trees and return their edit distance"
+  [link1 link2]
+  (let [t1 (load-tree link1)
+        t2 (load-tree link2)]
     (- 1
-       (/ (rtdm-edit-distance tree-1 tree-2 del-cost ins-cost sub-cost)
-          (+ (* (+ (count t1-desc) 1) del-cost)
-             (* (+ (count t2-desc) 1) sub-cost))))))
-
-(defn get-xml-tree-body
-  "Downloads a webpage and converts it to an org.w3.dom.Document"
-  [page-src]
-
-  (let [cleaner        (new HtmlCleaner)
-        props          (.getProperties cleaner)
-        cleaner-props  (new CleanerProperties)
-        dom-serializer (new DomSerializer cleaner-props)
-        tag-node       (.clean cleaner page-src)]
-
-    (.createDOM dom-serializer tag-node)))
-
-(defn rtdm-edit-distance-html
-  [pg1 pg2 del-cost ins-cost sub-cost]
-  (rtdm-edit-distance-sim
-   (get-xml-tree-body pg1)
-   (get-xml-tree-body pg2)
-   del-cost
-   ins-cost
-   sub-cost))
+       (/ (tree-edit-distance t1 t2 1 1 1)
+          (+ (tree-descendants t1)
+             (tree-descendants t2))))))


wait 1h for next synnchronisation

wait 1h for next synnchronisation

--- src/brainbot/nozzle/manage.clj
+++ src/brainbot/nozzle/manage.clj
@@ -72,14 +72,15 @@
                             {:id id
                              :filesystem fs}))
         wait-idle (partial wait-for-zero-messages get-num-messages)]
-    (logging/info "waiting for" qname "to become idle")
+    (logging/debug "waiting for" qname "to become idle")
     (wait-idle)
     (while true
       (logging/info "starting synchronization of" qname)
       (start-synchronization id fs)
       (Thread/sleep 10000)
-      (logging/info "waiting for synchronization of" qname "to finish")
-      (wait-idle))))
+      (wait-idle)
+      (logging/info "synchronization of" qname "finished. restarting in 1h")
+      (Thread/sleep (* 3600 1000)))))

 (defn manage-run-section


Complete 'Rendering' section (but needs review)

--- src/literate_2048/core.cljs
+++ src/literate_2048/core.cljs
@@ -215,33 +215,91 @@

 ;; # Rendering

+;; Because manually manipulating the DOM is messy, we'll let
+;; [Quiescent](https://github.com/levand/quiescent) do the work, which is an
+;; abstraction over [React](http://facebook.github.io/react) that leverages
+;; immutability. All we need to do is provide a data structure which tells how
+;; we want the DOM to look like at a given moment, but before getting into it
+;; lets define a couple of helper functions.
+
+;; An element is positioned on the board by specifying the classes "pos" and
+;; "pos-i-j", where i and j are numbers from 0 to 3 representing the row and
+;; the column of the element, respectively. The following function translates a
+;; vector with the element position, that is, the row and the column, to a
+;; string of theese classes.
+
 (defn pos-classes
   [[i j]]
   (str "pos pos-" i "-" j))

+;; Also, tiles are styled differently according to their value. We'll use the
+;; class "tile" to identify an element as a tile and "tile-val", where val is
+;; the value of the tile, to apply the correct color, font size, shadow, etc.
+
 (defn tile-classes
   [val]
   (str "tile tile-" val))

-(defn background-view
+;; To paint the squares of the board, we need to render the following HTML
+
+;;

+;;

+;;

+;;      ...
+;;

+;;

+
+;; The squares-view function, when supplied with 4, returns a virtual
+;; representation of that.
+
+(defn squares-view
   [order]
-  (apply d/div {:className "background"}
+  (apply d/div {:className "squares"}
     (for [i (range order) j (range order)]
-      (d/div {:className (pos-classes [i j])}))))
-
-(defn tiles-view [s]
+      (d/div {:className (str "square " (pos-classes [i j]))}))))
+
+;; A tile with a value of 2 that just appeared on the bottom-left corner will
+;; look something like this
+
+;;

+;;
2

+;;

+
+;; The tiles-view function, takes a sequence of tiles and renders them inside a
+;; div with the "tiles" class. Each element of the sequence is a map with the
+;; :val and :pos keys, 2 and [3 0] from the example. A :classes key may be
+;; provided to apply extra classes to the tile element, like "reveal" from the
+;; example. As we'll see in a moment, theese classes are needed to animate the
+;; appearence of new tiles. There is one last detail. When React updates the
+;; DOM, it tries to do it in the most efficiently manner and does not provide
+;; any warantee by default that the same DOM element will be used for the same
+;; tile across render passes. This is a problem for us because the CSS
+;; translation animations happens when the "pos-i-j" class of a DOM element
+;; changes. The goods news is that we can instruct React to do it if we identify
+;; indentify every tile uniquely with a :key. To learn more about React's
+;; reconciliation process see
+;; [this](http://facebook.github.io/react/docs/reconciliation.html) and
+;; [this](http://facebook.github.io/react/docs/multiple-components.html).
+
+(defn tiles-view
+  [s]
   (apply d/div {:className "tiles"}
-    (map (fn [{:keys [val pos key classes] :as tile}]
+    (map (fn [{:keys [val pos key classes]}]
            (d/div {:className (pos-classes pos)
                    :key key}
              (d/div {:className (str classes " " (tile-classes val))}
                val)))
          s)))

+;; Finally, a Quiescent component will render the squares and the tiles. To
+;; learn more about Quiescent you can read the
+;; [docs](https://github.com/levand/quiescent/blob/master/docs.md) or just the
+;; [source](https://github.com/levand/quiescent/tree/master/src).
+
 (q/defcomponent SquareBoard
   [tiles order]
   (d/div {:className "square-board"}
-    (background-view order)
+    (squares-view order)
     (tiles-view tiles)))

 ;; # UI


Use a cooler header for training page.

Use a cooler header for training page.

--- src/cadence/views/training.clj
+++ src/cadence/views/training.clj
@@ -13,7 +13,7 @@
      [:h1 "Training"]]
     [:p "If you don't know what this is for please checkout the "
      (link-to "/#training" "blurb on the front page") "."]
-    [:h2 "Let's get to training!"]
+    [:h2 "Let's get down to business!"]
     [:div#train_well.well.container-fluid
      [:p.help "Simply type the following phrase in the form repeatedly until I"
       " tell you to stop."]


Use CM to clear gutters

Use CM to clear gutters

--- src/lt/plugins/rubocop.cljs
+++ src/lt/plugins/rubocop.cljs
@@ -40,12 +40,6 @@
                           (raise this :cop-finished stdout)
                         )))))

-(defn clear-gutters [ed]
-  (let [line-nos (range (editor/line-count ed))]
-    (editor/operation ed (fn []
-      (doseq [idx line-nos]
-        (.setGutterMarker ed idx "cop-gutter" ))))))
-
 (behavior ::cop-finished
           :triggers #{:cop-finished}
           :reaction (fn [this cops]
@@ -59,7 +53,7 @@
                         (object/merge! this {::cops-by-line cops-by-line})
                         (editor/operation ed
                                           (fn []
-                                            (clear-gutters ed)
+                                            (.clearGutter ed "cop-gutter")
                                             (editor/set-options ed {:gutters (clj->js (conj current-gutters "cop-gutter"))})
                                             (dom/set-css (dom/$ :div.cop-gutter gutter-div) {"width" "8px"})
                                             (doall (map (fn [gutter-marker]


Simplify Game of Life rules a bit.

Simplify Game of Life rules a bit.

--- src/cljs/beatha/automaton.cljs
+++ src/cljs/beatha/automaton.cljs
@@ -91,9 +91,8 @@
                alive? (= (:state cell) :alive)]
            {[x y]
             (cond
-             (and alive? (< n 2))              {:state :dead}
+             (and alive? (or (< n 2) (> n 3))) {:state :dead}
              (and alive? (or (= n 2) (= n 3))) {:state :alive}
-             (and alive? (> n 3))              {:state :dead}
              (and (not alive?) (= n 3))        {:state :alive}
              :else                             cell)}))))


Minor fixes on catacumba.auth introduced in previous commits.

--- src/clojure/catacumba/auth.clj
+++ src/clojure/catacumba/auth.clj
@@ -31,15 +31,15 @@
 ;; Handlers
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn autentication
+(defn authentication
   "Authentication chain handler constructor."
   [& backends]
   {:pre [(pos? (count backends))]}
   (fn [context]
-    (let [context (assoc context :auth-backend current)]
-      (loop [[current & pending] backends]
-        (let [last? (empty? pending)
-              resp (buddy-proto/parse current context)]
+    (loop [[current & pending] backends]
+      (let [last? (empty? pending)
+            context (assoc context :auth-backend current)
+            resp (buddy-proto/parse current context)]
         (if (and (buddy-http/response? resp) last?)
           resp
           (if (and (nil? resp) last?)
@@ -49,7 +49,7 @@
                 resp
                 (if (or (:identity resp) last?)
                   (context/delegate context resp)
-                  (recur pending)))))))))))
+                  (recur pending))))))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Adapters


add function to create dracula script

add function to create dracula script

--- src/clojure/confgraph/core.clj
+++ src/clojure/confgraph/core.clj
@@ -8,11 +8,11 @@
         lacij.layouts.layout
         lacij.view.graphview))

-(def  yaml (Yaml. (ExtendedConstructor.)))
-(defn extends [conf] (.get (.load yaml (slurp (.getPath conf))) "extends"))
-(def  confs (for [x (.listFiles (File. "configs/runs")) :when (.isFile x)] x))
-(def  nodes (for [x confs] (.getName x)))
-(def  edges (zipmap nodes (for [x confs] (extends x))))
+(def yaml (Yaml. (ExtendedConstructor.)))
+(def extends (memoize (fn [conf] (.get (.load yaml (slurp (.getPath conf))) "extends"))))
+(def confs (for [x (.listFiles (File. "configs/runs")) :when (.isFile x)] x))
+(def nodes (for [x confs] (.getName x)))
+(def edges (zipmap nodes (for [x confs] (extends x))))

 (def rootpath
   (memoize (fn [src]
@@ -46,11 +46,27 @@
   (println "Supply at most a single filtering prefix.")
   (System/exit 1))

+(defn out-dracula [fe]
+  (println "$(document).ready(function() {")
+  (println "var g=new Graph();")
+  (doseq [x fe]
+    (let [[t h] x]
+      (println (str "g.addEdge("\" t "\",\"" h "\");"))))
+  (println "var layouter=new Graph.Layout.Spring(g,topological_sort(g));")
+  (println "var renderer=new Graph.Renderer.Raphael('canvas',g,$(document).width(),$(document).height());")
+  (println "});"))
+
+(defn out-lacij [fe]
+  (-> (graph)
+      (add-edges (into [] fe))
+      (layout :hierarchical)
+      (build)
+      (export "graph.svg")))
+
+(defn out-prn [fe]
+  (prn fe))
+
 (defn -main [& args]
   (alter-var-root #'*read-eval* (constantly false))
   (if (> (count args) 1) (usage))
-  (-> (graph)
-      (add-edges (into [] (filtered-edges (first args))))
-      (layout :hierarchical)
-      (build)
-      (export "graph.svg")))
+  (let [fe (filtered-edges (first args))] (out-lacij fe)))


GUI: Added new heuristics of DimDraw

GUI: Added new heuristics of DimDraw

--- src/main/clojure/conexp/gui/draw/control/dim_draw.clj
+++ src/main/clojure/conexp/gui/draw/control/dim_draw.clj
@@ -6,17 +6,36 @@
             [conexp.layouts.base :refer :all]
             [conexp.layouts.dim-draw :refer :all]
             [seesaw.core :refer [listen]])
-  (:import [javax.swing JButton]))
+  (:import [javax.swing JButton JSpinner]))

 ;;; DimDraw layout

 (defn dimdraw
   "Installs DimDraw Layout control."
   [frame scn buttons]
-  (let [^JButton btn    (make-button buttons "DimDraw")]
-    (listen btn :action
+  (let [^JButton exact    (make-button buttons "Exact")
+        ^JLabel l1 (make-label buttons "Individuums:")
+        ^JSpinner ind   (make-spinner buttons 0 1000 20 1)
+        ^JLabel l2 (make-label buttons "Generations:")
+        ^JSpinner gen   (make-spinner buttons 0 1000 20 1)
+        ^JButton genetic    (make-button buttons "Genetic")
+        ^JButton greedy    (make-button buttons "Greedy")]
+    (listen exact :action
             (fn [_]
               (update-layout-of-scene scn (dim-draw-layout (lattice (get-layout-from-scene scn))))
+              (fit-scene-to-layout scn)))
+    (listen genetic :action
+            (fn [_]
+              (update-layout-of-scene scn (dim-draw-layout
+                                           (lattice (get-layout-from-scene scn))
+                                           "genetic"
+                                           (int (.getValue ind))
+                                           (int (.getValue gen))))
+              (fit-scene-to-layout scn)))
+    (listen greedy :action
+            (fn [_]
+              (update-layout-of-scene scn (dim-draw-layout (lattice (get-layout-from-scene scn))
+                                                           "greedy"))
               (fit-scene-to-layout scn)))))

 ;;;


remove non-serializable specs from exception

--- src/adzerk/boot_cljs/impl.clj
+++ src/adzerk/boot_cljs/impl.clj
@@ -95,6 +95,8 @@
                            "] "))
                     message)
                   message)
+        spec-error? (or (:clojure.spec/spec data)
+                        (:clojure.spec.alpha/spec data))
         cljs-error? (or (= :reader-exception type)
                         (= :cljs/analysis-error tag))]

@@ -106,9 +108,10 @@
       (-> data
           (assoc :from :boot-cljs)
           (cond->
+            spec-error? (dissoc :clojure.spec/spec)
+            spec-error? (dissoc :clojure.spec.alpha/spec)
             file (assoc :file file)
-            cljs-error? (assoc :boot.util/omit-stacktrace? true)))
-      e)))
+            cljs-error? (assoc :boot.util/omit-stacktrace? true))))))

 (defn compile-cljs
   "Given a seq of directories containing CLJS source files and compiler options
@@ -161,9 +164,9 @@
        (let [ex (handle-ex e source-paths dirs)]
          ;; attempt to return serialized exception
          (try {:exception (util/serialize-object ex)}
-           ;; doesnt work for clojure.spec exceptions
+           ;; catch serialization exception
            (catch Exception e
-             ;; throw now instead
+             ;; rethrow original exception
              (throw ex))))))))


Allow the path for an async/namespace-handler to be nil

--- src/io/aviso/rook/async.clj
+++ src/io/aviso/rook/async.clj
@@ -167,12 +167,19 @@

 (defn namespace-handler
   "Asynchronous namespace handler. Adds namespace middleware, but the handler (including any middleware on the handler)
-  should be asynchronous (returning a channel, not a direct result)."
+  should be asynchronous (returning a channel, not a direct result).
+
+  In most cases, a path will be specified and the context macro used to put the new handler inside the context. However,
+  path may also be nil."
+  ([namespace-name]
+   (namespace-handler nil namespace-name))
   ([path namespace-name]
    (namespace-handler path namespace-name default-rook-pipeline))
   ([path namespace-name handler]
    (let [handler' (rook/namespace-middleware handler namespace-name)]
-     (context path handler'))))
+     (if path
+       (context path handler')
+       handler'))))

 (defn wrap-with-loopback
   "Wraps a set of asynchronous routes with a loopback: a function that calls back into the same asynchronous routes.


arrow gesture handler create-pager

arrow gesture handler
create-pager

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -11,19 +11,23 @@

 (defn decorate-arrow-node [arrow-node text]
   (.. (DOMElement. arrow-node)
-               (setProperty "color" "white")
-               (setContent text)
-               (setProperty "fontSize" "40px")
-               (setProperty "lineHeight" "40px")
-               (setProperty "cursor" "pointer")
-               (setProperty "textHighlight" "none")
-               (setProperty "zIndex" "2")))
+      (setProperty "color" "white")
+      (setContent text)
+      (setProperty "fontSize" "40px")
+      (setProperty "lineHeight" "40px")
+      (setProperty "cursor" "pointer")
+      (setProperty "textHighlight" "none")
+      (setProperty "zIndex" "2"))
+  (.. (GestureHandler. arrow-node) (on "tap" (fn []
+                                               (println text))))
+
+  )

 (defn decorate-dots [dots-node]
   (let [dot-nodes (.. dots-node getChildren)
         resize (clj->js {:onSizeChange (fn [^Float32Array size]
-                                           "NOTE: this call back is called only once because root-dot setSizeMode is ABSOLUTE (value of 1)"
-                                           (let [size (IndexedSeq. size 0)
+                                         "NOTE: this call back is called only once because root-dot setSizeMode is ABSOLUTE (value of 1)"
+                                         (let [size (IndexedSeq. size 0)
                                                dotWidth 10
                                                numPages 5
                                                spacing 5
@@ -31,7 +35,6 @@
                                                                (* spacing (dec numPages)))
                                                start-x (/ (- (nth size 0) totalDotSize)
                                                           2)]
-                                           (println size)
                                            (doseq [n (range (count dot-nodes))
                                                    :let [dot-node (nth dot-nodes n)]]
                                              (.. dot-node (setPosition (+ start-x
@@ -62,12 +65,19 @@
         (setMountPoint .5, 1, 0))
     root-dot))

+(defn create-pager [root-node]
+  (let [pager-node (.. root-node addChild)]
+    pager-node
+    )
+  )
+
 (defn Carousel [selector data]
   (let [context (.. FamousEngine (createScene selector))
         root-node (.. context addChild)
         back-node (.. root-node addChild)
         next-node (.. root-node addChild)
         dots-node (create-dots root-node)
+        pager-node (create-pager root-node)

         back (decorate-arrow-node back-node "<")
         next (decorate-arrow-node next-node ">")


Remove duplicated alias on core tests.

Remove duplicated alias on core tests.

--- test/catacumba/core_tests.clj
+++ test/catacumba/core_tests.clj
@@ -3,7 +3,6 @@
             [clojure.test :refer :all]
             [clojure.java.io :as io]
             [clojure.pprint :refer [pprint]]
-            [clojure.core.async :as async]
             [clj-http.client :as client]
             [promesa.core :as p]
             [catacumba.stream :as stream]
@@ -101,7 +100,7 @@
   (testing "Using completable future as response."
     (letfn [(handler [ctx]
               (p/promise (fn [resolve reject]
-                           (async/<!! (async/timeout 1000))
+                           (a/<!! (a/timeout 1000))
                            (resolve (http/ok "hello world")))))]
       (with-server {:handler handler}
         (let [response (client/get base-url)]
@@ -111,7 +110,7 @@
   (testing "Using completable future as body."
     (letfn [(handler [ctx]
               (http/ok (p/promise (fn [resolve reject]
-                                    (async/<!! (async/timeout 1000))
+                                    (a/<!! (a/timeout 1000))
                                     (resolve "hello world")))))]
       (with-server {:handler handler}
         (let [response (client/get base-url)]
@@ -131,7 +130,7 @@
   (testing "Using manifold deferred as response."
     (letfn [(handler [ctx]
               (let [d (md/deferred)]
-                (async/thread
+                (a/thread
                   (md/success! d (http/accepted "hello world")))
                 d))]
       (with-server {:handler handler}
@@ -142,7 +141,7 @@
   (testing "Using manifold deferred as body."
     (letfn [(handler [ctx]
               (let [d (md/deferred)]
-                (async/thread
+                (a/thread
                   (md/success! d "hello world"))
                 (http/accepted d)))]
       (with-server {:handler handler}
@@ -153,7 +152,7 @@
   (testing "Using manifold stream as body."
     (letfn [(handler [ctx]
               (let [d (ms/stream 3)]
-                (async/thread
+                (a/thread
                   @(ms/put! d "hello")
                   @(ms/put! d " ")
                   @(ms/put! d "world")


changed predicate from andare to go

changed predicate from andare to go

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -408,7 +408,7 @@
    {:synsem {:cat :verb
               :sem {:activity true
                     :discrete false
-                    :pred :andare
+                    :pred :go
                     :subj {:animate true}}}
     :english {:past "went"}}


irregular "to hurt" past: add 'past' annotation

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -717,7 +717,7 @@
     :english {:past "hugged"
               :participle "hugging"}}

-   "hurt" (let [common {:english {:past "hurt"}
+   "hurt" (let [common {:english {:past "hurt (past)"}
                         :synsem {:cat :verb}}]
             [(let [subject-semantics (ref {:human true})
                    subject-agr (ref :top)]


generate imperfect sentences

generate imperfect sentences

--- src/babel/italiano/writer.clj
+++ src/babel/italiano/writer.clj
@@ -44,6 +44,8 @@
                                 (list {:synsem {:sem {:tense :conditional}}}
                                       {:synsem {:sem {:tense :future}}}
                                       {:synsem {:sem {:tense :present}}}
+                                      {:synsem {:sem {:aspect :progressive
+                                                      :tense :past}}}
                                       {:synsem {:sem {:aspect :perfect
                                                       :tense :past}}})))))
                 (reduce concat