"Patch" 1.0

"Patch" 1.0

Tried to do it on mobile 2 hours ago and ended up accidentally deleting it...so again:

changed "formal" you to "personal" you as thought it would fit better.
changed several changes, small as well as big ones
will need to play around with the app more to be sure if i interpreted the constellation of some of those translations correctly

--- src/status_im/translations/de.cljs
+++ src/status_im/translations/de.cljs
@@ -4,7 +4,7 @@
   {
    ;common
    :members-title                         "Mitglieder"
-   :not-implemented                       "!nicht implementiert"
+   :not-implemented                       "nicht implementiert"
    :chat-name                             "Chatname"
    :notifications-title                   "Benachrichtigungen und Sounds"
    :offline                               "Offline"
@@ -15,8 +15,8 @@
    :switch-users                          "Benutzer wechseln"

    ;chat
-   :is-typing                             "gibt ein"
-   :and-you                               "und Sie"
+   :is-typing                             "tippt"
+   :and-you                               "und du"
    :search-chat                           "Chat durchsuchen"
    :members                               {:one   "1 Mitglied"
                                            :other "{{count}} Mitglieder"
@@ -32,14 +32,14 @@
    :suggestions-commands                  "Befehle"

    ;sync
-   :sync-in-progress                      "Synchronisiere..."
+   :sync-in-progress                      "synchronisiere..."
    :sync-synced                           "Synchronisiert"

    ;messages
-   :status-sending                        "Absenden"
-   :status-pending                        "In Bearbeitung"
+   :status-sending                        "sendet..."
+   :status-pending                        "wird zugestellt"
    :status-sent                           "Verschickt"
-   :status-seen-by-everyone               "Von allen gesehen"
+   :status-seen-by-everyone               "Von Allen gesehen"
    :status-seen                           "Gesehen"
    :status-delivered                      "Zugestellt"
    :status-failed                         "Fehlgeschlagen"
@@ -54,7 +54,7 @@
                                            :other "Stunden"}
    :datetime-day                          {:one   "Tag"
                                            :other "Tage"}
-   :datetime-multiple                     "s"
+   :datetime-multiple                     "mehrere"
    :datetime-ago                          "vor"
    :datetime-yesterday                    "Gestern"
    :datetime-today                        "Heute"
@@ -69,30 +69,29 @@
    :phone-number                          "Telefonnumer"
    :email                                 "E-Mail"
    :profile-no-status                     "Kein Status"
-   :add-to-contacts                       "Zu Kontakte hinzufügen"
+   :add-to-contacts                       "Zu Kontakten hinzufügen"
    :error-incorrect-name                  "Bitte wählen Sie einen anderen Namen"
    :error-incorrect-email                 "Inkorrekte E-Mail"

    ;;make_photo
    :image-source-title                    "Profilfoto"
-   :image-source-make-photo               "Fotografieren"
+   :image-source-make-photo               "Foto machen"
    :image-source-gallery                  "Aus Galerie auswählen"
    :image-source-cancel                   "Abbrechen"

    ;sign-up
-   :contacts-syncronized                  "Ihre Kontakte wurden synchronisiert."
-   :confirmation-code                     (str "Danke! Wir haben Ihnen eine Textnachricht mit einem Bestätigungscode "
-                                               "geschickt. Bitte geben Sie den Code ein, damit wir Ihre Telefonnummer verifizieren können.")
+   :contacts-syncronized                  "Deine Kontakte wurden synchronisiert."
+   :confirmation-code                     (str "Danke! Wir haben dir eine Textnachricht mit einem Bestätigungscode "
+                                               "geschickt. Bitte gib den Code ein, damit wir deine Telefonnummer verifizieren können.")
    :incorrect-code                        (str "Tut uns leid, der Code war nicht korrekt, bitte erneut eingeben")
-   :generate-passphrase                   (str "Ich werde eine Passphrase für Sie generieren, damit Sie Ihren"
-                                               "Zugriff wiederherstellen oder sich von einem anderen Gerät aus einloggen können")
-   :phew-here-is-your-passphrase          "*Puh* das war schwer, hier ist Ihr Passphrase, *bitte aufschreiben und sicher aufbewahren! *Sie benötigen dies, um Ihren Account wiederherzustellen."
-   :here-is-your-passphrase               "Hier ist Ihr Passphrase, *bitte aufschreiben und sicher verwahren!*Sie benötigen dies, um Ihren Account wiederherzustellen."
-   :written-down                          "Stellen Sie sicher, dass Sie es sicher aufgeschrieben haben"
-   :phone-number-required                 "Tippen Sie hier, um Ihre Telefonnummer einzugeben & ich werde Ihre Freunde finden"
-   :intro-status                          "Chatten Sie mit mir, um Ihren Account einzurichten und Ihre Einstellungen zu ändern!"
-   :intro-message1                        "Willkommen beim Status.\nTippen Sie auf diese Nachricht, um Ihr Passwort einzurichten und loszulegen!"
-   :account-generation-message            "Eine Sekunde, ich muss wahnsinnig schwierige Berechnungen durchführen, um Ihr Konto zu generieren!"
+   :generate-passphrase                   (str "Ich werde eine Passphrase für dich generieren, damit du deinen Zugriff wiederherstellen oder dich von einem anderen Gerät aus einloggen kannst")
+   :phew-here-is-your-passphrase          "*Puh* So das wars, hier ist deine Passphrase, *bitte schreib sie auf und verwahre sie sicher! *Du benötigen diese, um deinen Account wiederherzustellen."
+   :here-is-your-passphrase               "Hier ist deine Passphrase, *Bitte aufschreiben und sicher verwahren!*Du benötigst diese, um deinen Account wiederherzustellen."
+   :written-down                          "Stell sicher, dass du sie sicher aufgeschrieben hast"
+   :phone-number-required                 "Tippe hier, um deine Telefonnummer einzugeben"
+   :intro-status                          "Chatte mit mir, um deinen Account einzurichten und deine Einstellungen zu ändern!"
+   :intro-message1                        "Willkommen beim Status.\nTippe bitte auf diese Nachricht, um dein Passwort einzurichten und loszulegen!"
+   :account-generation-message            "Eine Sekunde, ich generiere gerade dein Konto!"

    ;chats
    :chats                                 "Chats"
@@ -102,7 +101,7 @@
    ;discover
    :discover                             "Entdecken"
    :none                                  "Nichts"
-   :search-tags                           "Geben Sie Ihre Suchbegriffe hier ein"
+   :search-tags                           "Suchbegriffe"
    :popular-tags                          "Beliebte Begriffe"
    :recent                                "Kürzlich"
    :no-statuses-discovered                "Kein Status gefunden"
@@ -113,10 +112,10 @@
    ;contacts
    :contacts                              "Kontakte"
    :new-contact                           "Neuer Kontakt"
-   :show-all                              "ALLE ANZEIGEN"
+   :show-all                              "Alle anzeigen"
    :contacts-group-dapps                  "ÐApps"
    :contacts-group-people                 "Leute"
-   :contacts-group-new-chat               "Neuen Chat beginnen"
+   :contacts-group-new-chat               "Neuen Chat starten"
    :no-contacts                           "Noch keine Kontakte"
    :show-qr                               "QR-Code anzeigen"

@@ -141,17 +140,17 @@
    :phone-request-text                    "Telefonnummer anfragen"
    :confirmation-code-command-description "Bestätitungscode senden"
    :confirmation-code-request-text        "Bestätigungscode anfragen"
-   :send-command-description              "Position senden"
+   :send-command-description              "Senden"
    :request-command-description           "Anfrage senden"
    :keypair-password-command-description  ""
    :help-command-description              "Hilfe"
    :request                               "Anfrage"
-   :chat-send-eth                         "{{amount}} ETH"
-   :chat-send-eth-to                      "{{amount}} ETH an {{chat-name}}"
-   :chat-send-eth-from                    "{{amount}} ETH von {{chat-name}}"
+   :chat-send-eth                         "{{amount}} ETH senden"
+   :chat-send-eth-to                      "{{amount}} ETH an {{chat-name}} senden"
+   :chat-send-eth-from                    "{{amount}} ETH von {{chat-name}} empfangen"

    ;new-group
-   :group-chat-name                       "Chatname"
+   :group-chat-name                       "Gruppenname"
    :empty-group-chat-name                 "Bitte geben Sie einen Namen ein"
    :illegal-group-chat-name               "Bitte wählen Sie einen anderen Namen"

@@ -160,23 +159,23 @@
    :remove-participants                   "Teilnehmer entfernen"

    ;protocol
-   :received-invitation                   "Chateinladung erhalten"
+   :received-invitation                   "Gruppenchateinladung erhalten"
    :removed-from-chat                     "Aus dem Gruppenchat entfernt"
    :left                                  "Links"
    :invited                               "Eingeladen"
    :removed                               "Entfernt"
-   :You                                   "Sie"
+   :You                                   "Du"

    ;new-contact
    :add-new-contact                       "Neuen Kontakt hinzufügen"
-   :import-qr                             "Import"
+   :import-qr                             "Importeren anhang QR-Code"
    :scan-qr                               "QR-Code scannen"
    :name                                  "Name"
    :whisper-identity                      "Identität flüstern"
-   :address-explication                   "Vielleicht sollte hier ein Text stehen, der erklärt, was eine Adresse ist und wo man danach sucht"
+   :address-explication                   "Deine Adresse findest du in deinem Benutzerprofil"
    :enter-valid-address                   "Bitte geben Sie eine gültige Adresse ein oder scannen Sie einen QR-Code"
    :contact-already-added                 "Dieser Kontakt wurde bereits hinzugefügt"
-   :can-not-add-yourself                  "Sie können sich selbst nicht hinzufügen"
+   :can-not-add-yourself                  "Du kannst dich nicht selbst hinzufügen"
    :unknown-address                       "Unbekannte Adresse"

@@ -189,10 +188,10 @@

    ;recover
    :recover-from-passphrase               "Mittels Passphrase wiederherstellen"
-   :recover-explain                       "Bitte geben Sie die Passphrase für Ihr Passwort ein, um den Zugriff wiederherzustellen"
+   :recover-explain                       "Bitte gib die Passphrase für deinen Account ein, um den Zugriff wiederherzustellen"
    :passphrase                            "Passphrase"
    :recover                               "Wiederherstellen"
-   :enter-valid-passphrase                "Bitte geben Sie einen Passphrase ein"
+   :enter-valid-passphrase                "Bitte geben Sie eine gültige Passphrase ein"
    :enter-valid-password                  "Bitte geben Sie ein Passwort ein"

    ;accounts
@@ -213,9 +212,9 @@
                                            :other "{{count}} Transaktionen bestätigen"
                                            :zero  "Keine Transaktionen"}
    :status                                "Status"
-   :pending-confirmation                  "Bestätigung in Bearbeitung"
+   :pending-confirmation                  "Bestätigung ausstehend"
    :recipient                             "Empfänger"
-   :one-more-item                         "Noch ein Objekt"
+   :one-more-item                         "Noch eine Sache"
    :fee                                   "Gebühr"
    :value                                 "Wert"


Added test-snapshot-restore 10.

Added test-snapshot-restore 10.

--- test/ago/test.cljs
+++ test/ago/test.cljs
@@ -282,5 +282,6 @@
   (test-alts 10)
   (test-snapshot-restore 0)
   (test-snapshot-restore 1)
+  (test-snapshot-restore 10)
   (println "ago test run PASS.")
   success)


Further expression simplification

Further expression simplification

--- src/clj/algorithms_clj/derivative.clj
+++ src/clj/algorithms_clj/derivative.clj
@@ -35,7 +35,7 @@
   (let [parts (group-by number? terms)
         number-sum (reduce + (parts true))]
     (cond
-      (empty? (parts true)) (list* '+ (parts false))
+      (zero? number-sum) (list* '+ (parts false))
       (empty? (parts false)) number-sum
       :else (list* '+ number-sum (parts false))
       )))
@@ -46,7 +46,7 @@
   (let [parts (group-by number? terms)
         product (reduce * (parts true))]
     (cond
-      (empty? (parts true)) (list* '* (parts false))
+      (= 1 product) (list* '* (parts false))
       (empty? (parts false)) product
       (zero? product) 0
       :else (list* '* product (parts false))


disable the rvsp for now

disable the rvsp for now

--- src/cljs/just_married/home/views.cljs
+++ src/cljs/just_married/home/views.cljs
@@ -5,7 +5,7 @@
    [just-married.home.timeline :refer [timeline]]
    [just-married.home.find-us :refer [find-us]]
    [just-married.home.navbar :refer [navbar]]
-   [just-married.home.rvsp :refer [rvsp]]
+   #_[just-married.home.rvsp :refer [rvsp]]
    #_[just-married.home.story :refer [story]]))

@@ -22,7 +22,7 @@
    ;; :story story
    :find-us find-us
    :timeline timeline
-   :rvsp rvsp
+   ;; :rvsp rvsp
    ;; :gifts gifts
    ;;:accomodation accommodation
    ;; :contacts contacts
@@ -37,11 +37,3 @@
          [navbar (keys SECTIONS)]
          (vector (into [:div.container]
                        (map vector (vals SECTIONS)))))))
-
-;; (defn main-panel
-;;   []
-;;   ;;TODO: there could be a better way to do this
-;;   (into [:g]
-;;         [navbar (keys SECTIONS)]))
-
-;; (main-panel)


Categories can be created in Postgres

Categories can be created in Postgres

--- src/swanson/models/db.clj
+++ src/swanson/models/db.clj
@@ -52,6 +52,29 @@
       :users
       [:fname :lname :email :encrypted_password]
       [fname lname email encrypted-pass]))
+
+(defn create-categories []
+  (let [names ["amazon"
+               "asset"
+               "atm"
+               "cash"
+               "check"
+               "clothing"
+               "credit card"
+               "dining"
+               "education"
+               "entertainment"
+               "grocery"
+               "health and exercise"
+               "household"
+               "interest"
+               "paypal"
+               "salary"
+               "savings"
+               "transportation"
+               "utilities"]
+        insert-fn #(jdbc/insert! db-spec :categories [:name] [%])]
+    (map insert-fn names)))

 (defn get-category
   [name]


Can find existing transaction

Can find existing transaction

--- src/swanson/models/db.clj
+++ src/swanson/models/db.clj
@@ -1,6 +1,7 @@
 (ns swanson.models.db
   (:require [clojure.java.jdbc :as jdbc]
-             [swanson.utils :refer [date-converter]])
+            [swanson.utils :refer [date-converter]]
+            [clj-time.core :as time-core])
   (:import [java.security MessageDigest]
            [javax.xml.bind DatatypeConverter]))

@@ -111,3 +112,14 @@
     :transactions
     ["id=?" id]
     {:category_id new-category-id}))
+
+(defn transaction-exists
+  "checks if the transaction record already exists"
+  [{:keys [amount date description]}]
+  (let [result
+        (with-db jdbc/with-query-results res
+          ["SELECT COUNT(*) FROM transactions WHERE
+           amount = ? AND
+           date = date(?) AND
+           description = ?" amount date description] (first res))]
+    (> (:count result) 0)))


remove unnecessary (filter)

remove unnecessary (filter)

--- src/babel/over.cljc
+++ src/babel/over.cljc
@@ -92,13 +92,11 @@
            (let [[head comp] (if (= (:first parent) :head)
                                [child1 child2]
                                [child2 child1])]
-             (filter (fn [each]
-                       (not (= :fail each)))
-                     (overhc parent
-                             (if (= (:first parent) :head)
-                               child1 child2)
-                             (if (= (:first parent) :head)
-                               child2 child1)))))
+             (overhc parent
+                     (if (= (:first parent) :head)
+                       child1 child2)
+                     (if (= (:first parent) :head)
+                       child2 child1))))
          parents)))

 (defn morph-with-recovery [morph-fn input]


Calculate all fibs in fib def

Calculate all fibs in fib def

--- clojure/src/euler/002.clj
+++ clojure/src/euler/002.clj
@@ -4,7 +4,7 @@
   (require [clojure.test :refer [is]]))

 (def fibs
-  (lazy-cat [1 2] (map + fibs (rest fibs))))
+  (lazy-cat [0 1] (map + fibs (rest fibs))))

 (defn even-fibs-sum [max]
   (reduce + (filter even? (take-while #(< % max) fibs))))


fix Closure deps graph generator

fix Closure deps graph generator

--- bin/closure_deps_graph.clj
+++ bin/closure_deps_graph.clj
@@ -2,9 +2,9 @@
   (:require [clojure.java.io :as io])
   (:import [java.io File]
            [com.google.javascript.jscomp SourceFile BasicErrorManager]
-           [com.google.javascript.jscomp.deps DepsGenerator
-            DepsGenerator$InclusionStrategy ModuleLoader
-            ModuleLoader$PathResolver ModuleLoader$ResolutionMode]))
+           [com.google.javascript.jscomp.deps BrowserModuleResolver
+            DepsGenerator DepsGenerator$InclusionStrategy ModuleLoader
+            ModuleLoader$PathResolver]))

 (defn js-files-in
   "Return a sequence of all .js files in the given directory."
@@ -17,10 +17,11 @@

 (spit (io/file "deps/closure-library/closure/goog/transit_deps.js")
   (.computeDependencyCalls
-    (DepsGenerator. (map #(SourceFile/fromFile (io/file %)) '("deps/closure-library/closure/goog/deps.js"))
-      (map #(SourceFile/fromFile %)
+    (DepsGenerator.
+      []
+      (map #(SourceFile/fromFile (.getAbsolutePath %))
         (mapcat (comp js-files-in io/file)
-          ["src"]))
+          ["src" "deps/closure-library/closure/goog"]))
       DepsGenerator$InclusionStrategy/ALWAYS
       (.getAbsolutePath (io/file "deps/closure-library/closure/goog"))
       (proxy [BasicErrorManager] []
@@ -29,5 +30,5 @@
         (println [level error]
           (println error)))
       (ModuleLoader. nil [] []
-        ModuleLoader$PathResolver/ABSOLUTE
-        ModuleLoader$ResolutionMode/LEGACY))))
+        BrowserModuleResolver/FACTORY
+        ModuleLoader$PathResolver/ABSOLUTE))))


Checking progress on register-report. Looks right for small register reports, but looks like it might be wrong for larger ones. Need to be able to visualize the results though, so time to work on front end.

--- src/wealthpulse/query.clj
+++ src/wealthpulse/query.clj
@@ -121,13 +121,24 @@
     :period-start :: select entries on or after this date.
     :period-end :: select entries up to and including this date."
   [journal {:keys [accounts-with exclude-accounts-with period-start period-end] :as filters}]
-  (letfn [(get-register-lines
-           [transactions]
-           {:date (get-in (first transactions) [:header :date])
-            :payee (get-in (first transactions) [:header :payee])
-            :entries (map #(select-keys % [:account :amount]) transactions)})]
+  (letfn [(calc-transaction-lines
+           [coll entry]
+           (let [running-total (+ (:amount entry) (:running-total coll))
+                 mapped-entry (merge (select-keys entry [:account :amount]) {:total running-total})]
+             {:entries (cons mapped-entry (:entries coll))
+              :running-total running-total}))
+          (calc-register-lines
+           [coll transactions]
+           (let [entries-total (reduce calc-transaction-lines {:entries [] :running-total (:running-total coll)} transactions)
+                 entries (:entries entries-total)
+                 running-total (:running-total entries-total)
+                 transaction {:date (get-in (first transactions) [:header :date])
+                              :payee (get-in (first transactions) [:header :payee])
+                              :entries entries}]
+             {:transactions (cons transaction (:transactions coll))
+              :running-total running-total}))]
     (let [filtered-entries (filter-entries journal filters)
           grouped-entries (partition-by :header filtered-entries)
-          transactions (map get-register-lines grouped-entries)
+          transactions (:transactions (reduce calc-register-lines {:transactions [] :running-total 0M} grouped-entries))
           n transactions]
       n)))


Add with-err-str macro to utils

Add with-err-str macro to utils

--- boot/pod/src/boot/util.clj
+++ boot/pod/src/boot/util.clj
@@ -132,6 +132,17 @@
          (throw e#)
          (exit-error (print-ex e#))))))

+(defmacro with-err-str
+  "Evaluates exprs in a context in which *err* is bound to a fresh
+  StringWriter.  Returns the string created by any nested printing
+  calls.
+  http://stackoverflow.com/questions/17314128/get-stacktrace-as-string"
+  [& body]
+  `(let [s# (new java.io.StringWriter)]
+     (binding [*err* s#]
+       ~@body
+       (str s#))))
+
 (defn print-ex
   [ex]
   (case @*verbosity*


Fix truncation_len usage

Fix truncation_len usage

--- src-cljs/frontend/components/build_steps.cljs
+++ src-cljs/frontend/components/build_steps.cljs
@@ -94,7 +94,7 @@
                  :download "BuildOutput.txt"
                  :target "_blank"}
              (if (:truncated action)
-               (gstring/format "Download the first %s as a file." (:truncation-len action))
+               (gstring/format "Download the first %s as a file." (:truncation_len action))
                "Download the full output as a file.")])])))))

 (defn action [action owner {:keys [container-id uses-parallelism?] :as opts}]


Fix issue where peer group wasn't started up but inbox was polled anyway.

--- src/onyx/peer/peer_group_manager.clj
+++ src/onyx/peer/peer_group_manager.clj
@@ -98,6 +98,8 @@
          (info t "Attempted to stop OnyxComm component failed.")))
   (-> state
       (assoc :comm nil)
+      (assoc :inbox-ch nil)
+      (assoc :outbox-ch nil)
       (assoc :connected? false)))

 (def spin-park-ms 1)
@@ -277,13 +279,15 @@
 (def idle-backoff-ms 5)

 (defn poll-inbox! [{:keys [inbox-ch] :as state}]
-  (update state
-          :inbox-entries
-          into
-          (loop [entries []]
-            (if-let [v (poll! inbox-ch)]
-              (recur (conj entries v))
-              entries))))
+  (if inbox-ch
+    (update state
+            :inbox-entries
+            into
+            (loop [entries []]
+              (if-let [v (poll! inbox-ch)]
+                (recur (conj entries v))
+                entries)))
+    state))

 (defn peer-group-manager-loop [state]
   (try
@@ -310,7 +314,7 @@
        (when (and new-state (not= ch shutdown-ch))
          (recur new-state))))
    (catch Throwable t
-     (error "Error caught in PeerGroupManager loop." t))))
+     (error t "Error caught in PeerGroupManager loop."))))

 (defrecord PeerGroupManager [peer-config onyx-vpeer-system-fn]
   component/Lifecycle


Tweak some parameters

Tweak some parameters

--- src/overtone_workspace/ambi_rand.clj
+++ src/overtone_workspace/ambi_rand.clj
@@ -41,8 +41,8 @@
                      ambi-soft-buzz-b
                      ambi-swoosh-b
                      ])]
-    (at (metro beat) (ambi buf (num-frames buf) start rate (/ dur 2)))
-    (apply-by (metro (+ beat 1/2)) #'ambi-player [metro (+ beat 1/2)])))
+    (at (metro beat) (ambi buf (num-frames buf) start rate (/ dur (choose [1 2 3 4]))))
+    (apply-by (metro (+ beat 1/4)) #'ambi-player [metro (+ beat 1/4)])))

 (comment
   (do


drier adj?

drier adj?

--- src/cellf/core.cljs
+++ src/cellf/core.cljs
@@ -147,11 +147,12 @@

 (defn adj? [app i]
-  (let [{size :grid-size {emp :empty} :cells} app]
+  (let [{size :grid-size {emp :empty} :cells} app
+        emp' (inc emp)]
     (or
       (= i (- emp size))
       (and (= i (dec emp)) (pos? (mod emp size)))
-      (and (= i (inc emp)) (pos? (mod (inc emp) size)))
+      (and (= i emp') (pos? (mod emp' size)))
       (= i (+ emp size)))))


added exit

added exit

--- src/uawa/core.clj
+++ src/uawa/core.clj
@@ -1,14 +1,30 @@
 (ns uawa.core)
+;; (use 'uawa.core)
+(defmacro стала "defonce" [назва значення] `(let [v# (def ~назва)](when-not (.hasRoot v#) (def ~назва ~значення))))

-(defmacro стала "defonce" [назва значення] `(let [v# (def ~назва)](when-not (.hasRoot v#) (def ~назва ~значення))))
 (defmacro вираз "same as defn" [назви & описи] (list* `defn (with-meta назви (assoc (meta назви) :private false)) описи))
+
 (defmacro якщо ([умова то] `(if ~умова ~то nil)) ([умова то інакше] `(if ~умова ~то ~інакше)))
+
 (стала істина true)
+
 (стала фальш false)
+
 (вираз ні? "not" [x] (not x))
+
 (вираз кожен? "and" ([x y] (and x y)) ([x y & more] (reduce кожен? (кожен? x y) more)))
+
 (вираз якийсь? "or" ([x y] (or x y)) ([x y & more] (reduce якийсь? (якийсь? x y) more)))
-(вираз дай-випадкове "rand-int" [n] (rand-int n))
+
+(вираз дай-випадкове "rand-int" [максимальне] (rand-int максимальне))
+
 (вираз друкуй "println" [& більше]  (binding [*print-readably* nil] (apply prn більше)))
+
 (вираз менше?  ([x] true) ([x y] (. clojure.lang.Numbers (lt x y))) ([x y & more]   (if (< x y)     (if (next more)       (recur y (first more) (next more))       (< y (first more))) false)))
-;; (якщо (менше? (дай-випадкове 3) 4) (друкуй "українська") (друкуй "ураиский русский))+
+;; (якщо (менше? (дай-випадкове 3) 4) (друкуй "українська") (друкуй "ураиский русский))
+
+
+(вираз завершись ([] (System/exit 0)) ([статус] (System/exit статус)))
+
+(defmacro для "у циклі for" [set-expr body-expr] `(for ~set-expr body-expr))


clarifying comments and usage

clarifying comments and usage

--- sidecar/src/figwheel_sidecar/repl_api.clj
+++ sidecar/src/figwheel_sidecar/repl_api.clj
@@ -3,6 +3,11 @@
    [figwheel-sidecar.repl :as fr]
    [figwheel-sidecar.config :as fc]))

+;; this is intended to help you boot figwheel ontop of an nREPL
+;; requires that you have piggeiback nrepl middleware installed
+;; Currently having problems with the foreign deps resolution.
+;; See::
+;; http://dev.clojure.org/jira/browse/CLJS-1036
 (defn start-figwheel!
   [{:keys [figwheel-options all-builds build-ids] :as autobuild-options}]
   (if-not fr/*autobuild-env*
@@ -15,12 +20,16 @@
     (println "Figwheel system already initialized!")))

 (comment
+  ;; example usage
+  (require 'figwheel-sidecar.repl-api)
+
+  (in-ns 'figwheel-sidecar.repl-api)

   (start-figwheel!
    {:figwheel-options {}
     :build-ids ["example"]
     :all-builds [{ :id "example"
-                  :source-paths ["src" "dev" "../support/src"]
+                  :source-paths ["src" "dev"]
                   :compiler {:main "example.dev"
                              :asset-path "js/out"
                              :output-to "resources/public/js/example.js"


Remove dead code

Remove dead code

--- src/kmg/client.cljs
+++ src/kmg/client.cljs
@@ -13,8 +13,7 @@

 (def tmpl "/html/kmg.html")

-(em/defsnippet kmg-header tmpl ".kmg-header" []
-  )
+(em/defsnippet kmg-header tmpl ".kmg-header" [])
 (em/defsnippet kmg-content tmpl "#content" [])
 (em/defsnippet kmg-sidebar tmpl "#sidebar" [])

@@ -107,21 +106,6 @@
        {:handler recommendation-list
         :error-handler error-handler})))

-#_(defn try-load-recommendations-completed []
-  (GET (str "/recommendation/completed/" (:username @user))
-       {:handler recommendation-completed-list
-        :error-handler error-handler}))
-
-#_(defn try-load-specializations-available []
-  (GET (str "/specialization/available/" (:username @user))
-       {:handler specialization-available-list
-        :error-hadler error-handler}))
-
-#_(defn try-load-specializations-completed []
-  (GET (str "/specialization/completed/" (:username @user))
-       {:handler specialization-completed-list
-        :error-handler error-handler}))
-
 (defn try-load-whole-user-data []
   (GET (str "/data/" (:username @user))
        {:handler render-whole-user-data


Capitalize state when sending to abacus

Capitalize state when sending to abacus

--- src/mdr2/abacus.clj
+++ src/mdr2/abacus.clj
@@ -141,7 +141,7 @@
            date id produced_date volumes] :as production}]
   (->> [(create-row 2 product_number)
         (create-row 239 (quot (or total_time 0) (* 1000 60))) ; in minutes
-        (create-row 106 state)
+        (create-row 106 (string/capitalize state))
         (create-row 280 audio_format)
         (create-row 271 volumes) ; Number of CDs
         (create-row 281 multimedia_type)


expanded on background and against-background docs

--- src/midje/sweet.clj
+++ src/midje/sweet.clj
@@ -30,13 +30,19 @@
 (intern *ns* 'around #'background/around)

 (defmacro background
-  ""
+  "Runs facts against setup code which is run before, around, or after
+   :contents, :facts or :checks. Optionally, contains one or more provided forms
+   that apply for all facts run within the against-background form.
+   Runs against the rest of the file."
   [& forms]
   (when (user-desires-checking?)
     (put-wrappers-into-effect (background/background-wrappers forms))))

 (defmacro against-background
-  "Runs facts against setup code whch is run before :contents, :facts or :checks."
+  "Runs facts against setup code which is run before, around, or after
+   :contents, :facts or :checks. Optionally, contains one or more provided forms
+   that apply for all facts run within the against-background form.
+   Runs against the code it surrounds."
   [background-forms & foreground-forms]
   (if (user-desires-checking?)
     (midjcoexpand `(against-background ~background-forms ~@foreground-forms))


Add schema for TaskScheduler

Add schema for TaskScheduler

--- src/onyx/schema.clj
+++ src/onyx/schema.clj
@@ -139,7 +139,7 @@
 (def Job
   {:catalog Catalog
    :workflow Workflow
-   :task-scheduler s/Keyword
+   :task-scheduler TaskScheduler
    (s/optional-key :percentage) s/Int
    (s/optional-key :flow-conditions) [FlowCondition]
    (s/optional-key :windows) [Window]
@@ -167,6 +167,9 @@
   (s/enum :busy-spin :low-restart-latency :high-restart-latency))

 (def JobScheduler
+  s/Keyword)
+
+(def TaskScheduler
   s/Keyword)

 (def Messaging


core performance optimization

core performance optimization

--- flatguicore/src/flatgui/widgets/componentbase.clj
+++ flatguicore/src/flatgui/widgets/componentbase.clj
@@ -207,9 +207,8 @@
                 ret container
                 aux aux-container]
           (if (< pi ps-count)
-                  (let [ p (nth properties-to-evolve pi)
-                         pk (fgc/conjv k p)
-                         evolver (p (:evolvers tgt))]
+                  (let [p (nth properties-to-evolve pi)
+                        evolver (p (:evolvers tgt))]
                     (if (or initialization evolver)
                       (let [;; Remember: cannot use get in :evolved-properties check because of http://dev.clojure.org/jira/browse/CLJ-700
                             ;; We don track :children change during initialization. Current implementation of initialization
@@ -229,22 +228,6 @@
                              has-changes-raw (not (= old-value new-value))
                              has-changes has-changes-raw ;(or initialization has-changes-raw)

-;                             _ (if (and has-changes (= p :children)) (println " Evolved children count from " (count old-value) " to " (count new-value) " str change "
-;                                                                       (and has-changes-raw (= p :children) (or (not (:_flexible-childset tgt)) (empty? old-value)))))
-                             ;@todo for :content-pane has-structure-changes should be false in case new child count is LESS than previous child count?
-                             ;
-                             children-changed (= p :children)
-                            ;_ (if children-changed (println (:widget-type tgt) (:id tgt) "------CHILDREN CHANGED--FROM-" (count old-value) " TO " (count new-value)))
-
-
-
-                             has-structure-changes (and has-changes-raw children-changed (or (not (:_flexible-childset tgt)) (empty? old-value)))
-                             flex-structure-changes (if (and has-changes-raw children-changed (:_flexible-childset tgt) (seq old-value))
-                                                      (:_flexible-childset-added new-value))
-
-
-                             flex-target-id-paths-added (if flex-structure-changes (:_flex-target-id-paths-added new-value))
-                             new-value (if flex-structure-changes (dissoc new-value :_flexible-childset-added :_flex-target-id-paths-added) new-value)
                              new-aux-with-consume (if (evolve-reason-provider nil)
                                                     (assoc!
                                                       aux-with-evolved-dependencies
@@ -267,7 +250,27 @@

                             new-ret (if has-changes
-                                       (let [fin-ret1 (assoc (assoc-in root-p pk new-value)
+                                       (let [
+
+                                             ;                             _ (if (and has-changes (= p :children)) (println " Evolved children count from " (count old-value) " to " (count new-value) " str change "
+                                             ;                                                                       (and has-changes-raw (= p :children) (or (not (:_flexible-childset tgt)) (empty? old-value)))))
+                                             ;@todo for :content-pane has-structure-changes should be false in case new child count is LESS than previous child count?
+                                             ;
+                                             children-changed (= p :children)
+                                             ;_ (if children-changed (println (:widget-type tgt) (:id tgt) "------CHILDREN CHANGED--FROM-" (count old-value) " TO " (count new-value)))
+
+
+
+                                             has-structure-changes (and has-changes-raw children-changed (or (not (:_flexible-childset tgt)) (empty? old-value)))
+                                             flex-structure-changes (if (and has-changes-raw children-changed (:_flexible-childset tgt) (seq old-value))
+                                                                      (:_flexible-childset-added new-value))
+
+
+                                             flex-target-id-paths-added (if flex-structure-changes (:_flex-target-id-paths-added new-value))
+                                             new-value (if flex-structure-changes (dissoc new-value :_flexible-childset-added :_flex-target-id-paths-added) new-value)
+
+
+                                             fin-ret1 (assoc (assoc-in root-p (fgc/conjv k p) new-value)
                                                          :has-structure-changes (or (:has-structure-changes root-p) has-structure-changes)
                                                          :flex-structure-changes (merge (:flex-structure-changes root-p) flex-structure-changes)

@@ -362,22 +365,25 @@
           container)
         (let [ k (fgc/get-access-key target-id-path)
                prev-has-changes (:has-changes container)
-              ;before-time (System/currentTimeMillis)
+              before-time (System/currentTimeMillis)
                with-evolved-target-fresh (evolve-component original-container (assoc container :has-changes false) original-target-id-path target-id-path reason remaining-to-evolve debug-shift initialization)
-              ;_time-spent (if initialization
-              ;              nil
-              ;              (loop [pi (dec (count remaining-to-evolve))
-              ;                     _ts nil]
-              ;                (if (>= pi 0)
-              ;                  (recur
-              ;                    (dec pi)
-              ;                    (let [t (- (System/currentTimeMillis) before-time)
-              ;                          pp (fgc/conjv target-id-path (nth remaining-to-evolve pi))]
-              ;                      (do
-              ;                        (swap! stats (fn [s] (assoc s pp (+ (get s pp 0) t))))
-              ;                        ))))))
                new-has-changes (:has-changes with-evolved-target-fresh)
-               has-changes (or prev-has-changes new-has-changes)
+              _time-spent (if initialization
+                            nil
+                            (loop [pi (dec (count remaining-to-evolve))
+                                   _ts nil]
+                              (if (>= pi 0)
+                                (recur
+                                  (dec pi)
+                                  (let [t (- (System/currentTimeMillis) before-time)
+                                        pp (fgc/conjv
+                                             (fgc/conjv (fgc/conjv target-id-path (nth remaining-to-evolve pi)) (str reason))
+                                             (if new-has-changes "(Y)" "(N)"))
+                                        ]
+                                    (do
+                                      (swap! stats (fn [s] (assoc s pp (+ (get s pp 0) t))))
+                                      ))))))
+              has-changes (or prev-has-changes new-has-changes)
                with-evolved-target (assoc with-evolved-target-fresh :has-changes has-changes)
                new-aux (:aux-container with-evolved-target)
                ;_ (if (and


Use :parameters instead of :params for controller example

--- examples/frontend-controllers/src/frontend/core.cljs
+++ examples/frontend-controllers/src/frontend/core.cljs
@@ -65,12 +65,11 @@
        {:name ::item
         :parameters {:path {:id s/Int}
                      :query {(s/optional-key :foo) s/Keyword}}
-        :controllers [{:params (fn [match]
-                                 (:path (:parameters match)))
-                       :start (fn [params]
-                                (js/console.log "start" "item controller" (:id params)))
-                       :stop (fn [params]
-                               (js/console.log "stop" "item controller" (:id params)))}]}]]]
+        :controllers [{:parameters {:path [:id]}
+                       :start (fn [{:keys [path]}]
+                                (js/console.log "start" "item controller" (:id path)))
+                       :stop (fn [{:keys [path]}]
+                               (js/console.log "stop" "item controller" (:id path)))}]}]]]
     {:data {:controllers [{:start (log-fn "start" "root-controller")
                            :stop (log-fn "stop" "root controller")}]
             :coercion rsc/coercion}}))


Handle RiotException, return :failed instead of ILD

--- src/rdf_path_examples/evaluation.clj
+++ src/rdf_path_examples/evaluation.clj
@@ -12,7 +12,7 @@
   (:import [org.apache.jena.rdf.model Model]
            [java.io ByteArrayInputStream]
            [org.apache.commons.math3.stat.inference MannWhitneyUTest]
-           [org.apache.jena.riot RiotParseException]))
+           [org.apache.jena.riot RiotException]))

 (defn- count-pairs
   "Count number of pairs from `n` items."
@@ -45,20 +45,24 @@
              number-of-runs]
       :or {number-of-retries 5
            number-of-runs 10}}]
-  (let [paths (map (comp json-ld->rdf-model io/input-stream)
+  (let [paths (map (juxt #(.getName %) (comp json-ld->rdf-model io/input-stream))
                    (filter #(.isFile %) (file-seq (io/as-file path-dir))))
         path-count (count paths)
         generate-fn (fn [path] (try-times number-of-retries (examples/generate-examples params path)))
-        clj->rdf-model (comp json-ld->rdf-model string->input-stream json/generate-string)]
-    (doall (mapv (comp average
-                       (fn [path index]
-                         (println (str "Processing path " index "/" path-count))
-                         (repeatedly number-of-runs
-                                     (comp (partial intra-list-diversity params)
-                                           clj->rdf-model
-                                           (partial generate-fn path)))))
-                 paths
-                 (range 1 (inc path-count))))))
+        clj->rdf-model (comp json-ld->rdf-model string->input-stream json/generate-string)
+        repeatedly-generate-fn (fn [path index]
+                                (log/info (str "Processing path " index "/" path-count))
+                                (repeatedly number-of-runs
+                                            (comp (partial intra-list-diversity params)
+                                                  clj->rdf-model
+                                                  (partial generate-fn path))))
+        avg-ild-fn (fn [[path-name path] index]
+                     (let [avg-ild (try (repeatedly-generate-fn path index)
+                                        (catch RiotException ex
+                                          (log/error (.getMessage ex))
+                                          :failed))]
+                       [path-name avg-ild]))]
+    (into {} (map avg-ild-fn paths (range 1 (inc path-count))))))

 (defn mann-whitney-u-test
   "Compute Mann-Whitney U test between collections of doubles `a` and `b`."


Delete the item from the list and the table

--- fulcro-todo/src/main/app/operations.cljs
+++ fulcro-todo/src/main/app/operations.cljs
@@ -12,10 +12,10 @@
 (defmutation delete-item!
   [{:keys [id]}]
   (action [{:keys [state]}]
-          (let [ident [:item/by-id id]
-                current-items (get-in @state [:item-list :item-list/items])
-                updated-items (vec (remove #(= ident %) current-items))]
-            (swap! state assoc-in [:item-list :item-list/items] updated-items))))
+          (let [remove-ident (fn [items] (vec (remove #(= [:item/by-id id] %) items)))]
+            (swap! state #(-> %
+                              (update-in [:item-list :item-list/items] remove-ident)
+                              (update :item/by-id dissoc id))))))

 (defmutation update-input-value!
   [{:keys [input-value]}]


Update user settings organization plans subpage

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -32,32 +32,29 @@
                                    (get-in app state/user-organizations-path))]
         (html
          [:div#settings-plans.account-settings-subpage
-          [:legend "Org Plan Settings"]
-          [:div.plans-item
-           [:h3 "Set up a plan for one of your Organizations:"]
-           [:p "You can set up plans for any organization that you admin."]
-           [:div.plans-accounts
-            (map
-             (fn [org]
-               (let [;; TODO: this link is sometimes dead. We should not link, or make
-                     ;; the org settings page do something sane if there's not a plan.
-                     org-url (routes/v1-org-settings-path {:org (:login org)
-                                                           :vcs_type (:vcs_type org)})
-                     avatar-url (gh-utils/make-avatar-url org :size 25)]
-                 [:div
-                  [:a
-                   {:href org-url}
-                   [:img
-                    {:src    avatar-url
-                     :height 25
-                     :width  25}]]
-                  " "
-                  [:a.account-plan-pricing-org-link
-                   {:href org-url}
-                   [:span (:login org)]]
-                  [:br]
-                  [:br]]))
-             user-and-orgs)]]])))))
+          [:legend "Organization Plans"]
+          (card/basic
+            (html
+              [:div
+               [:div.plans-item
+                [:p "You can manage the CircleCI plan for any organization that you admin."
+                 [:br]
+                 "You have admin permissions for the following organizations:"]
+                [:div.plans-accounts
+                 (om/build table/table {:key-fn :org-name
+                                        :rows (map
+                                                (fn [org]
+                                                  (let [;; TODO: this link is sometimes dead. We should not link, or make
+                                                        ;; the org settings page do something sane if there's not a plan.
+                                                        org-url (routes/v1-org-settings-path {:org (:login org)
+                                                                :vcs_type (:vcs_type org)})]
+                                                    ;; FIXME: Add VCS icon in front of org name
+                                                    {:org-name [:a
+                                                                {:href org-url}
+                                                                [:span (:login org)]]}))
+                                                user-and-orgs)
+                                        :columns [{:header "Organization Name"
+                                                   :cell-fn :org-name}]})]]]))])))))

 (defn api-tokens [app owner]
   (reify


validate expected null values

validate expected null values

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -129,6 +129,7 @@
                               (re-find #"\s*<[^>]+>" a) (try (diff* (parse-str a) (parse-str b))
                                                              (catch Exception e a))
                               :else a)
+                (and (nil? a) (some? b)) (str b " not null")
                 :else a)]
     (log/debug "diff..." a b " is " ldiff)
     ldiff))
@@ -176,7 +177,7 @@
    (some (fn [[header value]]
            (if (diff* (str/trim value) (headers header))
              (str "header " header " was " (headers header) " expected " value))) exp-headers)
-   (when-let [ldiff (diff* exp-body body)]
+   (when-let [ldiff (if exp-body (diff* exp-body body))]
      (log/error "failed matching body. expected:" exp-body " got:" body)
      (->> ldiff (#(if (instance? Element %)
                     (emit-str %)


Exclude boolean? to avoid Clojure 1.9 warnings

--- src/yada/schema.clj
+++ src/yada/schema.clj
@@ -8,6 +8,7 @@
 simplifies coding while giving the author of yada resources the
 convenience of terse, expressive short-hand descriptions."}
     yada.schema
+  (:refer-clojure :exclude [boolean?])
   (:require
    [clojure.walk :refer [postwalk]]
    [clojure.set :as set]


Wrapped failed execution to a proper HTTP response.

--- src/clj_formal_specifications_app/api.clj
+++ src/clj_formal_specifications_app/api.clj
@@ -18,7 +18,9 @@

 (defn execute-with-ns
   [ns command]
-  {:body (str (binding [*ns* (find-ns (symbol ns))] (load-string command)))})
+  (try
+    {:body (str (binding [*ns* (find-ns (symbol ns))] (load-string command)))}
+    (catch Exception e {:body (.getMessage e) :status 400})))

 (defn ns-data
   [ns]


Simplify declaration of HTML tags classes

--- src/cljs/flux_challenge_reagent/core.cljs
+++ src/cljs/flux_challenge_reagent/core.cljs
@@ -18,21 +18,21 @@
 ;; Views

 (defn render-sith-lord [sith-lord]
-  [:li {:class "css-slot" :key (get sith-lord "id")}
+  [:li.css-slot {:key (get sith-lord "id")}
    [:h3 (get sith-lord "name")]
    [:h6 (str "Homeworld: " (get-in sith-lord ["homeworld" "name"]))]])

 (defn home-page []
-  [:div {:class "css-root"}
-   [:h1 {:class "css-planet-monitor"} (str "Obi-Wan currently on " (get @current-planet "name"))]
+  [:div.css-root
+   [:h1.css-planet-monitor (str "Obi-Wan currently on " (get @current-planet "name"))]

-   [:section {:class "css-scrollable-list"}
-    [:ul {:class "css-slots"}
+   [:section.css-scrollable-list
+    [:ul.css-slots
      (map render-sith-lord @sith-lords-list)]]

-   [:div {:class "css-scroll-buttons"}
-    [:button {:class "css-button-up"}]
-    [:button {:class "css-button-down"}]]])
+   [:div.css-scroll-buttons
+    [:button.css-button-up
+    [:button.css-button-down]]]])

 (defn current-page []
   [:div [(session/get :current-page)]])


Add legend to bottom map

Add legend to bottom map

--- src/cljs/travel_site/components/city.cljs
+++ src/cljs/travel_site/components/city.cljs
@@ -257,7 +257,6 @@
         waypoints (attractions/get-waypoints
                     (-> journey :waypoint-attraction-ids)
                     (-> current-city :attractions :data)) ]
-    (js/console.log (clj->js journey))
     (when (valid-journey? journey)
       (.route
         (om/get-state owner :google-directions-service)
@@ -339,6 +338,24 @@
     (render-state [this state]
       (html [:div {:class "city-map-container"} "This is where the map should go"]))))

+(defn attraction-map-legend-view [transit-journey owner]
+  (reify
+    om/IRender
+    (render [_]
+      (let [legend-tuples (map vector
+                               "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                               (flatten (vector
+                                          (:start_name (first transit-journey))
+                                          (map #(:end_name %) transit-journey))))]
+        (html [:table {:class "ui celled table"}
+               [:thead
+                [:th "Symbol"]
+                [:th "Name"]]
+               (map #(html [:tr
+                            [:td (get % 0)]
+                            [:td (get % 1)]])
+                    legend-tuples)])))))
+
 (defn city-view [{:keys [current-city journey transit-journey]} owner]
   (reify
     om/IDidMount
@@ -382,8 +399,8 @@
                                                             (-> current-city :attractions :data)])]]
               [:div {:class "ui fourteen wide column row basic segment final-directions"}
                [:div {:class "fourteen wide column"}
-                (om/build attraction-map-view [current-city journey transit-journey true])] ]
+                (om/build attraction-map-view [current-city journey transit-journey true])
+                (om/build attraction-map-legend-view transit-journey)]]
               [:div {:class "ui fourteen wide column row basic segment final-directions"}
                [:div {:class "fourteen wide column"}
-                (om/build transit-view transit-journey)]]
-              ]]))))
+                (om/build transit-view transit-journey)]]]]))))


mouse/down?

mouse/down?

--- src/cljx/jamesmacaulay/zelkova/mouse.cljx
+++ src/cljx/jamesmacaulay/zelkova/mouse.cljx
@@ -44,3 +44,14 @@
 #+cljs
 (def clicks (assoc (z/input :click ::clicks)
               :event-sources {::clicks clicks-channel}))
+
+#+cljs
+(defn down?-channel
+  [graph opts]
+  (let [down-events (listen js/document "mousedown" (map (constantly (z/->Event ::down? true))))
+        up-events (listen js/document "mouseup" (map (constantly (z/->Event ::down? false))))]
+    (async/merge [down-events up-events])))
+
+#+cljs
+(def down? (assoc (z/input false ::down?)
+             :event-sources {::down? down?-channel}))


Use the buffer-size as a qos prefetch-count.

--- src/com/farmlogs/conduit/subscription.clj
+++ src/com/farmlogs/conduit/subscription.clj
@@ -48,8 +48,9 @@
   (log/infof "Consumer tag: %s on queue: %s shutdown" consumer-tag queue-name))

 (defn- make-channel
-  [conn {:keys [exchange-name exchange-type] :as config}]
+  [conn prefetch-count {:keys [exchange-name exchange-type] :as config}]
   (let [chan (rmq.chan/open conn)]
+    (rmq.basic/qos chan prefetch-count)
     (rmq.exch/declare chan exchange-name exchange-type config)
     (rmq.queue/declare chan (:queue-name config) config)
     (rmq.queue/bind chan (:queue-name config) exchange-name config)
@@ -60,7 +61,7 @@
   component/Lifecycle
   (start [this]
     (log/infof "Starting subscription on queue '%s'" (:queue-name queue-config))
-    (let [rmq-chan (or rmq-chan (make-channel (:conn rmq-connection) queue-config))
+    (let [rmq-chan (or rmq-chan (make-channel (:conn rmq-connection) buffer-size  queue-config))
           new-messages (a/chan buffer-size)
           pending-messages (a/chan buffer-size)
           ack-process (->ack-process new-messages buffer-size rmq-chan)


Increase threshold for cljs automated comparison.

--- test/clj/quil/snippet.clj
+++ test/clj/quil/snippet.clj
@@ -138,7 +138,7 @@
 (t/deftest ^:manual
   all-cljs-snippets-produce-expected-output
   (let [driver (etaoin/firefox)
-        threshold 0.0001]
+        threshold 0.01]
     (etaoin/go driver "http://localhost:3000/test.html")
     (let [elements (etaoin/query-all driver {:tag :option})
           names    (doall (map #(etaoin/get-element-text-el driver %) elements))]


Add send-message test for two-arg arity

Add send-message test for two-arg arity

--- test/postal/test/core.clj
+++ test/postal/test/core.clj
@@ -41,6 +41,11 @@
                                          :port "25"}
                                        {:from "foo@example.com"
                                         :to "bar@example.com"}))))
+    (is (= :smtp (:which
+                  (postal/send-message {:host "localhost"
+                                        :port "25"}
+                                       {:from "foo@example.com"
+                                        :to "bar@example.com"}))))
     (is (= :sendmail (:which
                       (postal/send-message {:from "foo@example.com"
                                             :to "bar@example.com"}))))))


Added a test to see if a page will render. Spoiler: It does. ;)

--- test/timber/core_test.clj
+++ test/timber/core_test.clj
@@ -1,7 +1,8 @@
 (ns timber.core-test
   (:require [clojure.test :refer :all]
-            [timber.core :refer :all]))
+            [timber.core]))

-(deftest a-test
-  (testing "I succeed!"
-    (is (= 1 1))))
+(deftest base-page-test
+  (is (= (timber.core/base-page {:asset-uri-path ["foo" "bar"]})
+         '("<!DOCTYPE html>\n" "<" "html" ">" "\n  " "<" "head" ">" "\n    " "<" "meta" " " "charset" "=\"" "utf-8" "\"" " />" "\n    " "<" "meta" " " "content" "=\"" "width=device-width, initial-scale=1.0" "\"" " " "name" "=\"" "viewport" "\"" " />" "\n    " "<" "title" "></" "title" ">" "\n\n    " "<" "link" " " "rel" "=\"" "stylesheet" "\"" " " "href" "=\"" "foo/bar/css/bootstrap.min.css" "\"" " " "asset" "=\"" "true" "\"" " />" "\n    " "<" "link" " " "rel" "=\"" "stylesheet" "\"" " " "href" "=\"" "foo/bar/font-awesome/css/font-awesome.css" "\"" " " "asset" "=\"" "true" "\"" " />" "\n    " "<" "link" " " "rel" "=\"" "stylesheet" "\"" " " "href" "=\"" "foo/bar/css/plugins/select/select-theme-default.css" "\"" " " "asset" "=\"" "true" "\"" " />" "\n    " "<" "link" " " "rel" "=\"" "stylesheet" "\"" " " "href" "=\"" "foo/bar/css/timber.css" "\"" " " "asset" "=\"" "true" "\"" " />" "\n    " "<!--" " Link tag to a stylesheet template. " "-->" "\n    " "\n  " "</" "head" ">" "\n\n  " "<" "body" ">" "\n    " "<" "div" " " "id" "=\"" "wrapper" "\"" ">" "\n      " "<" "nav" " " "style" "=\"" "margin-bottom: 0" "\"" " " "role" "=\"" "navigation" "\"" " " "class" "=\"" "navbar navbar-default navbar-static-top" "\"" " " "id" "=\"" "top-nav" "\"" ">" "\n      " "<" "div" " " "class" "=\"" "navbar-header" "\"" ">" "\n        " "<" "a" " " "href" "=\"" "#" "\"" " " "class" "=\"" "navbar-brand" "\"" " " "id" "=\"" "brand" "\"" "></" "a" ">" "\n      " "</" "div" ">" "\n      " "<" "ul" " " "class" "=\"" "nav navbar-top-links navbar-right" "\"" ">" "\n        " "<" "li" " " "class" "=\"" "dropdown" "\"" ">" "\n        " "<" "a" " " "href" "=\"" "#" "\"" " " "data-toggle" "=\"" "dropdown" "\"" " " "class" "=\"" "dropdown-toggle" "\"" " " "id" "=\"" "user-menu-toggle" "\"" "></" "a" ">" "\n        " "<" "ul" " " "class" "=\"" "dropdown-menu dropdown-user" "\"" " " "id" "=\"" "user-account-menu" "\"" "></" "ul" ">" "</" "li" ">" "\n        " "</" "ul" ">" "\n        \n      \n      " "</" "nav" ">" "\n      " "<" "nav" " " "role" "=\"" "navigation" "\"" " " "class" "=\"" "navbar-default navbar-static-side" "\"" " " "id" "=\"" "main-menu" "\"" ">" "\n      " "<" "div" " " "class" "=\"" "sidebar-collapse" "\"" ">" "\n        " "<" "ul" " " "id" "=\"" "main-menu-list" "\"" " " "class" "=\"" "nav" "\"" "></" "ul" ">" "\n      " "</" "div" ">" "\n      " "</" "nav" ">" "\n      " "<" "div" " " "id" "=\"" "page-wrapper" "\"" ">" "\n        " "<" "div" " " "id" "=\"" "content" "\"" "></" "div" ">" "\n      " "</" "div" ">" "\n    " "</" "div" ">" "\n    " "<" "script" " " "src" "=\"" "foo/bar/js/angular.min.js" "\"" " " "asset" "=\"" "true" "\"" "></" "script" ">" "\n    " "<" "script" " " "src" "=\"" "foo/bar/js/jquery-1.10.2.js" "\"" " " "asset" "=\"" "true" "\"" "></" "script" ">" "\n    " "<" "script" " " "src" "=\"" "foo/bar/js/bootstrap.min.js" "\"" " " "asset" "=\"" "true" "\"" "></" "script" ">" "\n    " "<!--" "JavaScript Plugins " "-->" "\n    " "<" "script" " " "src" "=\"" "foo/bar/js/plugins/select/select.min.js" "\"" " " "asset" "=\"" "true" "\"" "></" "script" ">" "\n    " "<" "script" " " "type" "=\"" "text/javascript" "\"" ">" "Select.init({selector: '.nice-select'});" "</" "script" ">" "\n    " "<!--" " Template script tag to use for adding scripts. " "-->" "\n    " "\n  " "</" "body" ">" "\n\n" "</" "html" ">")))
+  )


Two tests: test-log-request-pretty-print-mode-1 and 2

--- test/emender_jenkins/server_test.clj
+++ test/emender_jenkins/server_test.clj
@@ -14,7 +14,8 @@
   (:require [clojure.test :refer :all]
             [emender-jenkins.server :refer :all]))

-(require '[clojure.tools.logging    :as log])
+(require '[clojure.tools.logging :as log])
+(require '[clojure.pprint        :as pprint])

 ;
 ; Common functions used by tests.
@@ -162,3 +163,17 @@
             (let [request  {:uri "http://test" :remote-addr "10.20.30.40" :configuration {:config {:verbose true :pretty-print false}}}]
                 (is (.startsWith (log-request request) "Handling request:  {"))))))

+(deftest test-log-request-pretty-print-mode-1
+    "Check the function emender-jenkins.server/log-request."
+    (testing "the function emender-jenkins.server/log-request."
+        (with-redefs [log/log* (fn [logger level throwable message] message)]
+            (let [request  {:uri "http://test" :remote-addr "10.20.30.40" :configuration {:config {:verbose true :pretty-print true}}}]
+                (is (nil? (log-request request)))))))
+
+(deftest test-log-request-pretty-print-mode-2
+    "Check the function emender-jenkins.server/log-request."
+    (testing "the function emender-jenkins.server/log-request."
+        (with-redefs [pprint/pprint (fn [value] (str value))]
+            (let [request  {:uri "http://test" :remote-addr "10.20.30.40" :configuration {:config {:verbose true :pretty-print true}}}]
+                (is (log-request request))))))
+


tidied up predicate test to ignore order.


Update version to 0.2.1-SNAPSHOT.

Update version to 0.2.1-SNAPSHOT.

--- metlog-vault/project.clj
+++ metlog-vault/project.clj
@@ -1,4 +1,4 @@
-(defproject metlog-vault "0.2.0-SNAPSHOT"
+(defproject metlog-vault "0.2.1-SNAPSHOT"
   :description "Repository for long term storage of series data."

   :license {:name "Eclipse Public License"


Refactor tests

Refactor tests

--- test/territory_bro/gis_user_test.clj
+++ test/territory_bro/gis_user_test.clj
@@ -24,34 +24,60 @@
           user-id2 (user/save-user! conn "user2" {})]

       (gis-user/create-gis-user! conn cong-id user-id)
+      (gis-user/create-gis-user! conn cong-id user-id2)
+      (gis-user/create-gis-user! conn cong-id2 user-id)
       (gis-user/create-gis-user! conn cong-id2 user-id2)
-      (testing "create & get user"
+      (testing "create & get GIS user"
         (let [user (gis-user/get-gis-user conn cong-id user-id)]
           (is (::gis-user/username user))
           (is (= 50 (count ((::gis-user/password user)))))))

-      (testing "get all users"
+      (testing "get GIS users by congregation"
         (is (= #{[cong-id user-id]
-                 [cong-id2 user-id2]}
-               (->> (gis-user/get-gis-users conn)
+                 [cong-id user-id2]}
+               (->> (gis-user/get-gis-users conn {:congregation cong-id})
                     (map (juxt ::gis-user/congregation ::gis-user/user))
                     (into #{})))))

-      (testing "can login to the database") ; TODO
+      (testing "get GIS users by user"
+        (is (= #{[cong-id user-id]
+                 [cong-id2 user-id]}
+               (->> (gis-user/get-gis-users conn {:user user-id})
+                    (map (juxt ::gis-user/congregation ::gis-user/user))
+                    (into #{})))))

-      (testing "can view the congregation schema") ; TODO
-
-      (testing "cannot view the master schema") ; TODO
-
-      (testing "cannot view the public schema") ; TODO
-
-      (gis-user/delete-gis-user! conn cong-id user-id)
-      (testing "delete user"
+      (testing "delete GIS user"
+        (gis-user/delete-gis-user! conn cong-id user-id)
         (is (nil? (gis-user/get-gis-user conn cong-id user-id)))
         (is (gis-user/get-gis-user conn cong-id2 user-id2)
-            "should not delete unrelated users"))
+            "should not delete unrelated users")))))

-      (testing "cannot login to database after user is deleted")))) ; TODO
+(defn- create-test-data! []
+  (db/with-db [conn {}]
+    (let [cong-id (congregation/create-congregation! conn "cong")
+          cong (congregation/get-unrestricted-congregation conn cong-id)
+          user-id (user/save-user! conn "user" {})
+          _ (gis-user/create-gis-user! conn cong-id user-id)
+          gis-user (gis-user/get-gis-user conn cong-id user-id)]
+      {:cong-id cong-id
+       :user-id user-id
+       :schema (::congregation/schema-name cong)
+       :username (::gis-user/username gis-user)
+       :password ((::gis-user/password gis-user))})))
+
+(deftest gis-user-database-access-test
+  (let [{:keys [cong-id user-id schema username password]} (create-test-data!)]
+
+    (is true)
+    (testing "can login to the database") ; TODO)
+
+    (testing "can view the congregation schema") ; TODO
+
+    (testing "cannot view the master schema") ; TODO
+
+    (testing "cannot view the public schema") ; TODO
+
+    (testing "cannot login to database after user is deleted"))) ; TODO

 (deftest generate-password-test
   (let [a (gis-user/generate-password 10)


fix geoname remove fn

fix geoname remove fn

--- src/cljs/iwaswhere_web/ui/entry/location.cljs
+++ src/cljs/iwaswhere_web/ui/entry/location.cljs
@@ -37,7 +37,7 @@
   (let [detail (r/atom false)
         emoji-flags (aget js/window "deps" "emojiFlags")
         toggle-detail (fn [_] (swap! detail not))
-        remove (put-fn [:entry/update (assoc-in @entry [:geoname] :removed)])]
+        remove #(put-fn [:entry/update (assoc-in @entry [:geoname] :removed)])]
     (fn location-details-render [entry put-fn edit-mode?]
       (let [geoname (:geoname @entry)]
         (when (and geoname (not= :removed geoname))


Removed lexicase variants from one-individual-per-error-vector-for-lexicase that would have different probabilities of selection with it than without it.

--- src/clojush/pushgp/selection/preselection.clj
+++ src/clojush/pushgp/selection/preselection.clj
@@ -6,9 +6,7 @@
   to represent each error vector."
   [pop {:keys [parent-selection]}]
   (if (some #{parent-selection}
-            #{:lexicase :leaky-lexicase :epsilon-lexicase :elitegroup-lexicase
-              :random-threshold-lexicase :random-toggle-lexicase
-              :randomly-truncated-lexicase})
+            #{:lexicase :leaky-lexicase :elitegroup-lexicase})
     (map lrand-nth (vals (group-by #(:errors %) pop)))
     pop))


PDOK-1599: mustache-runner extended with extract-type

--- src/main/clojure/pdok/mustache_runner.clj
+++ src/main/clojure/pdok/mustache_runner.clj
@@ -6,11 +6,11 @@
   (with-open [w (clojure.java.io/writer (str dataset "-" feature-type "-" idx ".xml"))]
        (.write w feature)))

-(defn -main [feature-type feature-file & args]
+(defn -main [feature-type feature-file extract-type & args]
   (let [dataset "bgt"
         features (e/file-to-features feature-file dataset)
         template-dir (or (first args) "")
-        rendered-features (map second (e/features-for-extract dataset feature-type features template-dir))
+        rendered-features (map second (e/features-for-extract dataset feature-type extract-type features template-dir))
         num-features (count rendered-features)]
     (doseq [idx (take num-features (range num-features))]
      (write-file "bgt" feature-type (get (vec rendered-features) idx) idx))))


Drop unneeded bits

Drop unneeded bits

--- examples/kafka-jvm/src/clj/pixelcount/spouts/pixel_spout.clj
+++ examples/kafka-jvm/src/clj/pixelcount/spouts/pixel_spout.clj
@@ -13,29 +13,21 @@

 ;; Default path, shouldn't be a need to change this
-(def ^{:private true
-       :doc "Zookeeper broker path"}
+(def ^{:doc "Zookeeper broker path"}
   zk-broker-path "/brokers")

-;; Need to use ZkHosts instead of StaticHosts to configure hosts --
-;; see https://groups.google.com/forum/#!topic/storm-user/RniihgIQxCI
-;; (def kafka-hosts (KafkaConfig$StaticHosts/fromHostString host 1))
 (def kafka-zk-hosts (ZkHosts. zk-hosts zk-broker-path))

-(def ^{:private true
-       :doc "Topic name"}
+(def ^{:doc "Topic name"}
   topic-name "pixels")

-(def ^{:private true
-       :doc "Root path of Zookeeper for spout to store consumer offsets"}
+(def ^{:doc "Root path of Zookeeper for spout to store consumer offsets"}
   kafka-zk-root "/kafka_storm")

-(def ^{:private true
-       :doc "ID for this Kafka consumer"}
+(def ^{:doc "ID for this Kafka consumer"}
   kafka-consumer-id "pixel_reader")

-(def ^{:private true
-       :doc "Kafka spout config definition"}
+(def ^{:doc "Kafka spout config definition"}
   spout-config (let [cfg (SpoutConfig. kafka-zk-hosts topic-name kafka-zk-root kafka-consumer-id)]
                   (set! (. cfg scheme) (SchemeAsMultiScheme. (StringScheme.)))
                   ;; During testing, it's usually valuable to force a spout to


Upgrade to latest bidi

Upgrade to latest bidi

--- modules/bidi/project.clj
+++ modules/bidi/project.clj
@@ -6,7 +6,7 @@
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
   :dependencies [[com.stuartsierra/component "0.2.1"]
-                 [bidi "1.16.0"]
+                 [bidi "1.17.0"]
                  [juxt.modular/ring "0.5.2"]
                  [prismatic/schema "0.3.3"]
                  [prismatic/plumbing "0.3.5"]]


reposition menu

reposition menu

--- Assets/game/player.clj
+++ Assets/game/player.clj
@@ -117,6 +117,6 @@
      (.LookAt rect (l/v3* (l/v3- (.position rect) (.. UnityEngine.Camera/main transform position)) 5)))))
   (ui/on-value-changed input #'on-name-change)
   (timeline*
-   (tween {:position (l/v3+ (l/v3 0 2.4 -1) (.. skater transform position))} name-canvas 2 {:out :pow3}))))
+   (tween {:position (l/v3+ (l/v3 0 2.4 1) (.. skater transform position))} name-canvas 2 {:out :pow3}))))

 '(setup-name-select)


Fix add email form values.

Fix add email form values.

--- src/cljs/hatnik/web/client/form_components.cljs
+++ src/cljs/hatnik/web/client/form_components.cljs
@@ -45,7 +45,7 @@

 ;; For selecting action form body

-(defn email-action-form-body [data]
+(defn email-action-form-body [data artifact template]
   (dom/form
    #js {:id "email-action-form"}
    (dom/div #js {:className "form-group"}
@@ -53,7 +53,8 @@
             (dom/input #js {:type "text"
                             :className "form-control"
                             :id "artifact-input"
-                            :placeholder "Artifact name"}))
+                            :placeholder "Artifact name"
+                            :value artifact}))
    (dom/div #js {:className "form-group"}
             (dom/label #js {:for "emain-input"} "Email")
             (dom/input #js {:type "email"
@@ -66,17 +67,21 @@
                      (dom/textarea #js {:cols "40"
                                         :className "form-control"
                                         :id "emain-body-input"}
-                                   "Library release: {{LIBRARY}} {{VERSION}}")))))
+                                   template)))))
+
+(defn email-create-action-body [data]
+  (let [artifact-input (.getElementById js/document "artifact-input")
+        email-body-input (.getElementById js/document "emain-body-input")]
+    (email-action-form-body data "" "Library release: {{LIBRARY}} {{VERSION}}")))

 (defn email-edit-action [data]
   (let [artifact-input (.getElementById js/document "artifact-input")
         email-body-input (.getElementById js/document "emain-body-input")]
-    (set! (.-value artifact-input) (get (:current-action data) "library"))
-    (set! (.-value email-body-input) (get (:current-action data) "template"))
-    (email-action-form-body data)))
+    (email-action-form-body data (get (:current-action data) "library")
+                            (get (:current-action data) "template"))))

 (def action-form-bodys
-  {:email-action email-action-form-body
+  {:email-action email-create-action-body
    :email-edit-action email-edit-action})

 (defn action-form-body [data body]


wrap the workspace tab bar for small-width windows (#1424)

--- src/cljs/main/broadfcui/components/tab_bar.cljs
+++ src/cljs/main/broadfcui/components/tab_bar.cljs
@@ -54,7 +54,7 @@
                  :padding "0 1.5rem" :justifyContent "space-between"}}

    [:div {:data-test-id (or data-test-id "tabs")
-          :style {:display "flex"}}
+          :style {:display "flex" :flexWrap "wrap"}}
     (map-indexed
      (fn [index [label link-key]]
        (make-tab (merge {:first? (zero? index)


make tokeninfo resolver configurable

make tokeninfo resolver configurable

--- src/io/sarnowski/swagger1st/util/security.clj
+++ src/io/sarnowski/swagger1st/util/security.clj
@@ -43,18 +43,12 @@
 (defn resolve-access-token
   "Checks with a tokeninfo endpoint for the token's validity and returns the session information if valid."
   [tokeninfo-url access-token]
-  ; TODO make connection pool configurable!
   (try
-    (let [request-start (t/now)
-          response (client/get tokeninfo-url
+    (let [response (client/get tokeninfo-url
                                {:query-params     {:access_token access-token}
                                 :throw-exceptions false
                                 :as               :json-string-keys})
-          request-end (t/now)
-          body (:body response)
-          request-duration-ms (t/in-millis (t/interval request-start request-end))]
-      (when-not (< 10 request-duration-ms)
-        (log/warn "resolving tokeninfo took" request-duration-ms "ms"))
+          body (:body response)]
       (when (= 200 (:status response)) body))
     (catch IOException e
       (log/warn "could not get tokeninfo from" tokeninfo-url "because " (str e) "; rejecting token!")
@@ -78,14 +72,15 @@
    * config-fn takes one parameter for getting configuration values. Configuration values:
    ** :tokeninfo-url
    * check-scopes-fn takes tokeninfo and scopes data and returns if token is valid"
-  [get-config-fn check-scopes-fn]
+  [get-config-fn check-scopes-fn & {:keys [resolver-fn]
+                                    :or {resolver-fn resolve-access-token}}]
   (fn [request definition requirements]
     ; get access token from request
     (if-let [access-token (extract-access-token request)]
       (let [tokeninfo-url (get-config-fn :tokeninfo-url)]
         (if tokeninfo-url
           ; check access token
-          (if-let [tokeninfo (resolve-access-token tokeninfo-url access-token)]
+          (if-let [tokeninfo (resolver-fn tokeninfo-url access-token)]
             ; check scopes
             (if (check-scopes-fn tokeninfo requirements)
               (assoc request :tokeninfo tokeninfo)


Node on issues

Node on issues


styling

styling


remove badge duplicate from grid when featured


Inform about returning reduced data

Inform about returning reduced data

--- src/matchmaker_sparql/evaluation/teardown.clj
+++ src/matchmaker_sparql/evaluation/teardown.clj
@@ -2,7 +2,8 @@
   (:require [matchmaker-sparql.endpoint :refer [endpoint]]
             [matchmaker-sparql.config :refer [config]]
             [sparclj.core :as sparql]
-            [stencil.core :as stencil]))
+            [stencil.core :as stencil]
+            [taoensso.timbre :as timbre]))

 (defn return-withheld-data
   "Return pc:awardedTender links from `withheld-graph` back to source graph."
@@ -11,6 +12,7 @@
         update-operation (stencil/render-file "templates/evaluation/teardown/return_withheld_data"
                                               {:graph graph
                                                :withheld-graph withheld-graph})]
+    (timbre/info "Returning reduced data...")
     (sparql/update-operation endpoint update-operation)))

 (defn teardown-evaluation


minor - comments

minor - comments

--- cljs-admin/tourneybot_admin/core.cljs
+++ cljs-admin/tourneybot_admin/core.cljs
@@ -561,6 +561,7 @@
         :on-touch-start (partial on-change-status game-id status-val)}
        (get status-text status-val)])))

+;; TODO: do not allow teamA and teamB to be the same in a single game
 (rum/defc GameRow2 < rum/static
   [teams [game-id game]]
   (let [{:keys [start-time teamA-id teamB-id]} game
@@ -591,7 +592,6 @@
                           :type "text"
                           :value start-time}]]]
           [:tr
-              ;; TODO: do not allow them to have the same team play each other
             [:td.label-cell "Team A"]
             [:td (if-not scorable?
                    (TeamSelect teams game-id game :teamA-id)
@@ -608,8 +608,6 @@
           [:tr
             [:td.label-cell "Status"]
             [:td {:col-span "3"}
-              ;; TODO: do not let them move the game from "Scheduled"
-              ;; if there is not a time, teamA, and teamB
               (StatusInput game-id scheduled-status status any-points?)
               (StatusInput game-id in-progress-status status (not both-teams-selected?))
               (StatusInput game-id finished-status status (not both-teams-selected?))]]]]]))


Updated doesChildLearnGrammar? function

Updated doesChildLearnGrammar? function

--- src/research_clojure/eChild/runSimulation.clj
+++ src/research_clojure/eChild/runSimulation.clj
@@ -17,9 +17,10 @@
   (def grammarLearned (atom false))
   (def sentenceCount (atom 0))

+  (def eChildData [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1])
   (while (and (not @grammarLearned) (< @sentenceCount max_num))
-    (def eChildData (conj (consumeSentence (rand-nth sentences)) [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1]))
-    (def currGrammarAndState (setParameters (get eChildData 0) (get eChildData 2)))
+    (conj eChildData (consumeSentence (rand-nth sentences)))
+    (def currGrammarAndState (setParameters (get eChildData 1) (get eChildData 0)))
     (swap! grammarLearned (isGrammarLearned? (get currGrammarAndState 1)))
     (swap! sentenceCount inc))
   ;(writeResults currGrammarAndState)


Create the client side cache

Create the client side cache

When a request is made from a data client for realtime data then make
sure you create a client side cache entry for that client

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -633,6 +633,18 @@

+(defn create-client-cache [client-realtime-id]
+  (let [client-cache     (get @realtime-clients  client-realtime-id)
+        ]
+    (if (nil? client-cache)
+      (swap! realtime-clients assoc client-realtime-id (atom {:queries (atom {})    :records (atom {})})))))
+
+
+
+
+
+
+
 ; ----------------------------------------------------------------
 ; Whenever the web browser asks the server for data it calls
 ; this function (!get-query-results-v2) telling the server
@@ -685,6 +697,7 @@
                       :params    params
                       :order     order)
          ]
+     (create-client-cache  data-session-id)

      (if (get @cached-queries  query-key)
        nil


Fix tests for bidi routes generated from screens

--- src/test/workflo/macros/screen/bidi_test.cljs
+++ src/test/workflo/macros/screen/bidi_test.cljs
@@ -1,7 +1,13 @@
 (ns workflo.macros.screen.bidi-test
-  (:require [cljs.test :refer-macros [deftest is]]
+  (:require [cljs.test :refer-macros [deftest is use-fixtures]]
             [workflo.macros.screen :as screen :refer-macros [defscreen]]
             [workflo.macros.screen.bidi :as screen-bidi]))
+
+(defn empty-screen-registry [f]
+  (screen/reset-registry!)
+  (f))
+
+(use-fixtures :each empty-screen-registry)

 (deftest routes
   (def user-view :user-view)
@@ -27,9 +33,9 @@
       {:content users-view}))
   (and
    ;; Check routes generation
-   (is (= '["/" [[["users"] users]
-                [["users" "/" :user-id] user]
-                [["users" "/" :user-id "/" "settings"] user-settings]]]
+   (is (= '["/" [[["users" "/" :user-id] user]
+                 [["users" "/" :user-id "/" "settings"] user-settings]
+                 [["users"] users]]]
           (screen-bidi/routes)))
    ;; Check route matching
    (is (= {:screen (screen/resolve-screen 'users)


Content tweak

Content tweak

--- resources/fragments/onvim.clj
+++ resources/fragments/onvim.clj
@@ -1,14 +1,15 @@
 [:article
- [:h1 "Complaints about VIM as I Struggle to Master It"]
- [:h2 "~ or ~"]
- [:h1 "Straw Horses & VIM: How They Tell You Editing Sucks, VS How It Actually Sucks"]
- [:h2 "Oliver Mooney"]
+ [:h1 "A Programmer's Lament"]
+ [:h2 "Complaints about VIM as I Struggle to Master It"]
+ [:h3 "~ or ~"]
+ [:h1 "Straw Horses & VIM"]
+ [:h2 "How They Tell You Editing Sucks, VS How It Actually Sucks"]
  [:section   [:p [:span.newthought "I am typing this in "
                   [:a {:href "http://spacemacs.org"} "Spacemacs"]
                   ]
               ", a version of Emacs that's been overhauled to operate like Vim."]

-  [:p "I've watched "[:a {:href "https://vimeo.com/53144573"} "Drew Neil's talk on Vim"] " and bought his book, which I'm still working throuh. I've run through the VimTutor more than once, in Vim and in Spacemacs, and I've used Spacemacs for real work (both client work and to build the static site generator that creates these pages)."
+  [:p "I've watched "[:a {:href "https://vimeo.com/53144573"} "Drew Neil's talk on Vim"] " and bought his book, which I'm still working throuh. I've run through the VimTutor more than once, in Vim and in Spacemacs, and I've used Spacemacs for real work (both client work and to build the static site generator that creates these pages)."
    [:ul
     [:li "The mouse is BAD (not if you've played video games all your life, it's not; first-person shooters are ALL ABOUT hitting arbitrary tiny targets fast, and I've been doing that for a decade or more for fun; and these days the touchpad on laptops is always in the same place, vastly reducing time needed to find & use it). For example, Neil (around 33 minutes into his talk) talks about a notional touch interaction where you've to pick out the opening and closing brackets/tags/quotes of a section of text to highlight them. But who would suggest that?! There's already a great way of selecting the matching closing tag in a text using a mouse: double-click the opening (or closing) tag. IntelliJ does this, and I'm sure others do too. It works " [:emphasis "without"] " you having to even consider the type of tag and finding it's matching symbol on the keyboard. The v-a-t workflow Neil describes is " [:strong "great"] ", but made-up examples of poor alternatives don't sell it."]
     [:li "The cursor keys are BAD because... reasons?"]


hashtag replacement in multiline entries

--- iwaswhere-web/src/cljs/iwaswhere_web/ui/markdown.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/ui/markdown.cljs
@@ -52,10 +52,7 @@
             md-string (or (:md @local-display-entry) "edit here")
             ts (:timestamp entry)
             get-content #(aget (.. % -target -parentElement -parentElement -firstChild -firstChild) "innerText")
-            update-temp-fn (fn [ev]
-                             (let [cursor-pos {:cursor-pos (.-anchorOffset (.getSelection js/window))}
-                                   updated (with-meta (merge latest-entry (h/parse-entry (get-content ev))) cursor-pos)]
-                               (reset! local-saved-entry updated)))
+            update-temp-fn #(reset! local-saved-entry (merge latest-entry (h/parse-entry (get-content %))))
             save-fn #(put-fn [:text-entry/update @local-saved-entry])
             on-keydown-fn (fn [ev] (let [key-code (.. ev -keyCode)
                                          meta-key (.. ev -metaKey)]
@@ -74,9 +71,12 @@
                        :on-input         update-temp-fn
                        :on-key-down      on-keydown-fn}
                 md-string]]
-         (let [cursor-pos (.-anchorOffset (.getSelection js/window))
+         (let [selection (.getSelection js/window)
+               cursor-pos (.-anchorOffset selection)
+               anchor-node (aget selection "anchorNode")
+               node-value (str (when anchor-node (aget anchor-node "nodeValue")) "")
                md (:md @local-saved-entry)
-               before-cursor (subs md 0 cursor-pos)
+               before-cursor (subs node-value 0 cursor-pos)
                current-tag (re-find (js/RegExp. "(?!^)#[\\w\\-\\u00C0-\\u017F]+$" "m") before-cursor)
                current-tag-regex (js/RegExp. current-tag "i")
                tag-substr-filter (fn [tag] (when current-tag (re-find current-tag-regex tag)))