Remove cljs Hiccup compiler; defer to Singult.

--- src/cljs/c2/dom.cljs
+++ src/cljs/c2/dom.cljs
@@ -1,8 +1,8 @@
 (ns c2.dom
   (:use-macros [c2.util :only [p pp timeout bind!]]
-               [clojure.core.match.js :only [match]]
-               [iterate :only [iter]])
+               [clojure.core.match.js :only [match]])
   (:require [clojure.string :as string]
+            [singult.core :as singult]
             [goog.dom :as gdom]
             [goog.dom.classes :as gclasses]
             [goog.style :as gstyle]))
@@ -19,16 +19,6 @@
 (extend-type js/Node
   IHash
   (-hash [x] x))
-
-;; Regular expression that parses a CSS-style id and class from a tag name. From Weavejester's Hiccup.
-(def re-tag #"([^\s\.#]+)(?:#([^\s\.#]+))?(?:\.([^\s#]+))?")
-
-;;Namespace URIs
-(def xmlns {:xhtml "http://www.w3.org/1999/xhtml"
-            :svg "http://www.w3.org/2000/svg"})
-
-;;Common SVG tags; DOM node creation fn checks this set to infer element namespace (so users don't have to write things like [:svg:rect]).
-(def svg-tags #{:svg :g :rect :circle :clipPath :path :line :polygon :polyline :text :textPath})

 (defn dom-element?
@@ -79,11 +69,6 @@
   (.-parentNode (select node)))

-
-(declare build-dom-elem)
-(declare canonicalize)
-
-
 (defn append!
   "Make element last child of container.
    Returns live DOM node.
@@ -92,7 +77,7 @@
   [container el]
   (let [el (if (dom-element? el)
              el
-             (build-dom-elem el))]
+             (singult/render el))]
     (gdom/appendChild (select container) el)
     el))

@@ -104,7 +89,7 @@
   [container el]
   (let [el (if (dom-element? el)
              el
-             (build-dom-elem el))]
+             (singult/render el))]
     (gdom/insertChildAt (select container) el 0)
     el))

@@ -121,7 +106,7 @@
   [old new]
   (let [new (condp = (node-type new)
               :dom new
-              :hiccup (build-dom-elem new)
+              :hiccup (singult/render new)
               :selector (select new))]
     (gdom/replaceNode new (select old))))

@@ -203,86 +188,3 @@
   (or (.-requestAnimationFrame js/window)
       (.-webkitRequestAnimationFrame js/window)
       #(timeout 10 (%))))
-
-(defn merge!
-  "Recursively walk a live DOM node, unifying its attributes and children with those of hiccup vector `el`.
-   Boolean kwarg `:defer-attr` to set attributes on next animation frame, defaults to `false`. "
-  [$node el & {:keys [defer-attr]
-               :or {defer-attr false}}]
-
-  (let [el (canonicalize el)]
-    (when (not= (.toLowerCase (.-nodeName $node))
-                (.toLowerCase (name (:tag el))))
-      (p $node)
-      (pp el)
-      (throw "Cannot merge el into node of a different type"))
-
-    (if defer-attr
-      (request-animation-frame #(attr $node (:attr el)) $node)
-      (attr $node (:attr el)))
-
-    ;;merge children (implicitly assumes that nodes by index match up)
-    (doseq [[$c c] (map vector
-                        (remove whitespace-node? (.-childNodes $node))
-                        (:children el))]
-      (match [[(.-nodeType $c) c]]
-             [[1 (m :when map?)]]    (merge! $c m :defer-attr defer-attr)
-             [[3 (s :when string?)]] (set! (.-textContent $c) s)
-             :else (do (p $c) (pp c) (throw "Cannot merge."))))
-    $node))
-
-(defn canonicalize
-  "Convert hiccup vectors into maps suitable for rendering.
-   Hiccup vectors will be converted to maps of {:tag :attr :children}.
-   Strings will be passed through and numbers coerced to strings.
-   Based on Pinot's html/normalize-element."
-  [x]
-  (match [x]
-         [(str :when string?)] str
-         [(n   :when number?)] (str n)
-         [(m   :when map?)] m ;;todo, actually check to make sure map has nsp, tag, attr, and children keys
-         ;;todo, make explicit match here for attr map and clean up crazy Pinot logic below
-         [[tag & content]]   (let [[_ tag id class] (re-matches re-tag (name tag))
-                                   [nsp tag]     (let [[nsp t] (string/split tag #":")
-                                                       ns-xmlns (xmlns (keyword nsp))]
-                                                   (if t
-                                                     [(or ns-xmlns nsp) (keyword t)]
-                                                     (let [tag (keyword nsp)]
-                                                       [(if (svg-tags tag)
-                                                          (:svg xmlns)
-                                                          (:xhtml xmlns))
-                                                        tag])))
-                                   tag-attrs        (into {}
-                                                          (filter #(not (nil? (second %)))
-                                                                  {:id (or id nil)
-                                                                   :class (if class (string/replace class #"\." " "))}))
-                                   map-attrs        (first content)]
-
-                               (let [[attr raw-children] (if (map? map-attrs)
-                                                           [(merge-with #(str %1 " " %2) tag-attrs map-attrs)
-                                                            (next content)]
-                                                           [tag-attrs content])
-                                     ;;Explode children seqs in place
-                                     children (mapcat #(if (and (not (vector? %)) (seq? %))
-                                                         (map canonicalize %)
-                                                         [(canonicalize %)])
-                                                      raw-children)]
-                                 {:nsp nsp :tag tag :attr attr :children children}))))
-
-(defn create-elem [nsp tag]
-  (.createElementNS js/document nsp (name tag)))
-
-(defn build-dom-elem
-  "Build live DOM element from hiccup vector, hiccup map, or string."
-  [el]
-  (match [el]
-         [(s :when string?)] (gdom/createTextNode s)
-         [(v :when vector?)] (recur (canonicalize v))
-         [(m :when map?)] ;;Can't use {:keys [...]} destructuring in place of m in this clause. Why?
-         (let [{:keys [nsp tag children] :as elm} m
-               elem (create-elem nsp tag)]
-           (attr elem (:attr elm))
-           (doseq [c (map build-dom-elem children)]
-             (when c
-               (append! elem c)))
-           elem)))


Basic full algorithm working (simple)

Basic full algorithm working (simple)

--- src/hangman/core.clj
+++ src/hangman/core.clj
@@ -236,7 +236,7 @@
   ( [word-seq]
     (do-tests)
     (println "----------------------------------------")
-    (def tgt-word         "hate")
+    (def tgt-word         "bed")
     (def words-map        (to-words-by-length word-seq) )
     (def curr-len         (count tgt-word) )
     (def curr-words       (words-map curr-len) )
@@ -257,6 +257,9 @@
       ] ))

 ;(comment
+    (println)
+    (println "************************************************************")
+    (println "word-array" word-array)
     (loop [ guessed-chars  #{}
             clue           (make-clue tgt-word guessed-chars)
           ]
@@ -267,9 +270,8 @@
       (println "clue" clue)
       (let [
         keep-flag       (map #(guess-matches? % clue ) word-array )
-          _ (println "keep-flag" keep-flag)
-        keep-words      (filter-with keep-flag curr-words)
-          _ (println "keep-words" keep-words)
+        keep-words      (filter-with keep-flag word-array)
+          _ (println "keep-words" (map str/join keep-words) )
         col-char-freqs   (to-freqs-by-col keep-words)

         new-guess       (make-guess clue col-char-freqs guessed-chars)
@@ -279,8 +281,9 @@
         new-clue        (make-clue tgt-word guessed-chars)
           _ (println "new-clue" new-clue)
       ]
-        (when (some nil? new-clue)
-          (recur  (conj guessed-chars new-guess)  new-clue ) )
+        (if (some nil? new-clue)
+          (recur  (conj guessed-chars new-guess)  new-clue )
+        )
       ))
 ;)


Check for Valid Token Introspection URI

Check for Valid Token Introspection URI

--- src/lens/handler.clj
+++ src/lens/handler.clj
@@ -7,7 +7,8 @@
             [lens.handler.util :refer :all]
             [lens.handler.version :as version]
             [lens.api :as api]
-            [lens.oauth2 :as oauth2]))
+            [lens.oauth2 :as oauth2])
+  (:import [java.net URI]))

 (defn workbook-path [path-for workbook]
   (path-for :get-workbook-handler :id (:workbook/id workbook)))
@@ -187,6 +188,7 @@
 ;; ---- Handlers --------------------------------------------------------------

 (defnk handlers [path-for version token-introspection-uri]
+  {:pre [(URI/create token-introspection-uri)]}
   {:service-document-handler (service-document-handler path-for version)
    :find-workbook-handler (find-workbook-handler path-for)
    :get-workbook-handler (get-workbook-handler path-for)


missing references to circle.yml on project settings pages

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -382,6 +382,7 @@
         (html
          [:div.dependencies-page
           [:h2 "Install dependencies for " (vcs-url/project-name (:vcs_url project))]
+          [:p [:i "You can also set your dependencies commands from your " [:a {:href "/docs/configuration#dependencies"} "circle.yml"] "."]]
           [:div.dependencies-inner
            [:form.spec_form
             [:fieldset
@@ -423,6 +424,7 @@
         (html
          [:div.tests-page
           [:h2 "Set up tests for " (vcs-url/project-name (:vcs_url project))]
+          [:p [:i "You can also set your test commands from your " [:a {:href "/docs/configuration#tests"} "circle.yml"] "."]]
           [:div.tests-inner
            [:fieldset.spec_form
             [:textarea {:name "test",


Add note about IAM users to the AWS keys page

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -1105,12 +1105,15 @@
          [:div.aws-page
           [:h2 "AWS keys for " (vcs-url/project-name (:vcs_url project))]
           [:div.aws-page-inner
-           [:p "Set your AWS keypair to be used for authenticating against AWS services during your build. "
+           [:p "Set the AWS keypair to be used for authenticating against AWS services during your builds. "
             "Credentials are installed on your containers into the " [:code "~/.aws/config"] " and "
             [:code "~/.aws/credentials"] " properties files. These are read by common AWS libraries such as "
             [:a {:href "http://aws.amazon.com/documentation/sdk-for-java/"} "the Java SDK"] ", "
             [:a {:href "https://boto.readthedocs.org/en/latest/"} "Python's boto"] ", and "
             [:a {:href "http://rubygems.org/gems/aws-sdk"} "the Ruby SDK"] "."]
+           [:p "We recommend that you create a unique "
+            [:a {:href "http://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html"} "IAM user"]
+            " for use by CircleCI."]
            [:form
             [:input#access-key-id
              {:required true, :type "text", :value (or access_key_id "")


:sparkles: Load more history data on first request.

--- frontend/src/uxbox/main/data/history.cljs
+++ frontend/src/uxbox/main/data/history.cljs
@@ -145,7 +145,7 @@
      ptk/WatchEvent
      (watch [_ state s]
        (let [params (merge {:page id
-                            :max (or max 5)}
+                            :max (or max 20)}
                            (when since
                              {:since since}))]
          (->> (rp/req :fetch/page-history params)


spatter type hints all over the place

spatter type hints all over the place

* probably there is a more sensible way to do this

--- src/merlion/core.clj
+++ src/merlion/core.clj
@@ -1,7 +1,7 @@
 (ns merlion.core
   (:import [java.nio Buffer ByteBuffer]
            [java.net InetSocketAddress]
-           [java.nio.channels SocketChannel ServerSocketChannel
+           [java.nio.channels SocketChannel ServerSocketChannel Channel
             Selector SelectionKey])
   (:gen-class)
   (:require [merlion.etcd :as etcd]
@@ -19,8 +19,8 @@
   (.getTime (java.util.Date.)))

 (defn write-pending-buffer [w]
-  (let [ch (:to-channel w)
-        b (:buffer w)]
+  (let [ch ^SocketChannel (:to-channel w)
+        b ^ByteBuffer (:buffer w)]
     (if (:eof? w)
       w
       (do
@@ -29,7 +29,9 @@
           w
           (do (.clear b) nil))))))

-(defn read-pending-buffer [buffer from-channel to-channel]
+(defn read-pending-buffer [^ByteBuffer buffer
+                           ^SocketChannel from-channel
+                           to-channel]
   (let [b buffer
         c (.read from-channel b)]
     (cond
@@ -75,10 +77,10 @@
               :c2
               :write)))))

-(defn poll-selector [bo timeout]
-  (if-not (zero? (.select bo timeout))
+(defn poll-selector [^Selector bo ^long timeout]
+  (if-not (zero? ^int (.select bo timeout))
     (let [ready (.selectedKeys bo)
-          v (doall (map (fn [k]
+          v (doall (map (fn [^SelectionKey k]
                           {:channel (.channel k)
                            :ops (.readyOps k)})
                         ready))]
@@ -86,11 +88,11 @@
       v)))

 (defn poll-channels [poll-set timeout]
-  (with-open [bo (reduce (fn [s [channel & ops]]
-                           (.register channel s (poll-ops-mask ops))
-                           s)
-                         (Selector/open)
-                         poll-set)]
+  (with-open [^Selector bo (reduce (fn [s [channel & ops]]
+                                     (.register channel s (poll-ops-mask ops))
+                                     s)
+                                   (Selector/open)
+                                   poll-set)]
     (doall ; have to force evaluation of this before closing selector
      (poll-selector bo timeout))))

@@ -121,8 +123,8 @@
         (.write ssh msg)
         (is (ready-for? (poll-channels [[ssh :read]] 1357) ssh :read))))))

-(defn accept-connection [socket]
-  (let [s1 (.accept socket)]
+(defn accept-connection [^ServerSocketChannel socket]
+  (let [s1 ^SocketChannel (.accept socket)]
     (when s1
       (when (log/may-log? :debug)
         ;; no need to getRemoteAddress if we don't have debug logging
@@ -135,17 +137,19 @@
     (.register channel s (poll-ops-mask ops))
     s))

-(defn update-selector-for-writing [selector w]
+(defn update-selector-for-writing [^Selector selector w]
   (when-not (:eof? w)
-    (let [c (:to-channel w)]
-      (run! #(or (= c (.channel %)) (.cancel %)) (.keys selector))
+    (let [c ^SocketChannel (:to-channel w)]
+      (run! (fn [^SelectionKey k]
+              (or (= c (.channel k)) (.cancel k)))
+            (.keys selector))
       (.register c selector (poll-ops-mask [:write]))
       selector)))

 (defn backend [serversocket address finished-ch on-exit]
   (let [bytebuffer (ByteBuffer/allocate 8192)
         {:keys [::conf/host ::conf/port]} address
-        selector (new-selector serversocket [:accept])
+        selector ^Selector (new-selector serversocket [:accept])
         write-selector (Selector/open)]
     (info (str "started backend for " address))
     (loop [pending-write false
@@ -184,8 +188,9 @@
             ;; our selector, so we can finish up serving the requests we already
             ;; started but will not pick up any new connections
             (async/poll! finished-ch)
-            (let [key (first (filter #(= serversocket (.channel %))
-                                     (.keys selector)))]
+            (let [key ^SelectionKey
+                  (first (filter #(= serversocket (.channel %))
+                                 (.keys selector)))]
               ;; if the serversocket has been closed already (e.g. by another
               ;; thread when the listen-address is changed) then it will not
               ;; appear in this selector
@@ -200,8 +205,8 @@
             ;; Zeroth, close the corresponding down/upstream for any up/downstream
             ;; on which we received eof while reading
             (and pending-write (:eof? pending-write))
-            (let [fch (:from-channel pending-write)
-                  tch (:to-channel pending-write)]
+            (let [fch ^SocketChannel (:from-channel pending-write)
+                  tch ^SocketChannel (:to-channel pending-write)]
               (.close fch)              ;this also causes removal of these
               (.close tch)              ;channels from the selector
               (recur nil (dissoc downstreams-for-upstreams fch tch)))
@@ -240,10 +245,11 @@
             ;; Note this may block in connect(), I haven't decided if that's
             ;; bad or not
             (get ready-channels serversocket)
-            (if-let [sock (log/spy :trace (accept-connection serversocket))]
+            (if-let [sock ^SocketChannel
+                     (log/spy :trace (accept-connection serversocket))]
               (let [ds (try
                          (doto (SocketChannel/open)
-                           (.connect (InetSocketAddress. host port))
+                           (.connect (InetSocketAddress. ^String host ^long port))
                            (debug "connected")
                            (.configureBlocking false))
                          (catch java.net.ConnectException e
@@ -343,10 +349,10 @@
             {}
             (:backends config))))

-(defn get-port [listener]
+(defn get-port [^ServerSocketChannel listener]
   (.. listener socket getLocalPort))

-(defn update-listener [listener config]
+(defn update-listener [^ServerSocketChannel listener config]
   (when-let [l (get-in config [:config :log-level])]
     (when-not (= l (:level log/*config*))
       (log/info (str "Setting log level to " l))


separate type/value from styling

separate type/value from styling

--- src/tile_game/grid.cljs
+++ src/tile_game/grid.cljs
@@ -28,9 +28,9 @@
    [:button {:on-click #(async/put! command :reset)} "Reset"]
    [:button {:on-click #(async/put! command :new-game)} "Shuffle"]
    [:label (str "Board size: " size)]
-   [:input {:type "range" :style {:width "25%"}
-            :value size :min 2 :max 8
-            :on-change (fn [e] (swap! app-state assoc :size (.-target.value e)))}]])
+   [:input {:type "range" :value size :min 2 :max 8
+            :on-change (fn [e] (swap! app-state assoc :size (.-target.value e)))
+            :style {:width "25%"}}]])

 (defn render-tile [[x y] tile command]
   (if-not (zero? tile)


Register event listeners

Register event listeners

--- higher/desktop/src-common/higher/core.clj
+++ higher/desktop/src-common/higher/core.clj
@@ -11,7 +11,19 @@
   :on-render
   (fn [screen entities]
     (clear!)
-    (render! screen entities)))
+    (render! screen entities))
+
+  :on-key-down
+  (fn [screen entities]
+    (cond
+      (= (:key screen) (key-code :dpad-up))
+      (println "up")
+      (= (:key screen) (key-code :dpad-down))
+      (println "down")
+      (= (:key screen) (key-code :dpad-left))
+      (println "left")
+      (= (:key screen) (key-code :dpad-right))
+      (println "right"))))

 (defgame higher-game
   :on-create


emits userslist on join and disconnect

emits userslist on join and disconnect

--- src/moomoo/core.cljs
+++ src/moomoo/core.cljs
@@ -13,7 +13,10 @@
 (def app (.createServer http))
 (def io (.listen socketio app))

-
+(defn emit-userslistto-room [room]
+  (rooms/get-all-users room
+    (fn [err reply]
+      (.emit (.to io room) "userslist" (clj->js reply)))))

 (defn connection [socket]
   (println "A user has connected!")
@@ -21,14 +24,15 @@
     (.get rooms/redis-client (string/join ["users:" (.-id socket)])
       (fn [err reply]
         (if (not (nil? reply))
-          (let [room (.toString reply)]
-            (rooms/get-all-users room
-              (fn [err reply]
-                (.emit (.to io room) "userslist" (clj->js reply))))))))
+          (let [room (.toString reply)
+                id   (.-id socket)]
+            (.hdel rooms/redis-client (string/join [room ":users"] id))
+            (emit-userslistto-room room)))))
     (println "A user has disconnected!")))
   (.on socket "set_username"
     (fn [room username]
       (rooms/set-username room (.-id socket) username)
+      (emit-userslistto-room room)
       (println (string/join [username " has joined " room]))))
   (.on socket "join_room"
     (fn [room]


Function for fetching all the books on a shelf

--- src/myshelf/core.clj
+++ src/myshelf/core.clj
@@ -155,6 +155,21 @@
          second
          :content
          (map extract-book-data))))
+
+(defn get-all-books-on-shelf
+  "Fetches all the books on a shelf. Note that this might be
+  hundreds or thousands of books!"
+  [consumer access-token user-id shelf]
+  (let [per-page 200]
+    (loop [page 1
+           books []]
+      (let [new-books (get-books-on-shelf consumer access-token
+                                          user-id shelf
+                                          :page page
+                                          :per-page per-page)]
+        (if (empty? new-books)
+          books
+          (recur (inc page) (apply conj books new-books)))))))

 (defn find-book-by-title
   "Runs a query for a book by title. Returns only the last


removed events comments

removed events comments

--- src/nonaga/draw.cljs
+++ src/nonaga/draw.cljs
@@ -4,30 +4,6 @@
             [nonaga.rules.ball :as b]
             [nonaga.rules.rings :as r])
   (:use-macros [dommy.macros :only [sel1]]))
-
-; Events
-;
-; [:turn-began :red]
-; - Clickable red marbles
-; [:marble-selected :red coords]
-; - Clickable red marbles
-; - Clickable pink marbles
-; [:marble-moved :red]
-; - Clickable moveable rings
-; [:ring-selected :ring coords]
-; - Clickable moveable rings
-; - Clickable light grey rings
-;
-; [:turn-began :blue]
-; - Clickable blue marbles
-; [:marble-selected :blue coords]
-; - Clickable blue marbles
-; - Clickable pink marbles
-; [:marble-moved :blue]
-; - Clickable moveable rings
-; [:ring-selected :ring coords]
-; - Clickable moveable rings
-; - Clickable light grey rings

 (defn hex->svg [[hex-x hex-y]]
   (let [width  40


show port mode #221

show port mode
#221

--- src/cljs/swarmpit/component/service/info/ports.cljs
+++ src/cljs/swarmpit/component/service/info/ports.cljs
@@ -5,10 +5,10 @@

 (enable-console-print!)

-(def headers ["Container port" "Protocol" "Host port"])
+(def headers ["Container port" "Protocol" "Mode" "Host port"])

 (def render-item-keys
-  [[:containerPort] [:protocol] [:hostPort]])
+  [[:containerPort] [:protocol] [:mode] [:hostPort]])

 (defn render-item
   [item]


work on constructing changed-files list

work on constructing changed-files list

--- src/revdiff/core.clj
+++ src/revdiff/core.clj
@@ -18,6 +18,7 @@
 ;; copy to avoid following the history of a differently-named object.

 (defn log [item] (:out (sh "svn" "log" shhh "--stop-on-copy" "--xml" item)))
+;;(defn log [item] (slurp "xml"))

 ;; Try to explain why this has failed.

@@ -61,37 +62,28 @@

 ;; A string containing the output of "diff" on the two svn revision of item.

-(defn txtdiff [r1 r2 item]
+(defn diff [r1 r2 item]
   (let [v (vpaths r1 r2 item item)]
     (sh "svn" "diff" "--diff-cmd" "diff" "-x" "-u0" shhh (first v) (second v))))

-;; A sequence (possibly nil) of the changed lines (denoted by a leading + or -)
-;; from the given text diff, filtered by the filter term, if provided.
+;; Obtain a diff from svn for the given item between the specified revisions.
+;; Break each diff into blocks (delineated by the text "Index: "), where each
+;; block describes one file. The block's first line is the filename, and lines
+;; beginning with a single '+' or '-' are the changes. Construct and return a
+;; vector of the names of files where the filter term appears on a changed line.
+;; If no filter term is given, a changed file automatically matches.

-(defn matches? [txt_diff term]
-  (let [restr (if term (str "[+-][^+-].*" term ".*") ".*")]
-    (seq (filter #(re-matches (re-pattern restr) %) txt_diff))))
-
-;; A sequence of files from the revision-pair diff with changed lines matching
-;; the filter term. The first line of each block contains the file/path name from
-;; the text diff header, with "Index:" stripped off. The rest of the lines
-;; contain the +/- changed lines. Process all blocks recursively to produce the
-;; list of matching files.
-
-(defn matchfiles [blocks term]
-  (when (seq blocks)
-    (let [lines (split-lines (first blocks))
-          fname (trim (first lines))
-          match (matches? (rest lines) term)]
-      (concat (when match (list fname)) (matchfiles (rest blocks) term)))))
-
-;; A wrapper for matchfiles: provides a sequence of blocks from the text diff,
-;; each block delineated by an "Index:" tag (either in the first position of
-;; the string, or at the start of a line). Returns the sequence of filenames
-;; produced recursively by matchfiles.
-
-(defn filediffs [r1 r2 term item]
-  (matchfiles (rest (split (:out (txtdiff r1 r2 item)) #"^Index: |\nIndex: ")) term))
+(defn matching-files [r1 r2 item term]
+  (let [blocks (rest (split (:out (diff r1 r2 item)) #"^Index: |\nIndex: "))]
+    (remove nil?
+            (into []
+                  (for [block blocks]
+                    (let [lines (split-lines block)
+                          filename (trim (first lines))
+                          changes (filter #(re-matches #"^[+-][^+-].*" %) lines)
+                          re (re-pattern (str ".*" term ".*"))
+                          matching-line-in #(re-matches re %)]
+                      (if (some matching-line-in changes) filename)))))))

 ;; Run "svn diff" on the file/pathname in index. The format of the file/path name
 ;; following "Index:" in diff's output depends on the argument: If the argument
@@ -101,7 +93,7 @@
 ;; pathname) we can use item; if it was the uri to a directory, we have to
 ;; concatenate the item and index to form a complete pathname.

-(defn diff [r1 r2 index item]
+(defn svndiff [r1 r2 index item]
   (let [r (re-pattern (str "^.*/" index "$"))
         p (if (uri? item)
             (if (re-matches r item) item (str item "/" index))
@@ -115,9 +107,11 @@

 (defn diffrevpairs [item term revpairs]
   (when (seq revpairs)
-    (let [r1 (first revpairs) r2 (first (rest revpairs)) fd (filediffs r1 r2 term item)]
+    (let [r1 (first revpairs)
+          r2 (first (rest revpairs))
+          mf (matching-files r1 r2 item term)]
       (println (str "Checking: r" r1 " vs r" r2))
-      (doseq [index fd] (diff r1 r2 index item))
+      (doseq [index mf] (svndiff r1 r2 index item))
       (diffrevpairs item term (rest (rest revpairs))))))

 (defn usage []


Add docstrings to stuff.

Add docstrings to stuff.

--- src/soy_clj/core.clj
+++ src/soy_clj/core.clj
@@ -21,10 +21,12 @@
   (reset! template-cache cache))

 (def ^:private opts
+  "Default to requiring autoescaped templates."
   (doto (SoyGeneralOptions.)
     (.setStrictAutoescapingRequired true)))

 (defn- parse-uncached
+  "Returns a compiled set of templates from the given files."
   [files]
   (let [builder (SoyFileSet/builder)]
     (run! #(.add builder (io/file (io/resource %))) files)
@@ -43,12 +45,15 @@
         templates))))

 (defn- camel-case
+  "Converts a symbol like `:blah-blah` into a string like `blahBlah`."
   [s]
   (let [ss (string/split (name s) #"-")]
     (string/join (cons (string/lower-case (first ss))
                        (map string/capitalize (next ss))))))

 (defn- camelize-keys
+  "Recursively transforms a map, converting all keyword keys into camel-case
+  strings."
   ^java.util.Map [m]
   (let [f (fn [[k v]] (if (keyword? k) [(camel-case k) v] [k v]))]
     (walk/postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m)))
@@ -63,6 +68,7 @@
     "text/plain; charset=utf-8"))

 (def ^:private content-kind
+  "A map of ContentKind enums to happy little symbols."
   {SanitizedContent$ContentKind/ATTRIBUTES :attributes
    SanitizedContent$ContentKind/CSS :css
    SanitizedContent$ContentKind/HTML :html
@@ -70,7 +76,9 @@
    SanitizedContent$ContentKind/TEXT :text
    SanitizedContent$ContentKind/URI :uri})

-(def ^:private content-kind-enum (set/map-invert content-kind))
+(def ^:private content-kind-enum
+  "A map of happy little symbols to ContentKind enums."
+  (set/map-invert content-kind))

 (defn render
   "Given a parsed set of templates, renders the named template with the given


opus2c

--- src/tgmart/opus2.clj
+++ src/tgmart/opus2.clj
@@ -61,4 +61,41 @@
    :width 720 :height 720
    )

+  ;; opus2c
+  ;; https://twitter.com/tweegeemee/status/695932961036832769/photo/1
+  ;; :name "160206_113143_M.clj" :parents ["160203_163143_C.clj"]
+  (render-animation
+   [i 0 20 1]
+   (->>
+    (vfrac (green-from-hsl (lerp (vconcat (gradient (offset [2.1641 -1.8963 1.3623 1.1235] (vcos (vpow (clamp -2.1979 [2.8877 -0.1482 -0.9508] [2.2707 -2.5016]) (v- pos 2.6432))))) (saturation-from-rgb (rgb-from-hsl [1.4505 -0.0455 2.0777]))) (v- (adjust-hue (vconcat (lightness-from-rgb (length pos)) 2.433) 2.0835) (adjust-hsl (alpha (t (sigmoid 1.7052))) (v- pos 2.6432))) (vabs (vround (vfrac (sigmoid (v* turbulence (lerp pos 2.0475 pos)))))))))
+    (scale [(+ 3.0 (circle-sin i 1 20)) (+ 3.0 (circle-sin i 1 20))])
+    (offset [(circle-sin i 0.5 (/ 20 2)) (circle-cos i 0.5 20)])
+    )
+   {:filename "art/opus2c/a%04d.png"
+    :width   (* (/ 1920 10) 2)
+    :height  (* (/ 1080 10) 2)
+    })
+
+  ;; just the image (centered at the origin)
+  (show
+   (->>
+    (vfrac (green-from-hsl (lerp (vconcat (gradient (offset [2.1641 -1.8963 1.3623 1.1235] (vcos (vpow (clamp -2.1979 [2.8877 -0.1482 -0.9508] [2.2707 -2.5016]) (v- pos 2.6432))))) (saturation-from-rgb (rgb-from-hsl [1.4505 -0.0455 2.0777]))) (v- (normalize (adjust-hue (vdivide (lightness-from-rgb (length pos)) 2.433) 2.0835)) (adjust-hsl (alpha (t (sigmoid 1.7052))) (v- pos 2.6432))) (vabs (vround (vfrac (sigmoid (v* turbulence (lerp pos 2.0475 pos)))))))))
+    (scale [1.0 1.0])
+    ;;(offset [-0.5 -0.5])
+    )
+   :width 320 :height 320
+   )
+
+  ;; opus2? -- this one is pretty expensive to calculate...
+  ;; :name "160131_203257_N.clj" :parents ["160127_173218_N.clj"]
+  (show
+   (->>
+    (adjust-hsl (vcos (blue-from-hsl (dot pos (vsin (rgb-from-hsl (adjust-hue [1.009 0.4101 -0.8179] (vmin [0.502 2.7223 -1.2887] (dot pos pos)))))))) (x (min-component (normalize (square (vsin (rgb-from-hsl (adjust-hue (green-from-hsl [1.009 0.4101 -0.8179]) (v- [0.502 2.7223 -1.2887] pos)))))))))
+    (scale [1.0 1.0])
+    ;;(offset [-0.5 -0.5])
+    )
+   :width 320 :height 320
+   )
+
+
 )


[Fixes: #13582] Increase cooldown on sending request

--- src/status_im/ui/screens/communities/community.cljs
+++ src/status_im/ui/screens/communities/community.cljs
@@ -24,7 +24,7 @@
             [status-im.ui.components.accordion :as accordion]
             [status-im.ui.screens.communities.styles :as styles]))

-(def request-cooldown-ms (* 60 1000))
+(def request-cooldown-ms (* 24 60 60 1000))

 (defn can-request-access-again? [requested-at]
   (> (datetime/timestamp) (+ (* requested-at 1000) request-cooldown-ms)))


Whitespace.

Whitespace.

--- test/clojure_the_language/clojure_numerics_test.clj
+++ test/clojure_the_language/clojure_numerics_test.clj
@@ -6,31 +6,30 @@

 ;;; Clojure's numeric types (some of which are Java types)

-(fact (type 2)    => Long)
-(fact (type 2)    => java.lang.Long)
+(fact (type 2)     => Long)
+(fact (type 2)     => java.lang.Long)

 ;; **** I'm surprised clojure.lang.xxxx is needed for BigInt and Ratio.

-(fact (type 2N)   => clojure.lang.BigInt)
-
-(fact (type 2/3)  => clojure.lang.Ratio)
-
-(fact (type 2.0M) => BigDecimal)
-(fact (type 2.0M) => java.math.BigDecimal)
-(fact (type 2M)   => BigDecimal)
-
-(fact (type 2.0)  => Double)
-(fact (type 2.0)  => java.lang.Double)
-
-(fact (type 4/2)  => Long)
+(fact (type 2N)    => clojure.lang.BigInt)
+
+(fact (type 2/3)   => clojure.lang.Ratio)
+
+(fact (type 2.0M)  => BigDecimal)
+(fact (type 2.0M)  => java.math.BigDecimal)
+(fact (type 2M)    => BigDecimal)
+
+(fact (type 2.0)   => Double)
+(fact (type 2.0)   => java.lang.Double)
+
+(fact (type 4/2) => Long)

 ;;; Some non-Clojure Java numeric types

-(fact (type (byte 2)) => java.lang.Byte)
-(fact (type (Byte. (byte 2))) => java.lang.Byte)
-(fact (type (short 2)) => java.lang.Short)
-(fact (type (Short. (short 2))) => java.lang.Short)
-
+(fact (type (byte 2))                    => java.lang.Byte)
+(fact (type (Byte. (byte 2)))            => java.lang.Byte)
+(fact (type (short 2))                   => java.lang.Short)
+(fact (type (Short. (short 2)))          => java.lang.Short)
 (fact (type (java.math.BigInteger. "2")) => java.math.BigInteger)

 ;;; From /Clojure Programming/, p427: "double is the only representation that


A few typos changed and a missing edge case or two

--- test/simple_symbolic_regression_clojure/gp_test.clj
+++ test/simple_symbolic_regression_clojure/gp_test.clj
@@ -84,7 +84,7 @@

 (fact "uniform crossover works with empty collections"
   (count (uniform-crossover [1 1 1 1 1] [])) => 0
-  (count (uniform-crossover [1 1 1 1 1] [])) => 0
+  (count (uniform-crossover [] [1 1 1 1 1])) => 0
   )

@@ -105,11 +105,12 @@
 ;; uneven one-point-crossover

 (fact "one-point crossover takes two collections and splices them together at a randomly chosen internal point"
-  (let [stubby (cycler [3 3 2 4 1 5 7 0])] ;; these will be used in pairs to pick slice points
+  (let [stubby (cycler [3 3 2 4 1 5 7 0 0 7])] ;; these will be used in pairs to pick slice points
     (with-redefs [rand-int (fn [arg] (step-cycler stubby))]
       (one-point-crossover [1 1 1 1 1 1 1 1] [2 2 2 2 2 2 2 2]) => (just [1 1 1 2 2 2 2 2])
       (one-point-crossover [1 1 1 1 1 1 1 1] [2 2 2 2 2 2 2 2]) => (just [1 1 2 2 2 2])
       (one-point-crossover [1 1 1 1 1 1 1 1] [2 2 2 2 2 2 2 2]) => (just [1 2 2 2])
       (one-point-crossover [1 1 1 1 1 1 1 1] [2 2 2 2 2 2 2 2]) => (just [1 1 1 1 1 1 1 2 2 2 2 2 2 2 2])
+      (one-point-crossover [1 1 1 1 1 1 1 1] [2 2 2 2 2 2 2 2]) => (just [2])
       ))
   )


Add contact email

Add contact email

--- template/index.html.clj
+++ template/index.html.clj
@@ -16,6 +16,8 @@
     [:p.text-center
       (link "github.com/Pance" "https://github.com/Pance")
       "  "
+      "PBarnett888@gmail.com"
+      "  "
       (link "soundcloud.com/DJPance" "https://soundcloud.com/djpance")]
     [:p.text-center "I am a Texan, hacker, gamer and a bedroom DJ. I am interested in the web, personal data tracking, automation, people, cars, fitness and electronic dance music."]
     [:p.text-center "I'm currently building a todo-list web app using Clojure called todo-repl[link]."]


sort keys for readability

sort keys for readability

--- test/babel/test/en.cljc
+++ test/babel/test/en.cljc
@@ -244,17 +244,17 @@
                         :comp {:synsem {:agr {:person :3rd}}}
                         :synsem {:cat :verb
                                  :sem {:aspect :progressive
+                                       :obj {:pred :table
+                                             :mod '()
+                                             :number :sing
+                                             :spec {:def :def
+                                                    :pred :definite}}
                                        :pred :in-front-of
                                        :subj {:pred :chair
                                               :mod '()
                                               :number :sing
                                               :spec {:def :def
                                                      :pred :definite}}
-                                       :obj {:pred :table
-                                             :mod '()
-                                             :number :sing
-                                             :spec {:def :def
-                                                    :pred :definite}}
                                        :tense :present}}})]
     (is (= (fo expr)
            "the chair is in front of the table"))))


s/lexicon/lex/

s/lexicon/lex/

--- test/babel/test/fr.cljc
+++ test/babel/test/fr.cljc
@@ -88,12 +88,12 @@
     (is (= "j'avais" (fo result)))))

 (deftest être-as-aux
-  (let [lexicon (:lexicon (small))
+  (let [lex (:lexicon (small))
         result
         (filter #(not (fail? %))
                 (map (fn [rule]
                        (unify rule
-                               {:head (last (get lexicon "être"))}))
+                               {:head (last (get lex "être"))}))
                      (:grammar (small))))]
     (is (not (empty? result)))
     (is (= (get-in (first result) [:rule]) "vp-aux"))))


add no-op test

add no-op test

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -292,3 +292,8 @@
                                       :spec {:def :none}} ;; "a casa", not "a tua casa", "a della casa", etc
                                 :subj {:pred :I}}}})]
     (is (= (fo result) "io sono a casa"))))
+
+(deftest alla-prossima
+  (let [alla-prossima "alla prossima"]))
+
+


more tests

more tests

--- test/hsm/test_utils.clj
+++ test/hsm/test_utils.clj
@@ -14,15 +14,16 @@
 	(fact "Find Host of the Request"
 		(host-of {:headers { "host" ?host }} ) => ?result)
 		?host ?result
-		 "dev.pythonhackers.com" "dev.pythonhackers.com"
-		 "clojurehackers.com" "clojurehackers.com")
+		 "dev.pythonhackers.com" 		"dev.pythonhackers.com"
+		 "clojurehackers.com" 			"clojurehackers.com")

 (tabular
 	(fact "Empty Host Request with falsy hash-map "
 		(host-of ?request ) => ?result)
 		?request ?result
-		 {:headers { "TEST" 1}} nil
-		 {:headers2 "test"} nil)
+		 {:headers { "TEST" 1}} 		nil
+		 {:headers2 "test"} 				nil
+		 )

 ; Well Token fetcher always returns the same ID for right now! Very effective!! :)
 (tabular
@@ -37,9 +38,9 @@
 		(select-values ?hashmap ?keys) => ?result)
 		?hashmap ?keys ?result
 		{:a 1 :b 2} [:a :b] [1 2]
-		{:a 1 :b 2} [:a] [1]
-		{:a 1 :b 2} [] []
-		{:a 1 :b 2} nil []
+		{:a 1 :b 2} [:a] 		[1]
+		{:a 1 :b 2} [] 			[]
+		{:a 1 :b 2} nil 		[]
 		)

 (let [temp-file (java.io.File/createTempFile (str "body-test" (now->ep)) ".txt")]
@@ -52,4 +53,15 @@
 			?body ?result
 			"test" "test"
 			temp-file "testing")
-	(.delete temp-file))+	(.delete temp-file))
+
+(tabular
+	(fact "Convert maps into keyword keyed hashmaps"
+		(mapkeyw ?hashmap) => ?result)
+		?hashmap ?result
+		{"a" 1 "b" 2} {:a 1 :b 2}
+		{:a 1 :b 2} 	{:a 1 :b 2}
+		{1 2} 				{nil 2}
+		{1 2 3 4} 		{nil 4}
+		{"1" 2 "3" 4} {:1 2 :3 4}
+	)


Patch for recurrent problem with Lein New Project wizard

--- ccw.leiningen/src/clj/ccw/leiningen/util.clj
+++ ccw.leiningen/src/clj/ccw/leiningen/util.clj
@@ -108,7 +108,8 @@
                       (eval-in-project
                         project
                         `(leiningen.core.project/merge-profiles
-                           leiningen.core.project/defaults
+                           (update-in leiningen.core.project/defaults
+                             [:repositories] (fnil conj []) ["clojars-ccw-added" {:url "https://clojars.org/repo/"}])
                            [:user :default]))
                       (eval-in-project
                         project


Add ctrl? predicate to keyboard ns.

Add ctrl? predicate to keyboard ns.

--- src/uxbox/ui/keyboard.cljs
+++ src/uxbox/ui/keyboard.cljs
@@ -5,5 +5,9 @@
   (fn [e]
     (= (.-keyCode e) keycode)))

+(defn ctrl?
+  [event]
+  (.-ctrlKey event))
+
 (def esc? (is-keycode? 27))
 (def enter? (is-keycode? 13))


Refactoring

Refactoring

login generalized to be protector

--- modules/entrance/src/modular/entrance.clj
+++ modules/entrance/src/modular/entrance.clj
@@ -288,17 +288,17 @@
 ;; authorizer and session store. Different constructors can build this
 ;; component in different ways.

-(defrecord ProtectionDomain [login authorizer http-session-store]
+(defrecord ProtectionDomain [protector authorizer http-session-store]
   component/Lifecycle
   (start [this] (component/start-system this (keys this)))
   (stop [this] (component/stop-system this (keys this)))
-  ;; We must export the routes provided by the login sub-component TODO:
-  ;; It's possible that the authorizer and http-session-store components
-  ;; provided may also contribute routes - we should return an
-  ;; aggregation of all the sub-components, not just the login.
+  ;; In this implementation, we export any routes provided by sub-components
   BidiRoutesContributor
-  (routes [this] (routes (:login this)))
-  (context [this] (context (:login this))))
+  (routes [this] ["" (vec (keep #(when (satisfies? BidiRoutesContributor %) (routes %)) (vals this)))])
+  (context [this] (or
+                   (first (keep #(when (satisfies? BidiRoutesContributor %) (context %))
+                                ((juxt :protector :authorizer :http-session-store) this)))
+                   "")))

 (def new-default-protection-domain-schema
   {(s/optional-key :session-timeout-in-seconds) s/Int
@@ -307,9 +307,9 @@
 (defn new-default-protection-domain [opts]
   (s/validate new-default-protection-domain-schema opts)
   (map->ProtectionDomain
-   {:login (if-let [boilerplate (:boilerplate opts)]
-             (new-login-form :boilerplate boilerplate)
-             (new-login-form))
+   {:protector (if-let [boilerplate (:boilerplate opts)]
+                 (new-login-form :boilerplate boilerplate)
+                 (new-login-form))
     :authorizer (new-map-backed-user-registry {"malcolm" "password"})
     :http-session-store (new-atom-backed-session-store
                          (or (:session-timeout-in-seconds opts)
@@ -322,10 +322,10 @@
 (defrecord ProtectedBidiRoutes [routes context]
   component/Lifecycle
   (start [this]
-    (let [pd (get-in this [:protection-domain :login])
+    (let [protector (get-in this [:protection-domain :protector])
           routes (cond-> routes
                          (fn? routes) (apply [this])
-                         pd ((partial protect-bidi-routes pd)))]
+                         protector ((partial protect-bidi-routes protector)))]
       (assoc this :routes routes)))
   (stop [this] this)


Fixed missing object exception in Travis.

--- lambda-blog/test/lambda_blog/fixtures.clj
+++ lambda-blog/test/lambda_blog/fixtures.clj
@@ -105,12 +105,15 @@
                                     :id n
                                     :summary (-> t .getShortMessage)
                                     :tags ["changelog" n]
-                                    :timestamp (->> t
-                                                    .getObject
-                                                    .getId
-                                                    (.parseCommit rev-walk)
-                                                    .getAuthorIdent
-                                                    .getWhen)
+                                    :timestamp (try (->> t
+                                                         .getObject
+                                                         .getId
+                                                         (.parseCommit rev-walk)
+                                                         .getAuthorIdent
+                                                         .getWhen)
+                                                    ;; NOTE Travis CI doesn't pull all the objects.
+                                                    (catch Exception _
+                                                      #inst "1970-01-01T00:00:00.000Z"))
                                     :title (format "λ-blog v%s has been released!" n))))))))
          (giti/get-refs repo "refs/tags/"))))


Fixed a bug in etl data generate - the entities location was nested inside body

--- dev/etl.clj
+++ dev/etl.clj
@@ -72,8 +72,9 @@
         ;; ENTITY
         entity                {:project_id project_id
                                :property_code "1a2b3c4d"}
-        entity_url            (:location (read-response (post-resource (str hostname "/4/entities/")
-                                                                       "application/json" entity)))
+        entity_url            (:location (:body (read-response (post-resource (str hostname "/4/entities/")
+                                                                       "application/json" entity))))
+        _ (log/error ">>>>>>" entity_url)
         [_ _ _ entity_id]     (string/split entity_url #"/")
         ;; DEVICE
         device                {:description "External air temperature sensor"


Two new tests: test-get-calendar and test-get-calendar-2

--- test/clj_calendar/calendar_test.clj
+++ test/clj_calendar/calendar_test.clj
@@ -100,3 +100,45 @@
     (testing "if the clj-calendar.calendar/get-last-day-of-week-formatted function definition exists."
         (is (callable? 'clj-calendar.calendar/get-last-day-of-week-formatted))))

+;
+; Tests for function behaviours
+;
+
+(deftest test-get-calendar
+    "Check the function clj-calendar.calendar.calendar/get-calendar."
+    (testing "the function clj-calendar.calendar.calendar/get-calendar."
+        (is (not (nil? (get-calendar))))
+        (is (or
+            (=  (class (get-calendar)) java.util.Calendar)
+            (=  (class (get-calendar)) java.util.GregorianCalendar)))
+        (is (or
+            (=  (type  (get-calendar)) java.util.Calendar)
+            (=  (type  (get-calendar)) java.util.GregorianCalendar)))
+        (is (>  (.get (get-calendar) (java.util.Calendar/YEAR)) 2000))
+        (is (>= (.get (get-calendar) (java.util.Calendar/MONTH)) 0))
+        (is (<  (.get (get-calendar) (java.util.Calendar/MONTH)) 12))
+        (is (>= (.get (get-calendar) (java.util.Calendar/DAY_OF_MONTH)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/DAY_OF_MONTH)) 31)) ; let's be on the safe side
+        (is (>= (.get (get-calendar) (java.util.Calendar/DAY_OF_YEAR)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/DAY_OF_YEAR)) 366)) ; let's be on the safe side
+        (is (>= (.get (get-calendar) (java.util.Calendar/WEEK_OF_YEAR)) 0))
+        (is (<= (.get (get-calendar) (java.util.Calendar/WEEK_OF_YEAR)) 54)) ; let's be on the safe side
+))
+
+(deftest test-get-calendar-2
+    "Check the function clj-calendar.calendar.calendar/get-calendar."
+    (testing "the function clj-calendar.calendar.calendar/get-calendar."
+        (let [calendar (get-calendar)]
+            (.set calendar 2000 01 01 10 20 30)
+            (is (not (nil? calendar)))
+            (is (or
+                (=  (class calendar) java.util.Calendar)
+                (=  (class calendar) java.util.GregorianCalendar)))
+            (is (or
+                (=  (type  calendar) java.util.Calendar)
+                (=  (type  calendar) java.util.GregorianCalendar)))
+            (is (=  (.get calendar (java.util.Calendar/YEAR)) 2000))
+            (is (=  (.get calendar (java.util.Calendar/MONTH)) 1))
+            (is (=  (.get calendar (java.util.Calendar/DAY_OF_MONTH)) 1)))
+))
+


Restore excluded testcase following CLJS bug fix

--- test/cljc/spectrace/trace_test.cljc
+++ test/cljc/spectrace/trace_test.cljc
@@ -215,21 +215,19 @@
     #_[[{:spec `(s/& integer? even?) :path [] :val [1] :in [0]}
       {:spec `even? :path [] :val 1 :in []}]]

-    #?@(:clj
-        ((s/& (s/cat :x integer? :y integer?)
-              (fn [{:keys [x y]}] (< x y)))
-         [4 :a]
-         [[{:spec `(s/& (s/cat :x integer? :y integer?)
-                        (fn [{:keys [~'x ~'y]}] (< ~'x ~'y)))
-            :path [:y]
-            :val [4 :a]
-            :in [1]}
-           {:spec `(s/cat :x integer? :y integer?)
-            :path [:y]
-            :val [4 :a]
-            :in [1]}
-           {:spec `integer? :path [] :val :a :in []}]]
-         ))
+    (s/& (s/cat :x integer? :y integer?)
+         (fn [{:keys [x y]}] (< x y)))
+    [4 :a]
+    [[{:spec `(s/& (s/cat :x integer? :y integer?)
+                   (fn [{:keys [~'x ~'y]}] (< ~'x ~'y)))
+       :path [:y]
+       :val [4 :a]
+       :in [1]}
+      {:spec `(s/cat :x integer? :y integer?)
+       :path [:y]
+       :val [4 :a]
+       :in [1]}
+      {:spec `integer? :path [] :val :a :in []}]]

     #_(s/& (s/cat :x integer? :y integer?)
          (fn [{:keys [x y]}] (< x y)))


returned network-badge

returned network-badge

--- src/status_im/ui/screens/network_settings/network_details/views.cljs
+++ src/status_im/ui/screens/network_settings/network_details/views.cljs
@@ -28,6 +28,9 @@
       [react/view {:flex 1}
        [status-bar/status-bar]
        [new-toolbar/toolbar]
+       [network-settings/network-badge
+        {:name       name
+         :connected? connected?}]
        (when-not connected?
          [react/touchable-highlight {:on-press #(rf/dispatch [:connect-network id])}
           [react/view st/connect-button-container
@@ -43,14 +46,14 @@
        ;; TODO(rasom): uncomment edit-button when it will be functional,
        ;; https://github.com/status-im/status-react/issues/2104
        #_[react/view {:opacity 0.4}
-        [react/view st/edit-button-container
-         [react/view st/edit-button
-          [react/text {:style      st/edit-button-label
-                       :uppercase? (get-in platform/platform-specific [:uppercase?])}
-           (i18n/label :t/edit-network-config)]]
-         #_[context-menu                                      ; TODO should be implemented later
-            [view st/edit-button
-             [text {:style st/edit-button-label} (i18n/label :t/edit-network-config)]]
-            options]
-         [react/text {:style st/edit-button-description}
-          (i18n/label :t/edit-network-warning)]]]])))
+          [react/view st/edit-button-container
+           [react/view st/edit-button
+            [react/text {:style      st/edit-button-label
+                         :uppercase? (get-in platform/platform-specific [:uppercase?])}
+             (i18n/label :t/edit-network-config)]]
+           #_[context-menu                                      ; TODO should be implemented later
+              [view st/edit-button
+               [text {:style st/edit-button-label} (i18n/label :t/edit-network-config)]]
+              options]
+           [react/text {:style st/edit-button-description}
+            (i18n/label :t/edit-network-warning)]]]])))


add tagesschau summary

add tagesschau summary


Add German support to the desktop version

--- desktop/src/nightweb_desktop/utils.clj
+++ desktop/src/nightweb_desktop/utils.clj
@@ -29,6 +29,7 @@
 ; language

 (def lang-files {"en" "values/strings.xml"
+                 "de" "values-de/strings.xml"
                  "fr" "values-fr/strings.xml"
                  "ja" "values-ja/strings.xml"})
 (def lang-strings (-> (get lang-files (.getLanguage (Locale/getDefault)))


added a link to discuss in the header

added a link to discuss in the header

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -222,6 +222,7 @@
                     [:a.menu-item {:href "/pricing"} "Pricing"]]))
                [:li (maybe-active nav-point :documentation)
                 [:a.menu-item {:href "/docs"} "Documentation"]]
+               [:li [:a.menu-item {:href "https://discuss.circleci.com"} "Discuss"]]
                (when (config/show-marketing-pages?)
                  (list
                    [:li {:class (when (contains? #{:about


Refactoring

Refactoring

--- modules/entrance/src/modular/entrance.clj
+++ modules/entrance/src/modular/entrance.clj
@@ -45,7 +45,7 @@

 ;; Certain objects can provide protection for routes
 (defprotocol BidiRoutesProtector
-  (protect-routes [_ routes]))
+  (protect-bidi-routes [_ routes]))

 ;; Tag that a BidiRoutesContributor is protected
 ;; TODO Rename BidiRoutesContributor to BidiRoutesProvider
@@ -87,19 +87,17 @@
   (unresolve-handler [this m]
     (unresolve-handler routes m)))

-(defn protect [routes & {:as opts}]
-  ["" (->ProtectMatched [routes]
-                        (s/validate
-                         {:authorizer (s/protocol HttpRequestAuthorizer)
-                          (s/optional-key :fail-handler) (s/protocol FailedAuthorizationHandler)}
-                         opts))])
+(defn add-bidi-protection-wrapper [routes & {:as opts}]
+  ["" (->ProtectMatched
+       [routes]
+       (s/validate
+        {:authorizer (s/protocol HttpRequestAuthorizer)
+         (s/optional-key :fail-handler) (s/protocol FailedAuthorizationHandler)}
+        opts))])

 (defrecord BidiFailedAuthorizationRedirect [h]
   FailedAuthorizationHandler
   (failed-authorization [_ req]
-    (println "FAILED AUTH" (path-for (:modular.bidi/routes req) h))
-    (println "FAILED AUTH2" (:modular.bidi/routes req))
-    (println "FAILED AUH h" h)
     {:status 302
      :headers {"Location" (path-for (:modular.bidi/routes req) h)}
      :body "Not authorized\n"
@@ -184,6 +182,24 @@

 (defn new-composite-disjunctive-request-authorizer [& delegates]
   (->CompositeDisjunctiveRequestAuthorizer (s/validate [(s/protocol HttpRequestAuthorizer)] delegates)))
+
+;; For a REST API, it is useful to support both HTTP Basic
+;; Authentication (for machines) but to honor cookies passed from a
+;; browser in an AJAX call, when the user has logged in via a login
+;; form.
+
+#_(defrecord ApiAuthorizer []
+  component/Lifecycle
+  (start [this]
+    (let [sessions (get this :http-session-store)
+          users (get this :user-registry)]
+      (assoc this :authorizer (new-composite-disjunctive-request-authorizer
+                               (new-session-based-request-authorizer :http-session-store sessions)
+                               (new-http-based-request-authorizer :user-password-authorizer users)))))
+  (stop [this] this))
+
+#_(defn new-api-authorizer []
+  (component/using (->ApiAuthorizer) [:authorizer :http-session-store]))

 ;; Since this module is dependent on bidi, let's provide some sample
 ;; bidi routes that can be used as-is or to demonstrate.
@@ -248,11 +264,11 @@
   (context [this] context)

   BidiRoutesProtector
-  (protect-routes [this routes]
-    (println "protecting routes:" routes)
-    (protect routes
-             :authorizer (new-session-based-request-authorizer :http-session-store (:http-session-store this))
-             :fail-handler (->BidiFailedAuthorizationRedirect (get-in this [:handlers :get-handler])))))
+  (protect-bidi-routes [this routes]
+    (add-bidi-protection-wrapper
+     routes
+     :authorizer (new-session-based-request-authorizer :http-session-store (:http-session-store this))
+     :fail-handler (->BidiFailedAuthorizationRedirect (get-in this [:handlers :get-handler])))))

 (def new-login-form-schema
   {(s/optional-key :path) s/Str
@@ -284,8 +300,9 @@
   (routes [this] (routes (:login this)))
   (context [this] (context (:login this))))

-(def new-default-protection-domain-schema {(s/optional-key :session-timeout-in-seconds) s/Int
-                                           (s/optional-key :boilerplate) (s/=> 1)})
+(def new-default-protection-domain-schema
+  {(s/optional-key :session-timeout-in-seconds) s/Int
+   (s/optional-key :boilerplate) (s/=> 1)})

 (defn new-default-protection-domain [opts]
   (s/validate new-default-protection-domain-schema opts)
@@ -298,6 +315,7 @@
                          (or (:session-timeout-in-seconds opts)
                              10))}))

+
 ;; Now that we have a protection domain, we want the ability to create
 ;; routes components that can be protected.

@@ -307,7 +325,7 @@
     (let [pd (get-in this [:protection-domain :login])
           routes (cond-> routes
                          (fn? routes) (apply [this])
-                         pd ((partial protect-routes pd)))]
+                         pd ((partial protect-bidi-routes pd)))]
       (assoc this :routes routes)))
   (stop [this] this)

@@ -316,13 +334,13 @@
   (context [this] context))

 (defn new-mandatory-protected-bidi-routes
-
   "Create a set of protected routes. The absence of a :protection-domain
   dependency will cause an error. Routes can a bidi route structure, or
   a function that takes the component and returns a bidi route
   structure."
   [routes context]
   (component/using (->ProtectedBidiRoutes routes context) [:protection-domain]))
+
 (defn new-protected-bidi-routes
   "Create a set of protected routes. The absence of a :protection-domain
   dependency will remove the protection. If protection is mandatory, use
@@ -330,4 +348,3 @@
   structure, or a function that takes the component and returns a bidi
   route structure."  [routes context]
   (->ProtectedBidiRoutes routes context))
-


Sort key-values constants in wpml/word-xmlns

--- src/bakyeono/litedocx/wpml.clj
+++ src/bakyeono/litedocx/wpml.clj
@@ -54,31 +54,31 @@
    :xmlns:dc "http://purl.org/dc/elements/1.1/"})

 (def ^:const ^{:private true} word-xmlns
-  {:xmlns:v "urn:schemas-microsoft-com:vml"
-   :xmlns:pic "http://schemas.openxmlformats.org/drawingml/2006/picture"
+  {:xmlns:a "http://schemas.openxmlformats.org/drawingml/2006/main"
+   :xmlns:c "http://schemas.openxmlformats.org/drawingml/2006/chart"
+   :xmlns:dgm "http://schemas.openxmlformats.org/drawingml/2006/diagram"
+   :xmlns:dsp "http://schemas.microsoft.com/office/drawing/2008/diagram"
+   :xmlns:m "http://schemas.openxmlformats.org/officeDocument/2006/math"
    :xmlns:ns11 "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
-   :xmlns:r "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
-   :xmlns:o "urn:schemas-microsoft-com:office:office"
-   :xmlns:odq "http://opendope.org/questions"
    :xmlns:ns13 "urn:schemas-microsoft-com:office:excel"
-   :xmlns:w10 "urn:schemas-microsoft-com:office:word"
-   :xmlns:dsp "http://schemas.microsoft.com/office/drawing/2008/diagram"
-   :xmlns:ns8 "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"
-   :xmlns:m "http://schemas.openxmlformats.org/officeDocument/2006/math"
+   :xmlns:ns17 "urn:schemas-microsoft-com:office:powerpoint"
+   :xmlns:ns24 "http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
    :xmlns:ns25 "http://schemas.openxmlformats.org/drawingml/2006/compatibility"
    :xmlns:ns26 "http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"
    :xmlns:ns6 "http://schemas.openxmlformats.org/schemaLibrary/2006/main"
-   :xmlns:ns24 "http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
+   :xmlns:ns8 "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"
+   :xmlns:o "urn:schemas-microsoft-com:office:office"
+   :xmlns:odc "http://opendope.org/conditions"
+   :xmlns:odgm "http://opendope.org/SmartArt/DataHierarchy"
+   :xmlns:odi "http://opendope.org/components"
+   :xmlns:odq "http://opendope.org/questions"
    :xmlns:odx "http://opendope.org/xpaths"
-   :xmlns:odi "http://opendope.org/components"
-   :xmlns:dgm "http://schemas.openxmlformats.org/drawingml/2006/diagram"
-   :xmlns:a "http://schemas.openxmlformats.org/drawingml/2006/main"
-   :xmlns:odc "http://opendope.org/conditions"
-   :xmlns:c "http://schemas.openxmlformats.org/drawingml/2006/chart"
-   :xmlns:wp "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
-   :xmlns:ns17 "urn:schemas-microsoft-com:office:powerpoint"
-   :xmlns:odgm "http://opendope.org/SmartArt/DataHierarchy"
-   :xmlns:w "http://schemas.openxmlformats.org/wordprocessingml/2006/main"})
+   :xmlns:pic "http://schemas.openxmlformats.org/drawingml/2006/picture"
+   :xmlns:r "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+   :xmlns:v "urn:schemas-microsoft-com:vml"
+   :xmlns:w "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
+   :xmlns:w10 "urn:schemas-microsoft-com:office:word"
+   :xmlns:wp "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"})

 (def ^:const ^{:private true} default-content-types
   [(node :Default {:Extension "rels"


fix syntax error, add type hint

fix syntax error, add type hint

--- src/bolth.clj
+++ src/bolth.clj
@@ -137,7 +137,7 @@
         (redify "E")
         (redify "F")))))

-(defn start-printer [full-failures results]
+(defn start-printer [full-failures ^AbstractQueue results]
   (let [builder (StringBuilder.)]
     (future
       (loop [r (.poll results)]
@@ -150,9 +150,10 @@
               (do
                 (print (str builder))
                 (flush)
-                (.setLength builder 0))
-              (.append builder ^String (format-progress-result r full-failures))))
-          (recur (.poll results)))))))
+                (.setLength builder 0)
+                (Thread/sleep 10))
+              (.append builder ^String (format-progress-result r full-failures)))
+            (recur (.poll results))))))))

 (defn run-gathered-tests [^AbstractQueue tests-to-run pharrallelism]
   (let [results (LinkedBlockingQueue.)


In streams/fixed-wall-clock-time-window for window alignment use (:time event) instead of (unix-time)

--- src/riemann/streams.clj
+++ src/riemann/streams.clj
@@ -402,7 +402,7 @@

   Events without times accrue in the current window."
   [n & children]
-  (apply fixed-time-window-fn n (fn [n event] (- (unix-time) (mod (unix-time) n))) children))
+  (apply fixed-time-window-fn n (fn [n event] (- (:time event) (mod (:time event) n))) children))

 (defn window
   "Alias for moving-event-window."


Check for pending container specs in spec-report*

--- src/main/clojure/com/stuartsierra/lazytest/report.clj
+++ src/main/clojure/com/stuartsierra/lazytest/report.clj
@@ -83,7 +83,7 @@
     (flush)))

 (defn- spec-report* [r parents]
-  (if (container? r)
+  (if (and (container? r) (not (pending? r)))
     (doseq [c (:children r)]
       (spec-report* c (conj parents r)))
     (if (and (success? r) (not (pending? r)))


Bumps version

Bumps version


Bumps version to 1.58.4-SNAPSHOT

Bumps version to 1.58.4-SNAPSHOT


bring top level let test back

bring top level let test back

--- test/cljs/test_runner.cljs
+++ test/cljs/test_runner.cljs
@@ -21,7 +21,7 @@
 (macro-test/test-macros)
 (letfn-test/test-letfn)
 (ns-shadow-test/test-shadow)
-;(top-level/test)
+(top-level/test)

 (println "Tests completed without exception")


Updated comments, fixed minor errors

Updated comments, fixed minor errors

--- src/background/relevance/background.cljs
+++ src/background/relevance/background.cljs
@@ -69,9 +69,11 @@
   []
   ;; We should use dispatch for anything that does not absolutely require
   ;; immediate handling, to avoid interferring with the regular initialization
-  ;; and event flow.  On this case, I' using it only for log-content,
-  ;; which has no effect on app-state, and for on-suspend, which we want to
-  ;; handle immediately.
+  ;; and event flow.
+  ;;
+  ;; In this case, I'm using dispatch-sync only for log-content, which has no
+  ;; effect on app-state, and for on-suspend, which we want to handle
+  ;; immediately.
   (on-channel alarms/on-alarm dispatch ::on-alarm)
   (on-channel browser/on-clicked dispatch ::on-clicked-button)
   (on-channel runtime/on-message dispatch ::on-message)
@@ -239,8 +241,8 @@
       ;; We only store the idle tabs on the app state if we actually idled any.
       ;; That way we avoid losing the originally stored idled tabs when we
       ;; first go from active->idle and then from idle->locked (the first one
-      ;; would find tabs, the second one would and would overwrite the original
-      ;; saved set with an empty list).
+      ;; would find tabs, the second one wouldn't and would overwrite the
+      ;; original saved set with an empty list).
       (if active-tab
         (do
           (dispatch [action active-tab])


Доработка выделения для chart-2

Доработка выделения для chart-2

--- radiolamp-6P3S/src/r6p3s/cpt/d3/chart_2.cljs
+++ radiolamp-6P3S/src/r6p3s/cpt/d3/chart_2.cljs
@@ -163,14 +163,45 @@
             (let [brush (-> js/d3 .-svg .brush (.x x-scale))]
               (.on brush "brushend"
                    (fn [v]
-                     (let [selected (js->clj (.extent brush))]
-                       (on-brushend-fn selected))))
+                     (let [selected (js->clj (.extent brush))
+                           [x1 x2] selected]
+
+                       ;; Левая пунктирная линия
+                       (-> chart-pano
+                           (.selectAll "g.lines.brush .brush-line-left")
+                           (.attr "x1" (x-scale x1))
+                           (.attr "y1" -6)
+                           (.attr "x2" (x-scale x1))
+                           (.attr "y2" (+ chart-height 7)))
+
+                       ;; Правая пунктирная линия
+                       (-> chart-pano
+                           (.selectAll "g.lines.brush .brush-line-right")
+                           (.attr "x1" (x-scale x2))
+                           (.attr "y1" -6)
+                           (.attr "x2" (x-scale x2))
+                           (.attr "y2" (+ chart-height 7)))
+
+                       (on-brushend-fn selected))))
+
               (-> chart-pano
                   (.selectAll "g.x.brush")
                   (.call brush)
                   (.selectAll "rect")
                   (.attr "y" -6)
-                  (.attr "height" (+ chart-height 7)))))
+                  (.attr "height" (+ chart-height 7)))
+
+
+              ;;Обнуляем селекторы
+              (-> chart-pano
+                  (.selectAll "g.lines.brush line")
+                  (.attr "x1" 0)
+                  (.attr "y1" 0)
+                  (.attr "x2" 0)
+                  (.attr "y2" 0))
+
+              #_(on-brushend-fn [nil nil])
+              ))

           ))

@@ -197,4 +228,7 @@
                                           y-label))
                          (dom/g #js {:className "x axis" :transform (str "translate(0," chart-height ")")})
                          (dom/g #js {:className "charting pathes"})
+                         (dom/g #js {:className "lines brush"}
+                                (dom/line #js {:className "brush-line-left"})
+                                (dom/line #js {:className "brush-line-right"}))
                          (dom/g #js {:className "x brush" :width chart-width :height chart-height}))))))))


normalize format of second return value

normalize format of second return value

--- src/insn/util.clj
+++ src/insn/util.clj
@@ -203,7 +203,7 @@
   ([pred [x & more :as xs] default]
    (if (pred x)
      [x more]
-     [default xs])))
+     [default (seq xs)])))

 (defn special-desc
   "Return internal type string for the 'anewarray', 'checkcast',


Add key url

Add key url

--- main/src/dda/pallet/dda_managed_vm/infra/office.clj
+++ main/src/dda/pallet/dda_managed_vm/infra/office.clj
@@ -59,7 +59,13 @@
     (logging/info (str facility "-install system: pdf-chain")))
   ;(actions/packages :aptitude ["pdfchain" "pdftk" "gprename" "pyrenamer" "a2ps"])
   ;(actions/exec-script ("snap" "install" "pdftk"))
-  (actions/packages :aptitude ["pdftk-java"])
+  (actions/package-source "pdftk-java"
+                          :aptitude
+                          {:url "http://ppa.launchpad.net/malteworld/ppa/ubuntu"
+                           :scopes ["main"]
+                           :release "bionic"
+                           :key-url "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x20D0BB61B700CE29"})
+  (actions/package "pdftk-java")
   )

 (defn install-audio


get math test working

get math test working


Clean up tests.

Clean up tests.

--- test/soy_clj/core_test.clj
+++ test/soy_clj/core_test.clj
@@ -26,6 +26,7 @@
     (is (thrown? IllegalArgumentException
                  (compile-to-js "bad.soy"))))
   (testing "Compiling templates to Javascript"
+    (set-cache (cache/lu-cache-factory {}))
     (is (= (slurp "test/example.js")
            (compile-to-js "example.soy")))
     (is (cache/has? @@#'soy-clj/cache [:js ["example.soy"]]))))
@@ -36,9 +37,6 @@
     (is (parse "example.soy"))
     (is (parse ["example.soy"]))
     (is (cache/has? @@#'soy-clj/cache [:tofu ["example.soy"]])))
-  (testing "Parsing a template without a cache"
-    (is (parse "example.soy"))
-    (is (parse ["example.soy"])))
   (testing "Overriding the builder"
     (binding [*builder-fn* (fn [] (let [builder (SoyFileSet/builder)]
                                     (.add builder (io/file "test/example.soy"))


Disable eftest multi threading by default

--- settings/lk/scratch.clj
+++ settings/lk/scratch.clj
@@ -7,6 +7,7 @@
             [clojure.java.io :as io])
   (:import (java.io File)))

+(def multithread (atom false))
 (defn init! []
   (ns.repl/disable-reload! *ns*))

@@ -24,13 +25,15 @@
   find a namespace"
   ([]
    (refresh)
-   (eftest/run-tests (eftest/find-tests "test")))
+   (eftest/run-tests (eftest/find-tests "test")
+                      {:multithread? @multithread}))
   ([pattern]
    (let [regex (re-pattern pattern)
          nss (filter (fn [v] (re-find regex (str v)))
                      (eftest/find-tests "test"))]
      (refresh)
-     (eftest/run-tests nss))))
+     (eftest/run-tests nss
+                       {:multithread? @multithread}))))

 (println "yo")
 (init!)


Update tests for more grammatical main output.

--- test/zprint/main_test.cljc
+++ test/zprint/main_test.cljc
@@ -152,7 +152,7 @@
       (expect
         (more-of result
           1 (:exit result)
-          "Processing file ttt_test.clj\nFormatting required in file ttt_test.clj\nProcessed 1 file, 1 of which require formatting.\n"
+          "Processing file ttt_test.clj\nFormatting required in file ttt_test.clj\nProcessed 1 file, 1 of which requires formatting.\n"
             (:err result)
           "" (:out result))
         (sh "java" "-jar" target-uberjar "-lfsc" "ttt_test.clj"))
@@ -172,7 +172,7 @@
       (expect
         (more-of result
           0 (:exit result)
-          "Processing file ttt_test.clj\nProcessed 1 file, none of which require formatting.\n"
+          "Processing file ttt_test.clj\nProcessed 1 file, none of which requires formatting.\n"
             (:err result)
           "" (:out result))
         (sh "java" "-jar" target-uberjar "-lfsc" "ttt_test.clj"))


and upsert again

and upsert again

--- src/clj/conference_rating/db_handler.clj
+++ src/clj/conference_rating/db_handler.clj
@@ -37,7 +37,7 @@

 (s/defn add-attendance [attendance :- schemas/Attendance db]
   (let [document (assoc attendance :_id (ObjectId.))]
-    (mc/insert db "attendances" document)
+    (mc/update db "attendances" {:user (:user document) :conference-id (:conference-id document)} {$set {:user (:user document)}} {:upsert true})
     (clear-id-in-doc document)))

 (s/defn remove-attendance [attendance :- schemas/Attendance db]


some clazz input changes tests

some clazz input changes tests

--- src/clojure/my/company/superapp/main.clj
+++ src/clojure/my/company/superapp/main.clj
@@ -354,7 +354,7 @@
     ;; Using default jsonSerializer
     (def defaultmCache
       (->
-       (Builder. mCacheId 1 String)
+       (Builder. mCacheId 1 HashMap)
        (.enableLog)
        (.useSerializerInRam mRamCacheSize defaultjsonSerializer)
        (.useSerializerInDisk mDiskCacheSize, true, defaultjsonSerializer, (*a))


Changed size and instruction diversification -- not backward compatible.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -570,28 +570,39 @@
 (defn size-and-instruction-diversifying?
   "Returns true iff genome g passes the diversification test."
   [g argmap]
-  (let [kids (repeatedly (:autoconstructive-si-children argmap)
+  (let [numkids (:autoconstructive-si-children argmap)
+        kids (repeatedly numkids
                          #(produce-child-genome-by-autoconstruction g g false argmap))
+        kid-counts (map count kids)
         instruction-set (fn [genome]
-                          (hash-set (keys (frequencies (map :instruction genome)))))]
-    (and (not (some #{g} kids))
-         (not (apply = (map count kids)))
-         (not (apply = (map instruction-set kids))))))
+                          (hash-set (keys (frequencies (map :instruction genome)))))
+        kid-sets (map instruction-set kids)]
+    (and (not (some #{(count g)} kid-counts))
+         (not (some #{(instruction-set g)} kid-sets))
+         (or (< numkids 2) (not (apply = kid-counts)))
+         (or (< numkids 2) (not (apply = kid-sets))))))

 (defn three-gens-size-and-instruction-diversifying?
   "Returns true iff genome g passes the diversification test."
   [g argmap]
-  (let [make-child #(produce-child-genome-by-autoconstruction % % false argmap)
+  (let [numkids (:autoconstructive-si-children argmap)
+        make-child #(produce-child-genome-by-autoconstruction % % false argmap)
         instruction-set (fn [genome]
                           (hash-set (keys (frequencies (map :instruction genome)))))
-        kids (repeatedly (:autoconstructive-si-children argmap)
-                         #(make-child g))
-        grandkids (map make-child kids)]
-    (and (apply distinct? (concat kids grandkids [g]))
-         (not (apply = (map count kids)))
-         (not (apply = (map count grandkids)))
-         (not (apply = (map instruction-set kids)))
-         (not (apply = (map instruction-set grandkids))))))
+        kids (repeatedly numkids #(make-child g))
+        kid-counts (map count kids)
+        kid-sets (map instruction-set kids)
+        grandkids (map make-child kids)
+        grandkid-counts (map count grandkids)
+        grandkid-sets (map instruction-set grandkids)]
+    (and (not (some #{(count g)} kid-counts))
+         (not (some #{(instruction-set g)} kid-sets))
+         (not (some #{(count g)} grandkid-counts))
+         (not (some #{(instruction-set g)} grandkid-sets))
+         (or (< numkids 2) (not (apply = (map count kids))))
+         (or (< numkids 2) (not (apply = (map count grandkids))))
+         (or (< numkids 2) (not (apply = (map instruction-set kids))))
+         (or (< numkids 2) (not (apply = (map instruction-set grandkids)))))))

 (defn safe-t-test ;; safely answers 1.0 if t-test would divide by zero
   [xvec yvec]


STORM-1588: Do not add event logger details if event loggers is zero

--- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
+++ storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
@@ -2185,21 +2185,22 @@
               comp-page-info
               (converter/thriftify-debugoptions debug-options)))
           ;; Add the event logger details.
-          (let [component->tasks (clojurify-structure (Utils/reverseMap (:task->component info)))
-                eventlogger-tasks (sort (get component->tasks
-                                             EVENTLOGGER-COMPONENT-ID))
-                ;; Find the task the events from this component route to.
-                task-index (mod (TupleUtils/listHashCode [component-id])
-                                (count eventlogger-tasks))
-                task-id (nth eventlogger-tasks task-index)
-                eventlogger-exec (first (filter (fn [[start stop]]
-                                                  (between? task-id start stop))
-                                                (keys executor->host+port)))
-                [host port] (get executor->host+port eventlogger-exec)]
-            (if (and host port)
-              (doto comp-page-info
-                (.set_eventlog_host host)
-                (.set_eventlog_port port))))
+          (let [component->tasks (clojurify-structure (Utils/reverseMap (:task->component info)))]
+            (if (contains? component->tasks EVENTLOGGER-COMPONENT-ID)
+              (let [eventlogger-tasks (sort (get component->tasks
+                                                 EVENTLOGGER-COMPONENT-ID))
+                    ;; Find the task the events from this component route to.
+                    task-index (mod (TupleUtils/listHashCode [component-id])
+                                    (count eventlogger-tasks))
+                    task-id (nth eventlogger-tasks task-index)
+                    eventlogger-exec (first (filter (fn [[start stop]]
+                                                      (between? task-id start stop))
+                                                    (keys executor->host+port)))
+                    [host port] (get executor->host+port eventlogger-exec)]
+                (if (and host port)
+                  (doto comp-page-info
+                    (.set_eventlog_host host)
+                    (.set_eventlog_port port))))))
           comp-page-info))

       (^TopologyHistoryInfo getTopologyHistory [this ^String user]


(PE-4966) Refactor serial/inventory test settings

--- test/puppetlabs/master/certificate_authority_test.clj
+++ test/puppetlabs/master/certificate_authority_test.clj
@@ -38,12 +38,11 @@
       :cacert                (str cadir "/ca_crt.pem")
       :cakey                 (str cadir "/ca_key.pem")
       :capub                 (str cadir "/ca_pub.pem")
-      :cert-inventory        (str (ks/temp-file))
+      :cert-inventory        (str cadir "/inventory.txt")
       :csrdir                (str cadir "/requests")
       :signeddir             (str cadir "/signed")
-      :load-path             []
-      :serial                (doto (str (ks/temp-file))
-                               initialize-serial-file!)}))
+      :serial                (str cadir "/serial")
+      :load-path             []}))

 (defn master-test-settings
   "Master configuration settings with defaults appropriate for testing.
@@ -65,11 +64,15 @@
 (defn assert-issuer [o issuer]
   (is (= issuer (-> o .getIssuerX500Principal .getName))))

-(defn tmp-whitelist [& lines]
+(defn tmp-whitelist! [& lines]
   (let [whitelist (ks/temp-file)]
     (doseq [line lines]
       (spit whitelist (str line "\n") :append true))
     (str whitelist)))
+
+(defn tmp-serial-file! []
+  (doto (str (ks/temp-file))
+    initialize-serial-file!))

 (def empty-stream-fn #(ByteArrayInputStream. (.getBytes "")))

@@ -129,11 +132,11 @@
                                  empty-stream-fn []))))

     (testing "exact certnames"
-      (doto (tmp-whitelist "foo"
-                           "UPPERCASE"
-                           "this.THAT."
-                           "bar1234"
-                           "AB=foo,BC=bar,CD=rab,DE=oof,EF=1a2b3d")
+      (doto (tmp-whitelist! "foo"
+                            "UPPERCASE"
+                            "this.THAT."
+                            "bar1234"
+                            "AB=foo,BC=bar,CD=rab,DE=oof,EF=1a2b3d")
         (assert-autosign "foo")
         (assert-autosign "UPPERCASE")
         (assert-autosign "this.THAT.")
@@ -144,9 +147,9 @@
         (assert-no-autosign "this-THAT-")))

     (testing "domain-name globs"
-      (doto (tmp-whitelist "*.red"
-                           "*.black.local"
-                           "*.UPPER.case")
+      (doto (tmp-whitelist! "*.red"
+                            "*.black.local"
+                            "*.UPPER.case")
         (assert-autosign "red")
         (assert-autosign ".red")
         (assert-autosign "green.red")
@@ -163,7 +166,7 @@
         (assert-autosign "one-two-three.red")))

     (testing "allow all with '*'"
-      (doto (tmp-whitelist "*")
+      (doto (tmp-whitelist! "*")
         (assert-autosign "foo")
         (assert-autosign "BAR")
         (assert-autosign "baz-buz.")
@@ -171,12 +174,12 @@
         (assert-autosign "AB=foo,BC=bar,CD=rab,DE=oof,EF=1a2b3d")))

     (testing "ignores comments and blank lines"
-      (doto (tmp-whitelist "#foo"
-                           "  "
-                           "bar"
-                           ""
-                           "# *.baz"
-                           "*.qux")
+      (doto (tmp-whitelist! "#foo"
+                            "  "
+                            "bar"
+                            ""
+                            "# *.baz"
+                            "*.qux")
         (assert-no-autosign "foo")
         (assert-no-autosign "  ")
         (assert-autosign "bar")
@@ -188,9 +191,9 @@
                             " #bar"
                             "bar "
                             " bar"]]
-        (let [whitelist (tmp-whitelist "foo"
-                                       invalid-line
-                                       "qux")]
+        (let [whitelist (tmp-whitelist! "foo"
+                                        invalid-line
+                                        "qux")]
           (assert-autosign whitelist "foo")
           (logutils/with-log-output logs
             (assert-no-autosign whitelist invalid-line)
@@ -275,10 +278,13 @@
           (fs/delete path))))))

 (deftest autosign-certificate-request!-test
-  (let [csr-fn             #(csr-stream "test-agent")
-        expected-cert-path (path-to-cert signeddir "test-agent")]
+  (let [settings           (assoc (ca-test-settings)
+                             :serial (tmp-serial-file!)
+                             :cert-inventory (str (ks/temp-file)))
+        csr-fn             #(csr-stream "test-agent")
+        expected-cert-path (path-to-cert (:signeddir settings) "test-agent")]
     (try
-      (autosign-certificate-request! "test-agent" csr-fn (ca-test-settings))
+      (autosign-certificate-request! "test-agent" csr-fn settings)

       (testing "requests are autosigned and saved to disk"
         (is (fs/exists? expected-cert-path))
@@ -337,7 +343,7 @@
 (deftest initialize-master!-test
   (let [ssldir          (ks/temp-dir)
         master-settings (master-test-settings ssldir "master")
-        serial          (doto (str (ks/temp-file)) initialize-serial-file!)
+        serial          (tmp-serial-file!)
         inventory       (str (ks/temp-file))
         signeddir       (str (ks/temp-dir))]

@@ -454,9 +460,10 @@
   (is (= (format-serial-number 42) "002A")))

 (deftest next-serial-number!-test
-  (let [serial-file (:serial (ca-test-settings))]
-    (is (fs/exists? serial-file))
-    (is (= (next-serial-number! serial-file) 1))
+  (let [serial-file (str (ks/temp-file))]
+    (testing "Serial file is initialized to 1"
+      (initialize-serial-file! serial-file)
+      (is (= (next-serial-number! serial-file) 1)))

     (testing "The serial number file should contain the next serial number"
       (is (= "0002" (slurp serial-file))))
@@ -467,9 +474,6 @@

       (is (= (next-serial-number! serial-file) 3))
       (is (= "0004" (slurp serial-file))))))
-
-(defn contains-duplicates? [coll]
-  (not= (count coll) (count (distinct coll))))

 ; If the locking is deleted from `next-serial-number!`, this test will hang,
 ; which is not as nice as simply failing ...
@@ -490,7 +494,9 @@
                               (let [serial-number (next-serial-number! serial-file)]
                                 (swap! serials conj serial-number)))
                             (deliver p 'done))
-                          p))]
+                          p))
+
+          contains-duplicates? #(not= (count %) (count (distinct %)))]

       ; wait on all the threads to finish
       (doseq [p promises] (deref p))
@@ -510,7 +516,7 @@
   (testing "Certs can be written to an inventory file."
     (let [first-cert     (utils/pem->cert cacert)
           second-cert    (utils/pem->cert (path-to-cert signeddir "localhost"))
-          inventory-file (:cert-inventory (ca-test-settings))]
+          inventory-file (str (ks/temp-file))]
       (write-cert-to-inventory! first-cert inventory-file)
       (write-cert-to-inventory! second-cert inventory-file)

@@ -535,35 +541,37 @@
             "/CN=localhost"))))))

 (deftest process-csr-submission!-test
-  (testing "throws an exception if a CSR already exists for that subject"
-    (is (thrown-with-slingshot?
-         {:type    :duplicate-cert
-          :message "test-agent already has a requested certificate; ignoring certificate request"}
-         (process-csr-submission! "test-agent" (csr-stream "test-agent") (ca-test-settings))))
-
-    (testing "unless $allow-duplicate-certs is true"
-      (let [settings  (assoc (ca-test-settings) :allow-duplicate-certs true)
-            cert-path (path-to-cert (:signeddir settings) "test-agent")]
-        (logutils/with-test-logging
-          (is (false? (fs/exists? cert-path)))
-          (process-csr-submission! "test-agent" (csr-stream "test-agent") settings)
-          (is (logged? #"test-agent already has a requested certificate; new certificate will overwrite it" :info))
-          (is (true? (fs/exists? cert-path))))
-        (fs/delete cert-path))))
-
-  (testing "throws an exception if a certificate already exists for that subject"
-    (is (thrown-with-slingshot?
-         {:type    :duplicate-cert
-          :message "localhost already has a signed certificate; ignoring certificate request"}
-         (process-csr-submission! "localhost" (csr-stream "test-agent") (ca-test-settings))))
-
-    (testing "unless $allow-duplicate-certs is true"
-      (let [settings (-> (ca-test-settings)
-                         (assoc :allow-duplicate-certs true :autosign false))
-            csr-path (path-to-cert-request (:csrdir settings) "localhost")]
-        (logutils/with-test-logging
-          (is (false? (fs/exists? csr-path)))
-          (process-csr-submission! "localhost" (csr-stream "test-agent") settings)
-          (is (logged? #"localhost already has a signed certificate; new certificate will overwrite it" :info))
-          (is (true? (fs/exists? csr-path))))
-        (fs/delete csr-path)))))
+  (let [settings (assoc (ca-test-settings)
+                   :serial (tmp-serial-file!)
+                   :cert-inventory (str (ks/temp-file)))]
+    (testing "throws an exception if a CSR already exists for that subject"
+      (is (thrown-with-slingshot?
+           {:type    :duplicate-cert
+            :message "test-agent already has a requested certificate; ignoring certificate request"}
+           (process-csr-submission! "test-agent" (csr-stream "test-agent") settings)))
+
+      (testing "unless $allow-duplicate-certs is true"
+        (let [settings  (assoc settings :allow-duplicate-certs true)
+              cert-path (path-to-cert (:signeddir settings) "test-agent")]
+          (logutils/with-test-logging
+            (is (false? (fs/exists? cert-path)))
+            (process-csr-submission! "test-agent" (csr-stream "test-agent") settings)
+            (is (logged? #"test-agent already has a requested certificate; new certificate will overwrite it" :info))
+            (is (true? (fs/exists? cert-path))))
+          (fs/delete cert-path))))
+
+    (testing "throws an exception if a certificate already exists for that subject"
+      (is (thrown-with-slingshot?
+           {:type    :duplicate-cert
+            :message "localhost already has a signed certificate; ignoring certificate request"}
+           (process-csr-submission! "localhost" (csr-stream "test-agent") settings)))
+
+      (testing "unless $allow-duplicate-certs is true"
+        (let [settings (assoc settings :allow-duplicate-certs true :autosign false)
+              csr-path (path-to-cert-request (:csrdir settings) "localhost")]
+          (logutils/with-test-logging
+            (is (false? (fs/exists? csr-path)))
+            (process-csr-submission! "localhost" (csr-stream "test-agent") settings)
+            (is (logged? #"localhost already has a signed certificate; new certificate will overwrite it" :info))
+            (is (true? (fs/exists? csr-path))))
+          (fs/delete csr-path))))))


Propagate handling of character encoding through nailgun

--- server/src/main/clojure/vimclojure/nails.clj
+++ server/src/main/clojure/vimclojure/nails.clj
@@ -51,10 +51,10 @@
      (.start))))

 (defn- make-stream-set
-  [in out err]
-  [(-> in InputStreamReader. LineNumberingPushbackReader.)
-   (-> out OutputStreamWriter.)
-   (-> err OutputStreamWriter. PrintWriter.)])
+  [in out err encoding]
+  [(-> in (InputStreamReader. encoding) LineNumberingPushbackReader.)
+   (-> out (OutputStreamWriter. encoding))
+   (-> err (OutputStreamWriter. encoding) PrintWriter.)])

 (defn- set-input-stream
   [#^ThreadLocalInputStream sys local]
@@ -73,10 +73,8 @@
   [#^NGContext ctx nail]
   (let [out          (ByteArrayOutputStream.)
         err          (ByteArrayOutputStream.)
-        [clj-in clj-out clj-err] (make-stream-set (.in ctx) out err)
-        encoding     (if-let [encoding (System/getProperty "clojure.vim.encoding")]
-                       encoding
-                       "UTF-8")
+        encoding     (System/getProperty "clojure.vim.encoding" "UTF-8")
+        [clj-in clj-out clj-err] (make-stream-set (.in ctx) out err encoding)
         sys-in       (set-input-stream System/in (.in ctx))
         sys-out      (set-output-stream System/out (PrintStream. out))
         sys-err      (set-output-stream System/err (PrintStream. err))
@@ -92,12 +90,14 @@
     (set-input-stream System/in sys-in)
     (set-output-stream System/out sys-out)
     (set-output-stream System/err sys-err)
-    (.print (.out ctx)
-            (print-str
-              (util/clj->vim
-                {:value  result
-                 :stdout (.toString out encoding)
-                 :stderr (.toString err encoding)})))
+    (let [output (.getBytes
+                   (print-str
+                     (util/clj->vim
+                       {:value  result
+                        :stdout (.toString out encoding)
+                        :stderr (.toString err encoding)}))
+                   encoding)]
+      (.write (.out ctx) output 0 (alength output)))
     (.flush (.out ctx))))

 (defmacro defnail


delete music-files on track delete

delete music-files on track delete


Updates UMM generators to avoid generating empty records.

--- umm-spec-lib/src/cmr/umm_spec/test/umm_generators.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/umm_generators.clj
@@ -30,6 +30,13 @@
       (throw (Exception. (format "The fields [%s] are not supported by generators with schema type [%s]"
                                  (pr-str unexpected-fields) (pr-str schema-type)))))))

+(defn- non-empty-obj-gen
+  [g]
+  (gen/fmap (fn [x]
+              (when (some some? (vals x))
+                x))
+            g))
+
 (defn- object-like-schema-type->generator
   "Takes an object-like schema type and generates a generator. By \"object-like\" it means a map
   with keys properties, required, and additionalProperties. This is used to handle a normal object
@@ -47,18 +54,18 @@
         ;; Figure out which properties are required and which are optional
         required-properties (set (map keyword (:required schema-type)))
         optional-properties (vec (set/difference (set (keys properties)) required-properties))]
-
-    (chgen/for [;; Determine which properties to generate in this instance of the object
-                num-optional-fields (gen/choose 0 (count optional-properties))
-                :let [selected-properties (concat required-properties
-                                                  (subvec optional-properties
-                                                          0 num-optional-fields))
-                      ;; Create a map of property names to generators
-                      selected-prop-gens (select-keys prop-gens selected-properties)]
-                ;; Generate a hash map containing the properties
-                prop-map (apply gen/hash-map (flatten (seq selected-prop-gens)))]
-               ;; Construct a record from the hash map
-               (constructor-fn prop-map))))
+    (non-empty-obj-gen
+     (chgen/for [;; Determine which properties to generate in this instance of the object
+                 num-optional-fields (gen/choose 0 (count optional-properties))
+                 :let [selected-properties (concat required-properties
+                                                   (subvec optional-properties
+                                                           0 num-optional-fields))
+                       ;; Create a map of property names to generators
+                       selected-prop-gens (select-keys prop-gens selected-properties)]
+                 ;; Generate a hash map containing the properties
+                 prop-map (apply gen/hash-map (flatten (seq selected-prop-gens)))]
+       ;; Construct a record from the hash map
+       (constructor-fn prop-map)))))

 (defn- assert-field-not-present-with-one-of
   [schema-type k]
@@ -104,7 +111,6 @@
   (rejected-unexpected-fields #{:properties :additionalProperties :required :oneOf :anyOf} schema-type)
   (if-let [one-of (:oneOf schema-type)]
     (object-one-of->generator schema type-name schema-type)
-
     ;; else
     (if-let [any-of (:anyOf schema-type)]
       (->> any-of
@@ -125,7 +131,7 @@
   [schema type-name schema-type]
   (rejected-unexpected-fields #{:items :minItems :maxItems} schema-type)
   (let [{:keys [items minItems maxItems]} (merge array-defaults schema-type)
-        item-generator (schema-type->generator schema type-name items)
+        item-generator (gen/such-that some? (schema-type->generator schema type-name items))
         ;; Limit the maximum number of items in an array to 5.
         maxItems (min maxItems 5)]
     (if (= minItems 0)


Backup dp.xml with timestamp

Backup dp.xml with timestamp

--- src/tango/export2.clj
+++ src/tango/export2.clj
@@ -12,22 +12,23 @@
             ))

 ;; Sample data
-(def class-results [{:class-name "Disco Freestyle B-klass J Po"
-                     :result {:round "S"
-                              :adjudicators [{:number 2}
-                                             {:number 4}
-                                             {:number 5}]
-                              :dances [{:name "X-Quick Forward"}
-                                       {:name "Quick"}]
-                              :result-array [{:dancer-number 30
-                                              :marks [true false true]}
-                                             {:dancer-number 31
-                                              :marks [true true true]}
-                                             {:dancer-number 32
-                                              :marks [false false true]}]}}
+(defn class-results[]
+  [{:class-name              "Disco Freestyle B-klass J Po"
+    :result {:round        "S"
+             :adjudicators [{:number 2}
+                            {:number 4}
+                            {:number 5}]
+             :dances       [{:name "X-Quick Forward"}
+                            {:name "Quick"}]
+             :result-array [{:dancer-number 30
+                             :marks         [true false true]}
+                            {:dancer-number 31
+                             :marks         [true true true]}
+                            {:dancer-number 32
+                             :marks         [false false true]}]}}
                     ])

-(def activities-with-result
+(defn activities-with-result []
 [{:activity/name "Hiphop Singel Guld J1",
   :round/name "Semifinal",
   :round/panel
@@ -144,9 +145,31 @@
     {:adjudicator/number 5}]},
   :round/dances [{:dance/name "Medium"} {:dance/name "Medium"}]}])

-(def activity-result (first activities-with-result))
-
-activity-result
+(defn activity-result [] ()first )
+
+
+(defn make-file-name-with-timestamp [file-name]
+
+  )
+
+(defn make-file-name-with-timestamp
+  ;; Adds the current time at the end
+  ;; of the filename
+  [file-name]
+  (let [time-now (t/now)
+        time-formatter (tf/formatters :hour-minute-second)
+        time-now-formatted (tf/unparse time-formatter time-now)
+        new-file-name (str file-name "." time-now-formatted)]
+    new-file-name
+    ))
+
+(defn make-copy-with-timestamp
+ ;; Copies the file and adds current time at the end
+ ;; of the filename.
+ [file-name]
+ (let [file-contents (slurp file-name)
+       new-file-name (make-file-name-with-timestamp file-name)]
+   (spit new-file-name file-contents)))

 (defn short-round-name [round-name]
   (condp = round-name
@@ -201,13 +224,6 @@
             :result-array (result-facts->result-array (:result/_activity activity-result))
             }})

-
-(get-marks result-facts)
-(get-dancers result-facts)
-(get-results-for-dancer result-facts 141)
-(apply hash-set [:a :b :b :c])
-(activity-result->class-result activity-result)
-activity-result
 ;; Provides useful Timbre aliases in this ns
 (log/refer-timbre)

@@ -303,9 +319,6 @@
         out-xml (add-results-to-dp-xml in-xml (first class-results))]
     (spit "export5.xml" (xml/emit-str out-xml))))

-(smoke-test)
-(smoke-test2)
-
 ;; TODO - should be the callers responsibillity to provide correct format
 (defn- transform-result [activities-with-result]

@@ -332,33 +345,18 @@
     (-> out .getWriter .toString)))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; API
-
-(defn tango-xml-encode [xml-str]
-  (cstr/escape xml-str {
-                        \Ö "Ö"
-                        \ö "ö"
-                        \ä "ä"
-                        \å "å"
-                        \é "é"
-                        })
-  )
-
-(tango-xml-encode "<Couple Seq=10\" Number=\"1090\" Name=\"Ebba Hellsten - Emmy Rapp\" Club=\"ND/ÖDT\" License=\"\"/>")
-
 (defn export-results [activities-with-result export-path]
   (log/info (str "Export Results to " export-path " with " activities-with-result))
   (let [in-xml (get-xml-from-file export-path)
         class-results (map activity-result->class-result activities-with-result)
-        ;out-xml (add-results-to-dp-xml in-xml (first class-results))
-        out-xml (reduce add-results-to-dp-xml in-xml class-results)
-        ]
-    (with-open [w (java.io.FileWriter. "bar.xml")]
-      (xml/emit out-xml w))
-    ))
+        out-xml (reduce add-results-to-dp-xml in-xml class-results)]
+    (make-copy-with-timestamp export-path)
+    (spit export-path (ppxml (xml/emit-str out-xml)))))
+
 (map activity-result->class-result activities-with-result)
 (activity-result->class-result activities-with-result)

-(defn smoke-test [] (export-results activities-with-result "dp.xml"))
+(defn smoke-test [] (export-results (activities-with-result) "dp.xml"))

 (smoke-test)


add : as separator for time intervals in EN

--- resources/duckling/rules/en.time.clj
+++ resources/duckling/rules/en.time.clj
@@ -579,7 +579,7 @@
   ; Specific for time-of-day, to help resolve ambiguities

   "<time-of-day> - <time-of-day> (interval)"
-  [#(and (= :time-of-day (:form %)) (not (:latent %))) #"\-|to|th?ru|through" {:form :time-of-day}] ; Prevent set alarm 1 to 5pm
+  [#(and (= :time-of-day (:form %)) (not (:latent %))) #"\-|:|to|th?ru|through" {:form :time-of-day}] ; Prevent set alarm 1 to 5pm
   (interval %1 %3 true)

   "from <time-of-day> - <time-of-day> (interval)"


Added a note to the sample app to explain that it's used in the tests.

--- sample/project.clj
+++ sample/project.clj
@@ -1,3 +1,7 @@
+;; This project is used for leiningen's test suite, so don't change
+;; any of these values without updating the relevant tests. If you
+;; just want a basic project to work from, generate a new one with
+;; "lein new".
 (defproject nomnomnom "0.5.0-SNAPSHOT"
   :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"]
                  [rome/rome "0.9"]