Fit columns in 80 chars

Fit columns in 80 chars

Signed-off-by: Njagi Mwaniki <b6a4ba60ad861b9c9afb6daea7294be4be68f44c@urbanslug.com>

--- test/hatti/ona/forms_test.cljs
+++ test/hatti/ona/forms_test.cljs
@@ -121,7 +121,9 @@
         (is (= (forms/format-answer q-sel1 (:name rand-option))
                (:label rand-option)))
         (is (= (forms/format-answer q-sel1 nil) forms/no-answer))
-        (is (= (forms/format-answer q-sel1 (:label rand-option) :field-key :label)
+        (is (= (forms/format-answer q-sel1
+                                    (:label rand-option)
+                                    :field-key :label)
                (:label rand-option)))))
     (testing "select all answers are formatted properly"
       (let [first-option (first (:children q-selm))


Prevent Double Init of System

Prevent Double Init of System

--- dev/user.clj
+++ dev/user.clj
@@ -7,6 +7,7 @@
 (def system nil)

 (defn init []
+  (assert (nil? system))
   (alter-var-root #'system (constantly (system/system (system/env)))))

 (defn start []


test fold edge cases

test fold edge cases

--- test/riemann/test/folds.clj
+++ test/riemann/test/folds.clj
@@ -107,7 +107,9 @@

 (deftest mean-test
     (is (= {:metric 4} (mean [{:metric 2} {:metric 4} {:metric 6}])))
-    (is (= {:metric 4} (mean [{:metric 2} {:metric 4} {:metric nil} {:metric 6}]))))
+    (is (= {:metric 4} (mean [{:metric 2} {:metric 4} {:metric nil} {:metric 6}])))
+    (is (= {:metric 4} (mean [{:metric 2} {:metric 4} {:metric nil} {:metric 6} nil])))
+    (is (= nil (mean []))))

 (deftest std-dev-test
     (is (= 147.0 (Math/floor (:metric (std-dev [{:metric 600} {:metric 470} {:metric 170} {:metric 430} {:metric 300}])))))


replace proxy with reify

replace proxy with reify

--- dada-core/src/main/clojure/org/dada/core/dql.clj
+++ dada-core/src/main/clojure/org/dada/core/dql.clj
@@ -44,7 +44,7 @@
      (custom-metadata3 org.dada.core.Result
 		       [:model]		;TODO - this is a BAD idea for a PK
 		       [:model]		;TODO - we need a proper version - or code that can handle versionless data
-		       (proxy [Metadata$VersionComparator][](compareTo [lhs rhs] -1))
+		       (reify Metadata$VersionComparator (compareTo [_ lhs rhs] -1))
 		       [[:model org.dada.core.Model false]
 			[:prefix String false]
 			[:pairs java.util.Collection false]
@@ -58,8 +58,7 @@
   (map (fn [#^Getter getter] (.get getter value)) getters))

 (def #^Metadata$VersionComparator int-version-comparator
-     (proxy [Metadata$VersionComparator][]
-	    (compareTo [old new] (- (.getVersion old) (.getVersion new)))))
+     (reify Metadata$VersionComparator (compareTo [_ old new] (- (.getVersion old) (.getVersion new)))))

 ;;----------------------------------------
 ;; Filtration - should be implemented as a thin wrapper around Splitter
@@ -139,29 +138,27 @@
   (let [src-metadata (.getMetadata src-model)
 	mutable (.getMutable (.getAttribute src-metadata key))
 	map (new ConcurrentHashMap)
-	view-factory (proxy
-		      [Factory]
-		      []
-		      (create [key]
-			      (let [value (key-to-value key)
-				    view (model (src-name-fn value) src-metadata)]
-				(.decouple
-				 internal-view-service-factory
-				 (view-hook view value))
-				view)
-			      ))
-	lazy-factory (proxy [Factory] [] (create [key] (new LazyView map key view-factory)))
+	view-factory (reify
+                       Factory
+                       (create [_ key]
+                         (let [value (key-to-value key)
+                               view (model (src-name-fn value) src-metadata)]
+                           (.decouple
+                            internal-view-service-factory
+                            (view-hook view value))
+                           view)
+                         ))
+	lazy-factory (reify Factory (create [_ key] (new LazyView map key view-factory)))
 	table (new SparseOpenLazyViewTable map lazy-factory)
 	getter (.getGetter (.getAttribute src-metadata key))]
     (new
      Splitter
-     (proxy
-      [Splitter$StatelessStrategy]
-      []
-      (getMutable [] mutable)
-      (getKeys [value] (value-to-keys (.get getter value)))
-      (getViews [key] (list (. table get key)))
-      ))))
+     (reify
+       Splitter$StatelessStrategy
+       (getMutable [_] mutable)
+       (getKeys [_ value] (value-to-keys (.get getter value)))
+       (getViews [_ key] (list (. table get key)))
+       ))))

 (defn do-split
   [#^Model src-model key value-to-keys key-to-value view-hook]
@@ -208,25 +205,24 @@
 	new-value (fn [#^Update update] (accessor (.getNewValue update)))
 	old-value (fn [#^Update update] (accessor (.getOldValue update)))
 	creator (.getCreator tgt-metadata)]
-    (proxy
-     [Reducer$Strategy]
-     []
-     (initialValue [] 0)
-     (initialType [type] type)
-     (currentValue [keys version value]
-		   (trace (str "SUM " (pr-str keys) " -  " (type version) " " version " " value))
-		   (.create creator (into-array Object (concat keys [(Integer. version) value])))) ;TODO - inefficient
-     (reduce [insertions alterations deletions]
-	     (-
-	      (+
-	       (reduce #(+ %1 (or (new-value %2) 0)) 0 insertions)
-	       (reduce #(+ %1 (- (or (new-value %2) 0) (or (old-value %2) 0))) 0 alterations))
-	      (reduce #(+ %1 (or (old-value %2))) 0 deletions))
-	     )
-     (apply [currentValue delta]
-	    ;;(trace "SUM:" currentValue delta)
-	    (+ currentValue delta))
-     )))
+    (reify
+      Reducer$Strategy
+      (initialValue [_] 0)
+      (initialType [_ type] type)
+      (currentValue [_ keys version value]
+        (trace (str "SUM " (pr-str keys) " -  " (type version) " " version " " value))
+        (.create creator (into-array Object (concat keys [(Integer. version) value])))) ;TODO - inefficient
+      (reduce [_ insertions alterations deletions]
+        (-
+         (+
+          (reduce #(+ %1 (or (new-value %2) 0)) 0 insertions)
+          (reduce #(+ %1 (- (or (new-value %2) 0) (or (old-value %2) 0))) 0 alterations))
+         (reduce #(+ %1 (or (old-value %2))) 0 deletions))
+        )
+      (apply [_ currentValue delta]
+        ;;(trace "SUM:" currentValue delta)
+        (+ currentValue delta))
+      )))

 (defn do-reduce-sum
   [#^String src-name #^Metadata src-metadata #^Metadata tgt-metadata sum-key #^Collection extra-values]
@@ -253,17 +249,16 @@
 (defn make-count-reducer-strategy [#^Metadata src-metadata #^Metadata tgt-metadata & [count-key]]
   ;; TODO - use count-key
   (let [creator (.getCreator tgt-metadata)]
-    (proxy
-     [Reducer$Strategy]
-     []
-     (initialValue [] 0)
-     (initialType [type] Integer)
-     (currentValue [extra-values version value]
-		   (trace (str "COUNT " (pr-str extra-values) " -  " (type version) " " version " " value))
-		   (.create creator (into-array Object (concat extra-values [(Integer. version) value])))) ;TODO - inefficient
-     (reduce [insertions alterations deletions] (- (count insertions) (count deletions)))
-     (apply [currentValue delta] (+ currentValue delta))
-     )
+    (reify
+      Reducer$Strategy
+      (initialValue [_] 0)
+      (initialType [_ type] Integer)
+      (currentValue [_ extra-values version value]
+        (trace (str "COUNT " (pr-str extra-values) " -  " (type version) " " version " " value))
+        (.create creator (into-array Object (concat extra-values [(Integer. version) value])))) ;TODO - inefficient
+      (reduce [_ insertions alterations deletions] (- (count insertions) (count deletions)))
+      (apply [_ currentValue delta] (+ currentValue delta))
+      )
     ))

 (defn do-reduce-count
@@ -457,10 +452,10 @@
     ;; view upstream metamodel for arrival of results
     (connect
      src-metamodel
-     (proxy [View] []
-	    (update [insertions alterations deletions]
-		    (doall (map (fn [#^Update insertion]
-				    (f tgt-metamodel (.getNewValue insertion))) insertions)))))
+     (reify View
+       (update [_ insertions alterations deletions]
+         (doall (map (fn [#^Update insertion]
+                       (f tgt-metamodel (.getNewValue insertion))) insertions)))))
     tgt-metamodel))

 (defn dunion [& [model-name]]
@@ -546,7 +541,7 @@
   (str "split(" (or key "") ")"))

 (defn attach [model update-fn]
-     (connect model (proxy [View] [] (update [insertions alterations deletions] (update-fn insertions alterations deletions)))))
+     (connect model (reify View (update [_ insertions alterations deletions] (update-fn insertions alterations deletions)))))

 (defn dsplit2 [split-key split-key-fn]
   (fn [[src-metadata-fn direct-fn]]


Added static-file response to r.u.response

--- ring-core/src/ring/util/response.clj
+++ ring-core/src/ring/util/response.clj
@@ -1,4 +1,5 @@
-(ns ring.util.response)
+(ns ring.util.response
+  (:import java.io.File))

 (defn redirect-to
   "Returns a Ring response for an HTTP redirect.
@@ -8,3 +9,43 @@
   {:status  (:status opts 302)
    :headers {"Location" url}
    :body    ""})
+
+(defn- safe-path?
+  "Is a filepath safe for a particular root?"
+  [root path]
+  (.startsWith (.getCanonicalPath (File. root path))
+               (.getCanonicalPath (File. root))))
+
+(defn- find-index-file
+  "Search the directory for an index file."
+  [dir]
+  (first
+    (filter
+      #(.startsWith (.toLowerCase (.getName %)) "index.")
+       (.listFiles dir))))
+
+(defn- get-file
+  "Safely retrieve the correct file. See serve-file for an explanation of
+  options."
+  [path opts]
+  (let [file (if-let [root (:root opts)]
+               (if (safe-path? root path)
+                 (File. root path))
+               (File. path))]
+    (if (.exists file)
+      (if (.isDirectory file)
+        (if (:index-files? opts true)
+          (find-index-file file))
+        file))))
+
+(defn static-file
+  "Returns a Ring response to serve a static file, or nil if the file does
+  not exist.
+  Options:
+    :root         - take the filepath relative to this root path
+    :index-files? - look for index.* files in directories, defaults to true"
+  [filepath & [opts]]
+  (if-let [file (get-file filepath opts)]
+    {:status  200
+     :headers {}
+     :body    file}))


Changed default page greeting

Changed default page greeting

--- src/env_logger/main.clj
+++ src/env_logger/main.clj
@@ -15,7 +15,7 @@
                       (db/get-last-n-days-obs 3 :rfc822))))

 (defroutes routes
-  (GET "/" [] "Hello HTTP!")
+  (GET "/" [] "Welcome to the environment log viewer!")
   (GET "/add" [json-string] (db/insert-observation (json/read-str json-string
                                     :key-fn keyword)))
   (GET "/fetch" [ & date-format] {:headers {"Content-Type" "application/json"}


comment in sudoku.clj

comment in sudoku.clj


RS+CM | #40 | Only connect to postgres DB in storage tests when actually running the tests

--- integration/objective8/db/storage_tests.clj
+++ integration/objective8/db/storage_tests.clj
@@ -5,16 +5,15 @@
             [objective8.storage.database :as db]))

-(def db-connection (db/connect! db/postgres-spec))
+(defn db-connection [] (db/connect! db/postgres-spec))

 (defn truncate-tables []
   (korma/delete :comments)
   (korma/delete :objectives)
   (korma/delete :users))

-(against-background [(after :facts (truncate-tables))]
+(against-background [(before :contents (db-connection)) (after :facts (truncate-tables))]
 (facts "Storage tests" :integration
-
        (fact "a user entity can be stored in the database"
              (let [user {:entity :user :twitter-id "the-twitter-id" :foo "bar"}
                    store-result (storage/pg-store! user)


No need to duplicate this info

No need to duplicate this info

--- test/cljs/go_test.clj
+++ test/cljs/go_test.clj
@@ -49,7 +49,4 @@
 (deftest go-test
   (let [{:keys [out exit]} (sh/sh "go" "test")
         out (s/replace (s/replace out "\r" "\n") "\n\t\t" "")]
-    (when-not (zero? exit)
-      (println)
-      (println out))
     (is (zero? exit) out)))


don't log healthchecks

don't log healthchecks

--- src/clj/tictag/server.clj
+++ src/clj/tictag/server.clj
@@ -312,7 +312,8 @@
 (defn wrap-log [handler]
   (fn [req]
     (trace req)
-    (debugf "REQ: [user: %s] [%s] [%s]" (:user-id req) (:uri req) (:remote-addr req))
+    (when-not (= (:uri req) "/healthcheck")
+      (debugf "REQ: [user: %s] [%s] [%s]" (:user-id req) (:uri req) (:remote-addr req)))
     (let [resp (try (handler req) (catch Exception e
                                     (error e)
                                     :ERROR))]


CLJS-225: fix warning about undeclared Var in cljs.reader

The reason was a typo in read-keyword; the resulting function worked
because cljs.core/keyword's binary variant currently delegates to the
unary variant anyway.

--- src/cljs/cljs/reader.cljs
+++ src/cljs/cljs/reader.cljs
@@ -262,7 +262,7 @@
             (identical? (aget name (dec (.-length name))) ":")
             (not (== (.indexOf token "::" 1) -1)))
       (reader-error reader "Invalid token: " token)
-      (if ns?
+      (if ns
         (keyword (.substring ns 0 (.indexOf ns "/")) name)
         (keyword token)))))


* src/cljs/cljs/reader.cljs: fix typo in cljs.reader

--- src/cljs/cljs/reader.cljs
+++ src/cljs/cljs/reader.cljs
@@ -154,7 +154,7 @@
       mapresult
       (if (or (identical? \u ch) (numeric? ch))
         (read-unicode-char reader ch)
-        (reader-error reader "Unsupported escape charater: \\" ch)))))
+        (reader-error reader "Unsupported escape character: \\" ch)))))

 (defn read-past
   "Read until first character that doesn't match pred, returning


positional tweak

positional tweak

--- src/cljs/re_dnd/subs.cljs
+++ src/cljs/re_dnd/subs.cljs
@@ -16,17 +16,30 @@
  [db dz-id draggable-id]
  (->>
   (get-in db [:dnd/state :drop-zones dz-id])
-  (filter (fn [{id :id}]
-            (= id draggable-id)))
+  (filter (comp (partial = draggable-id) :id))
   first))

+(defn drag-box-parent-bounding-rect
+  "DOM lookup, returns {:x 0 :y 0} if not found"
+  []
+  (let [e (.getElementById js/document "drag-box" )
+        p (when e
+            (some-> e
+                    .-parentNode
+                    .-parentNode
+                    h/bounding-rect))]
+    (or  {:left 0 :top 0})))
+
 (re-frame/reg-sub
  :dnd/drag-box
  (fn [db _]
-   (let [[drop-zone-id draggable-id] (h/find-first-dragging-element db)]
+   (let [[drop-zone-id draggable-id] (h/find-first-dragging-element db)
+         {:keys [left top] :as rr} (drag-box-parent-bounding-rect)]
      (if (and drop-zone-id draggable-id)
-       (:position
-        (get-dz-element db drop-zone-id draggable-id))
+       (-> (:position
+            (get-dz-element db drop-zone-id draggable-id))
+           (update :x - left)
+           (update :y - top))
        ;;else
        (when draggable-id
          (get-in db [:dnd/state :draggables draggable-id :position]))))))


Added copy with :callback option.

Added copy with :callback option.

--- src/com/lemonodor/xio.clj
+++ src/com/lemonodor/xio.clj
@@ -1,18 +1,173 @@
 (ns com.lemonodor.xio
-  (:require [clojure.java.io :as io]))
+  (:require [clojure.java.io :as io])
+  (:import (java.io ByteArrayInputStream CharArrayReader File
+                    FileInputStream FileOutputStream InputStream
+                    InputStreamReader OutputStream OutputStreamWriter
+                    Reader StringReader Writer)))
+
+
+(set! *warn-on-reflection* true)
+
+
+(def
+    ^{:doc "Type object for a Java primitive byte array."
+      :private true
+      }
+ byte-array-type (class (make-array Byte/TYPE 0)))
+
+(def
+    ^{:doc "Type object for a Java primitive char array."
+      :private true}
+ char-array-type (class (make-array Character/TYPE 0)))
+
+
+(defn- ^String encoding [opts]
+  (or (:encoding opts) "UTF-8"))
+
+(defn- buffer-size [opts]
+  (or (:buffer-size opts) 1024))
+
+
+(defmulti
+  ^{:doc "Internal helper for copy"
+    :private true
+    :arglists '([input output opts])}
+  do-copy
+  (fn [input output opts] [(type input) (type output)]))
+
+(defmethod do-copy [InputStream OutputStream]
+  [^InputStream input ^OutputStream output opts]
+  (let [buffer (make-array Byte/TYPE (buffer-size opts))]
+    (loop [total 0]
+      (let [size (.read input buffer)]
+        (when (pos? size)
+          (let [total (+ total size)]
+            (.write output buffer 0 size)
+            (when-let [callback (:callback opts)]
+              (callback size total))
+              (recur total)))))))
+
+(defmethod do-copy [InputStream Writer] [^InputStream input ^Writer output opts]
+  (let [^"[C" buffer (make-array Character/TYPE (buffer-size opts))
+        in (InputStreamReader. input (encoding opts))]
+    (loop [total 0]
+      (let [size (.read in buffer 0 (alength buffer))]
+        (if (pos? size)
+          (let [total (+ total size)]
+            (.write output buffer 0 size)
+            (when-let [callback (:callback opts)]
+              (callback size total))
+            (recur total)))))))
+
+(defmethod do-copy [InputStream File] [^InputStream input ^File output opts]
+  (with-open [out (FileOutputStream. output)]
+    (do-copy input out opts)))
+
+(defmethod do-copy [Reader OutputStream]
+  [^Reader input ^OutputStream output opts]
+  (let [^"[C" buffer (make-array Character/TYPE (buffer-size opts))
+        out (OutputStreamWriter. output (encoding opts))]
+    (loop [total 0]
+      (let [size (.read input buffer)]
+        (if (pos? size)
+          (let [total (+ total size)]
+            (.write out buffer 0 size)
+            (when-let [callback (:callback opts)]
+              (callback size total))
+            (recur total))
+          (.flush out))))))
+
+(defmethod do-copy [Reader Writer] [^Reader input ^Writer output opts]
+  (let [^"[C" buffer (make-array Character/TYPE (buffer-size opts))]
+    (loop [total 0]
+      (let [size (.read input buffer)]
+        (when (pos? size)
+          (let [total (+ total size)]
+            (.write output buffer 0 size)
+            (when-let [callback (:callback opts)]
+              (callback size total))
+            (recur total)))))))
+
+(defmethod do-copy [Reader File] [^Reader input ^File output opts]
+  (with-open [out (FileOutputStream. output)]
+    (do-copy input out opts)))
+
+(defmethod do-copy [File OutputStream] [^File input ^OutputStream output opts]
+  (with-open [in (FileInputStream. input)]
+    (do-copy in output opts)))
+
+(defmethod do-copy [File Writer] [^File input ^Writer output opts]
+  (with-open [in (FileInputStream. input)]
+    (do-copy in output opts)))
+
+(defmethod do-copy [File File] [^File input ^File output opts]
+  (with-open [in (-> input FileInputStream. .getChannel)
+              out (-> output FileOutputStream. .getChannel)]
+    (let [sz (.size in)]
+      (loop [pos 0]
+        (let [bytes-xferred (.transferTo in pos (- sz pos) out)
+              pos (+ pos bytes-xferred)]
+          (when-let [callback (:callback opts)]
+            (callback bytes-xferred pos))
+          (when (< pos sz)
+            (recur pos)))))))
+
+(defmethod do-copy [String OutputStream]
+  [^String input ^OutputStream output opts]
+  (do-copy (StringReader. input) output opts))
+
+(defmethod do-copy [String Writer] [^String input ^Writer output opts]
+  (do-copy (StringReader. input) output opts))
+
+(defmethod do-copy [String File] [^String input ^File output opts]
+  (do-copy (StringReader. input) output opts))
+
+(defmethod do-copy [char-array-type OutputStream]
+  [input ^OutputStream output opts]
+  (do-copy (CharArrayReader. input) output opts))
+
+(defmethod do-copy [char-array-type Writer] [input ^Writer output opts]
+  (do-copy (CharArrayReader. input) output opts))
+
+(defmethod do-copy [char-array-type File] [input ^File output opts]
+  (do-copy (CharArrayReader. input) output opts))
+
+(defmethod do-copy [byte-array-type OutputStream]
+  [^"[B" input ^OutputStream output opts]
+  (do-copy (ByteArrayInputStream. input) output opts))
+
+(defmethod do-copy [byte-array-type Writer] [^"[B" input ^Writer output opts]
+  (do-copy (ByteArrayInputStream. input) output opts))
+
+(defmethod do-copy [byte-array-type File] [^"[B" input ^Writer output opts]
+  (do-copy (ByteArrayInputStream. input) output opts))
+
+
+(defn copy
+  "Copies input to output.  Returns nil or throws IOException.
+  Input may be an InputStream, Reader, File, byte[], or String.
+  Output may be an OutputStream, Writer, or File.
+
+  Options are key/value pairs and may be one of
+
+    :buffer-size  buffer size to use, default is 1024.
+    :encoding     encoding to use if converting between
+                  byte and char streams.
+    :callback     a function of 2 arguments: the number of bytes/characters
+                  copied since the last call, and the total number of bytes/
+                  characters.
+
+  Does not close any streams except those it opens itself
+  (on a File)."
+  [input output & opts]
+  (do-copy input output (when opts (apply hash-map opts))))

 (defn binary-slurp
-  "Opens a reader on f and reads all its contents, returning a string.
-  See clojure.java.io/reader for a complete list of supported arguments."
+  "Opens an input stream on f and reads all its contents, returning a
+  string.  See clojure.java.io/input-stream for a complete list of
+  supported arguments."
   ([f & opts]
-     (let [output (java.io.ByteArrayOutputStream.)
-           buffer (make-array Byte/TYPE (get opts :buffer-size 16384))]
-       (with-open [^java.io.InputStream input (apply io/input-stream f opts)]
-         (loop []
-           (let [size (.read input buffer)]
-             (if (pos? size)
-               (do
-                 (.write output buffer 0 size)
-                 (recur))
-               (.toByteArray output))))))))
+     (let [output (java.io.ByteArrayOutputStream.)]
+       (apply copy (apply io/input-stream f opts) output opts)
+       (.toByteArray output))))


Test for function mode->str

Test for function mode->str

--- test/zg/html_renderer_test.clj
+++ test/zg/html_renderer_test.clj
@@ -139,6 +139,16 @@
     "Checking the function zg.html-renderer/render-html-footer."
     (testing "the function zg.html-renderer/render-html-footer."
         (is (= (slurp "test/expected/html_footer1.html") (page/xhtml (render-html-footer))))))
+
+(deftest test-mode->str
+    "Checking the function zg.html-renderer/mode->str."
+    (testing "the function zg.html-renderer/mode->str."
+        (are [x y] (= x (mode->str y))
+            "whitelist"    :whitelist
+            "blacklist"    :blacklist
+            "atomic-typos" :atomic-typos
+            "whitelist"    :other
+            "whitelist"    nil)))

 (deftest test-render-search-href
     "Checking the function zg.html-renderer/render-search-href."


make eastwood happy

make eastwood happy

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -2,7 +2,6 @@
   (:require [clojure.walk :refer (keywordize-keys)]
             [if-let.core :refer (if-let* when-let*)]
             [schema.core :as schema]
-            [taoensso.timbre :as timbre]
             [oc.lib.schema :as lib-schema]
             [oc.lib.db.common :as db-common]
             [oc.lib.slugify :as slugify]


Reformatting

Reformatting

--- lein-template/src/leiningen/new/modular.clj
+++ lein-template/src/leiningen/new/modular.clj
@@ -107,18 +107,18 @@
   ([name app-template & args]

    (let [augment-by (->> args
-                      (keep (partial re-matches #"\+(.*)") )
-                      (map second)    ; take the grouping
-                      (map #(split % #"/"))
-                      (map (partial apply keyword))
-                      set)
+                         (keep (partial re-matches #"\+(.*)") )
+                         (map second)   ; take the grouping
+                         (map #(split % #"/"))
+                         (map (partial apply keyword))
+                         set)

          diminish-by (->> args
-                       (keep (partial re-matches #"\-(.*)") )
-                       (map second)   ; take the grouping
-                       (map #(split % #"/"))
-                       (map (partial apply keyword))
-                       set)
+                          (keep (partial re-matches #"\-(.*)") )
+                          (map second)  ; take the grouping
+                          (map #(split % #"/"))
+                          (map (partial apply keyword))
+                          set)

          manifest (load-manifest (io/resource "manifest.edn") name)

@@ -139,13 +139,13 @@
                              (mapcat :components) vals set)

          components (->> manifest
-                      :components
-                      (filter (comp component-keys :component)))
+                         :components
+                         (filter (comp component-keys :component)))

          components-by-id (->> manifest
-                            :components
-                            (map (juxt :component identity))
-                            (into {}))
+                               :components
+                               (map (juxt :component identity))
+                               (into {}))

          modules (for [a (->> manifest :modules (filter select-module?))]
                    (merge a
@@ -224,37 +224,37 @@
                ;; these can be resolved later
                :library-dependencies
                (->>
-                   (for [module modules
-                         ;; this conj ensures module-level library dependencies are included
-                         c (conj (:components module) module)
-                         dep (:library-dependencies c)]
-                     dep)
-                 sort distinct)
+                (for [module modules
+                      ;; this conj ensures module-level library dependencies are included
+                      c (conj (:components module) module)
+                      dep (:library-dependencies c)]
+                  dep)
+                sort distinct)

                :refers
                (->>
-                   (for [module modules
-                         c (:components module)
-                         refer (:refers c)]
-                     refer)
-                 sort distinct
-                 (group-by (comp symbol namespace))
-                 (reduce-kv
-                  (fn [a k v] (conj a {:namespace k
-                                       :refers (apply str (interpose " " (distinct (map (comp clojure.core/name) v))))}))
-                  []))
+                (for [module modules
+                      c (:components module)
+                      refer (:refers c)]
+                  refer)
+                sort distinct
+                (group-by (comp symbol namespace))
+                (reduce-kv
+                 (fn [a k v] (conj a {:namespace k
+                                      :refers (apply str (interpose " " (distinct (map (comp clojure.core/name) v))))}))
+                 []))

                :dev-refers
                (->>
-                   (for [module modules
-                         refer (:dev-refers module)]
-                     refer)
-                 sort distinct
-                 (group-by (comp symbol namespace))
-                 (reduce-kv
-                  (fn [a k v] (conj a {:namespace k
-                                       :refers (apply str (interpose " " (distinct (map (comp clojure.core/name) v))))}))
-                  []))
+                (for [module modules
+                      refer (:dev-refers module)]
+                  refer)
+                sort distinct
+                (group-by (comp symbol namespace))
+                (reduce-kv
+                 (fn [a k v] (conj a {:namespace k
+                                      :refers (apply str (interpose " " (distinct (map (comp clojure.core/name) v))))}))
+                 []))

                :dev-snippets
                (apply str
@@ -268,36 +268,36 @@

                :dependencies
                (->>
-                   (for [m modules
-                         :let [mkey #(if (keyword? %) (make-key (:module m) %)
-                                         (apply make-key %))]
-
-                         [k v] (:dependencies m)
-                         [n v] (ensure-map v)
-                         ]
-                     [(mkey k) [n (mkey v)]])
-                 ;; This call to 'first' should actually check to ensure
-                 ;; there aren't multiple entries, if there are it means
-                 ;; we have a conflict - more than one dependency is trying to bind
-                 (gbf #(into {} (gbf first %)))
-                 (into {})
-                 )
+                (for [m modules
+                      :let [mkey #(if (keyword? %) (make-key (:module m) %)
+                                      (apply make-key %))]
+
+                      [k v] (:dependencies m)
+                      [n v] (ensure-map v)
+                      ]
+                  [(mkey k) [n (mkey v)]])
+                ;; This call to 'first' should actually check to ensure
+                ;; there aren't multiple entries, if there are it means
+                ;; we have a conflict - more than one dependency is trying to bind
+                (gbf #(into {} (gbf first %)))
+                (into {})
+                )

                :co-dependencies
                (->>
-                   (for [m modules
-                         :let [mkey #(if (keyword? %) (make-key (:module m) %)
-                                         (apply make-key %))]
-
-                         [k v] (:co-dependencies m)
-                         [n v] (ensure-map v)
-                         ]
-                     [(mkey k) [n (mkey v)]])
-                 ;; This call to 'first' should actually check to ensure
-                 ;; there aren't multiple entries, if there are it means
-                 ;; we have a conflict - more than one dependency is trying to bind
-                 (gbf #(into {} (gbf first %)))
-                 (into {}))
+                (for [m modules
+                      :let [mkey #(if (keyword? %) (make-key (:module m) %)
+                                      (apply make-key %))]
+
+                      [k v] (:co-dependencies m)
+                      [n v] (ensure-map v)
+                      ]
+                  [(mkey k) [n (mkey v)]])
+                ;; This call to 'first' should actually check to ensure
+                ;; there aren't multiple entries, if there are it means
+                ;; we have a conflict - more than one dependency is trying to bind
+                (gbf #(into {} (gbf first %)))
+                (into {}))

                :files (concat (get-in manifest [:application-templates app-template :files] [])
                               (mapcat :files modules))}]


Create tile views in separate thread

Create tile views in separate thread

--- android/src/clojure/net/nightweb/views.clj
+++ android/src/clojure/net/nightweb/views.clj
@@ -40,7 +40,6 @@
 (def default-tile-width 160)

 (defn add-last-tile
-  "Adds a tile to take you to the next page if necessary."
   [content results]
   (if (> (count results) limit)
     (let [next-page (-> (get content :page)
@@ -55,8 +54,7 @@
                        :page next-page))))
     results))

-(defn set-grid-view-tiles
-  "Sets the content in the given grid view."
+(defn create-grid-view-tiles
   [context content view]
   (let [num-columns (.getColumnCount view)
         width (.getWidth view)
@@ -71,88 +69,84 @@
         black android.graphics.Color/BLACK
         white android.graphics.Color/WHITE
         end android.text.TextUtils$TruncateAt/END]
-    ; create each tile view and add it to the grid layout
-    (doseq [position (range (count content))]
-      (let [tile-view (make-ui context
-                               [:frame-layout {}
-                                [:image-view {}]
-                                [:linear-layout {:orientation 1}
-                                 [:text-view {:text-color white}]
-                                 [:text-view {:layout-weight 1}]
-                                 [:linear-layout {:orientation 0}
-                                  [:text-view {:text-color white
-                                               :single-line true
-                                               :layout-weight 1
-                                               :ellipsize end}]
-                                  [:text-view {:text-color white}]]]])
-            item (get content position)
-            image-view (.getChildAt tile-view 0)
-            linear-layout (.getChildAt tile-view 1)
-            text-top (.getChildAt linear-layout 0)
-            text-spacer (.getChildAt linear-layout 1)
-            bottom-layout (.getChildAt linear-layout 2)
-            text-bottom (.getChildAt bottom-layout 0)
-            text-count (.getChildAt bottom-layout 1)
-            dip-text-size (make-dip context default-text-size)]
-        (.setScaleType image-view android.widget.ImageView$ScaleType/CENTER_CROP)
-        (.setTypeface text-bottom android.graphics.Typeface/DEFAULT_BOLD)
-        (.setLayoutParams tile-view layout-params)
-        (.setPadding text-spacer (- pad) (- pad) (- pad) (- pad))
-        (doseq [text-view [text-top text-bottom text-count]]
-          (set-text-size text-view default-text-size)
-          (.setPadding text-view pad pad pad pad)
-          (.setShadowLayer text-view radius 0 0 black))
-        (if (get item :add-emphasis?)
-          (do
-            (.setTypeface text-top android.graphics.Typeface/DEFAULT_BOLD)
-            (.setGravity text-top android.view.Gravity/CENTER_HORIZONTAL))
-          (do
-            (.setTypeface text-top android.graphics.Typeface/DEFAULT)
-            (.setGravity text-top android.view.Gravity/LEFT)))
-        (when-let [background (get item :background)]
-          (.setBackgroundResource image-view background))
-        (.setText text-top (or (get item :title)
-                               (get item :body)
-                               (get item :tag)))
-        (.setText text-bottom (get item :subtitle))
-        (if-let [item-count (get item :count)]
-          (.setText text-count (if (> item-count 0) (str item-count) nil)))
-        (if (and (= (.length (.getText text-bottom)) 0)
-                 (= (.length (.getText text-count)) 0))
-          (.setVisibility bottom-layout android.view.View/GONE))
-        (.setMaxLines text-top
-                      (-> (- tile-view-width pad pad)
-                          (- (if (= (.getVisibility bottom-layout)
-                                    android.view.View/VISIBLE)
-                               (+ dip-text-size pad pad)
-                               0))
-                          (/ dip-text-size)
-                          (- 1)
-                          (int)))
-        (.setOnClickListener
-          tile-view
-          (proxy [android.view.View$OnClickListener] []
-            (onClick [view]
-              (tile-action context item))))
-        (.addView view tile-view)))
-    ; load images in a separate thread
-    (future
-      (let [drawables (-> (for [item content]
-                            (if (nil? (get item :tag))
-                              (create-tile-image context
-                                                 (get item :userhash)
-                                                 (get item :pichash))
-                              (let [tag (get-single-tag-data item)]
-                                (create-tile-image context
-                                                   (get tag :userhash)
-                                                   (get tag :pichash)))))
-                          (doall)
-                          (vec))]
-        (on-ui
-          (doseq [i (range (count content))]
-            (-> (.getChildAt view i)
-                (.getChildAt 0)
-                (.setImageDrawable (get drawables i)))))))))
+    (doall
+      (for [position (range (count content))]
+        (let [tile-view (make-ui context
+                                 [:frame-layout {}
+                                  [:image-view {}]
+                                  [:linear-layout {:orientation 1}
+                                   [:text-view {:text-color white}]
+                                   [:text-view {:layout-weight 1}]
+                                   [:linear-layout {:orientation 0}
+                                    [:text-view {:text-color white
+                                                 :single-line true
+                                                 :layout-weight 1
+                                                 :ellipsize end}]
+                                    [:text-view {:text-color white}]]]])
+              item (get content position)
+              image-view (.getChildAt tile-view 0)
+              linear-layout (.getChildAt tile-view 1)
+              text-top (.getChildAt linear-layout 0)
+              text-spacer (.getChildAt linear-layout 1)
+              bottom-layout (.getChildAt linear-layout 2)
+              text-bottom (.getChildAt bottom-layout 0)
+              text-count (.getChildAt bottom-layout 1)
+              dip-text-size (make-dip context default-text-size)]
+          (.setScaleType image-view android.widget.ImageView$ScaleType/CENTER_CROP)
+          (.setTypeface text-bottom android.graphics.Typeface/DEFAULT_BOLD)
+          (.setLayoutParams tile-view layout-params)
+          (.setPadding text-spacer (- pad) (- pad) (- pad) (- pad))
+          (doseq [text-view [text-top text-bottom text-count]]
+            (set-text-size text-view default-text-size)
+            (.setPadding text-view pad pad pad pad)
+            (.setShadowLayer text-view radius 0 0 black))
+          (if (get item :add-emphasis?)
+            (do
+              (.setTypeface text-top android.graphics.Typeface/DEFAULT_BOLD)
+              (.setGravity text-top android.view.Gravity/CENTER_HORIZONTAL))
+            (do
+              (.setTypeface text-top android.graphics.Typeface/DEFAULT)
+              (.setGravity text-top android.view.Gravity/LEFT)))
+          (when-let [background (get item :background)]
+            (.setBackgroundResource image-view background))
+          (.setText text-top (or (get item :title)
+                                 (get item :body)
+                                 (get item :tag)))
+          (.setText text-bottom (get item :subtitle))
+          (if-let [item-count (get item :count)]
+            (.setText text-count (if (> item-count 0) (str item-count) nil)))
+          (if (and (= (.length (.getText text-bottom)) 0)
+                   (= (.length (.getText text-count)) 0))
+            (.setVisibility bottom-layout android.view.View/GONE))
+          (.setMaxLines text-top
+                        (-> (- tile-view-width pad pad)
+                            (- (if (= (.getVisibility bottom-layout)
+                                      android.view.View/VISIBLE)
+                                 (+ dip-text-size pad pad)
+                                 0))
+                            (/ dip-text-size)
+                            (- 1)
+                            (int)))
+          (.setImageDrawable image-view
+                             (if (nil? (get item :tag))
+                               (create-tile-image context
+                                                  (get item :userhash)
+                                                  (get item :pichash))
+                               (let [tag (get-single-tag-data item)]
+                                 (create-tile-image context
+                                                    (get tag :userhash)
+                                                    (get tag :pichash)))))
+          (.setOnClickListener
+            tile-view
+            (proxy [android.view.View$OnClickListener] []
+              (onClick [view]
+                (tile-action context item))))
+          tile-view)))))
+
+(defn set-grid-view-tiles
+  [tiles view]
+  (doseq [tile tiles]
+    (.addView view tile)))

 (defn get-grid-view
   [context content]
@@ -163,8 +157,6 @@
                        num-columns (int (/ w tile-view-min))]
                    (.setColumnCount this num-columns))
                  (proxy-super onMeasure width-spec height-spec)))]
-    (when (> (count content) 0)
-      (set-grid-view-tiles context content view))
     view))

 (defn get-post-view
@@ -248,17 +240,20 @@
                                 (concat pics)
                                 (remove-dupes-and-nils)
                                 (vec))
-              body-text (tags-encode :post (get post :body))]
+              tiles (create-grid-view-tiles context total-results grid-view)]
           (if (nil? (get post :body))
             (on-ui (toast (get-string :lost_post)))
-            (on-ui (set-text-content context text-view body-text)
-                   (let [date-format (java.text.DateFormat/getDateTimeInstance
-                                       java.text.DateFormat/MEDIUM
-                                       java.text.DateFormat/SHORT)]
-                     (.setText date-view (->> (get post :time)
-                                              (java.util.Date.)
-                                              (.format date-format))))
-                   (set-grid-view-tiles context total-results grid-view))))
+            (on-ui
+              (set-text-content context
+                                text-view
+                                (tags-encode :post (get post :body)))
+              (let [date-format (java.text.DateFormat/getDateTimeInstance
+                                  java.text.DateFormat/MEDIUM
+                                  java.text.DateFormat/SHORT)]
+                (.setText date-view (->> (get post :time)
+                                         (java.util.Date.)
+                                         (.format date-format))))
+              (set-grid-view-tiles tiles grid-view))))
         false))
     view))

@@ -351,8 +346,9 @@
               grid-content (-> first-tiles
                                (concat posts)
                                (remove-dupes-and-nils)
-                               (vec))]
-          (on-ui (set-grid-view-tiles context grid-content grid-view)))
+                               (vec))
+              tiles (create-grid-view-tiles context grid-content grid-view)]
+          (on-ui (set-grid-view-tiles tiles grid-view)))
         false))
     view))

@@ -387,8 +383,9 @@
               grid-content (-> first-tiles
                                (concat results)
                                (remove-dupes-and-nils)
-                               (vec))]
-          (on-ui (set-grid-view-tiles context grid-content grid-view)))
+                               (vec))
+              tiles (create-grid-view-tiles context grid-content grid-view)]
+          (on-ui (set-grid-view-tiles tiles grid-view)))
         false))
     view))


Add test for peek and pop

Add test for peek and pop

--- test/psq/clj_test.clj
+++ test/psq/clj_test.clj
@@ -244,6 +244,18 @@
        (map set (partition-by val (sort-by val (seq m)))))))

+(defn peek-pop-priority-seq [psq]
+  (if (seq psq)
+    (cons (peek psq)
+          (lazy-seq (peek-pop-priority-seq (pop psq))))))
+
+
+(defspec check-peek-pop 100
+  (prop/for-all [m psqgen]
+    (= (psq/priority-seq m)
+       (peek-pop-priority-seq m))))
+
+
 (defspec check-priority-seq-by 100
   (prop/for-all [m (psqgen-by > >)]
     (= (map set (partition-by val (psq/priority-seq m)))


Simplify renaming.

Simplify renaming.

--- src/incognito/base.cljc
+++ src/incognito/base.cljc
@@ -1,26 +1,18 @@
 (ns incognito.base
-  #?(:cljs (:require [clojure.string :as str])))
+  (:require [clojure.string :as str]))

 (defrecord IncognitoTaggedLiteral [tag value])
-
-(defn rec-name-parser [handlers]
-  #?(:clj  handlers
-     :cljs (into {} (map (fn [[k v]]
-                           [(-> k
-                                name
-                                (str/replace-first  #"(?s)(.*)(/)" "$1.")
-                                symbol)
-                            v])
-                         handlers))))

 (defn incognito-reader [read-handlers m]
     (if (read-handlers (:tag m))
            ((read-handlers (:tag m)) (:value m))
            (map->IncognitoTaggedLiteral m)))

+(defn cleanup-cljs-ns [s]
+  (str/replace-first s "/" "."))
+
 (defn incognito-writer [write-handlers r]
-  (let [write-handlers      (rec-name-parser write-handlers)
-        s                   (-> r type pr-str symbol)
+  (let [s                   (-> r type pr-str cleanup-cljs-ns symbol)
         break-map-recursion (if (map? r) (into {} r) r)
         [tag v]             (if (write-handlers s)
                               [s ((write-handlers s) break-map-recursion)]


fixing test

fixing test


Remove lein-pallet-release from :plugins

--- profiles.clj
+++ profiles.clj
@@ -1,6 +1,7 @@
-{:dev {:plugins [[lein-pallet-release "0.1.0-SNAPSHOT"]],
-       :pallet-release {:url "https://pbors:${GH_TOKEN}@github.com/palletops/lein-pallet-release.git",
-                        :branch "master"}},
+{:dev
+ {:pallet-release
+  {:url "https://pbors:${GH_TOKEN}@github.com/palletops/lein-pallet-release.git",
+   :branch "master"}},
  :no-checkouts {:checkout-deps-shares ^{:replace true} []},
  :release {:set-version
            {:updates


[execute] Default train/run contexts `:float` instead of `:double`. (#130)

For a big benefit in speed and a small benefit in space, these should default to :float.

--- src/cortex/nn/execute.clj
+++ src/cortex/nn/execute.clj
@@ -317,7 +317,7 @@
   [network dataset &
    {:keys [batch-size context optimizer datatype]
     :or {batch-size 10
-         datatype :double}}]
+         datatype :float}}]
   (resource/with-resource-context
     (let [optimizer (or optimizer (adam/adam))
           context (or context (compute-context :datatype datatype))
@@ -347,7 +347,7 @@
   generate the actual network loss."
   [network dataset & {:keys [batch-size context datatype loss-outputs?]
                       :or {batch-size 1
-                           datatype :double}
+                           datatype :float}
                       :as options}]
   (resource/with-resource-context
     (let [context (or context (compute-context :datatype datatype))


Add passing case to btree.cljs

Add passing case to btree.cljs

--- src/aurora/btree.cljs
+++ src/aurora/btree.cljs
@@ -895,7 +895,20 @@
               (.assoc! tree3 #js [(+ i 1) (+ i 2)] (* 2 i))))
         j (time (join #js [(iterator tree1) (iterator tree2) (iterator tree3)] 3 #js [#js [true true true] #js [true false true] #js [false true true]]))
         ]
-    (time (iter-seq j))
+    (alength (time (iter-seq j)))
+  )
+
+
+
+  (let [tree (tree 10)
+        _ (dotimes [i 10]
+            (let [i (+ i 0)]
+              (.assoc! tree #js [i i i] (* 2 i))))
+        j (time (join #js [(iterator tree) (iterator tree) (iterator tree)] 4 #js [#js [true false false true false false]
+                                                                                #js [false true false false true false]
+                                                                                #js [false false true false false true]]))
+        ]
+    (alength (time (iter-seq j)))
   )
  )


get log-cmd to show the argument values

get log-cmd to show the argument values

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

--- acqEngine/src/org/micromanager/mm.clj
+++ acqEngine/src/org/micromanager/mm.clj
@@ -32,9 +32,6 @@
   ([] (def gui (MMStudioMainFrame/getInstance))
       (load-mm gui)))

-;(defmacro apply* [& args]
-;  `(~@(butlast args) ~@(eval (last args))))
-
 (defn rekey
   ([m kold knew]
     (-> m (dissoc kold) (assoc knew (get m kold))))
@@ -55,16 +52,21 @@
 (defn log [& x]
   (.logMessage mmc (apply str x) true))

-(defmacro log-cmd [expr]
-  `(do (log '~expr)
-    (let [result# ~expr]
-      (if (nil? result#)
-        (log "  --> nil")
-        (log "  --> " result#))
-      result#)))
+(defmacro log-cmd
+  ([cmd-count expr]
+    (let [cmd# (take cmd-count expr)
+          args# (map eval (drop cmd-count expr))]
+      `(do
+      (log (.trim (prn-str (concat '~cmd# '~args#))))
+      (let [result# ~(concat cmd# args#)]
+        (if (nil? result#)
+          (log "  --> nil")
+          (log "  --> " result#))
+        result#))))
+  ([expr] (log-cmd 1 expr)))

 (defmacro core [& args]
-  `(log-cmd (. mmc ~@args)))
+  `(log-cmd 3 (. mmc ~@args)))

 (defmacro when-lets [bindings & body]
   (assert (vector? bindings))


core: random-sample

core: random-sample

--- core/data/core.clj
+++ core/data/core.clj
@@ -3803,3 +3803,10 @@
    (when (seq coll)
      (cons (first coll)
            (dedupe (drop-while #(= (first coll) %) (rest coll)))))))
+
+(defn random-sample
+  "Returns items from coll with random probability of prob (0.0 -
+  1.0)."
+  {:added "1.0"}
+  [prob coll]
+  (filter (fn [_] (< (rand) prob)) coll))


Fixed missing parameter usage

Fixed missing parameter usage

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/extensions/core.cljs
+++ src/status_im/extensions/core.cljs
@@ -394,7 +394,7 @@
 (defn text [o & children]
   (if (map? o)
     (into [react/text o] (map wrap-text-child children))
-    (into [react/text o] (map wrap-text-child children))))
+    (into [react/text {} o] (map wrap-text-child children))))

 (defn- wrap-view-child [child]
   (if (vector? child) child [text {} child]))


add missing app strings to french and clean non used ones

--- src/status_im/translations/fr.cljs
+++ src/status_im/translations/fr.cljs
@@ -2,31 +2,34 @@

 (def translations
   {
-   ;common
+   ;;common
    :members-title                         "Membres"
-   :not-implemented                       "! Pas disponible"
-   :chat-name                             "Pseudo"
+   :not-implemented                       "! Non disponible"
+   :chat-name                             "Pseudonyme"
    :notifications-title                   "Notifications et sons"
    :offline                               "Hors ligne"
    :search-for                            "Rechercher..."
    :cancel                                "Annuler"
    :next                                  "Suivant"
+   :open                                  "Ouvrir"
+   :description                           "Description"
+   :url                                   "URL"
    :type-a-message                        "Saisissez un message..."
    :type-a-command                        "Saisissez une commande..."
    :error                                 "Erreur"
+   :unknown-status-go-error               "Erreur status-go inconnue"
+   :node-unavailable                      "Aucun noeud ethereum n'est disponible"
+   :yes                                   "Oui"
+   :no                                    "Non"

    :camera-access-error                   "Merci d'aller dans vos paramètres système et de vous assurer que Status > Caméra est sélectionné afin d'accorder la permission d'utiliser votre caméra."
    :photos-access-error                   "Merci d'aller dans vos paramètres système et de vous assurer que Status > Photos est sélectionné afin d'accorder la permission d'utiliser vos photos."

-   ;drawer
-   :invite-friends                        "Inviter des amis"
-   :faq                                   "FAQ"
+   ;;drawer
    :switch-users                          "Changer d'utilisateur"
-   :feedback                              "Des remarques?\nSecouez votre téléphone!"
-   :view-all                              "Voir tout"
    :current-network                       "Le réseau actuel"

-   ;chat
+   ;;chat
    :is-typing                             "écrit..."
    :and-you                               "et vous"
    :search-chat                           "Rechercher un chat"
@@ -46,11 +49,11 @@
    :faucet-success                        "La demande de Faucet a été reçue"
    :faucet-error                          "Erreur avec la demande de Faucet"

-   ;sync
+   ;;sync
    :sync-in-progress                      "Synchronisation en cours..."
    :sync-synced                           "Synchronisé"

-   ;messages
+   ;;messages
    :status-sending                        "Envoi en cours..."
    :status-pending                        "En attente..."
    :status-sent                           "Envoyé"
@@ -69,21 +72,17 @@
                                            :other "heures"}
    :datetime-day                          {:one   "jour"
                                            :other "jours"}
-   :datetime-multiple                     "s"
    :datetime-ago                          "il y a"
    :datetime-yesterday                    "hier"
    :datetime-today                        "aujourd'hui"

-   ;profile
+   ;;profile
    :profile                               "Profil"
    :edit-profile                          "Modifier profil"
-   :report-user                           "DÉNONCER UN UTILISATEUR"
    :message                               "Message"
-   :username                              "Nom d'utilisateur"
    :not-specified                         "Non spécifié"
    :public-key                            "Clé publique"
    :phone-number                          "Numéro de téléphone"
-   :email                                 "Adresse e-mail"
    :update-status                         "Actualisez votre statut..."
    :add-a-status                          "Ajoutez un statut..."
    :status-prompt                         "Créez un nouveau statut pour partager vos intérêts avec tout le monde. Vous pouvez aussi utiliser les #hashtags."
@@ -92,15 +91,13 @@
    :remove-from-contacts                  "Supprimer des contacts"
    :start-conversation                    "Débuter une conversation"
    :send-transaction                      "Envoyer une transaction"
-   :share-qr                              "Partager QR"
-   :error-incorrect-name                  "Veuillez choisir un autre nom"
-   :error-incorrect-email                 "Adresse e-mail incorrecte"
+   :testnet-text                          "Vous êtes connecté au réseau de test {{testnet}}. Surtout n'envoyez jamais de vrai ETH ou SNT vers vos adresses"
+   :mainnet-text                          "Vous êtes sur le réseau principal. Vous pouvez envoyer de vrai ETH"

    ;;make_photo
    :image-source-title                    "Photo de profil"
    :image-source-make-photo               "Capturer"
    :image-source-gallery                  "Sélectionner dans la galerie"
-   :image-source-cancel                   "Annuler"

    ;;sharing
    :sharing-copy-to-clipboard             "Copier vers le presse-papiers"
@@ -108,20 +105,17 @@
    :sharing-cancel                        "Annuler"

    :browsing-title                        "Naviguer"
-   :browsing-browse                       "@naviguer"
    :browsing-open-in-web-browser          "Ouvrir dans le navigateur"
    :browsing-cancel                       "Annuler"

-   ;sign-up
+   ;;sign-up
    :contacts-syncronized                  "Vos contacts ont été synchronisés"
    :confirmation-code                     (str "Merci ! Nous vous avons envoyé un message texte contenant le code "
                                                "de confirmation. Veuillez fournir ce code pour confirmer votre numéro de téléphone")
    :incorrect-code                        (str "Désolé, le code est incorrect. Veuillez le saisir à nouveau.")
-   :generate-passphrase                   (str "Je vais créer une phrase secrète pour vous permettre de restaurer votre "
-                                               "accès ou de vous connecter depuis un autre périphérique")
    :phew-here-is-your-passphrase          "*Ouf* c'était dur, voici votre phrase secrète, *écrivez-la et gardez-la en lieu sûr !* Vous en aurez besoin pour restaurer votre compte."
    :here-is-your-passphrase               "Voici votre phrase secrète, *écrivez-la et gardez-la en lieu sûr !* Vous en aurez besoin pour restaurer votre compte."
-   :written-down                          "Assurez-vous de l'avoir bien écrite"
+   :here-is-your-signing-phrase           "Voici votre phrase de signature. Vous l'utiliserez pour vérifier vos signatures. *Ecrivez la et conservez la soigneusement!*"
    :phone-number-required                 "Appuyez ici pour entrer votre numéro de téléphone et je vais trouver vos amis"
    :shake-your-phone                      "Vous avez trouvé un bug ou alors avez une suggestion? ~Secouez~ simplement votre téléphone!"
    :intro-status                          "Chattez avec moi pour configurer votre compte et modifier vos paramètres !"
@@ -130,15 +124,14 @@
    :move-to-internal-failure-message      "Nous devons déplacer des fichiers importants depuis un stockage extérieur vers un stockage local. Afin de faire cela, nous avons besoin de votre permission. Nous n'utiliserons plus de stockage extérieur dans nos futures versions."
    :debug-enabled                         "Le serveur Debug a été lancé! Vous pouvez désormais utiliser *status-dev-cli scan* pour trouver le serveur depuis votre ordinateur sur le même réseau."

-   ;phone types
+   ;;phone types
    :phone-e164                            "International 1"
    :phone-international                   "International 2"
    :phone-national                        "National"
    :phone-significant                     "Significatif"

-   ;chats
+   ;;chats
    :chats                                 "Chats"
-   :new-chat                              "Nouveau chat"
    :delete-chat                           "Supprimer chat"
    :new-group-chat                        "Nouveau chat de groupe"
    :new-public-group-chat                 "Rejoindre chat public"
@@ -148,19 +141,29 @@
    :topic-format                          "Mauvais format [a-z0-9\\-]+"
    :public-group-topic                    "Sujet"

-   ;discover
+   ;;discover
    :discover                              "Découvrir"
    :none                                  "Aucun"
    :search-tags                           "Entrez vos mots clés ici"
    :popular-tags                          "Mots-clés populaires"
    :recent                                "Récent"
+   :no-statuses-found                     "Aucun statut trouvé"
+   :chat                                  "Chat"
+   :all                                   "Tout"
+   :public-chats                          "Chats publics"
+   :soon                                  "Prochainement"
+   :public-chat-user-count                "{{count}} personnes"
+   :dapps                                 "ÐApps"
+   :dapp-profile                          "profile ÐApp"
    :no-statuses-discovered                "Aucun statut découvert"
-   :no-statuses-found                     "Aucun statut trouvé"
-
-   ;settings
+   :no-statuses-discovered-body           "Quand quelqu'un écrira un post\nvous le verrez ici."
+   :no-hashtags-discovered-title          "Aucun #hashtag trouvé"
+   :no-hashtags-discovered-body           "Quand un #hashtag devient\npopulaire vous le verrez ici."
+
+   ;;settings
    :settings                              "Paramètres"

-   ;contacts
+   ;;contacts
    :contacts                              "Contacts"
    :new-contact                           "Nouveau contact"
    :delete-contact                        "Supprimer contact"
@@ -168,9 +171,6 @@
    :remove-from-group                     "Supprimer ce groupe"
    :edit-contacts                         "Modifier contacts"
    :search-contacts                       "Rechercher contacts"
-   :show-all                              "TOUT AFFICHER"
-   :contacts-group-dapps                  "ÐApps"
-   :contacts-group-people                 "Personnes"
    :contacts-group-new-chat               "Démarrer un nouveau chat"
    :choose-from-contacts                  "Ajouter depuis mes contacts"
    :no-contacts                           "Pas encore de contacts"
@@ -178,58 +178,41 @@
    :enter-address                         "Entrer Adresse"
    :more                                  "plus"

-   ;group-settings
+   ;;group-settings
    :remove                                "Retirer"
    :save                                  "Sauvegarder"
    :delete                                "Supprimer"
-   :change-color                          "Changer la couleur"
    :clear-history                         "Effacer l'historique"
    :mute-notifications                    "Couper le son des notifications"
    :leave-chat                            "Quitter le chat"
-   :delete-and-leave                      "Supprimer et quitter"
    :chat-settings                         "Paramètres de chat"
    :edit                                  "Modifier"
    :add-members                           "Ajouter des membres"
-   :blue                                  "Bleu"
-   :purple                                "Violet"
-   :green                                 "Vert"
-   :red                                   "Rouge"
-
-   ;commands
-   :money-command-description             "Envoyer de l'argent"
-   :location-command-description          "Envoyer l'emplacement"
-   :phone-command-description             "Envoyer le numéro de téléphone"
-   :phone-request-text                    "Demande de numéro de téléphone"
-   :confirmation-code-command-description "Envoyer le code de confirmation"
-   :confirmation-code-request-text        "Demande de code de confirmation"
-   :send-command-description              "Envoyer l'emplacement"
-   :request-command-description           "Envoyer une demande"
-   :keypair-password-command-description  ""
-   :help-command-description              "Aide"
-   :request                               "Demande"
+
+   ;;commands
    :chat-send-eth                         "{{amount}} ETH"
-   :chat-send-eth-to                      "{{amount}} ETH à {{chat-name}}"
-   :chat-send-eth-from                    "{{amount}} ETH de {{chat-name}}"
-
-   ;new-group
-   :group-chat-name                       "Pseudo"
-   :empty-group-chat-name                 "Veuillez saisir un nom"
-   :illegal-group-chat-name               "Veuillez choisir un autre nom"
+
+   ;;location command
+   :your-current-location                 "Votre localisation actuelle"
+   :places-nearby                         "Endroits proches"
+   :search-results                        "Résultats de recherche"
+   :dropped-pin                           "Repère placé"
+   :location                              "Localisation"
+   :open-map                              "Ouvrir la carte"
+   :sharing-copy-to-clipboard-address     "Copier l'adresse"
+   :sharing-copy-to-clipboard-coordinates "Copier les coordonnées"
+
+   ;;new-group
    :new-group                             "Nouveau groupe"
    :reorder-groups                        "Réarranger les groupes"
-   :group-name                            "Nom du groupe"
    :edit-group                            "Modifier groupe"
-   :delete-group                          "Supprimer group"
+   :delete-group                          "Supprimer le groupe"
    :delete-group-confirmation             "Ce groupe sera enlevé de vos groupes. Cela n'affectera pas vos contacts"
    :delete-group-prompt                   "Cela n'affectera pas vos contacts"
-   :group-members                         "Membres du groupe"
    :contact-s                             {:one   "contact"
                                            :other "contacts"}
-   ;participants
-   :add-participants                      "Ajouter des participants"
-   :remove-participants                   "Supprimer des participants"
-
-   ;protocol
+
+   ;;protocol
    :received-invitation                   "invitation de chat reçue"
    :removed-from-chat                     "vous avez été retiré du chat de groupe"
    :left                                  "est parti(e)"
@@ -237,78 +220,146 @@
    :removed                               "supprimé"
    :You                                   "Vous"

-   ;new-contact
+   ;;new-contact
    :add-new-contact                       "Ajouter un nouveau contact"
-   :import-qr                             "Importer"
    :scan-qr                               "Scanner le QR"
-   :swow-qr                               "Montrer le QR"
    :name                                  "Nom"
-   :whisper-identity                      "Murmurer l'identité"
    :address-explication                   "Peut-être qu'ici devrait se trouver un texte expliquant ce qu'est une adresse et où la chercher"
-   :enter-valid-address                   "Veuillez saisir une adresse valide ou scanner un code QR"
    :enter-valid-public-key                "Veuillez saisir une clé publique valide ou scanner un code QR"
    :contact-already-added                 "Le contact a déjà été ajouté"
    :can-not-add-yourself                  "Vous ne pouvez pas vous ajouter vous-même"
    :unknown-address                       "Adresse inconnue"

-
-   ;login
+   ;;login
    :connect                               "Connecter"
    :address                               "Adresse"
    :password                              "Mot de passe"
-   :login                                 "Connexion"
-   :sign-in-to-status                     "S'inscrire à Status"
-   :sign-in                               "Inscription"
+   :sign-in-to-status                     "Se connecter à Status"
+   :sign-in                               "Se connecter"
    :wrong-password                        "Mot de passe incorrect"
-
-   ;recover
-   :recover-from-passphrase               "Restaurer avec la phrase secrète"
-   :recover-explain                       "Veuillez saisir la phrase secrète correspondant à votre mot de passe pour restaurer votre accès"
+   :enter-password                        "Saisir le mot de passe"
+
+   ;;recover
    :passphrase                            "Phrase secrète"
    :recover                               "Restaurer"
-   :enter-valid-passphrase                "Veuillez saisir une phrase secrète"
-   :enter-valid-password                  "Veuillez saisir un mot de passe"
    :twelve-words-in-correct-order         "12 mots dans l'ordre"

-   ;accounts
+   ;;accounts
    :recover-access                        "Restaurer l'accès"
-   :add-account                           "Ajouter un compte"
    :create-new-account                    "Créer un nouveau compte"

-   ;wallet-qr-code
+   ;;wallet-qr-code
    :done                                  "Terminé"
-   :main-wallet                           "Portefeuille principal"
-
-   ;validation
+
+   ;;validation
    :invalid-phone                         "Numéro de téléphone invalide"
    :amount                                "Montant"
-   :not-enough-eth                        (str "Pas assez d'ETH sur le solde "
-                                               "({{balance}} ETH)")
-   ;transactions
+
+   ;;transactions
    :confirm                               "Confirmer"
-   :confirm-transactions                  {:one   "Confirmer la transaction"
-                                           :other "Confirmer {{count}} transactions"
-                                           :zero  "Aucune transaction"}
-   :transactions-confirmed                {:one   "Transaction confirmée"
-                                           :other "{{count}} transactions confirmées"
-                                           :zero  "Aucune transaction confirmée"}
    :transaction                           "Transaction"
-   :unsigned-transactions                 "Transactions non signées"
-   :no-unsigned-transactions              "Aucune transaction non signée"
-   :enter-password-transactions           {:one   "Confirmez la transaction en saisissant votre mot de passe"
-                                           :other "Confirmez les transactions en saisissant votre mot de passe"}
+   :unsigned-transaction-expired          "La transaction non signée a expiré"
    :status                                "Statut"
-   :pending-confirmation                  "Confirmation en attente"
    :recipient                             "Destinataire"
-   :one-more-item                         "Encore un élément"
-   :fee                                   "Frais"
-   :estimated-fee                         "Frais Estimés"
-   :value                                 "Valeur"
    :to                                    "à"
    :from                                  "de"
    :data                                  "Données"
    :got-it                                "Compris"
-   :contract-creation                     "Création du contrat"
-
-   ;:webview
-   :web-view-error                        "Oops, erreur"})
+   :block                                 "Bloc"
+   :hash                                  "Hash"
+   :gas-limit                             "limite Gas"
+   :gas-price                             "prix Gas"
+   :gas-used                              "Gas utilisé"
+   :cost-fee                              "Coût/Frais"
+   :nonce                                 "Nonce"
+   :confirmations                         "Confirmations"
+   :confirmations-helper-text             "Veuillez attendre au moins 12 confirmations pour être sûr que votre transaction a bien été définitivement validée"
+   :copy-transaction-hash                 "Copier le hash de la transaction"
+   :open-on-etherscan                     "Ouvrir sur Etherscan.io"
+
+   ;;webview
+   :web-view-error                        "Oops, erreur"
+
+   ;;testfairy warning
+   :testfairy-title                       "Avertissement!"
+   :testfairy-message                     "Vous utilisez une application installée à partir d'une version de développement. À des fins de test, cette version inclut l'enregistrement de session si la connexion Wi-Fi est utilisée. Toutes vos interactions avec cette application sont sauvegardées (vidéo et logs) et pourraient être utilisées par notre équipe de développement pour enquêter sur d'éventuels problèmes. Les vidéos / logs enregistrés n'incluent pas vos mots de passe. L'enregistrement est effectué uniquement si l'application est installée à partir d'une version instable (nightly builds). Rien n'est enregistré si l'application est installée depuis PlayStore ou TestFlight."
+
+   ;; wallet
+   :wallet                                "Portefeuille"
+   :wallets                               "Portefeuilles"
+   :your-wallets                          "Vos portefeuilles"
+   :main-wallet                           "Portefeuille principal"
+   :wallet-error                          "Erreur survenue lors du chargement de données"
+   :wallet-send                           "Envoyé"
+   :wallet-request                        "Requête"
+   :wallet-exchange                       "Echange"
+   :wallet-assets                         "Actifs"
+   :wallet-add-asset                      "Ajouter un actif"
+   :wallet-total-value                    "Valeur totale"
+   :wallet-settings                       "Paramètres du portefeuille"
+   :signing-phrase-description            "Signez la transaction en saisissant votre mot de passe. Assurez-vous que les mots ci-dessus correspondent à votre phrase de signature secrète"
+   :wallet-insufficient-funds             "Fonds insuffisants"
+   :request-transaction                   "Effectuer une transaction"
+   :send-request                          "Envoyer la requête"
+   :share                                 "Partager"
+   :eth                                   "ETH"
+   :currency                              "Devise"
+   :usd-currency                          "USD"
+   :transactions                          "Transactions"
+   :transaction-details                   "Détails de la transaction"
+   :transaction-failed                    "Transaction échouée"
+   :transactions-sign                     "Signer"
+   :transactions-sign-all                 "Tout signer"
+   :transactions-sign-transaction         "Signer la transaction"
+   :transactions-sign-later               "Signer ultérieurement"
+   :transactions-delete                   "Supprimer la transaction"
+   :transactions-delete-content           "La transaction va être enlevée de la liste 'Non-Signées'"
+   :transactions-history                  "Historique"
+   :transactions-unsigned                 "Non-Signées"
+   :transactions-history-empty            "Aucune transaction dans votre historique pour le moment"
+   :transactions-unsigned-empty           "Vous n'avez aucune transaction non signée"
+   :transactions-filter-title             "Filtrer l'historique"
+   :transactions-filter-tokens            "Tokens"
+   :transactions-filter-type              "Type"
+   :transactions-filter-select-all        "Tout sélectionner"
+   :view-transaction-details              "Voir le détail de la transaction"
+   :transaction-description               "Veuillez attendre au moins 12 confirmations pour être sûr que votre transaction a bien été définitivement validée"
+   :transaction-sent                      "Transaction envoyée"
+   :transaction-moved-text                "La transaction va rester dans la liste 'Non-signées' pendant 5 mins"
+   :transaction-moved-title               "Transaction déplacée"
+   :sign-later-title                      "Voulez vous signer la transaction ultérieurement?"
+   :sign-later-text                       "Vous pourrez signer la transaction dans l'historique des transactions"
+   :not-applicable                        "Ne s'applique pas aux transactions non signées"
+
+   ;; Wallet Send
+   :wallet-choose-recipient               "Choisir le destinataire"
+   :wallet-choose-from-contacts           "Choisir à partir des Contacts"
+   :wallet-address-from-clipboard         "Utiliser l'adresse du presse-papiers"
+   :wallet-invalid-address                "Adresse invalide: \n {{data}}"
+   :wallet-browse-photos                  "Parcourir les Photos"
+   :validation-amount-invalid-number      "Le montant n'est pas un nombre valide"
+   :validation-amount-is-too-precise      "Le montant est trop précis. La plus petite unité que vous pouvez saisir est 1 Wei (1x10^-18 ETH)"
+
+
+
+   ;; network settings
+   :new-network                           "Nouveau réseau"
+   :add-network                           "Ajouter un réseau"
+   :add-new-network                       "Ajouter un nouveau réseau"
+   :existing-networks                     "Réseaux existants"
+   :add-json-file                         "Ajouter un fichier JSON"
+   :paste-json-as-text                    "Coller JSON en texte"
+   :paste-json                            "Coller JSON"
+   :specify-rpc-url                       "Préciser une URL RPC"
+   :edit-network-config                   "Modifier la configuration réseau"
+   :connected                             "Connecté"
+   :process-json                          "Interpréter le JSON"
+   :error-processing-json                 "Erreur survenue lors de l'interprétation du JSON"
+   :rpc-url                               "URL RPC"
+   :remove-network                        "Supprimer le réseau"
+   :network-settings                      "Paramètres réseau"
+   :edit-network-warning                  "Soyez prudent, la modification des données réseau pourrait rendre ce réseau inutilisable pour vous"
+   :connecting-requires-login             "Il faut s'identifier pour se connecter à un nouveau réseau"
+   :close-app-title                       "Avertissement!"
+   :close-app-content                     "L'application va s'arrêter et se fermer. Lors de la prochaine ouverture, le réseau sélectionné sera utilisé"
+   :close-app-button                      "Confirmer"})


Fix test failure to load nio.file.Files on JDK 1.6

--- src/test/clojure/clojure/tools/namespace/dir_test.clj
+++ src/test/clojure/clojure/tools/namespace/dir_test.clj
@@ -25,7 +25,8 @@
     (.invoke to-file link (object-array 0))))

 ;; Only run this test on Java 1.7+, where java.nio.file.Files is available.
-(when (Class/forName "java.nio.file.Files")
+(when (try (Class/forName "java.nio.file.Files")
+           (catch ClassNotFoundException _ false))
   (deftest t-scan-by-canonical-path
     (let [dir (help/create-temp-dir "t-scan-by-canonical-path")
           main-clj (help/create-source dir 'example.main :clj '[example.one])


Add a fixme about the hard coded producer-raw-to-producer mapping

--- src/catalog/vubis.clj
+++ src/catalog/vubis.clj
@@ -134,6 +134,14 @@
    "MN" :musiknoten
    "TB" :taktilesbuch})

+;; FIXME: The following data changes once in a while (probably once a
+;; year), so it would make sense to store it somewhere where the users
+;; could configure it without the need for a recompile. I changed it
+;; so that this data would be read from a database. However there is
+;; also the validation that depends on this data. The validation
+;; schema is built at compile time. TBH I'm not sure if the validation
+;; schema could be built at run time. So the change has been rolled
+;; back (see 9304cb01c31b6ed4b513bc7c404d8e5d463f606e).
 (def producer-raw-to-producer
   "Mapping between producer-raw and producer"
   {1   "Blista, Marburg"


clone api

clone api

--- src/celestial/api.clj
+++ src/celestial/api.clj
@@ -170,6 +170,13 @@
            (catch [:type :celestial.persistency/missing-type] e
              (bad-req {:msg (<< "Cannot create machine with missing type ~(e :t)}")}))))

+  #_(POST- "/host/system-clone" [^:id id] {:nickname "cloneSystem" :summary "Clone an existing system replacing unique identifiers along the way"
+                                         :errorResponses (errors {:bad-req "Missing system type"})}
+         (if-not (p/system-exists? id)
+           (conflict {:msg "System does not exists, use POST /host/system first"})
+           (let [system (p/get-system id) clone-id (p/add-system system)]
+             (success {:msg "system cloned" :id clone-id}))))
+
   (PUT- "/host/system/:id" [^:int id & ^:system system] {:nickname "updateSystem" :summary "Update system"
                                                          :errorResponses (errors {:conflict "System does not exist"}) }
         (if-not (p/system-exists? id)
@@ -185,7 +192,7 @@
              (bad-req {:msg "Host does not exist"})))

   (GET- "/host/type/:id" [^:int id] {:nickname "getSystemType" :summary "Fetch type of provided system id"}
-          (success (select-keys (p/type-of (:type (p/get-system id))) [:classes])))
+        (success (select-keys (p/type-of (:type (p/get-system id))) [:classes])))

   (POST- "/type" [^:string type & ^:type props] {:nickname "addType" :summary "Add type"}
          (p/new-type type props)


email: remove testing prn

email: remove testing prn

--- reimann/src/reimann/email.clj
+++ reimann/src/reimann/email.clj
@@ -44,4 +44,4 @@
         (let [opts (if (empty? recipients)
                      opts
                      (merge opts {:to recipients}))]
-          (prn (email-event opts event)))))))
+          (email-event opts event))))))


Whitespace

Whitespace

--- src/foreclojure/users.clj
+++ src/foreclojure/users.clj
@@ -27,7 +27,7 @@
   (let [users (from-mongo
                (fetch :users
                       :only [:user :solved :contributor]))
-        sortfn  (comp - count :solved)]
+        sortfn (comp - count :solved)]
     (sort-by sortfn users)))

 (defn get-user-with-ranking [username, users]
@@ -81,28 +81,29 @@
   (let [username (session/session-get :user)
         {:keys [user-ranking top-100]} (get-top-100-and-current-user username)]
     {:title "Top 100 Users"
-    :content
-    (list
-     [:h1 "Top 100 Users"]
-     (format-user-ranking user-ranking)
-     [:div
-      [:span.contributor "*"] " "
-      (link-to repo-url "4clojure contributor")]
-     [:br]
-     [:table#user-table.my-table
-      [:thead
-       [:tr
-        [:th {:style "width: 40px;"} "Rank"]
-        [:th "Username"]
-        [:th "Problems Solved"]]]
-      (map-indexed (fn [rownum {:keys [user contributor solved]}]
-                     [:tr (row-class rownum)
-                      [:td (inc rownum)]
-                      [:td
-                       (when contributor [:span.contributor "* "])
-                       [:a.user-profile-link {:href (str "/user/" user)} user]]
-                      [:td.centered (count solved)]])
-                   top-100)])}))
+     :content
+     (list
+      [:p {:style "margin: 0;"} "(click " (link-to "/users/all" "here") " to list all users)"]
+      [:h1 "Top 100 Users"]
+      (format-user-ranking user-ranking)
+      [:div
+       [:span.contributor "*"] " "
+       (link-to repo-url "4clojure contributor")]
+      [:br]
+      [:table#user-table.my-table
+       [:thead
+        [:tr
+         [:th {:style "width: 40px;"} "Rank"]
+         [:th "Username"]
+         [:th "Problems Solved"]]]
+       (map-indexed (fn [rownum {:keys [user contributor solved]}]
+                      [:tr (row-class rownum)
+                       [:td (inc rownum)]
+                       [:td
+                        (when contributor [:span.contributor "* "])
+                        [:a.user-profile-link {:href (str "/user/" user)} user]]
+                       [:td.centered (count solved)]])
+                    top-100)])}))

 ;; TODO: this is snagged from problems.clj but can't be imported due to cyclic dependency, must refactor this out.


Move boolean options to (opt req <option>)

Clean up some of the options that were added that should have used the option
checking via `clj-http.util/opt`.

--- src/clj_http/core.clj
+++ src/clj_http/core.clj
@@ -113,9 +113,8 @@
                               socket-timeout
                               conn-request-timeout
                               max-redirects
-                              allow-circular-redirects
-                              allow-relative-redirects
-                              cookie-policy]}]
+                              cookie-policy]
+                       :as req}]
   (let [config (-> (RequestConfig/custom)
                    (.setConnectTimeout (or conn-timeout -1))
                    (.setSocketTimeout (or socket-timeout -1))
@@ -123,9 +122,10 @@
                     (or conn-request-timeout -1))
                    (.setRedirectsEnabled true)
                    (.setCircularRedirectsAllowed
-                    (boolean allow-circular-redirects))
+                    (boolean (opt req :allow-circular-redirects)))
                    (.setRelativeRedirectsAllowed
-                    ((complement false?) allow-relative-redirects))
+                    ((complement false?)
+                     (opt req :allow-relative-redirects)))
                    (.setCookieSpec (get-cookie-policy cookie-policy)))]
     (when max-redirects (.setMaxRedirects config max-redirects))
     (.build config)))
@@ -461,7 +461,7 @@
                      (failed [this ex]
                        (when-not (conn/reusable? conn-mgr)
                          (conn/shutdown-manager conn-mgr))
-                       (if (:ignore-unknown-host? req)
+                       (if (opt req :ignore-unknown-host)
                          ((:unknown-host-respond req) nil)
                          (raise ex)))
                      (completed [this resp]


half work

half work

--- src/codestat/core.clj
+++ src/codestat/core.clj
@@ -6,7 +6,24 @@
   [& args]
   (println "Hello, World!"))

+(defn get-body
+	"get the body"
+	[body]
+	(binding [*in* body]
+	(loop [input1 (read-line)]
+
+		(if input (recur (read-line)) (str input)))))
+
+
 (defn handler
    "ring handler"
-   [& args]
- "Hello World.")
+   [req]
+   (let [ret (str "uri:" (:uri req)
+     	"\nscheme:" (:scheme req)
+	"\nrequest-method:" (:request-method req)
+	)]
+	(spit "/tmp/test" (get-body (:body req)) )
+   {:status 200
+    :headers {"Content-Type" "text/plain"}
+    :body ret
+	}))


Fixed a type in move-node-by

Fixed a type in move-node-by

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

--- conexp/graphics/base.clj
+++ conexp/graphics/base.clj
@@ -145,8 +145,8 @@
 	[new-x new-y] [(+ x dx) (+ y dy)]]

     ; move node on the device
-    (let [[dx-1 dy-1] (world-to-device scn dx dy)
-	  [zx zy]     (world-to-device scn 0 0)
+    (let [[dx-1 dy-1] (world-to-device (.getScene node) dx dy)
+	  [zx zy]     (world-to-device (.getScene node) 0 0)
 	  device-dx   (- dx-1 zx)
 	  device-dy   (- dy-1 zy)]
       (doseq [segment (.getSegments node)]


iron-list

iron-list

--- iron-list/src/clj/iron_list/hiccup/iron_list.clj
+++ iron-list/src/clj/iron_list/hiccup/iron_list.clj
@@ -38,6 +38,16 @@
                  :last-response "{{data}}",
                  :auto "auto"}]

+
+    ;; <iron-ajax id="get_filltext_ajax" auto
+    ;;   url="//www.filltext.com/"
+    ;;   params='{"rows": "1000", "fname":"{firstName}", "lname": "{lastName}", "address": "{streetAddress}",
+    ;;    "city": "{city}", "state": "{usState|abb}", "zip": "{zip}", "integer": "{number|100}",
+    ;;    "business": "{business}", "index": "{index}"}'
+    ;;   handle-as="json"
+    ;;   loading="{{loading}}"
+    ;;   last-response="{{people}}">
+
     [:paper-scroll-header-panel.fit
      {:condenses true
       :keep-condensed-header true}


make select-all include the whole first line

--- src/lt/objs/editor.cljs
+++ src/lt/objs/editor.cljs
@@ -251,7 +251,7 @@

 (defn select-all [e]
   (set-selection e
-                 {:line (first-line e)}
+                 {:line (first-line e) :ch 0}
                  {:line (last-line e)}))

 (defn clear-history [e]


Sanity check that using new instead of dot works

--- test/cljs/go_test.clj
+++ test/cljs/go_test.clj
@@ -128,7 +128,8 @@
           3.14 '(js/ParseFloat "3.14")
           3 '(Math/floor 3.14))
     (test "New"
-          "&js.Date{Millis: 0}" '(js/Date. 0))
+          "&js.Date{Millis: 0}" '(js/Date. 0)
+          "&js.Date{Millis: 0}" '(new js/Date 0))
     (test "Dot"
           1970 '(.getUTCFullYear (js/Date. 0))
           "`f`" '(.charAt "foo" 0))


Remove statix mixin from shape component.

--- src/uxbox/ui/workspace/canvas.cljs
+++ src/uxbox/ui/workspace/canvas.cljs
@@ -79,11 +79,11 @@
                   :on-mouse-up on-mouse-up}
         (shapes/-render shape nil)]))))

-(def shape
+(def ^:static shape
   (mx/component
    {:render shape-render
     :name "shape"
-    :mixins [mx/static (mx/local {})]}))
+    :mixins [(mx/local {}) rum/reactive]}))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Canvas


Enabled criterium output redirection.

Enabled criterium output redirection.

--- src/validation_benchmark/bench.clj
+++ src/validation_benchmark/bench.clj
@@ -32,9 +32,8 @@

 (defn real [f]
-  ;; (stdout->tmpfile "criterium"
-  ;;                  (summarize (criterium/benchmark* f nil)))
-  (summarize (criterium/benchmark* f nil)))
+  (stdout->tmpfile "criterium"
+                   (summarize (criterium/benchmark* f nil))))

 (defn summarize [results]


Pass routes to the server as a var, resolves #143.

--- src/gorilla_repl/core.clj
+++ src/gorilla_repl/core.clj
@@ -113,7 +113,7 @@
     ;; first startup nREPL
     (nrepl/start-and-connect nrepl-requested-port)
     ;; and then the webserver
-    (server/run-server app-routes {:port webapp-port :join? false :ip ip})
+    (server/run-server #'app-routes {:port webapp-port :join? false :ip ip})
     (spit (doto (io/file ".gorilla-port") .deleteOnExit) webapp-port)
     (println (str "Running at http://localhost:" webapp-port "/worksheet.html ."))
     (println "Ctrl+C to exit.")))


add support of nested bq row

add support of nested bq row

--- src/datasplash/bq.clj
+++ src/datasplash/bq.clj
@@ -44,9 +44,13 @@
       (reduce
        (fn [acc k]
          (assoc! acc (keyword k)
-                 (if auto-parse
-                   (auto-parse-val (.get row k))
-                   (.get row k))))
+                 (let [raw-v (.get row k)]
+                   (cond
+                     (sequential? raw-v) (if (instance? java.util.AbstractMap (first raw-v))
+                                           (map #(table-row->clj {:auto-parse auto-parse} %) raw-v)
+                                           (map #(if auto-parse (auto-parse-val %) %) raw-v))
+                     (instance? java.util.AbstractMap raw-v) (table-row->clj {:auto-parse auto-parse} raw-v)
+                     :else (if auto-parse (auto-parse-val raw-v) raw-v)))))
        (transient {}) keyset))))
   ([row] (table-row->clj {} row)))


Remove unused code from datoteka.impl ns.

--- src/datoteka/impl.clj
+++ src/datoteka/impl.clj
@@ -25,8 +25,7 @@
 (ns datoteka.impl
   "Implementation details and helpers."
   (:require [datoteka.proto :as pt]
-            [datoteka.fs :as fs]
-            [buddy.core.codecs :as codecs]
+            [datoteka.core :as fs]
             [clojure.java.io :as io])
   (:import java.io.File
            java.io.ByteArrayInputStream
@@ -40,31 +39,12 @@
 (extend-protocol pt/IContent
   String
   (-input-stream [v]
-    (ByteArrayInputStream. (codecs/str->bytes v)))
+    (let [data (.getBytes v "UTF-8")]
+      (ByteArrayInputStream. ^bytes data)))

-  Path
+  Object
   (-input-stream [v]
-    (io/input-stream v))
-
-  File
-  (-input-stream [v]
-    (io/input-stream v))
-
-  URI
-  (-input-stream [v]
-    (io/input-stream v))
-
-  URL
-  (-input-stream [v]
-    (io/input-stream v))
-
-  InputStream
-  (-input-stream [v]
-    v)
-
-  ratpack.http.TypedData
-  (-input-stream [this]
-    (.getInputStream this)))
+    (io/input-stream v)))

 (extend-protocol pt/IUri
   URI
@@ -117,17 +97,3 @@
   (make-output-stream [path opts]
     (let [^OutputStream os (path->output-stream path)]
       (io/make-output-stream os opts))))
-
-(extend-type ratpack.http.TypedData
-  io/IOFactory
-  (make-reader [td opts]
-    (let [^InputStream is (.getInputStream td)]
-      (io/make-reader is opts)))
-  (make-writer [path opts]
-    (throw (UnsupportedOperationException. "read only object")))
-  (make-input-stream [td opts]
-    (let [^InputStream is (.getInputStream td)]
-      (io/make-input-stream is opts)))
-  (make-output-stream [path opts]
-    (throw (UnsupportedOperationException. "read only object"))))
-


IOUtils added to bootstrap

IOUtils added to bootstrap

--- src/clj/backtype/storm/bootstrap.clj
+++ src/clj/backtype/storm/bootstrap.clj
@@ -43,5 +43,5 @@
      (import (quote [backtype.storm.grouping CustomStreamGrouping]))
      (import (quote [java.io File FileOutputStream FileInputStream]))
      (import (quote [java.util Collection List Random Map HashMap Collections ArrayList]))
-     (import (quote [org.apache.commons.io FileUtils]))
+     (import (quote [org.apache.commons.io FileUtils IOUtils]))
      ))


Rename `get-timetable-day` to `timetable-get-day`

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -419,7 +419,7 @@
   []
   (set! Timetable (vec (map (fn [x] (create-day-repr)) (range 0 5)))))

-(defn- get-timetable-day
+(defn- timetable-get-day
   "Retrieves the in-memory representation of the given 0-indexed day in the
    Timetable, where 0 = Monday, 1 = Tuesday, until 4 = Friday."
   [day]
@@ -429,7 +429,7 @@
   "Returns the total number of rows in the given 0-indexed day in the Timetable,
    where 0 = Monday, 1 = Tuesday, until 4 = Friday."
   [day]
-  (count (get-timetable-day day)))
+  (count (timetable-get-day day)))

 (def ^{:doc     "HTML string for the <td> elements in a <tr> on the Timetable
                  Builder page"
@@ -510,7 +510,7 @@
    The `moduleMapLesson` parameter should be a lesson from the `ModulesMap`
    global"
   [day startTime endTime]
-  (let [ttDay (get-timetable-day day)]
+  (let [ttDay (timetable-get-day day)]
     (:rowIndex
       (reduce
         (fn [result ttRow]
@@ -1155,7 +1155,7 @@
         rowNum     (:rowNum removedAugTTLessonInfo)
         startTime  (:startTime removedAugTTLessonInfo)
         endTime    (:endTime removedAugTTLessonInfo)
-        ttDay      (get-timetable-day day)
+        ttDay      (timetable-get-day day)

         ; This is the time range freed up by removal of the lesson
         [lowTimeIdx highTimeIdx]
@@ -1324,7 +1324,7 @@
   [affectedDaysSet]
   (doseq [day affectedDaysSet]
     (let [nrRows          (get-nr-rows-in-timetable-day day)
-          ttDay           (get-timetable-day day)
+          ttDay           (timetable-get-day day)

           rowsPartition
           (reduce (fn [rPart [rowIdx ttRow]]
@@ -1389,7 +1389,7 @@
    lessons, update the individual entries in the `ModulesSelected` global."
   [affectedDaysSet]
   (doseq [day affectedDaysSet]
-    (let [ttDay (get-timetable-day day)]
+    (let [ttDay (timetable-get-day day)]
       (doseq [[rowIdx ttRow] (map vector (range (count ttDay)) ttDay)]
         (doseq [[ttLessonInfo _] ttRow]
           (let [moduleCode  (:moduleCode ttLessonInfo)


more language fix

more language fix

--- src/cljs/just_married/home/rvsp.cljs
+++ src/cljs/just_married/home/rvsp.cljs
@@ -10,7 +10,7 @@
         :name-sample "John Smith"
         :name "Name (*)"
         :coming "I'll be there"
-        :comment-sample"Eg My girflriend is celiac, I can't eat peanuts"
+        :comment-sample "Eg My girflriend is celiac, I'm allergic to peanuts"
         :comment "Other comments (any allergies/special requirements)"
         :not-coming "Sorry I can't"
         :confirmation-sent "Thanks for letting us know!"
@@ -23,7 +23,7 @@
         :name-sample "Mario Rossi"
         :coming "Contaci"
         :comment "Altri commenti (allergie/esigenze particolari)"
-        :comment-sample "Per esempio la mia ragazza e' celiaca, io posso mangiare arachidi"
+        :comment-sample "Per esempio la mia ragazza e' celiaca, io sono allergico alle arachidi"
         :not-coming "Non posso"
         :confirmation-sent "Grazie per averci fatto sapere!"
         :how-many "Quanti siete?"}})


Whitespace

Whitespace

--- src/detritus/pred.clj
+++ src/detritus/pred.clj
@@ -1,5 +1,6 @@
 (ns detritus.pred
-  "A collection of predicates and predicate helpers.")
+  "A collection of predicates and predicate helpers."
+  (:require [detritus.types :as t]))

 (defn ->assert
   "(λ T → ((λ T) → Bool)) → T
@@ -14,12 +15,11 @@
     (-> 1 inc inc dec
        (->assert number? \"oh god the types\"))"
   ([v pred]
-     (->assert v pred "->assert failed!"))
+   (->assert v pred "->assert failed!"))

   ([v pred error]
-     (if (pred v) v
-         (assert false error))))
-
+   (if (pred v) v
+       (assert false error))))

 (defn ->>assert
   "(λ ((λ T) → Bool) → T) → T
@@ -34,15 +34,13 @@
     (->> 1 inc inc dec
       (->>assert number? \"oh god the types\"))"
   ([pred v]
-     (->>assert pred "->>assert failed!" v))
+   (->>assert pred "->>assert failed!" v))

   ([pred error v]
-     (if (pred v) v
-         (assert false error))))
-
+   (if (pred v) v
+       (assert false error))))

 (def ! complement)
-

 ;; Missing type predicates
 ;;--------------------------------------------------------------------


Use pluralized strings

Use pluralized strings

--- src/discuss/find.cljs
+++ src/discuss/find.cljs
@@ -92,6 +92,6 @@
     (render [_]
       (let [results (get-search-results)]
         (dom/div nil
-                 (dom/h6 nil (str "Received " (count results) " entries."))
+                 (dom/h6 nil (str "Received " (count results) " " (lib/singular->plural (count results) "entry") "."))
                  (apply dom/div nil
                         (map #(om/build item-view (lib/merge-react-key %)) results)))))))


Fix viewport

Fix viewport

--- src/nextbus/handler.clj
+++ src/nextbus/handler.clj
@@ -21,7 +21,7 @@
     [:head
        (hiccup.page/include-css "normalize.css")
        (hiccup.page/include-css "style.css")
-       [:meta {:viewport "width=device-width, initial-scale=1"}]]
+       [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}]]
     [:body [:div {:class "wrapper"}
             [:div {:class "row"}
               [:div {:class "full column centered title"} (:label origin) [:button {:class "swap" :onclick "swap()"} "&#8634"]]]


Some more experiments with draw-lattice-to-file

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

--- src/conexp/contrib/draw/lattices.clj
+++ src/conexp/contrib/draw/lattices.clj
@@ -14,14 +14,16 @@
                                                   add-scrollbars
                                                   save-image)]
         [conexp.contrib.draw.scene-layouts :only (draw-on-scene,
-                                                  get-layout-from-scene)]
+                                                  get-layout-from-scene
+                                                  fit-scene-to-layout)]
         [conexp.contrib.draw.control util
                                      parameters
                                      freese
                                      file-exporter
                                      force-layout
                                      snapshots
-                                     zoom-move])
+                                     zoom-move]
+        conexp.contrib.gui.util)
   (:import [javax.swing JFrame JPanel BoxLayout JScrollBar JScrollPane]
            [java.awt Dimension BorderLayout]))

@@ -127,14 +129,16 @@
   [lattice file-name
    :layout-fn standard-layout,
    :dimension [600 600]]
-  (let [frame (JFrame. "conexp-clj Lattice"),
-        scene (draw-on-scene (scale-layout [0 100] [0 100] (layout-fn lattice)))]
-    (doto frame
-      (.add (scene-canvas scene))
-      (.setPreferredSize (Dimension. (first dimension) (second dimension)))
-      (.validate)
-      (.pack))
-    (save-image scene (java.io.File. ^String file-name) "png")))
+  (do-swing-return ;prevent some nasty AWT deadlocks while experimenting
+    (let [frame (JFrame. ""),
+          panel (make-lattice-editor frame (layout-fn lattice)),
+          scene (get-scene-from-panel panel)]
+      (.setPreferredSize panel (Dimension. 600 600))
+      (.add frame panel)
+      (fit-scene-to-layout scene)
+      (.pack frame)
+      (save-image scene (java.io.File. ^String file-name) "png"))))
+
 (alter-meta! #'draw-lattice-to-file assoc :private true)

 ;;;


null plugin no longer has lifecycles.

null plugin no longer has lifecycles.

--- src/onyx/tasks/null.clj
+++ src/onyx/tasks/null.clj
@@ -11,5 +11,4 @@
                              :onyx/medium :null
                              :onyx/doc "Writes segments to nowhere"}
                             opts)
-           :lifecycles [{:lifecycle/task task-name
-                         :lifecycle/calls :onyx.plugin.null/in-calls}]}})
+           :lifecycles []}})