double semicolons for comments

double semicolons for comments

--- src/revdiff/core.clj
+++ src/revdiff/core.clj
@@ -5,20 +5,20 @@
   (:use [clojure.java.shell :only [sh]])
   (:use [clojure.string :only [split split-lines trim]]))

-; TODO add a debug toggle and some related verbose prints?
-; TODO is --stop-on-copy on log really a good idea?
-; TODO maybe print log message / committer info (could use awt/swing popup)?
-; TODO pass all '--' options (e.g. --username) to svn?
-; TODO item, term used to be global: refactor to avoid passing them so much
+;; TODO add a debug toggle and some related verbose prints?
+;; TODO is --stop-on-copy on log really a good idea?
+;; TODO maybe print log message / committer info (could use awt/swing popup)?
+;; TODO pass all '--' options (e.g. --username) to svn?
+;; TODO item, term used to be global: refactor to avoid passing them so much

 (def shhh "--non-interactive")  ; suppress svn user prompts

-; A string containing the xml-formatted svn log for the requested item. Stop on
-; copy to avoid following the history of a differently-named object.
+;; A string containing the xml-formatted svn log for the requested item. Stop on
+;; copy to avoid following the history of a differently-named object.

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

-; Try to explain why this has failed.
+;; Try to explain why this has failed.

 (defn errmsg []
   (println "\nError retrieving repository information. Perhaps:\n")
@@ -26,7 +26,7 @@
   (println "- Your valid svn authentication credentials are not cached.")
   (println))

-; A newest-first sequence of revision numbers in which the item changed
+;; A newest-first sequence of revision numbers in which the item changed

 (defn revlist [item]
   (for [e (try
@@ -35,46 +35,46 @@
         :when (seq (:attrs e))]
     (:revision (:attrs e))))

-; A sequence of revision pairs for potential comparison -- e.g. for the revlist
-; (9 8 6 4 1), return (8 9 6 8 4 6 1 4).
+;; A sequence of revision pairs for potential comparison -- e.g. for the revlist
+;; (9 8 6 4 1), return (8 9 6 8 4 6 1 4).

 (defn revpairs [revlist item]
   (when (seq (rest revlist))
     (concat (list (first (rest revlist)) (first revlist))
             (revpairs (rest revlist) item))))

-; Is path a uri? If it contains :// assume it is.
+;; Is path a uri? If it contains :// assume it is.

 (defn uri? [path] (re-matches #".*://.*" path))

-; If item is a uri, the "-rn:m" revision-range format will not work if item is
-; no longer present in the head revision, in which case we have to use the
-; "item@n item@m" revision-specification format. Return the correctly formatted
-; versioned-path(s) string for use by a diff command.
+;; If item is a uri, the "-rn:m" revision-range format will not work if item is
+;; no longer present in the head revision, in which case we have to use the
+;; "item@n item@m" revision-specification format. Return the correctly formatted
+;; versioned-path(s) string for use by a diff command.

 (defn vpaths [r1 r2 path item]
   (if (uri? item)
     (list (str path "@" r1) (str path "@" r2))
     (list (str "-r" r1 ":" r2) path)))

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

 (defn txtdiff [r1 r2 item]
   (let [v (vpaths r1 r2 item item)]
     (sh "svn" "diff" "--diff-cmd" "diff" 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.
+;; 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.

 (defn matches? [txtdiff term]
   (let [restr (if term (str "[+-][^+-].*" term ".*") ".*")]
     (seq (filter #(re-matches (re-pattern restr) %) txtdiff))))

-; 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.
+;; 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)
@@ -83,21 +83,21 @@
           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.
+;; 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))

-; 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
-; is a filesystem pathname, the index name is absolute, and we can simply use
-; that. If the argument is a uri, the index name is relative to the base item
-; name. If the base item name was the uri to a file (and therefore a complete
-; 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.
+;; 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
+;; is a filesystem pathname, the index name is absolute, and we can simply use
+;; that. If the argument is a uri, the index name is relative to the base item
+;; name. If the base item name was the uri to a file (and therefore a complete
+;; 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]
   (let [r (re-pattern (str "^.*/" index "$"))
@@ -107,9 +107,9 @@
         v (vpaths r1 r2 p item)]
     (sh "svn" "diff" (first v) (second v))))

-; Given a list of revision pairs, diff those for which the given filter term (if
-; any) is present on a changed line in that pair. If no filter term is given,
-; diff all changed files from all revision pairs.
+;; Given a list of revision pairs, diff those for which the given filter term (if
+;; any) is present on a changed line in that pair. If no filter term is given,
+;; diff all changed files from all revision pairs.

 (defn diffrevpairs [item term revpairs]
   (when (seq revpairs)


Allow ModelInstance constructors to work

--- src/play_clj/g3d.clj
+++ src/play_clj/g3d.clj
@@ -86,9 +86,9 @@
        (cond
          (string? arg1#)
          (ModelInstance. (model* arg1#))
-         (:object arg1#)
-         (ModelInstance. ^ModelInstance (:object arg1#))
-         (isa? arg1# ModelData)
+         (isa? (type arg1#) ModelEntity)
+         (ModelInstance. (. ^ModelInstance (:object arg1#) model) ~@(rest args))
+         (isa? (type arg1#) ModelData)
          (ModelInstance. ^Model (Model. ~@args))
          :else
          (ModelInstance. ~@args)))))


fixed looping issue

fixed looping issue

--- src/server/core.cljs
+++ src/server/core.cljs
@@ -221,14 +221,16 @@
                     (.emit (.to io room) "upload-complete" (clj->js music-info))
                     (rooms/has-track-started? room
                       (fn [started?]
-                        (if-not started?
-                          (rooms/get-current-track room
-                            (fn [current-track]
-                              (println current-track)
-                              (rooms/change-track room current-track
-                                (fn [track-id]
-                                  (println "Track changed to " track-id)
-                                  (.emit (.to io room) "track-change" track-id))))))))))))
+                        (rooms/is-looping? room
+                          (fn [looping?]
+                            (if-not (and started? looping?)
+                              (rooms/get-current-track room
+                                (fn [current-track]
+                                  (println current-track)
+                                  (rooms/change-track room current-track
+                                    (fn [track-id]
+                                      (println "Track changed to " track-id)
+                                      (.emit (.to io room) "track-change" track-id))))))))))))))

             (println (str "Successfully uploaded " absolute-file-path)))))))


texture test

texture test

--- test/infinitelives/test.cljs
+++ test/infinitelives/test.cljs
@@ -1,7 +1,8 @@
 (ns infinitelives.test
   (:require [cljs.test :refer-macros [run-all-tests]]
             [infinitelives.pixi.canvas-test]
-            [infinitelives.pixi.resources-test])
+            [infinitelives.pixi.resources-test]
+            [infinitelives.pixi.texture-test])

 (enable-console-print!)


properly injects the p tag

properly injects the p tag

--- src/splash/core.cljs
+++ src/splash/core.cljs
@@ -35,7 +35,10 @@
                ((:render-fn canvas)))))

 (defonce fonts
-  [(font/install-google-font-stylesheet! "http://fonts.googleapis.com/css?family=Indie+Flower")])
+  [
+   (font/install-google-font-stylesheet! "http://fonts.googleapis.com/css?family=Indie+Flower")
+   (font/install-google-font-dom-anchor! "Indie Flower")
+   ])

 (defn on-js-reload []
   ;; optionally touch your app-state to force rerendering depending on


some of the examples now as tests

some of the examples now as tests

--- test/powderkeg/core_test.clj
+++ test/powderkeg/core_test.clj
@@ -11,4 +11,32 @@

 (deftest rdd
   (is (= (into [] (keg/rdd (range 10)))
-         (into [] (range 10)))))
+         (into [] (range 10))))
+  (is (= ["Testing spark"]
+         (into [] (keg/rdd ["This is a firest line"
+                            "Testing spark"
+                            "and powderkeg"
+                            "Happy hacking!"]
+                           (filter #(.contains % "spark"))))))
+  (is (instance? org.apache.spark.api.java.JavaRDD
+                 (keg/rdd (range 100)      ; source
+                          (filter odd?)    ; 1st transducer to apply
+                          (map inc)        ; 2nd transducer
+                          :partitions 2))) ; and options
+  (is (= [0 1 2 3 4 5 6 7 8 9]
+         (into [] (keg/rdd (range 10)))))
+  (is (= [0 1 2 3 4]
+         (into [] (keg/scomp (take 5)) (range 10))))
+  (is (= [0 1 2 3 4]
+         (keg/into [] (take 5) (range 10))))
+  (is (= [[0 1 2 3 4 5] [6 7 8 9 10 11] [12 13 14 15 16 17]]
+         (into [] (partition-by #(quot % 6)) (keg/rdd (range 20)))))
+  (is (= [[0 1 2 3 4 5] [6 7 8 9 10 11] [12 13 14 15 16 17] [18 19]]
+         (keg/into [] (partition-by #(quot % 6)) (keg/rdd (range 20)))))
+  (is (= [[0 1 2 3 4 5] [6 7 8 9 10 11] [12 13 14 15 16 17] [18 19]]
+         (into [] (keg/scomp (partition-by #(quot % 6))) (keg/rdd (range 20))))))
+
+
+(deftest pair-rdd
+  (is (instance? org.apache.spark.api.java.JavaRDD
+                 (keg/rdd {:a 1 :b 2}))))


Config: test index pubsub.

Config: test index pubsub.

--- test/riemann/config_test.clj
+++ test/riemann/config_test.clj
@@ -204,3 +204,12 @@
            ; Send outside streams
            (pubsub/publish! (:pubsub @core) :test "hi")
            (is (= "hi" @received))))
+
+(deftest index-pubsub-test
+  (let [received (promise)
+        index (index)]
+    (subscribe "index" (partial deliver received))
+    (streams index)
+    (apply!)
+    (core/stream! @core {:service "foo"})
+    (is (= {:service "foo"} (deref received 500 :timeout)))))


Add block io unit tests.

Add block io unit tests.

--- test/blocks/core_test.clj
+++ test/blocks/core_test.clj
@@ -12,93 +12,96 @@
     blocks.data.Block
     (java.io
       ByteArrayOutputStream
+      File
       InputStream
       IOException)))

 ;; ## IO Tests

-#_
-(deftest block-input-stream
+(deftest block-io
+  (testing "from-file"
+    (is (thrown? IllegalStateException
+          (dosync (block/from-file "README.md"))))
+    (is (nil? (block/from-file "not/a-real/file.txt")))
+    (let [tmp-dir (doto (io/file "target" "test" "tmp")
+                    (.mkdirs))
+          tmp (doto (File/createTempFile "input" ".tmp" tmp-dir)
+                (.deleteOnExit))]
+      (is (nil? (block/from-file tmp))
+          "empty file should return nil"))
+    (let [block (block/from-file "README.md")]
+      (is (pos? (:size block)))
+      (is (block/lazy? block))))
+  (testing "reading"
+    (is (thrown? IllegalStateException
+          (dosync (block/read! "foo bar baz"))))
+    (is (nil? (block/read! (byte-array 0)))
+        "empty content reads into nil block"))
+  (testing "writing"
+    (let [block (block/read! "frobblenitz")
+          baos (ByteArrayOutputStream.)]
+      (is (thrown? IllegalStateException
+            (dosync (block/write! block baos))))
+      (block/write! block baos)
+      (is (bytes= "frobblenitz" (.toByteArray baos)))))
+  (testing "loading"
+    (let [lazy-readme (block/from-file "README.md")
+          loaded-readme (block/load! lazy-readme)]
+      (is (thrown? IllegalStateException
+            (dosync (block/load! lazy-readme))))
+      (is (block/loaded? loaded-readme)
+          "load returns loaded block for lazy block")
+      (is (identical? loaded-readme (block/load! loaded-readme))
+          "load returns loaded block unchanged")
+      (is (bytes= (block/open loaded-readme)
+                  (block/open lazy-readme))
+          "loaded block content should match lazy block"))))
+
+
+(deftest block-opening
   (testing "ranged open validation"
     (let [block (block/read! "abcdefg")]
-      (is (thrown? IllegalArgumentException (block/open block nil 4)))
-      (is (thrown? IllegalArgumentException (block/open block -1 4)))
-      (is (thrown? IllegalArgumentException (block/open block 0 nil)))
-      (is (thrown? IllegalArgumentException (block/open block 0 -1)))
-      (is (thrown? IllegalArgumentException (block/open block 3 1)))
-      (is (thrown? IllegalArgumentException (block/open block 0 10)))))
-  (testing "empty block"
-    (let [block (empty (block/read! "abc"))]
-      (is (thrown? IOException (block/open block))
-          "full open should throw exception")
-      (is (thrown? IOException (block/open block 0 3))
-          "ranged open should throw exception")))
+      (is (thrown? IllegalArgumentException (block/open block {:start -1, :end 4})))
+      (is (thrown? IllegalArgumentException (block/open block {:start 0, :end -1})))
+      (is (thrown? IllegalArgumentException (block/open block {:start 3, :end 1})))
+      (is (thrown? IllegalArgumentException (block/open block {:start 0, :end 10})))))
   (testing "loaded block"
     (let [block (block/read! "the old dog jumped")]
       (is (= "the old dog jumped" (slurp (block/open block))))
-      (is (= "old dog" (slurp (block/open block 4 11))))))
+      (is (= "the old" (slurp (block/open block {:end 7}))))
+      (is (= "old dog" (slurp (block/open block {:start 4, :end 11}))))
+      (is (= "jumped" (slurp (block/open block {:start 12}))))))
   (testing "lazy block"
     (let [block (block/from-file "README.md")
           readme (slurp (block/open block))]
       (is (true? (block/lazy? block)) "file blocks should be lazy")
       (is (string? readme))
-      (is (= (subs readme 10 20) (slurp (block/open block 10 20)))))))
-
-
-#_
-(deftest block-reading
-  (testing "block construction"
-    (is (nil? (block/read! (byte-array 0)))
-        "empty content reads into nil block")))
-
-
-#_
-(deftest block-writing
-  (let [block (block/read! "frobblenitz")
-        baos (ByteArrayOutputStream.)]
-    (block/write! block baos)
-    (is (bytes= "frobblenitz" (.toByteArray baos)))))
-
-
-#_
-(deftest block-loading
-  (let [lazy-readme (block/from-file "README.md")
-        loaded-readme (block/load! lazy-readme)]
-    (is (not (block/lazy? loaded-readme))
-        "load returns loaded block for lazy block")
-    (is (identical? loaded-readme (block/load! loaded-readme))
-        "load returns loaded block unchanged")
-    (is (bytes= (block/open loaded-readme)
-                (block/open lazy-readme))
-        "loaded block content should match lazy block")))
-
-
-#_
+      (is (= (subs readme 10 20) (slurp (block/open block {:start 10, :end 20})))))))
+
+
 (deftest block-validation
   (let [base (block/read! "foo bar baz")
         fix (fn [b k v]
               (Block. (if (= k :id)      v (:id b))
                       (if (= k :size)    v (:size b))
+                      (:stored-at b)
                       (if (= k :content) v (.content b))
-                      nil nil))]
+                      nil))]
     (testing "non-multihash id"
-      (is (thrown? IllegalStateException
-                   (block/validate! (fix base :id "foo")))))
+      (is (thrown-with-msg? Exception #"id is not a multihash"
+            (block/validate! (fix base :id "foo")))))
     (testing "negative size"
-      (is (thrown? IllegalStateException
-                   (block/validate! (fix base :size -1)))))
+      (is (thrown-with-msg? Exception #"has an invalid size"
+            (block/validate! (fix base :size -1)))))
     (testing "invalid size"
-      (is (thrown? IllegalStateException
-                   (block/validate! (fix base :size 123)))))
+      (is (thrown-with-msg? Exception #"reports size 123 but has actual size 11"
+            (block/validate! (fix base :size 123)))))
     (testing "incorrect identifier"
-      (is (thrown? IllegalStateException
-                   (block/validate! (fix base :id (multihash/sha1 "qux"))))))
-    (testing "empty block"
-      (is (thrown? IOException
-                   (block/validate! (empty base)))))
+      (is (thrown-with-msg? Exception #"has mismatched id and content"
+            (block/validate! (fix base :id (multihash/sha1 "qux"))))))
     (testing "valid block"
-      (is (nil? (block/validate! base))))))
+      (is (true? (block/validate! base))))))


Add ability to run tests in manual mode: user has to close each test manually before proceeding to the next. Also prints test source code.

--- test/clj/quil/snippet.clj
+++ test/clj/quil/snippet.clj
@@ -2,11 +2,14 @@
   (:require [quil.util :refer [clj-compilation?]]
             [quil.core :as q]
             [quil.util :refer [no-fn]]
-            [clojure.test :refer [is]]))
+            [clojure.test :refer [is]]
+            clojure.pprint))

 (def default-size [500 500])
 (def default-host {:p2d "quil-test-2d"
                    :p3d "quil-test-3d"})
+
+(def manual? (-> (System/getenv) (get "MANUAL") boolean))

 (def tests-in-set 50)
 (def current-test (atom -1))
@@ -14,6 +17,9 @@
 (defmacro snippet-as-test [snip-name opts & draw-fn-body]
   `(let [result# (promise)]
      (Thread/sleep 100)
+     (when manual?
+       (println "Test:" '~snip-name)
+       (clojure.pprint/pprint '~draw-fn-body))
      (q/sketch
       :title (str '~snip-name)
       :size ~(:size opts default-size)
@@ -28,7 +34,7 @@
                   (println "Error" e#)
                   (.printStackTrace e#)
                   (deliver result# e#))
-                (finally (q/exit))))
+                (finally (when-not manual? (q/exit)))))
       :on-close #(deliver result# nil))
      (is (nil? @result#))))


fix PR to add Emirates Currency

fix PR to add Emirates Currency

--- resources/languages/en/rules/finance.clj
+++ resources/languages/en/rules/finance.clj
@@ -61,7 +61,7 @@

 ;Emirates Currency
 "AED"
-#"(?a)AED|AED(. )?|(D|d)irhams?"
+#"(?i)AED|AED(. )?|(D|d)irhams?"
 {:dim :unit
  :unit "AED"}


Add Duration to Request/Response Logging

--- src/lens/app.clj
+++ src/lens/app.clj
@@ -24,12 +24,18 @@
       resp
       {:status 404})))

+(defn- duration [start end]
+  (Math/round (/ (double (- end start)) 1000000)))
+
 (defn wrap-log [handler]
   (fn [req]
-    (let [resp (handler req)]
+    (let [start (System/nanoTime)
+          resp (handler req)
+          end (System/nanoTime)]
       (log/info (pr-str {:request (select-keys req [:remote-addr :request-method
                                                     :uri :query-string :headers])
-                         :response (select-keys resp [:status :headers])}))
+                         :response (select-keys resp [:status :headers])
+                         :duration (str (duration start end) " ms")}))
       resp)))

 (defnk app [db-uri context-path :as opts]


This doesn't need to be delayed

This doesn't need to be delayed

--- src/useful/state.clj
+++ src/useful/state.clj
@@ -79,10 +79,10 @@
          ret# ~(cons 'do body)]
      [ret# (/ (double (- (System/nanoTime) start#)) 1000000.0)]))

-(let [executor (delay (ScheduledThreadPoolExecutor. 1 (reify ThreadFactory
-                                                        (newThread [this r]
-                                                          (doto (Thread. r)
-                                                            (.setDaemon true))))))]
+(let [executor (ScheduledThreadPoolExecutor. 1 (reify ThreadFactory
+                                                 (newThread [this r]
+                                                   (doto (Thread. r)
+                                                     (.setDaemon true)))))]
   (defn periodic-recompute
     "Takes a thunk and a duration (from useful.time), and yields a function
    that attempts to pre-cache calls to that thunk. The first time you call
@@ -95,7 +95,7 @@
     [f duration]
     (let [{:keys [unit num]} duration
           worker (agent {:ready false})
-          task (delay (.scheduleAtFixedRate @executor
+          task (delay (.scheduleAtFixedRate executor
                                             (fn []
                                               (send worker
                                                     (fn [_]


Fix icon for replies and mentions

Fix icon for replies and mentions

Signed-off-by: Andrea Maria Piana <39e16ece3c2d27e1889178b15ddb376e524032f8@gmail.com>

--- src/status_im/ui/screens/notifications_center/views/notification.cljs
+++ src/status_im/ui/screens/notifications_center/views/notification.cljs
@@ -6,6 +6,8 @@
             [status-im.i18n.i18n :as i18n]
             [status-im.ui.screens.notifications-center.styles :as styles]
             [status-im.utils.handlers :refer [<sub]]
+            [status-im.ui.screens.chat.photos :as photos]
+            [status-im.multiaccounts.core :as multiaccounts]
             [status-im.ui.components.icons.icons :as icons]
             [status-im.utils.contenthash :as contenthash]
             [status-im.constants :as constants]
@@ -117,16 +119,25 @@
         message (or message last-message)
         {:keys [community-id]} (<sub [:chat-by-id chat-id])
         {:keys [name]} @(re-frame/subscribe [:communities/community community-id])
+        contact (when message @(re-frame/subscribe [:contacts/contact-by-identity (message :from)]))
         sender (when message (first @(re-frame/subscribe [:contacts/contact-two-names-by-identity (message :from)])))]
     [react/touchable-opacity (merge {:style (styles/notification-container read)} opts)
      [react/view {:style styles/notification-content-container}
-      [chat-icon.screen/chat-icon-view chat-id group-chat chat-name
-       {:container              styles/photo-container
-        :size                   40
-        :chat-icon              chat-icon.styles/chat-icon-chat-list
-        :default-chat-icon      (chat-icon.styles/default-chat-icon-chat-list color)
-        :default-chat-icon-text (chat-icon.styles/default-chat-icon-text 40)
-        :accessibility-label    :current-account-photo}]
+      (if (or
+           (= type constants/activity-center-notification-type-mention)
+           (= type constants/activity-center-notification-type-reply))
+        [react/view {:style styles/photo-container}
+         [photos/photo
+          (multiaccounts/displayed-photo contact)
+          {:size 40
+           :accessibility-label :current-account-photo}]]
+        [chat-icon.screen/chat-icon-view chat-id group-chat chat-name
+         {:container              styles/photo-container
+          :size                   40
+          :chat-icon              chat-icon.styles/chat-icon-chat-list
+          :default-chat-icon      (chat-icon.styles/default-chat-icon-chat-list color)
+          :default-chat-icon-text (chat-icon.styles/default-chat-icon-text 40)
+          :accessibility-label    :current-account-photo}])
       [quo/text {:weight              :medium
                  :color               (when muted :secondary)
                  :accessibility-label :chat-name-or-sender-text


do something more interesting

do something more interesting

--- src/swanson/core.clj
+++ src/swanson/core.clj
@@ -1,23 +1,25 @@
 (ns swanson.core
   (:require
+    [cheshire.core :as json]
+    [clojure.edn :as edn]
     [compojure.core :refer :all]
     [compojure.handler :refer [site]]
-    [ring.util.response :refer [response status]]
     [ring.adapter.jetty :refer [run-jetty]]
-    [cheshire.core :as json]))
+    [ring.util.response :refer [response status]]))

-(def players (atom ()))
+(def snippets (repeatedly promise))

-(defn list-players []
-  (response (json/encode @players)))
+(future
+  (doseq [snippet (map deref snippets)]
+    (println snippet)))

-(defn create-player "doc-string" [player-name]
-  (swap! players conj player-name)
-  (status (response "") 201))
+(defn accept-snippet "enter snippets structure" [n text]
+  (deliver (nth snippets n) text))

 (defroutes app-routes
-  (GET "/players" [] (list-players))
-  (PUT "/players/:player-name" [player-name] (create-player player-name)))
+  (PUT "/snippet/:n" [n :as {:keys [body]}]
+       (accept-snippet (edn/read-string n) (slurp body))
+       (response "OK")))

 (defn -main [& args]
   (run-jetty (site app-routes) {:port 3000}))


CMR-1405: Added comment explaining stripping off '.native' extension in routes.clj

--- search-app/src/cmr/search/api/routes.clj
+++ search-app/src/cmr/search/api/routes.clj
@@ -259,6 +259,8 @@
         ;; In this case, the Echo-Token header is used in the GET request.
         (OPTIONS "/" req options-response)
         (GET "/" {params :params headers :headers context :request-context}
+          ;; According to the CMR-1405, a '.native' extension with direct retrieval should behave
+          ;; the same as no extension, so we just strip off '.native' here
           (find-concept-by-cmr-concept-id context
                                           (str/replace path-w-extension #"\.native" "")
                                           params


fix compilation for cljs

fix compilation for cljs

--- src/rum/core.clj
+++ src/rum/core.clj
@@ -29,18 +29,13 @@
 (defn- compile-body [[argvec & body]]
   (list argvec (s/compile-html `(do ~@body))))

-(defmacro if-cljs
-  "Return then if we are generating cljs code and else for Clojure code.
-   https://groups.google.com/d/msg/clojurescript/iBY5HaQda4A/w1lAQi9_AwsJ
-   https://github.com/plumatic/schema/blob/master/src/clj/schema/macros.clj#L15-L19"
-  [then else]
-  (if (:ns &env) then else))
-
-(defn- -defc [render-ctor body]
+(defn- -defc [render-ctor is-cljs body]
   (let [{:keys [name doc mixins bodies]} (parse-defc body)
-        render-fn (map compile-body bodies)]
+        render-fn (if is-cljs
+                    (map compile-body bodies)
+                    bodies)]
     `(def ~name ~(or doc "")
-       (let [render-mixin# (~render-ctor (fn ~@(if-cljs render-fn bodies)))
+       (let [render-mixin# (~render-ctor (fn ~@render-fn))
              class#        (rum.core/build-class (concat [render-mixin#] ~mixins) ~(str name))
              ctor#         (fn [& args#]
                              (let [state# (args->state args#)]
@@ -60,7 +55,7 @@

        (defc name doc-string? [< mixins+]? [params*] render-body+)"
   [& body]
-  (-defc 'rum.core/render->mixin body))
+  (-defc 'rum.core/render->mixin (:ns &env) body))

 (defmacro defcs
   "Same as defc, but render will take additional first argument: state
@@ -69,7 +64,7 @@

         (defcs name doc-string? [< mixins+]? [state params*] render-body+)"
   [& body]
-  (-defc 'rum.core/render-state->mixin body))
+  (-defc 'rum.core/render-state->mixin (:ns &env) body))

 (defmacro defcc
   "Same as defc, but render will take additional first argument: react component
@@ -78,7 +73,7 @@

         (defcc name doc-string? [< mixins+]? [comp params*] render-body+)"
   [& body]
-  (-defc 'rum.core/render-comp->mixin body))
+  (-defc 'rum.core/render-comp->mixin (:ns &env) body))

 (defmacro with-props
   "DEPRECATED. Use rum.core/with-key and rum.core/with-ref functions


Delete pledges.clj

Delete pledges.clj

--- bin/codestarter/views/pledges.clj
+++ bin/codestarter/views/pledges.clj
@@ -1,135 +0,0 @@
-(ns codestarter.views.pledges
-  (:use codestarter.views.common
-        hiccup.core
-        hiccup.form-helpers
-        [hiccup.page-helpers :exclude (url)]
-        [korma.core :exclude (select* delete*)]
-        korma.db
-        [clj-time.core :only (days plus)]
-        [clj-time.format :only (formatter unparse)]
-        [clj-time.coerce :only (from-sql-date)])
-  (:require [clojure.data :as data]
-            [clojure.string :as string]
-            [noir.validation :as vali]))
-
-(defn form [project id params {:keys [uri] :as request}]
-  (let [create? (re-find #"create" (request :uri))]
-    (html
-      (header project (assoc request :uri (url "projects" id "pledges")))
-      (form-to {:id "pledge"} [:post "."]
-               (csrf)
-               [:div.alert-box.secondary
-                [:h4 "Notice"]
-                [:p (format "Your credit card be charged on %s only if the project reaches one or more funding goals."
-                            (unparse (formatter "MMMM d, y") (plus (from-sql-date (project :time)) (days 30))))]
-                [:p "You can edit or delete your pledge up to that time."]]
-               [:hr]
-               [:h4 "pledge amount"]
-               [:div.row.collapse
-                [:div.one.columns [:span.prefix "$"]]
-                [:div.eleven.columns
-                 (text-field :amount (if-let [amount (params :amount)] (cents->$ amount)))]]
-               [:hr]
-               [:h4 "credit card information"]
-               (control :card
-                        (html (map #(vector :label
-                                            (radio-button :card (= (% :id) (params :card_id)) (% :id))
-                                            [:span (% :details)])
-                                   (select cards (where {:user_id (*user* :id)})))
-                              [:label
-                               (radio-button :card create? "other")
-                               [:span "other - fill in the details below"]]))
-               (control :number (text-field {:name nil} :number))
-               (control :cvc (text-field {:name nil} :cvc (params :cvc)) :label "CVC")
-               [:div.row
-                [:div.two.columns
-                 [:label.right.inline "expiration (mm/yyyy)"]]
-                [:div.columns.two (text-field {:name nil} :exp_month)]
-                [:div.columns.eight (text-field {:name nil} :exp_year)]]
-               [:hr]
-               [:button#submit-button.button (format "%s pledge" (if create? "create" "update"))]
-               (if (not create?) (link-to {:class "button secondary"} (string/replace uri #"edit" "delete") "delete"))))))
-
-(defn index [id {:keys [params] :as request}]
-  (body* [project (select-one projects (where {:id id}) (with pledges (with users) (order :id :DESC)))]
-         true
-         request
-         (html
-           (header project request)
-           (let [pledge (select-one pledges  (where {:project_id id :user_id (*user* :id)}) (with users))]
-             (html
-               (if pledge
-                 [:div#dl.row
-                  [:div.two.columns.offset-by-one "current pledge"]
-                  [:div.nine.columns
-                   [:span.radius.success.label (format "$%s" (cents->$ (pledge :amount)))]
-                   (link-to {:class "button secondary tiny"} (str (pledge :id) "/edit/") "edit")
-                   (link-to {:class "button secondary tiny"} (str (pledge :id) "/delete/") "delete")]]
-                 [:div (link-to {:class "button"} "create/" "create pledge") [:hr]])
-               (if (empty? (project :pledges))
-                 [:em "No pledges"]
-                 [:table#table
-                  [:thead [:tr [:th "user"] [:th "amount"]]]
-                  [:tbody
-                     (map #(vector :tr
-                                   [:td (link-to (url "users" (% :user_id)) (display % 16))]
-                                   [:td (format "$%s" (cents->$ (% :amount)))])
-                          (project :pledges))]]))))))
-
-(defn create [id {:keys [params uri] :as request}]
-  (body* [project (select-one projects (where {:id id}))]
-         *user*
-         request
-         (let [pledge (select-one pledges (where {:user_id (*user* :id) :project_id id}))]
-           (if pledge
-             (redirect (string/replace uri #"create" (str (pledge :id) "/edit")))
-             (form project id params request)))
-         true;;(required params :accept?)
-         "Pledge created."
-         (let [fields {:user_id (*user* :id) :stripe (params :stripe) :details (params :details)}
-               card (or (select-one cards (where (or {:id (read-string (params :card))} fields)))
-                        (insert cards (values fields)))]
-           (insert pledges
-                   (values {:user_id (*user* :id) :card_id (card :id) :project_id id
-                            :amount ($->cents (read-string (params :amount)))}))
-           #_(notify id
-                   user
-                   (pledge :time)
-                   :pledge
-                   nil
-                   (format "/projects/%s/pledges/" id)
-                   (pledge :pledge))
-           (redirect (format "/projects/%s/" id)))))
-
-(defn edit [id pledge-id {:keys [params] :as request}]
-  (body* [project (select-one projects (where {:id id}) (with pledges (where {:id pledge-id})))]
-         (= (-> project :pledges first :user_id) (*user* :id))
-         request
-         (form project id (-> project :pledges first) request)
-         true
-         "Pledge updated."
-         (let [fields {:user_id (*user* :id) :stripe (params :stripe) :details (params :details)}
-               card (or (select-one cards (where (or {:id (read-string (params :card))} fields)))
-                        (insert cards (values fields)))]
-           (update pledges (set-fields {:card_id (card :id) :amount ($->cents (read-string (params :amount)))})
-                   (where {:id pledge-id}))
-           (redirect (format "/projects/%s/pledges/" id)))))
-
-(defn delete* [id pledge-id {:keys [params] :as request}]
-  (body* [project (select-one projects (where {:id id}) (with pledges (where {:id pledge-id})))]
-         (= (-> project :pledges first :user_id) (*user* :id))
-         request
-         (html
-           (header project request :uri (url "projects" id "pledges"))
-           (html
-             (form-to [:post "."]
-                      (csrf)
-                      [:div.alert-box.secondary
-                       [:h4 "Notice"]
-                       [:p "You are about to delete your pledge."]]
-                      [:button.button "delete"])))
-         true
-         "Pledge deleted."
-         (do
-           (delete pledges (where {:id pledge-id}))
-           (redirect (format "/projects/%s/pledges/" id)))))


Add docstrings for the macros.

Add docstrings for the macros.

--- ClojureScript/src/goby/macros.clj
+++ ClojureScript/src/goby/macros.clj
@@ -1,11 +1,22 @@
 (ns goby.macros)

-(defmacro reify [protocol & impls]
+(defmacro reify
+  "Implements a protocol, delegating to clojure.core/reify while also adding an
+  additional method named <protocol>-implements which indicates the protocol
+  methods implemented. This is used to partially implement a protocol which mimics
+  an Objective-C protocol where some of the methods are optional. The additional
+  method <protocol>-implements is used at runtime to determine which methods
+  are actually implemented."
+  [protocol & impls]
   `(clojure.core/reify ~protocol
      (~(symbol (str protocol "-implements")) [~(symbol "_")] (cljs.core/clj->js ~(mapv (comp str first) impls)))
      ~@impls))

 (defmacro defui [& ui-elements]
+  "Given a list of ui-elements, defines an atom per ui-element, along with an implicit
+  view-controller atom. Additionally exports a view-did-load! method which initializes
+  the atoms with the supplied arguments. Then calls a handle-view-did-load! method to
+  allow the namespace to perform further initialization when the view loads."
   (let [my-ns (str *ns*)]
     `(do
        (def ~'view-controller (atom nil))


(SERVER-977) move test logging wrapper within testing blocks for handle-delete-cert.-req.-test

--- test/unit/puppetlabs/services/ca/certificate_authority_core_test.clj
+++ test/unit/puppetlabs/services/ca/certificate_authority_core_test.clj
@@ -126,8 +126,8 @@
         subject "foo-agent"
         csr-stream (io/input-stream (test-pem-file "foo-agent-csr.pem"))
         expected-path (ca/path-to-cert-request (:csrdir settings) subject)]
-    (logutils/with-test-logging
-      (testing "successful csr deletion"
+    (testing "successful csr deletion"
+      (logutils/with-test-logging
         (try
           (handle-put-certificate-request! subject csr-stream settings)
           (is (true? (fs/exists? expected-path)))
@@ -141,23 +141,25 @@
           (finally
             (fs/delete expected-path))))
       (testing "Attempted deletion of a non-existant CSR"
-        (let [response (handle-delete-certificate-request! subject settings)
-              msg-matcher (re-pattern
-                            (str "No cert.*request for " subject " at.*" expected-path))]
-          (is (false? (fs/exists? expected-path)))
-          (is (= 404 (:status response)))
-          (is (re-matches msg-matcher (:body response)))
-          (is (= "text/plain" (get-in response [:headers "Content-Type"])))
-          (is (logged? msg-matcher :warn))))
+        (logutils/with-test-logging
+          (let [response (handle-delete-certificate-request! subject settings)
+                msg-matcher (re-pattern
+                              (str "No cert.*request for " subject " at.*" expected-path))]
+            (is (false? (fs/exists? expected-path)))
+            (is (= 404 (:status response)))
+            (is (re-matches msg-matcher (:body response)))
+            (is (= "text/plain" (get-in response [:headers "Content-Type"])))
+            (is (logged? msg-matcher :warn)))))
       (testing "Error during deletion of a CSR"
-        (let [response
-              (with-redefs [me.raynes.fs/exists? (constantly true)]
-                (handle-delete-certificate-request! subject settings))
-              msg-matcher (re-pattern (str "Path " expected-path " exists but.*"))]
-          (is (= 500 (:status response)))
-          (is (re-matches msg-matcher (:body response)))
-          (is (= "text/plain" (get-in response [:headers "Content-Type"])))
-          (is (logged? msg-matcher :error)))))))
+        (logutils/with-test-logging
+          (let [response
+                (with-redefs [me.raynes.fs/exists? (constantly true)]
+                  (handle-delete-certificate-request! subject settings))
+                msg-matcher (re-pattern (str "Path " expected-path " exists but.*"))]
+            (is (= 500 (:status response)))
+            (is (re-matches msg-matcher (:body response)))
+            (is (= "text/plain" (get-in response [:headers "Content-Type"])))
+            (is (logged? msg-matcher :error))))))))

 (deftest handle-put-certificate-request!-test
   (let [settings   (assoc (testutils/ca-sandbox! cadir)


provide better error message

provide better error message

--- ring-container/src/sixsq/slipstream/server/ring_container.clj
+++ ring-container/src/sixsq/slipstream/server/ring_container.clj
@@ -63,7 +63,7 @@
     (try
       (require ns)
       (catch Exception e
-        (log-and-throw (str "error requiring namespace: " ns))))
+        (log-and-throw (str "error requiring namespace (" ns "): " (.getMessage e)))))

     (if-let [result (resolve-var ns f)]
       result


(SERVER-1103) Added one more `wait-for-jrubies` call to jruby lock test

This commit adds another `wait-for-rubies` call to a test which borrows
a jruby puppet instance.  Without this call, it is possible that a slow
initialization of the jruby pool will cause the test's borrow attempt to
fail because of the relatively short default borrow timeout that the
test uses, 1 millisecond.

--- test/integration/puppetlabs/services/jruby/jruby_locking_test.clj
+++ test/integration/puppetlabs/services/jruby/jruby_locking_test.clj
@@ -77,6 +77,7 @@
          profiler/puppet-profiler-service
          event-service]
         (jruby-service-test-config 1)
+        (jruby-testutils/wait-for-jrubies app)
         (let [jruby-service (tk-app/get-service app :JRubyPuppetService)]

           (testing "locking events trigger event notifications"


don't return `nil` from within a `(component ...` call

--- src-cljs/frontend/components/pieces/page_header.cljs
+++ src-cljs/frontend/components/pieces/page_header.cljs
@@ -220,52 +220,49 @@
      :placement :bottom}
     (engine-2)))

-(defn top-bar-feedback-button [{:keys [show-button?]} owner]
+(defn top-bar-feedback-button [_ owner]
   (reify
     om/IRender
     (render [_]
       (component
         (html
-          [:span
-           (when show-button?
-             [:span.feedback
-              (button/link {:fixed? true
-                            :kind :primary
-                            :size :small
-                            :target "_blank"
-                            :href "mailto:beta+ui@circleci.com?Subject=Topbar%20UI%20Feedback"
-                            :on-click #((om/get-shared owner :track-event) {:event-type :feedback-clicked
-                                                                            :properties {:component "topbar"
-                                                                                :treatment "top-bar-beta"}})}
-                           "Give Topbar UI Feedback")])])))))
-
-(defn toggle-topbar-button [{:keys [show-button? has-topbar? topbar-beta]} owner]
+          [:span.feedback
+           (button/link {:fixed? true
+                         :kind :primary
+                         :size :small
+                         :target "_blank"
+                         :href "mailto:beta+ui@circleci.com?Subject=Topbar%20UI%20Feedback"
+                         :on-click #((om/get-shared owner :track-event) {:event-type :feedback-clicked
+                                                                         :properties {:component "topbar"
+                                                                                :treatment "top-bar-beta"}})}
+                        "Give Topbar UI Feedback")])))))
+
+(defn toggle-topbar-button [{:keys [has-topbar? topbar-beta]} owner]
   (reify
     om/IRender
     (render [_]
       (component
         (html
-          (when show-button?
-            (let [toggle-topbar (when-not has-topbar? "top-bar-ui-v-1")
-                  toggle-topbar-text (if has-topbar?
-                                       "Go Back to Our Old Look"
-                                       "Check Out Our New Look")]
-              (button/link {:fixed? true
-                            :kind (if has-topbar?
-                                    :secondary
-                                    :primary)
-                            :size :small
-                            :href (if has-topbar?
-                                    "/dashboard"
-                                    (routes/org-centric-path {:nav-point (:nav-point topbar-beta)
-                                                              :current-org (:org topbar-beta)}))
-                            :on-click #(do
-                                         (raise! owner [:preferences-updated {state/user-betas-key [toggle-topbar]}])
-                                         ((om/get-shared owner :track-event) {:event-type :topbar-toggled
-                                                                              :properties {:toggle-topbar-text toggle-topbar-text
-                                                                                :has-topbar has-topbar?
-                                                                                :toggled-topbar-on (boolean toggle-topbar)}}))}
-                           toggle-topbar-text))))))))
+          (let [toggle-topbar (when-not has-topbar? "top-bar-ui-v-1")
+                toggle-topbar-text (if has-topbar?
+                                     "Go Back to Our Old Look"
+                                     "Check Out Our New Look")]
+            (button/link {:fixed? true
+                          :kind (if has-topbar?
+                                  :secondary
+                                  :primary)
+                          :size :small
+                          :href (if has-topbar?
+                                  "/dashboard"
+                                  (routes/org-centric-path {:nav-point (:nav-point topbar-beta)
+                                                            :current-org (:org topbar-beta)}))
+                          :on-click #(do
+                                       (raise! owner [:preferences-updated {state/user-betas-key [toggle-topbar]}])
+                                       ((om/get-shared owner :track-event) {:event-type :topbar-toggled
+                                                                            :properties {:toggle-topbar-text toggle-topbar-text
+                                                                                :has-topbar has-topbar?
+                                                                                :toggled-topbar-on (boolean toggle-topbar)}}))}
+                         toggle-topbar-text)))))))

 (defn header
   "The page header.
@@ -298,12 +295,13 @@
                                   (om/get-shared owner :track-event)))
               (when (feature/enabled? "top-bar-beta-button")
                 [:div.topbar-toggle
-                 (om/build top-bar-feedback-button {:show-button? (and has-topbar?
-                                                                       (not om-next-page?))})
-                 (om/build toggle-topbar-button {:show-button? (and (false? om-next-page?)
-                                                                    (false? show-nux-experience?))
-                                                 :has-topbar? has-topbar?
-                                                 :topbar-beta topbar-beta})])
+                 (when (and has-topbar?
+                            (not om-next-page?))
+                   (om/build top-bar-feedback-button {}))
+                 (when (and (false? om-next-page?)
+                            (false? show-nux-experience?))
+                   (om/build toggle-topbar-button {:has-topbar? has-topbar?
+                                                   :topbar-beta topbar-beta}))])
               actions]]))))))

 (dc/do


use precursor logo in spinner

use precursor logo in spinner

--- src-cljs/frontend/components/common.cljs
+++ src-cljs/frontend/components/common.cljs
@@ -90,8 +90,8 @@
        (for [path (:paths template)]
         [:path {:class (name path) :d (get icon-paths path)}])]]))

-; (def spinner
-;   (icon :spinner))
+(def spinner
+  (icon :logomark-precursor))

 (defn updating-duration
   "Takes a :start time string and :stop time string. Updates the component every second


Make nav mimic outer

Make nav mimic outer

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -176,25 +176,30 @@
                (when (config/show-marketing-pages?)
                  (list
                    [:li.dropdown {:class (when (contains? #{:features
+                                                            :integrations
                                                             :mobile
-                                                            :ios
-                                                            :android
-                                                            :integrations
-                                                            :enterprise}
+                                                            :docker}
                                                           nav-point)
                                            "active")}
                     [:a.menu-item (open-ext {:href "/features/"})
-                     "Product "
+                     "Features "
                      [:i.fa.fa-caret-down]]
                     [:ul.dropdown-menu
                      [:li {:role "presentation"}
                       [:a.sub.menu-item (
                                          merge
                                           (maybe-active nav-point :features)
-                                         (open-ext {:role "menuitem"
-                                                    :tabIndex "-1"
-                                                    :href "/features/"}))
+                                          (open-ext {:role "menuitem"
+                                                     :tabIndex "-1"
+                                                     :href "/features/"}))
                        "Features"]]
+                     [:li {:role "presentation"}
+                      [:a.sub.menu-item (merge
+                                          (maybe-active nav-point :integrations)
+                                          (open-ext {:role "menuitem"
+                                                     :tabIndex "-1"
+                                                     :href "/integrations/"}))
+                       "Integrations"]]
                      [:li {:role "presentation"}
                       [:a.sub.menu-item (merge
                                           (maybe-active nav-point :mobile)
@@ -208,30 +213,57 @@
                                           (open-ext {:role "menuitem"
                                                      :tabIndex "-1"
                                                      :href "/integrations/docker/"}))
-                       "Docker"]]
-                     [:li {:role "presentation"}
-                      [:a.sub.menu-item (merge
-                                          (maybe-active nav-point :enterprise)
-                                          (open-ext {:role "menuitem"
-                                                     :tabIndex "-1"
-                                                     :href "/enterprise/"}))
-                       "Enterprise"]]]]
+                       "Docker"]]]]
+                   [:li (maybe-active nav-point :enterprise)
+                    [:a.menu-item (open-ext {:href "/enterprise/"}) "Enterprise"]]
                    [:li (maybe-active nav-point :pricing)
-                    [:a.menu-item (open-ext {:href "/pricing/"}) "Pricing"]]))
-               [:li (maybe-active nav-point :documentation)
-                [:a.menu-item {:href "/docs"} "Documentation"]]
-               [:li [:a.menu-item {:href "https://discuss.circleci.com" :target "_blank"} "Discuss"]]
-               (when (config/show-marketing-pages?)
-                 (list
-                   [:li {:class (when (contains? #{:about
-                                                   :contact
-                                                   :team
-                                                   :jobs
-                                                   :press}
-                                                 nav-point)
-                                  "active")}
-                    [:a.menu-item (open-ext {:href "/about/"}) "About Us"]]
-                   [:li [:a.menu-item {:href "http://blog.circleci.com"} "Blog"]]))]
+                    [:a.menu-item (open-ext {:href "/pricing/"}) "Pricing"]]
+                   [:li (maybe-active nav-point :customers)
+                    [:a.menu-item (open-ext {:href "/customers/"}) "Customers"]]
+
+                   [:li.dropdown {:class (when (contains? #{:support
+                                                            :blog}
+                                                          nav-point)
+                                           "active")}
+                    [:a.menu-item (open-ext {:href "/support/"})
+                     "Support "
+                     [:i.fa.fa-caret-down]]
+                    [:ul.dropdown-menu
+                     [:li {:role "presentation"}
+                      [:a.sub.menu-item (
+                                         merge
+                                          (maybe-active nav-point :documentation)
+                                          (open-ext {:role "menuitem"
+                                                     :tabIndex "-1"
+                                                     :href "/docs/"}))
+                       "Documentation"]]
+                     [:li {:role "presentation"}
+                      [:a.sub.menu-item {:href "https://discuss.circleci.com" :target "_blank"}
+                       "Community"]]]]
+
+                   [:li.dropdown {:class (when (contains? #{:about
+                                                            :contact
+                                                            :team
+                                                            :jobs
+                                                            :press}
+                                                          nav-point)
+                                           "active")}
+                    [:a.menu-item (open-ext {:href "/more/"})
+                     "More "
+                     [:i.fa.fa-caret-down]]
+                    [:ul.dropdown-menu
+                     [:li {:role "presentation"}
+                      [:a.sub.menu-item (
+                                         merge
+                                          (maybe-active nav-point :about)
+                                          (open-ext {:role "menuitem"
+                                                     :tabIndex "-1"
+                                                     :href "/about/"}))
+                       "About Us"]]
+                     [:li {:role "presentation"}
+                      [:a.sub.menu-item {:href "https://blog.circleci.com" :target "_blank"}
+                       "Blog"]]]]))]
+
               (if logged-in?
                 [:ul.nav.navbar-nav.navbar-right.back-to-app
                  [:li [:a.menu-item {:href "/"} "Back to app"]]]


don't change order when we get new issues

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -390,7 +390,7 @@
             (:issue/title issue)]
            (issue-tags issue)]])))))

-(defn issues [app owner {:keys [submenu]}]
+(defn issues* [app owner {:keys [submenu]}]
   (reify
     om/IDisplayName (display-name [_] "Issues")
     om/IInitState
@@ -403,7 +403,7 @@
        (om/get-shared owner :comms)
        (om/get-shared owner :sente))
       (fdb/add-attribute-listener (om/get-shared owner :issue-db)
-                                  :frontend/issue-id
+                                  :issue/title
                                   (om/get-state owner :listener-key)
                                   (fn [tx-report]
                                     (om/refresh! owner)))
@@ -414,7 +414,7 @@
     (will-unmount [_]
       (d/unlisten! (om/get-shared owner :issue-db) (om/get-state owner :listener-key))
       (fdb/remove-attribute-listener (om/get-shared owner :issue-db)
-                                     :frontend/issue-id
+                                     :issue/title
                                      (om/get-state owner :listener-key)))
     om/IRender
     (render [_]
@@ -429,6 +429,14 @@
             (if submenu
               (om/build issue {:issue-id (:active-issue-id app)} {:key :issue-id})
               (when-let [issues (seq (map #(d/entity @issue-db (:e %)) (d/datoms @issue-db :aevt :issue/title)))]
-                (om/build-all issue-summary (map (fn [i] {:issue-id (:db/id i)}) (sort (issue-model/issue-comparator cust (datetime/server-date)) issues))
+                (om/build-all issue-summary (map (fn [i] {:issue-id (:db/id i)})
+                                                 (sort (issue-model/issue-comparator cust (datetime/server-date)) issues))
                               {:key :issue-id
                                :opts {:issue-db issue-db}})))]]])))))
+
+(defn issues [app owner {:keys [submenu]}]
+  (reify
+    om/IDisplayName (display-name [_] "Issues Overlay")
+    om/IRender
+    (render [_]
+      (om/build issues* (select-keys app [:active-issue-id]) {:opts {:submenu submenu}}))))


Display number of results returned by search.

--- src-cljs/kixi/hecuba/tabs/hierarchy.cljs
+++ src-cljs/kixi/hecuba/tabs/hierarchy.cljs
@@ -261,17 +261,17 @@
       {:results-size 10})
     om/IRenderState
     (render-state [_ state]
-      (let [{:keys [results-size]} (om/get-state owner)]
+      (let [{:keys [results-size]} (om/get-state owner)
+            {:keys [data term stats]} cursor
+            {:keys [total_hits page]} stats]
         (html
          [:div.row#results-div
           [:div.col-md-12 {:style {:padding-top "10px"} :id "found-properties-table"}
-           [:h1 "Search Results"]
+           [:h2 (str "We've found " total_hits (if (= total_hits 1) " matching property." " matching properties."))]
            (if (:fetching cursor)
              [:div [:div.col-md-12.text-center [:p.lead {:style {:padding-top 30}} "Fetching data."]]]
-             (let [{:keys [data term stats]} cursor
-                   {:keys [total_hits page]} stats
-                   results-left             (- total_hits (* (inc page) results-size))
-                   more-to-load?            (pos? results-left)]
+             (let [results-left  (- total_hits (* (inc page) results-size))
+                   more-to-load? (pos? results-left)]
                (if (-> data seq)
                  [:div
                   [:table.table.table-hover.table-condensed


Refine code to check equivalence fn

Refine code to check equivalence fn

--- test/cljam/t_bam.clj
+++ test/cljam/t_bam.clj
@@ -46,29 +46,12 @@
 ;;                                        (slurp-bam-for-test large-bam-file))))))

 (defn- shallow= [alns1 alns2]
-  (when (= (count alns1) (count alns2))
-    (loop [alns1 alns1
-           alns2 alns2]
-      (let [aln1 (first alns1)
-            aln2 (first alns2)]
-        (if (nil? aln1)
-          true
-          (when (and (= (:rname aln1) (:rname aln2))
-                     (= (:pos aln1) (:pos aln2)))
-            (recur (rest alns1) (rest alns2))))))))
+  (= (map #(select-keys % [:rname :pos]) alns1)
+     (map #(select-keys % [:rname :pos]) alns2)))

 (defn- pointer= [alns1 alns2]
-  (when (= (count alns1) (count alns2))
-    (loop [alns1 alns1
-           alns2 alns2]
-      (let [aln1 (first alns1)
-            aln2 (first alns2)]
-        (if (nil? aln1)
-          true
-          (when (and (= (:rname aln1) (:rname aln2))
-                     (= (:pos aln1) (:pos aln2))
-                     (= (:flag aln1) (:flag aln2)))
-            (recur (rest alns1) (rest alns2))))))))
+  (= (map #(select-keys % [:rname :pos :flag]) alns1)
+     (map #(select-keys % [:rname :pos :flag]) alns2)))

 (deftest bamreader
   (with-before-after {:before (do (prepare-cache!)


Change submit on metadata wizard to Republish if the workspace is currently in the published state (#662)

--- src/cljs/main/broadfcui/page/workspace/summary/catalog/wizard.cljs
+++ src/cljs/main/broadfcui/page/workspace/summary/catalog/wizard.cljs
@@ -48,6 +48,7 @@
            {:keys [versions]} library-schema]
        {:page-num 0
         :working-attributes (get-initial-attributes (:workspace props))
+        :published? (get-in props [:workspace :workspace :library-attributes :library:published])
         :version-attributes (->> versions
                                  (map keyword)
                                  (map (fn [version]
@@ -57,7 +58,7 @@
    :render
    (fn [{:keys [props state this]}]
      (let [{:keys [library-schema]} props
-           {:keys [page-num working-attributes required-attributes validation-error submit-error]} @state]
+           {:keys [page-num working-attributes required-attributes published? validation-error submit-error]} @state]
        [:div {}
         (when (:submitting? @state)
           [comps/Blocker {:banner "Submitting..."}])
@@ -106,7 +107,7 @@
                          :disabled? (= page-num (-> library-schema :wizard count dec))
                          :style {:width 80}}]
           flex/flex-spacer
-          [comps/Button {:text "Submit"
+          [comps/Button {:text (if published? "Republish" "Submit")
                          :onClick #(react/call :next-page this)
                          :disabled? (< page-num (-> library-schema :wizard count dec))
                          :style {:width 80}}])]]))


updated clojure tests with real words

updated clojure tests with real words

--- assignments/clojure/anagram/anagram_test.clj
+++ assignments/clojure/anagram/anagram_test.clj
@@ -5,10 +5,10 @@
   (is (= [] (anagram/anagrams-for "diaper" ["hello" "world" "zombies" "pants"]))))

 (deftest detect-simple-anagram
-  (is (= ["ab"] (anagram/anagrams-for "ba" ["ab" "abc" "bac"]))))
+  (is (= ["tan"] (anagram/anagrams-for "ant" ["tan" "stand" "at"]))))

 (deftest does-not-confuse-different-duplicates
-  (is (= [] (anagram/anagrams-for "abb" ["baa"]))))
+  (is (= [] (anagram/anagrams-for "galea" ["eagle"]))))

 (deftest detect-anagram
   (is (= ["inlets"] (anagram/anagrams-for "listen" ["enlists" "google" "inlets" "banana"]))))


Added test for deploying the same .ima [IMMUTANT-412]

--- integration-tests/src/test/clojure/immutant/integs/basic_archive_from_descriptor.clj
+++ integration-tests/src/test/clojure/immutant/integs/basic_archive_from_descriptor.clj
@@ -20,11 +20,18 @@
         clojure.test
         [immutant.integs.integ-helper :only [get-as-data]]))

-(use-fixtures :once (with-deployment *file*
-                      {:root (str (System/getProperty "user.dir") "/target/apps/basic-ring.ima")
-                       :context-path "/basic-archive"}
-                      ))
+(use-fixtures :once (with-deployments
+                      {"archive-app1"
+                       {:root (str (System/getProperty "user.dir") "/target/apps/basic-ring.ima")
+                        :context-path "/basic-archive"}
+                       "archive-app2"
+                       {:root (str (System/getProperty "user.dir") "/target/apps/basic-ring.ima")
+                        :context-path "/basic-archive2"}}))

-(deftest simple "it should work"
+(deftest mounted-ima-should-be-available
   (is (= :basic-ring (:app (get-as-data "/basic-archive")))))

+(deftest ima-should-be-mountable-more-than-once
+  (is (= :basic-ring (:app (get-as-data "/basic-archive"))))
+  (is (= :basic-ring (:app (get-as-data "/basic-archive2")))))
+


we shall concede on namespace usage within scripts.

--- src/plugins/Scripts/Funimage/SpatialAnalysis/local_area_coverage.clj
+++ src/plugins/Scripts/Funimage/SpatialAnalysis/local_area_coverage.clj
@@ -1,25 +1,21 @@
-; @ImagePlus(label="Target image",description="Input image (will be binarized)") Funimage.SpatialAnalysis.local-area-coverage/segments
-; @Integer(label="Radius",description="Coverage within a ball of this radius will be analyzed.",value=25) Funimage.SpatialAnalysis.local-area-coverage/density-radius
+; @ImagePlus(label="Target image",description="Input image (will be binarized)") segments
+; @Integer(label="Radius",description="Coverage within a ball of this radius will be analyzed.",value=25) density-radius
 ; @OUTPUT ImagePlus Funimage.SpatialAnalysis.local-area-coverage/density-imp
-(ns Funimage.SpatialAnalysis.local-area-coverage
-  (:use [funimage img imp project conversion]
-        [funimage.segmentation utils imp]
-        [funimage.imp calibration roi threshold calculator statistics])
-  (:import [net.imglib2.algorithm.neighborhood Neighborhood]
-           [ij.process ImageConverter FloatProcessor ByteProcessor]))
-
-;Should check if density-radius is less than this
-;(max (get-width segments) (get-height segments))
+
+(use '[funimage img imp project conversion]
+     '[funimage.segmentation utils imp]
+     '[funimage.imp calibration roi threshold calculator statistics])
+
+(let [segments user/segments
+      density-radius (min user/density-radius (max (get-width segments) (get-height segments)))]
+  (ij.IJ/run segments "Make Binary" "")

-(ij.IJ/run segments "Make Binary" "")
-
-(def rois (imp-to-rois segments ))
-
-(def segment-maps (for [^ij.gui.Roi roi rois]
-                    (assoc (get-image-statistics (set-roi segments roi) :center-of-mass true :centroid true :ellipse true :circularity true :area true)
-                           :roi roi)))
-
-(let [density-maps (rolling-ball-statistics segment-maps density-radius)
-      key-fn :area]
-  (def density-imp (color-code-rois segments density-maps key-fn))
-  (.setMinAndMax (.getProcessor density-imp) 0 (* java.lang.Math/PI density-radius density-radius)))
+  (let [rois (imp-to-rois segments )
+        segment-maps (for [^ij.gui.Roi roi rois]
+                       (assoc (get-image-statistics (set-roi segments roi) :center-of-mass true :centroid true :ellipse true :circularity true :area true)
+                              :roi roi))
+        density-maps (rolling-ball-statistics segment-maps density-radius)
+        key-fn :area]
+    (def density-imp (show-imp (color-code-rois segments density-maps key-fn)))
+    (.setMinAndMax (.getProcessor density-imp) 0 (* java.lang.Math/PI density-radius density-radius))
+    (update-imp density-imp)))


ex32 fix

ex32 fix

--- examples/ex32_harmonograph.clj
+++ examples/ex32_harmonograph.clj
@@ -47,7 +47,7 @@
   nscalex/nscaley - noise scale, n1-n4 noise functions (or value 1.0), c1-c2 colors, dampsteps"
   []
   (let [^int rngs (r/irand 8 32)
-        freqs (map #(/ (* (double %)) m/TWO_PI) (range (- rngs) rngs (r/irand 1 rngs)))
+        freqs (map #(/ (double %) m/TWO_PI) (range (- rngs) rngs (r/irand 1 rngs)))
         ^double a1 (r/drand hwidth)
         a2 (r/drand (- hwidth a1))
         ^double a3 (r/drand hheight)
@@ -110,7 +110,7 @@
               s2 (m/sin (+ (* time f3) p3))

               s3 (m/sin (+ (* time f1)
-                           (* m/TWO_PI ^double (n1 (* (+ time prevy) nscaley2) p1))
+                           (* m/TWO_PI ^double (n1 (* (* time prevy) nscaley2) p1))
                            p1))
               ^double dampx (if (zero? dampxc) 1.0
                                 (dampstepsx (int (m/norm (m/qsin (+ time p1)) -1.0 1.1 0.0 dampxc))))


GNFID

GNFID

--- src/clj_simple_chart/ncs/discovery/resource_class_diagram.clj
+++ src/clj_simple_chart/ncs/discovery/resource_class_diagram.clj
@@ -37,8 +37,8 @@
              :shut-down-produced gray})

 (def text {:not-evaluated "Ikkje evaluert"
-           :likely "Utvinning sannsynlig"
-           :clarification "Under avklaring"
+           :likely "Utvinning truleg"
+           :clarification "Under avklåring"
            :pdo-approved "PUD*-godkjent"
            :remaining-reserves "Gjenverande reservar"
            :producing-produced "Produksjon frå felt i produksjon"
@@ -79,7 +79,12 @@

 (def header (opentype/stack
               {:width available-width}
-              [{:text "Gjenverande ressursar og historisk produksjon" :font "Roboto Bold" :font-size 30}]))
+              [{:text "Gjenverande ressursar og kumulativ produksjon" :font "Roboto Bold" :font-size 30
+                :margin-bottom 3}
+               {:text "Milliardar fat olje" :font "Roboto Bold" :font-size 16
+                :align :right
+                :margin-bottom 3
+                :valign :bottom}]))

 (def footer (opentype/stack
               {:width available-width}


addressed a whitespace concern

addressed a whitespace concern

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/workspace_method_confs.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/workspace_method_confs.cljs
@@ -41,7 +41,7 @@
      [:div {:style {:padding "0 4em"}}
       (if (zero? (count (:method-confs props)))
         [:div {:style {:textAlign "center" :backgroundColor (:background-gray style/colors)
-                       :padding   "1em 0" :borderRadius 8}}
+                       :padding "1em 0" :borderRadius 8}}
          "There are no method configurations to display."]
         [table/Table
          (let [cell-style {:flexBasis  "8ex" :flexGrow 1 :whiteSpace "nowrap" :overflow "hidden"


(TK-260) Add additional tests for allow unauthenticated

Comments addressed:
https://github.com/puppetlabs/trapperkeeper-authorization/pull/5#discussion_r38347896

Might be good to throw another test in here somewhere which validates
that that authenticated request - one that should also be allowed by
rule - will still end up being allowed for a rule which has
allow_authenticated: true

Might also be good to add a test which has an unauthenticated request
being made to a URI which does match a rule but where the rule has been
configured with allow_unauthenticated: false (explicitly or implicitly
by not having allow_unauthenticated specified) to confirm that the
request is still denied.

--- test/puppetlabs/trapperkeeper/services/authorization/authorization_service_test.clj
+++ test/puppetlabs/trapperkeeper/services/authorization/authorization_service_test.clj
@@ -144,7 +144,11 @@
                     (assoc :body "Hello World!"))
             {:keys [status body]} (app req)]
         (is (= status 200))
-        (is (= body "Prefix: !dlroW olleH")))))
+        (is (= body "Prefix: !dlroW olleH")))
+      (let [req (assoc base-request :uri "/puppet-ca/v1/certificate/ca")
+            {:keys [status body]} (app req)]
+        (is (= status 200))
+        (is (= body "Prefix: ")))))
   (testing "(TK-260) Authorizing unauthenticated requests"
     (let [app (build-ring-handler default-rules)]
       (let [{:keys [status body]} (app unauthenticated-request)]
@@ -164,7 +168,10 @@
         (is (= body "Prefix: ")))
       (let [req (assoc unauthenticated-request :uri "/not/covered/by/rules")
             {:keys [status body]} (app req)]
-        (is (= status 403)))))
+        (is (= status 403)))
+      (let [req (assoc unauthenticated-request :uri "/puppet/v3/status")
+            {:keys [status body]} (app req)]
+        (is (= status 403) "Unauthentic requests are denied with allow-unauthenticated false"))))
   (testing "With a minimal config of an empty list of rules"
     (let [app (build-ring-handler [])]
       (let [req (request "/path/to/foo" :get "127.0.0.1" test-domain-cert)
@@ -190,8 +197,7 @@
                :allow "*"}])
         req (assoc base-request
                    :uri "/puppet/v3/environments"
-                   :body "Query Param Test")
-        {:keys [status body]} (app req)]
+                   :body "Query Param Test")]
     (testing "request denied - params don't match"
       (let [{:keys [status body]}
             (app (assoc req :query-string "environment=dev&foo=bar"))]


Rename build-selector to ->selector

Rename build-selector to ->selector

--- src/eq/core.cljs
+++ src/eq/core.cljs
@@ -9,8 +9,8 @@

 (def fs (js/require "fs"))

-(defn build-selector
-  "Build an eq-like selector"
+(defn ->selector
+  "Build an eq selector to be used by eq/select."
   [expr]
   (cond
     ;; "", "." -> identity
@@ -42,7 +42,7 @@

 (defn -main
   [expr & _]
-  (if-let [selector (build-selector expr)]
+  (if-let [selector (->selector expr)]
     (doseq [line (->> (. fs openSync "/dev/stdin" "rs")
                       line-seq
                       (map edn/read-string)


install lein-cljfmt

install lein-cljfmt

--- dot/lein/profiles.clj
+++ dot/lein/profiles.clj
@@ -4,6 +4,6 @@
             [lein-kibit "0.1.6"]
             [jonase/eastwood "0.2.5"]
             ;;[com.billpiel/sayid "0.0.10"]
-            ]
+            [lein-cljfmt "0.5.7"]]
   :dependencies [[slamhound "1.5.5"]]
   :aliases {"slamhound" ["run" "-m" "slam.hound"]}}}


core: for

core: for

--- core/data/core.clj
+++ core/data/core.clj
@@ -2325,6 +2325,58 @@
   [& colls]
   `(concat ~@(map #(list `lazy-seq %) colls)))

+(defmacro for
+  "List comprehension. Takes a vector of one or more
+  binding-form/collection-expr pairs, each followed by zero or more
+  modifiers, and yields a lazy sequence of evaluations of expr.
+  Collections are iterated in a nested fashion, rightmost fastest,
+  and nested coll-exprs can refer to bindings created in prior
+  binding-forms.  Supported modifiers are: :let [binding-form expr ...],
+  :while test, :when test.
+
+  (take 100 (for [x (range 100000000) y (range 1000000) :while (< y x)]  [x y]))"
+  [seq-exprs body-expr]
+  (assert-args for
+               (vector? seq-exprs) "a vector for its binding"
+               (even? (count seq-exprs)) "an even number of forms in binding vector")
+  (let [to-groups (fn [seq-exprs]
+                    (reduce1 (fn [groups [k v]]
+                               (if (keyword? k)
+                                 (conj (pop groups) (conj (peek groups) [k v]))
+                                 (conj groups [k v])))
+                             [] (partition 2 seq-exprs)))
+        err (fn [& msg] (throw (ex-info (apply str msg) {})))
+        emit-bind (fn emit-bind [[[bind expr & mod-pairs]
+                                  & [[_ next-expr] :as next-groups]]]
+                    (let [giter (gensym "iter__")
+                          gxs (gensym "s__")
+                          do-mod (fn do-mod [[[k v :as pair] & etc]]
+                                   (cond
+                                     (= k :let) `(let ~v ~(do-mod etc))
+                                     (= k :while) `(when ~v ~(do-mod etc))
+                                     (= k :when) `(if ~v
+                                                    ~(do-mod etc)
+                                                    (recur (rest ~gxs)))
+                                     (keyword? k) (err "Invalid 'for' keyword " k)
+                                     next-groups
+                                     `(let [iterys# ~(emit-bind next-groups)
+                                            fs# (seq (iterys# ~next-expr))]
+                                        (if fs#
+                                          (concat fs# (~giter (rest ~gxs)))
+                                          (recur (rest ~gxs))))
+                                     :else `(cons ~body-expr
+                                                  (~giter (rest ~gxs)))))]
+                      `(fn ~giter [~gxs]
+                         (lazy-seq
+                          (loop [~gxs ~gxs]
+                            (when-first [~bind ~gxs]
+                              ~(do-mod mod-pairs)))))))]
+    `(let [iter# ~(emit-bind (to-groups seq-exprs))]
+       (iter# ~(second seq-exprs)))))
+
+
+
+
 (defmacro assert
   "Evaluates expr and throws an exception if it does not evaluate to
   logical true."


support :imperfect-stem

support :imperfect-stem

--- src/babel/francais/morphology/verbs.cljc
+++ src/babel/francais/morphology/verbs.cljc
@@ -907,6 +907,61 @@
                   :français (get-in val [:français :imperfect :3plur] :nothing)
                   :agr {:number :plur
                         :person :3rd}}})}
+
+   {:path [:français :imperfect-stem]
+    :merge-fn
+    (fn [val]
+      [{:français {:infl :imperfect
+                   :imperfect-stem (get-in val [:français :imperfect-stem])
+                   :français (str (get-in val [:français :imperfect-stem]) "ais")
+                   :agr {:number :sing
+                         :person :1st}}}])}
+
+   {:path [:français :imperfect-stem]
+    :merge-fn
+    (fn [val]
+      [{:français {:infl :imperfect
+                   :imperfect-stem (get-in val [:français :imperfect-stem])
+                   :français (str (get-in val [:français :imperfect-stem]) "ais")
+                   :agr {:number :sing
+                         :person :2nd}}}])}
+
+   {:path [:français :imperfect-stem]
+    :merge-fn
+    (fn [val]
+      [{:français {:infl :imperfect
+                   :imperfect-stem (get-in val [:français :imperfect-stem])
+                   :français (str (get-in val [:français :imperfect-stem]) "ait")
+                   :agr {:number :sing
+                         :person :3rd}}}])}
+
+   {:path [:français :imperfect-stem]
+    :merge-fn
+    (fn [val]
+      [{:français {:infl :imperfect
+                   :imperfect-stem (get-in val [:français :imperfect-stem])
+                   :français (str (get-in val [:français :imperfect-stem]) "ions")
+                   :agr {:number :plur
+                         :person :1st}}}])}
+
+   {:path [:français :imperfect-stem]
+    :merge-fn
+    (fn [val]
+      [{:français {:infl :imperfect
+                   :imperfect-stem (get-in val [:français :imperfect-stem])
+                   :français (str (get-in val [:français :imperfect-stem]) "iez")
+                   :agr {:number :plur
+                         :person :2nd}}}])}
+
+   {:path [:français :imperfect-stem]
+    :merge-fn
+    (fn [val]
+      [{:français {:infl :imperfect
+                   :imperfect-stem (get-in val [:français :imperfect-stem])
+                   :français (str (get-in val [:français :imperfect-stem]) "aient")
+                   :agr {:number :plur
+                         :person :3rd}}}])}
+
    ;; 3. present-tense boot-stem exception: :boot-stem1.
    {:path [:français :boot-stem1]
     :merge-fn


Bump version to 0.1.2-SNAPSHOT

Bump version to 0.1.2-SNAPSHOT

--- cortex/project.clj
+++ cortex/project.clj
@@ -1,4 +1,4 @@
-(defproject thinktopic/cortex "0.1.1"
+(defproject thinktopic/cortex "0.1.2-SNAPSHOT"
   :description "A neural network toolkit for Clojure."
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [com.taoensso/timbre "4.3.1"]


halt in local mode for now

halt in local mode for now

--- src/clj/backtype/storm/daemon/worker.clj
+++ src/clj/backtype/storm/daemon/worker.clj
@@ -248,9 +248,13 @@
     ret
     ))

+;; (defmethod mk-suicide-fn
+;;   :local [conf active]
+;;   (fn [] (reset! active false)))
+
 (defmethod mk-suicide-fn
-  :local [conf active]
-  (fn [] (reset! active false)))
+  :local [conf _]
+  (fn [] (halt-process! 1 "Task died")))

 (defmethod mk-suicide-fn
   :distributed [conf _]


Make little refactoring on opensubtitles source

--- src/clj/subman/sources/opensubtitles.clj
+++ src/clj/subman/sources/opensubtitles.clj
@@ -1,5 +1,6 @@
 (ns subman.sources.opensubtitles
-  (:require [net.cgrand.enlive-html :as html]
+  (:require [swiss.arrows :refer [-<>]]
+            [net.cgrand.enlive-html :as html]
             [subman.helpers :as helpers]
             [subman.const :as const]))

@@ -74,8 +75,8 @@

 (defn get-release-page-result
   "Get release page result"
-  [page] (-> (get-page-url page)
-             helpers/fetch
-             (html/select [:table#search_results
-                           [:tr.expandable (html/has [:strong])]])
-             (#(map create-subtitle %))))
+  [page] (-<> (get-page-url page)
+              helpers/fetch
+              (html/select [:table#search_results
+                            [:tr.expandable (html/has [:strong])]])
+              (map create-subtitle <>)))


moved to end

moved to end

--- src/cljs/infinitelives/utils/events.cljs
+++ src/cljs/infinitelives/utils/events.cljs
@@ -284,11 +284,6 @@
   []
   (request-animation-frame frame-event-chan-handler))

-;; install all the event channel handlers
-(install-key-handler!)
-(install-frame-handler!)
-(install-resize-handler!)
-
 ;;
 ;; gamepad wrapper
 ;;
@@ -323,3 +318,12 @@
                                         ;(.on "swipe" #(put! c [:swipe %]))
         )
       c)))
+
+
+
+;; install handlers
+
+;; install all the event channel handlers
+(install-key-handler!)
+(install-frame-handler!)
+(install-resize-handler!)


New recursively-variant?

New recursively-variant?

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -301,186 +301,16 @@
   (levenshtein-distance (expressed-program-sequence-from-genome g1 argmap)
                         (expressed-program-sequence-from-genome g2 argmap)))

-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [translate #(translate-plush-genome-to-push-program {:genome %} argmap)
-;        child1 (produce-child-genome-by-autoconstruction g g true argmap)
-;        gc1a (produce-child-genome-by-autoconstruction child1 child1 true argmap)
-;        gc1b (produce-child-genome-by-autoconstruction child1 [] true argmap)
-;        gc1c (produce-child-genome-by-autoconstruction child1 child1 false argmap)
-;        child2 (produce-child-genome-by-autoconstruction g g false argmap)
-;        gc2a (produce-child-genome-by-autoconstruction child2 child2 true argmap)
-;        gc2b (produce-child-genome-by-autoconstruction child2 [] true argmap)
-;        gc2c (produce-child-genome-by-autoconstruction child2 child2 false argmap)]
-;    (and (apply distinct? (map translate [g child1 child2 gc1a gc1b gc1c gc2a gc2b gc2c]))
-;         (distinct? (expressed-difference child1 gc1b argmap)
-;                    (expressed-difference child2 gc2b argmap)))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [translate #(translate-plush-genome-to-push-program {:genome %} argmap)
-;        c1 (produce-child-genome-by-autoconstruction g g true argmap)
-;        c2 (produce-child-genome-by-autoconstruction g g false argmap)
-;        c1c (produce-child-genome-by-autoconstruction c1 g true argmap)
-;        c2c (produce-child-genome-by-autoconstruction c2 g true argmap)]
-;    (and (apply distinct? (map translate [g c1 c1c c2 c2c]))
-;         (apply distinct? [(expressed-difference c1 c1c argmap)
-;                           (expressed-difference c2 c2c argmap)]))))
-
-(defn compute-errors
-  [g {:keys [error-function pass-individual-to-error-function] :as argmap}]
-  (let [p (translate-plush-genome-to-push-program {:genome g} argmap)]
-    (if pass-individual-to-error-function
-      (error-function (make-individual :genome g :program p))
-      (error-function p))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [translate #(translate-plush-genome-to-push-program {:genome %} argmap)
-;        c1 (produce-child-genome-by-autoconstruction g g true argmap)
-;        c2 (produce-child-genome-by-autoconstruction g g false argmap)
-;        c1c (produce-child-genome-by-autoconstruction c1 g true argmap)
-;        c2c (produce-child-genome-by-autoconstruction c2 g true argmap)]
-;    (and (apply distinct? (map translate [g c1 c1c c2 c2c]))
-;         (apply distinct? [(expressed-difference c1 c1c argmap)
-;                           (expressed-difference c2 c2c argmap)])
-;         (distinct? (compute-errors g argmap)
-;                    (compute-errors c1c argmap)
-;                    (compute-errors c2c argmap)))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [c1 (produce-child-genome-by-autoconstruction g g false argmap)
-;        c2 (produce-child-genome-by-autoconstruction g g false argmap)
-;        c1c (produce-child-genome-by-autoconstruction c1 g true argmap)
-;        c2c (produce-child-genome-by-autoconstruction c2 g true argmap)]
-;    (and (distinct? (expressed-difference c1 c1c argmap)
-;                    (expressed-difference c2 c2c argmap))
-;         (distinct? (compute-errors g argmap)
-;                    (compute-errors c1c argmap)
-;                    (compute-errors c2c argmap)))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [c (produce-child-genome-by-autoconstruction g g false argmap)
-;        gc (produce-child-genome-by-autoconstruction c c false argmap)]
-;    (and (distinct? (expressed-difference g c argmap)
-;                    (expressed-difference c gc argmap))
-;         (distinct? (compute-errors g argmap)
-;                    ;(compute-errors c argmap)
-;                    (compute-errors gc argmap)))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [translate #(translate-plush-genome-to-push-program {:genome %} argmap)
-;        c (produce-child-genome-by-autoconstruction g g false argmap)
-;        c2 (produce-child-genome-by-autoconstruction g g false argmap)
-;        gc (produce-child-genome-by-autoconstruction c c false argmap)]
-;    (and (distinct? (expressed-difference g c argmap)
-;                    (expressed-difference c gc argmap))
-;         (apply distinct? (map translate [g c c2 gc]))
-;         (let [g-errors (compute-errors g argmap)
-;               c-errors (compute-errors c argmap)
-;               gc-errors (compute-errors gc argmap)]
-;           (distinct? (map - g-errors c-errors)
-;                      (map - c-errors gc-errors))))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [translate #(translate-plush-genome-to-push-program {:genome %} argmap)
-;        c (produce-child-genome-by-autoconstruction g g false argmap)
-;        c2 (produce-child-genome-by-autoconstruction g g false argmap)
-;        gc (produce-child-genome-by-autoconstruction c c false argmap)]
-;    (and (distinct? (expressed-difference g c argmap)
-;                    (expressed-difference c gc argmap))
-;         (apply distinct? (map translate [g c c2 gc])))))
-
 (defn recursively-variant?
   "Returns true iff genome g is considered recursively variant."
   [g argmap]
-  (let [translate #(translate-plush-genome-to-push-program {:genome %} argmap)
-        c1 (produce-child-genome-by-autoconstruction g g false argmap)
-        c2 (produce-child-genome-by-autoconstruction g g false argmap)]
-    (and (distinct? (expressed-difference g c1 argmap)
-                    (expressed-difference g c2 argmap))
-         (apply distinct? (map translate [g c1 c2])))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [delta #(expressed-difference
-;                 g
-;                 (produce-child-genome-by-autoconstruction g g false argmap)
-;                 argmap)
-;        diffs (repeatedly 2 delta)]
-;    (and (> (reduce min diffs) 1)
-;         (> (reduce max diffs) 10)
-;         (> (count (distinct diffs)) 1))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [delta #(expressed-difference
-;                 g
-;                 (produce-child-genome-by-autoconstruction g g false argmap)
-;                 argmap)
-;        diffs (repeatedly 5 delta)]
-;    (and (> (reduce min diffs) 0)
-;         ;(> (reduce max diffs) 10)
-;         (> (count (distinct diffs)) 1))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [num-kids 5
-;        kids (repeatedly num-kids
-;                         #(produce-child-genome-by-autoconstruction g g false argmap))
-;        diffs (map #(expressed-difference g % argmap) kids)]
-;    (and (> (reduce min diffs) 0)
-;         (> (count (distinct diffs)) 1)
-;         (some #(< (count %) (count g)) kids))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [num-kids 5
-;        kids (repeatedly num-kids
-;                         #(produce-child-genome-by-autoconstruction g g false argmap))
-;        diffs (map #(expressed-difference g % argmap) kids)
-;        ]
-;    (and (> (reduce min diffs) 0)
-;         (> (count (distinct diffs)) 1)
-;         (some #(< (count %) (count g)) kids)
-;         (some #(> (count %) (count g)) kids))))
-
-;(defn recursively-variant?
-;  "Returns true iff genome g is considered recursively variant."
-;  [g argmap]
-;  (let [spawn (fn [genome]
-;                (repeatedly
-;                  5
-;                  #(produce-child-genome-by-autoconstruction
-;                     genome genome false argmap)))
-;        variant? (fn [genome children]
-;                   (let [diffs (map #(expressed-difference genome % argmap)
-;                                    children)]
-;                     (and (> (reduce min diffs) 0)
-;                          (> (count (distinct diffs)) 1)
-;                          (some #(< (count %) (count genome)) children)
-;                          (some #(> (count %) (count genome)) children))))
-;        kids (spawn g)]
-;    (and (variant? g kids)
-;         (every? #(variant? % (spawn %)) kids))))
-
-
-;; lein run clojush.problems.demos.simple-regression :autoconstructive true :max-points 1600 :max-genome-size-in-initial-program 400 :evalpush-limit 1600 :population-size 1000 :max-generations 10000 :parent-selection :lexicase | tee out
+  (let [delta #(expressed-difference
+                 g
+                 (produce-child-genome-by-autoconstruction g g false argmap)
+                 argmap)
+        diffs (repeatedly 5 delta)]
+    (and (> (reduce min diffs) 0)
+         (> (count (distinct diffs)) 1))))

 (defn autoconstruction
   "Returns a genome for a child produced either by autoconstruction (executing parent1


Actually add the uniform-addition genetic operator; lein release :minor

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -154,6 +154,24 @@
                                   (:ancestors ind)))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; uniform addition
+
+(defn uniform-addition
+  "Returns the individual with each element of its genome possibly preceded or followed by
+  a new gene, with probability given by uniform-addition-rate."
+  [ind {:keys [uniform-addition-rate maintain-ancestors atom-generators]}]
+  (let [new-genome (vec (apply concat
+                               (map #(if (< (lrand) uniform-addition-rate)
+                                      (lshuffle [% (random-plush-instruction-map atom-generators)])
+                                      [%])
+                                    (:genome ind))))]
+    (make-individual :genome new-genome
+                     :history (:history ind)
+                     :ancestors (if maintain-ancestors
+                                  (cons (:genome ind) (:ancestors ind))
+                                  (:ancestors ind)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; alternation

 (defn alternation


Попробуем либу [postgresql "9.3-1102.jdbc41"]

--- radiolamp-6P3/project.clj
+++ radiolamp-6P3/project.clj
@@ -19,7 +19,8 @@

                  [clj-time "0.12.0"]

-                 [org.postgresql/postgresql "9.4.1211"]
+                 ;;[org.postgresql/postgresql "9.4.1211"]
+                 [postgresql "9.3-1102.jdbc41"]
                  [korma "0.4.2"]


Use nodejs repl on scripts/repl.clj instead of nashorn.

Because rxjs does not works on nashorn.

--- scripts/repl.clj
+++ scripts/repl.clj
@@ -1,8 +1,9 @@
 (require
   '[cljs.repl :as repl]
-  '[cljs.repl.nashorn :as nashorn])
+  '[cljs.repl.nashorn :as nashorn]
+  '[cljs.repl.node :as node])

 (cljs.repl/repl
- (cljs.repl.nashorn/repl-env)
+ (cljs.repl.node/repl-env)
  :output-dir "out"
  :cache-analysis true)


Make trace panel show correct number of traces

Fixes #142

--- src/day8/re_frame/trace/view/traces.cljs
+++ src/day8/re_frame/trace/view/traces.cljs
@@ -163,14 +163,7 @@
               (if (:show-all? @trace-detail-expansions) "-" "+")]]
             [:th "operations"]
             [:th
-             [:button {:class    (str/join " " ["filter-items-count"
-                                                (when (pos? (count @filter-items)) "active")])
-                       :on-click #(rf/dispatch [:traces/reset-filter-items])}
-              (when (pos? (count @filter-items))
-                (str (count visible-traces) " of "))
-              (str (count @current-traces))]
-             " traces "
-             (when (pos? (count @current-traces))
-               [:span "(" [:button.text-button {:on-click #(rf/dispatch [:epochs/reset])} "clear"] ")"])]
+             (str (count visible-traces) " traces")
+             [:span "(" [:button.text-button {:on-click #(rf/dispatch [:epochs/reset])} "clear"] ")"]]
             [:th {:style {:text-align "right"}} "meta"]]
            [:tbody (render-traces visible-traces filter-items filter-input trace-detail-expansions)]]]]))))


(maint) Delete errant equals-rule function

--- src/puppetlabs/trapperkeeper/authorization/rules.clj
+++ src/puppetlabs/trapperkeeper/authorization/rules.clj
@@ -46,15 +46,6 @@
     pattern :- Pattern
     method :- Method]
     {:type type :path pattern :acl acl/empty-acl :method method}))
-
-(schema/defn equals-rule :- schema/Bool
-  "Test if two given rule are fully equal"
-  [a :- Rule b :- Rule]
-  (and
-    (= (:type a) (:type b))
-    (= (:acl a) (:acl b))
-    (= (:method a) (:method b))
-    (= (str (:path a)) (str (:path b)))))

 (schema/defn tag-rule :- Rule
   "Tag a rule with a file/line - useful for instance when the rule has been read


fix #10039

fix #10039

- wasn't able to reproduce the issue as it seems that all inputs are already
properly turned to lower case
- added :auto-capitalize :none property to the input field though to ensure
the keyboard doesn't force the user to start with an uppercase later

Signed-off-by: yenda <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@status.im>

--- src/status_im/ui/screens/add_new/new_chat/views.cljs
+++ src/status_im/ui/screens/add_new/new_chat/views.cljs
@@ -88,6 +88,7 @@
          ;; in onWillBlur navigation event handler
          :preserve-input?     true
          :accessibility-label :enter-contact-code-input
+         :auto-capitalize :none
          :return-key-type     :go}]]
       [react/view {:width 16}]
       [input-icon state]]


Update dependencies

Update dependencies

--- cortex/project.clj
+++ cortex/project.clj
@@ -8,21 +8,21 @@
                  [org.clojure/test.check "0.9.0"]
                  [thinktopic/matrix.fressian "0.3.1"]
                  [net.mikera/vectorz-clj "0.45.0"]
-                 [net.mikera/core.matrix "0.56.0"]
-                 [net.mikera/clojure-utils "0.7.0"]
+                 [net.mikera/core.matrix "0.57.0"]
+                 [net.mikera/clojure-utils "0.7.1"]
                  [core.blas "1.0.2"]
                  [com.github.fommil.netlib/all "1.1.2" :extension "pom"]
                  [thinktopic/think.parallel "0.1.0"]]

   :java-source-paths ["java"]

-  :profiles {:dev {:dependencies [[net.mikera/cljunit "0.4.1"]  ;; allows JUnit testing
+  :profiles {:dev {:dependencies [[net.mikera/cljunit "0.6.0"]  ;; allows JUnit testing
                                   [criterium/criterium "0.4.4"] ;; benchmarking tool
                                   ] ;; alternate core.matrix implementation
                    :source-paths ["src" "test/cljc" "test/clj"]
                    :java-source-paths ["test/clj"]}

-             :test {:dependencies [[net.mikera/cljunit "0.4.0"]
+             :test {:dependencies [[net.mikera/cljunit "0.6.0"]
                                    [criterium/criterium "0.4.4"]
                                    [clatrix "0.5.0" :exclusions [net.mikera/core.matrix]]]
                     :source-paths ["src" "test/cljc" "test/cljs" "test/clj"]


enhance missing-ns error to warn if there is a .clj file

it might be meant to be .cljs or .cljc and just accidentally
created as .clj

--- src/main/shadow/cljs/devtools/errors.clj
+++ src/main/shadow/cljs/devtools/errors.clj
@@ -12,7 +12,8 @@
             [shadow.build.warnings :as w]
             [expound.alpha :as expound]
             [clojure.tools.logging :as log]
-            [shadow.cljs.util :as util])
+            [shadow.cljs.util :as util]
+            [clojure.java.io :as io])
   (:import (java.io StringWriter FileNotFoundException)
            (clojure.lang ExceptionInfo ArityException)))

@@ -126,8 +127,12 @@
   (spec-explain w data))

 (defmethod ex-data-format ::resolve/missing-ns
-  [w e data]
-  (write-msg w e))
+  [w e {:keys [require] :as data}]
+  (write-msg w e)
+  (let [filename (str (util/ns->path require) ".clj")]
+    (when-let [rc (io/resource filename)]
+      (.write w (str "\"" filename "\" was found on the classpath. Should this be a .cljs file?\n"))
+      )))

 (defmethod ex-data-format ::resolve/missing-js
   [w e {:keys [require] :as data}]