Added compare-string-lengths problem

Added compare-string-lengths problem

--- src/clojush/problems/software/compare_string_lengths.clj
+++ src/clojush/problems/software/compare_string_lengths.clj
@@ -20,18 +20,20 @@
   (concat (list
             (fn [] (lrand-nth (list true false))) ;Boolean
             ;;; end ERCs
-            (tag-instruction-erc [:exec :integer :boolean :string :char] 1000)
+            (tag-instruction-erc [:integer :boolean :string :exec] 1000)
             (tagged-instruction-erc 1000)
             ;;; end tag ERCs
             'in1
+            'in2
+            'in3
             ;;; end input instructions
             )
-          (registered-for-stacks [:integer :boolean :string :char :exec :print])))
+          (registered-for-stacks [:integer :boolean :string :exec])))

 ;; Define test cases
 (defn csl-input
-  "Makes a Compare String Lengths input of length len."
+  "Makes a Compare String Lengths input string of length len."
   [len]
   (apply str
          (repeatedly len
@@ -44,14 +46,10 @@
 ;; inputs is either a list or a function that, when called, will create a
 ;; random element of the set.
 (def csl-data-domains
-  [[(list "", "A", "\t", "\n", "B\n", "\n\n",
-          (apply str (repeat 50 \newline))
-          (apply str (repeat 50 \space))
-          (apply str (repeat 50 \s))
-          (apply str (take 50 (cycle (list \C \D \newline))))
-          (apply str (take 50 (cycle (list \x \newline \y \space))))
-          (apply str (take 50 (cycle (list \space \newline))))) 12 0] ;; "Special" inputs covering some base cases
-   [(fn [] (csl-input (inc (lrand-int 50)))) 88 1000]
+  [[(list ["" "" ""] ["" "a" "bc"] ["q" "" "to"]) 3 0] ;; Some small cases with empty strings
+   [(fn [] (repeat 3 (csl-input (lrand-int 50)))) 5 100] ;; Edge cases where all are the same
+   [(fn [] (sort-by count (repeatedly 3 #(csl-input (lrand-int 50))))) 20 200] ;; Cases forced to be in order
+   [(fn [] (repeatedly 3 #(csl-input (lrand-int 50)))) 72 700] ;; Cases in random order
    ])

@@ -82,9 +80,7 @@
    [input output]."
   [inputs]
   (map #(vector %
-                (format "Check sum is %c"
-                        (char (+ (mod (apply + (map int %)) 64)
-                                 (int \space)))))
+                (apply < (map count %)))
        inputs))

 ; Define error function. For now, each run uses different random inputs
@@ -94,7 +90,7 @@
   [data-domains]
   (let [[train-cases test-cases] (map csl-test-cases
                                       (test-and-train-data-from-domains data-domains))]
-    (when false ;; Change to false to not print test cases
+    (when true ;; Change to false to not print test cases
       (doseq [[i case] (map vector (range) train-cases)]
         (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
       (doseq [[i case] (map vector (range) test-cases)]
@@ -106,29 +102,26 @@
         (the-actual-csl-error-function program data-cases false))
       ([program data-cases print-outputs]
         (let [behavior (atom '())
-              errors (flatten
-                       (doall
-                         (for [[input correct-output] (case data-cases
-                                                                   :train train-cases
-                                                                   :test test-cases
-                                                                   [])]
-                           (let [final-state (run-push program
-                                                       (->> (make-push-state)
-                                                         (push-item input :input)
-                                                         (push-item "" :output)))
-                                 printed-result (stack-ref :output 0 final-state)]
-                             (when print-outputs
-                               (println (format "Correct output: %-19s | Program output: %-19s" correct-output printed-result)))
-                             ; Record the behavior
-                             (when @global-print-behavioral-diversity
-                               (swap! behavior conj printed-result))
-                             ; Error is Levenshtein distance and, if correct format, distance from correct character
-                             (vector
-                               (levenshtein-distance correct-output printed-result)
-                               (if (not (empty? printed-result))
-                                 (abs (- (int (last correct-output)) (int (last printed-result)))) ;distance from correct last character
-                                 1000) ;penalty for wrong format
-                               )))))]
+              errors (doall
+                       (for [[[input1 input2 input3] correct-output] (case data-cases
+                                                                                :train train-cases
+                                                                                :test test-cases
+                                                                                [])]
+                         (let [final-state (run-push program
+                                                     (->> (make-push-state)
+                                                       (push-item input3 :input)
+                                                       (push-item input2 :input)
+                                                       (push-item input1 :input)))
+                               result (top-item :boolean final-state)]
+                           (when print-outputs
+                             (println (format "Correct output: %5b | Program output: %5b" correct-output result)))
+                           ; Record the behavior
+                           (when @global-print-behavioral-diversity
+                             (swap! behavior conj result))
+                           ; Error is boolean error
+                           (if (= result correct-output)
+                             0
+                             1))))]
           (when @global-print-behavioral-diversity
             (swap! population-behaviors conj @behavior))
           errors)))))
@@ -161,11 +154,11 @@
 (def argmap
   {:error-function (csl-error-function csl-data-domains)
    :atom-generators csl-atom-generators
-   :max-points 800
-   :max-points-in-initial-program 400
-   :evalpush-limit 1500
+   :max-points 200
+   :max-points-in-initial-program 100
+   :evalpush-limit 200
    :population-size 1000
-   :max-generations 300
+   :max-generations 200
    :parent-selection :lexicase
    :genetic-operator-probabilities {:alternation 0.2
                                     :uniform-mutation 0.2
@@ -173,7 +166,7 @@
                                     [:alternation :uniform-mutation] 0.5
                                     }
    :alternation-rate 0.01
-   :alignment-deviation 10
+   :alignment-deviation 5
    :uniform-mutation-rate 0.01
    :problem-specific-report csl-report
    :print-behavioral-diversity true


CMR-1453 Fixes test

CMR-1453 Fixes test

--- common-app-lib/src/cmr/common_app/api_docs.clj
+++ common-app-lib/src/cmr/common_app/api_docs.clj
@@ -92,7 +92,6 @@
       (force-trailing-slash req ; Without a trailing slash, the relative URLs in index.html are wrong
                             {:status 200
                              :body (slurp (io/resource welcome-page-location))}))
-    (route/resources "/")
     (context "/site" []
       (GET ["/:page", :page #".*\.html$"] {headers :headers, {page :page} :params}
         (when-let [resource (site-resource page)]
@@ -101,6 +100,9 @@
              :body (-> resource
                        slurp
                        (str/replace "%CMR-ENDPOINT%" cmr-root))})))
+      ;; Static HTML resources, typically API documentation which
+      ;; needs endpoint URLs replaced
+      (route/resources "/" {:root resource-root})
       (route/not-found (site-resource "404.html")))))

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


Make sure the entry is created without follow-ups and they are added later with the dedicated resource method.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -80,12 +80,12 @@
       ;; Create the new entry from the URL and data provided
       (let [entry-map (:data ctx)
             author (:user ctx)
-            new-entry (entry-res/->entry conn (:uuid board) entry-map author)
-            new-entry-without-follow-ups (dissoc new-entry :follow-ups)
+            without-follow-ups (dissoc entry-map :follow-ups)
+            new-entry (entry-res/->entry conn (:uuid board) without-follow-ups author)
             ts (db-common/current-timestamp)
             follow-ups (map #(fix-follow-up % author ts) (:follow-ups entry-map))
             valid-follow-ups? (every? #(lib-schema/valid? common-res/FollowUp %) follow-ups)]
-        {:new-entry (api-common/rep new-entry-without-follow-ups) :existing-board (api-common/rep board)
+        {:new-entry (api-common/rep new-entry) :existing-board (api-common/rep board)
          :new-follow-ups follow-ups})

       (catch clojure.lang.ExceptionInfo e


Reverse the order of the shared list to keep the most recent ones.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -123,7 +123,7 @@
             entry (:existing-entry ctx)
             user (:user ctx)
             share-requests (:share-requests ctx)
-            shared {:shared (take 50 (sort-by :shared-at (concat (or (:shared entry) []) share-requests)))}
+            shared {:shared (take 50 (reverse (sort-by :shared-at (concat (or (:shared entry) []) share-requests))))}
             update-result (entry-res/update-entry-no-version! conn (:uuid entry) shared user)
             entry-with-comments (assoc entry :existing-comments (entry-res/list-comments-for-entry conn (:uuid entry)))]
     (do


Made the bass more active.

Made the bass more active.

--- src/overtunes/songs/at_all.clj
+++ src/overtunes/songs/at_all.clj
@@ -35,10 +35,13 @@

 (def progression [I I II II II V I (update-in V [:base] lower)])

-(defn rythm-n-bass# [timing [chord & chords]]
+(defn rythm-n-bass# [timing [chord1 chord2 & chords]]
   (do
-    (at (timing 0) (note# (:base chord)))
-    (at (timing 2) (chord# (dissoc chord :base)))
-    (rythm-n-bass# (from timing 4) chords)))
+    (at (timing 0) (note# (:base chord1)))
+    (at (timing 2) (chord# (dissoc chord1 :base)))
+    (at (timing 3) (note# (:base chord1)))
+    (at (timing 4) (note# (:base chord2)))
+    (at (timing 6) (chord# (dissoc chord2 :base)))
+    (rythm-n-bass# (from timing 8) chords)))

 (rythm-n-bass# (bpm 130) (cycle progression))


Fixed typos in mod-update

Fixed typos in mod-update

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -386,12 +386,12 @@
       (dissoc :keep-votes))))

-(defn mod-uddate
+(defn mod-update
   "Take a conversation record and a seq of moderation data and updates the conversation's mod-out attr"
   [conv mods]
   (let [mod-sep (fn [mod] (->> mods (filter #{mod}) (map :tid)))
         mod-out (mod-sep -1)
-        mod-in  (mod-spec 1)]
+        mod-in  (mod-sep 1)]
     (update-in conv
                [:mod-out]
                (plmb/fn->


Each test file should have its own env

Each test file should have its own env

--- test/cljs/go_test.clj
+++ test/cljs/go_test.clj
@@ -209,6 +209,7 @@
                  (js* "x[`last`] = `finally`")))))]
    (emit-test "go_test" "special_forms_test")))

+;; these are generated and compiled, but not actually run during the tests
 (defn benchmarks []
   (->>
    [(bench "Fibonacci"
@@ -227,14 +228,13 @@
    (emit-test "go_test" "benchmarks_test")))

 (deftest go-all-tests
-  (cljs.env/ensure
-   (binding [cljs.analyzer/*cljs-file* (:file (meta #'go-test))
-             cljs.compiler/*go-line-numbers* true
-             *data-readers* cljs.tagged-literals/*cljs-data-readers*]
-     (constants)
-     (special-forms)
-     (benchmarks) ;; these are generated and compiled, but not actually run during the tests
-     (go-test "./..."))))
+  (binding [cljs.analyzer/*cljs-file* (:file (meta #'go-test))
+            cljs.compiler/*go-line-numbers* true
+            *data-readers* cljs.tagged-literals/*cljs-data-readers*]
+    (doseq [gen [constants special-forms benchmarks]]
+      (cljs.env/ensure
+       (gen)))
+    (go-test "./...")))

 (defn run-benchmarks []
   (doseq [dir ["." "target/generated/go_test"]]


fix #1124

fix #1124

--- src/status_im/chat/handlers/send_message.cljs
+++ src/status_im/chat/handlers/send_message.cljs
@@ -203,8 +203,9 @@
   (u/side-effect!
     (fn [_ [_ {:keys [chat-id] :as params} {:keys [result] :as data}]]
       (let [{:keys [returned context]} result
-            {:keys [markup text-message]} returned
-            {:keys [log-messages update-db default-db]} context]
+            {:keys [markup text-message err]} returned
+            {:keys [log-messages update-db default-db]} context
+            content (or err text-message)]
         (when update-db
           (dispatch [:update-bot-db {:bot chat-id
                                      :db  update-db}]))
@@ -223,10 +224,10 @@
                           :chat-id      chat-id
                           :from         chat-id
                           :to           "me"}]))))
-        (when text-message
+        (when content
           (dispatch [:received-message
                      {:message-id   (random/id)
-                      :content      (str text-message)
+                      :content      (str content)
                       :content-type text-content-type
                       :outgoing     false
                       :chat-id      chat-id


Add :add-pending-contact-and-open-chat handler

--- src/status_im/ui/screens/contacts/events.cljs
+++ src/status_im/ui/screens/contacts/events.cljs
@@ -7,7 +7,7 @@
             [status-im.protocol.core :as protocol]
             [status-im.utils.utils :refer [http-post]]
             [status-im.utils.phone-number :refer [format-phone-number]]
-            [status-im.utils.random :as random]
+            [status-im.utils.random :as random]
             [taoensso.timbre :as log]
             [cljs.reader :refer [read-string]]
             [status-im.utils.js-resources :as js-res]
@@ -156,7 +156,7 @@
                                   :photo-path       (identicon whisper-identity)
                                   :whisper-identity whisper-identity}]
                      (if (contacts/exists? whisper-identity)
-                       (dispatch [:add-pending-contact whisper-identity])
+                       (dispatch [:add-pending-contact-and-open-chat whisper-identity])
                        (dispatch [:add-new-contact-and-open-chat contact])))
                    (dispatch [:set :contacts/new-public-key-error (label :t/unknown-address)]))))))

@@ -236,7 +236,7 @@
            :bot-url          bot-url
            :description      description
            :dapp-hash        dapp-hash})
-        all-default-contacts (conj default-contacts console-chat/contact)]
+        all-default-contacts (conj default-contacts console-chat/contact)]
     [[:add-contacts all-default-contacts]]))

 (defn- prepare-add-chat-events [contacts default-contacts]
@@ -290,7 +290,7 @@
                              ;; NOTE(oskarth): Overwriting default contacts here
                              ;;(remove #(identities (:whisper-identity %)))
                              (map #(vector (:whisper-identity %) %))
-                             (into {}))
+                             (into {}))
           fx            {:db              (update db :contacts/contacts merge new-contacts')
                          ::save-contacts! (vals new-contacts')}]
       (transduce (map second)
@@ -347,6 +347,12 @@
       {:dispatch-n [[::add-new-contact contact']
                     [:watch-contact contact']
                     [:discoveries-send-portions chat-or-whisper-id]]})))
+
+(register-handler-fx
+  :add-pending-contact-and-open-chat
+  (fn [_ [_ whisper-id]]
+    {:dispatch-n [[:add-pending-contact whisper-id]
+                  [:start-chat whisper-id {:navigation-replace? true}]]}))

 (register-handler-db
   :set-contact-identity-from-qr
@@ -439,9 +445,8 @@
   (fn [{:keys [db]} [_ id]]
     (if (spec/valid? :global/address id)
       {::request-contact-by-address id}
-      {:dispatch-n (if (get-in db [:contacts/contacts id])
-                     [[:add-pending-contact id]
-                      [:start-chat id {:navigation-replace? true}]]
-                     [[:add-new-contact-and-open-chat {:name             (generate-gfy id)
-                                                       :photo-path       (identicon id)
-                                                       :whisper-identity id}]])})))
+      {:dispatch (if (get-in db [:contacts/contacts id])
+                   [:add-pending-contact-and-open-chat id]
+                   [:add-new-contact-and-open-chat {:name             (generate-gfy id)
+                                                    :photo-path       (identicon id)
+                                                    :whisper-identity id}])})))


TCHECK-93: use realistic sizing on TCHECK-32 test

Details in the comment I added above the test.

--- src/test/clojure/clojure/test/check/test.cljc
+++ src/test/clojure/clojure/test/check/test.cljc
@@ -960,17 +960,21 @@
 ;; TCHECK-32 Regression
 ;; ---------------------------------------------------------------------------

-;; Setting this to run sparsely on CLJS until I figure out why it's so
-;; slow
-(defspec merge-is-idempotent-and-this-spec-doesn't-OOM #?(:clj 200
-                                                          :cljs 10)
-  ;; using any-edn  here because:
+;; The original code reported in TCHECK-32 used 100 test runs,
+;; but I'm using 50 here because 100 pushes the limits of my
+;; node.js default memory allocation. I don't consider that
+;; the same as the original problem, though, because it's just
+;; as likely to OOM for (let [g (gen/vector gen/string)] (gen/map g g)),
+;; which shows that the problem has more to do with 2D collections of
+;; strings/etc. cranked up to size=200 than it has to do with
+;; gen/any in particular.
+(defspec merge-is-idempotent-and-this-spec-doesn't-OOM 50
+  ;; using any-edn instead of gen/any here because:
   ;;
   ;; - NaN is problematic as a map key in general
   ;; - NaN/infinity are a problem as a map key and set element on CLJS
   ;;   because of CLJS-1594
   ;; - NaN can be equal to itself in clj when identical? checks
   ;;   short-circuit equality, but this doesn't seem to happen in CLJS
-  (prop/for-all [m (->> (gen/map any-edn any-edn)
-                        #?(:cljs (gen/scale #(* 20 %))))]
+  (prop/for-all [m (gen/map any-edn any-edn)]
     (= m (merge m m))))


Reflow long lines in query tests

Reflow long lines in query tests

--- src/test/workflo/macros/specs/query_test.cljc
+++ src/test/workflo/macros/specs/query_test.cljc
@@ -417,23 +417,26 @@
     '[(a {b c d e})]

     '[[:parameterization
-       {:query [:property [:join [:properties {[:simple a]
-                                               [[:property [:simple b]]
-                                                [:property [:simple c]]]}]]]
+       {:query
+        [:property [:join [:properties {[:simple a]
+                                        [[:property [:simple b]]
+                                         [:property [:simple c]]]}]]]
         :parameters {d e f g}}]]
     '[({a [b c]} {d e f g})]

-    '[[:parameterization {:query [:aliased-property {:property [:simple a]
-                                                     :as :as :alias b}]
-                          :parameters {c d e f}}]]
+    '[[:parameterization
+       {:query [:aliased-property {:property [:simple a]
+                                   :as :as :alias b}]
+        :parameters {c d e f}}]]
     '[(a :as b {c d e f})]

     '[[:parameterization
-       {:query [:aliased-property
-                {:property [:join [:properties {[:simple a]
-                                                [[:property [:simple b]]
-                                                 [:property [:simple c]]]}]]
-                 :as :as :alias d}]
+       {:query
+        [:aliased-property
+         {:property [:join [:properties {[:simple a]
+                                         [[:property [:simple b]]
+                                          [:property [:simple c]]]}]]
+          :as :as :alias d}]
         :parameters {e f g h}}]]
     '[({a [b c]} :as d {e f g h})]))

@@ -486,19 +489,22 @@
        [:join
         [:properties
          {[:simple users]
-          [[:prefixed-properties {:base db
-                                  :children [[:property [:simple id]]]}]
-           [:prefixed-properties {:base user
-                                  :children [[:property [:simple name]]]}]
+          [[:prefixed-properties
+            {:base db
+             :children [[:property [:simple id]]]}]
+           [:prefixed-properties
+            {:base user
+             :children [[:property [:simple name]]]}]
            [:property
-            [:join [:properties
-                    {[:simple friends]
-                     [[:prefixed-properties
-                       {:base db
-                        :children [[:property [:simple id]]]}]
-                      [:prefixed-properties
-                       {:base user
-                        :children [[:property [:simple name]]]}]]}]]]]}]]]]
+            [:join
+             [:properties
+              {[:simple friends]
+               [[:prefixed-properties
+                 {:base db
+                  :children [[:property [:simple id]]]}]
+                [:prefixed-properties
+                 {:base user
+                  :children [[:property [:simple name]]]}]]}]]]]}]]]]
     '[{users [db [id]
               user [name]
               {friends [db [id]
@@ -512,24 +518,27 @@
             [:join
              [:properties
               {[:simple friends]
-               [[:property [:join
-                            [:properties
-                             {[:simple friends]
-                              [[:prefixed-properties
-                                {:base db
-                                 :children [[:property [:simple id]]]}]]}]]]]}]]]]}]]]]
+               [[:property
+                 [:join
+                  [:properties
+                   {[:simple friends]
+                    [[:prefixed-properties
+                      {:base db
+                       :children
+                       [[:property [:simple id]]]}]]}]]]]}]]]]}]]]]
     '[{users [{friends [{friends [db [id]]}]}]}]))

 (deftest parsing-joins-with-sub-joins
   (are [out in] (= out (q/conform-and-parse in))
     '[{:name users :type :join
        :join-source {:name users :type :property}
-       :join-target [{:name db/id :type :property}
-                     {:name user/name :type :property}
-                     {:name friends :type :join
-                      :join-source {:name friends :type :property}
-                      :join-target [{:name db/id :type :property}
-                                    {:name user/name :type :property}]}]}]
+       :join-target
+       [{:name db/id :type :property}
+        {:name user/name :type :property}
+        {:name friends :type :join
+         :join-source {:name friends :type :property}
+         :join-target [{:name db/id :type :property}
+                       {:name user/name :type :property}]}]}]
     '[{users [db [id]
               user [name]
               {friends [db [id]
@@ -537,11 +546,13 @@

     '[{:name users :type :join
        :join-source {:name users :type :property}
-       :join-target [{:name friends :type :join
-                      :join-source {:name friends :type :property}
-                      :join-target [{:name friends :type :join
-                                     :join-source {:name friends :type :property}
-                                     :join-target [{:name db/id :type :property}]}]}]}]
+       :join-target
+       [{:name friends :type :join
+         :join-source {:name friends :type :property}
+         :join-target
+         [{:name friends :type :join
+           :join-source {:name friends :type :property}
+           :join-target [{:name db/id :type :property}]}]}]}]
     '[{users [{friends [{friends [db [id]]}]}]}]))

 (deftest om-next-query-for-joins-with-sub-joins
@@ -561,8 +572,9 @@
        [:join
         [:properties
          {[:simple users]
-          [[:prefixed-properties {:base db
-                                  :children [[:property [:simple id]]]}]
+          [[:prefixed-properties
+            {:base db
+             :children [[:property [:simple id]]]}]
            [:property [:link [current-user _]]]]}]]]]
     '[{users [db [id] [current-user _]]}]

@@ -592,10 +604,11 @@

     '[{:name users :type :join
        :join-source {:name users :type :property}
-       :join-target [{:name user/name :type :property}
-                     {:name current-user :type :join
-                      :join-source {:name current-user :type :link :link-id _}
-                      :join-target [{:name user/name :type :property}]}]}]
+       :join-target
+       [{:name user/name :type :property}
+        {:name current-user :type :join
+         :join-source {:name current-user :type :link :link-id _}
+         :join-target [{:name user/name :type :property}]}]}]
     '[{users [user [name] {[current-user _] [user [name]]}]}]))

 (deftest om-next-query-for-joins-with-sub-links
@@ -612,10 +625,11 @@
        [:join
         [:properties
          {[:link [user 1]]
-          [[:prefixed-properties {:base db
-                                  :children [[:aliased-property
-                                              {:property [:simple id]
-                                               :as :as :alias db-id}]]}]
+          [[:prefixed-properties
+            {:base db
+             :children [[:aliased-property
+                         {:property [:simple id]
+                          :as :as :alias db-id}]]}]
            [:aliased-property {:property [:simple name]
                                :as :as :alias nm}]]}]]]]
     '[{[user 1] [db [id :as db-id] name :as nm]}]))


Fix broken build.

Fix broken build.

--- src/forces_assemble/handler.clj
+++ src/forces_assemble/handler.clj
@@ -25,6 +25,15 @@
 (def coll-channels "channels")
 (def coll-events "events")

+(defn import-data
+  [data]
+  (if-let [id (:id data)]
+    (assoc (dissoc data :id) :_id id)))
+
+(defn export-data
+  [data]
+  (dissoc (assoc data :id (str (:_id data))) :_id))
+
 (defn is-subscribed-to-channel
   [channel-id user-id]
   (let [cursor (mc/find mongodb
@@ -90,15 +99,6 @@
   (export-data (mc/find-map-by-id mongodb
                                   coll-events
                                   (mu/object-id event-id))))
-
-(defn import-data
-  [data]
-  (if-let [id (:id data)]
-    (assoc (dissoc data :id) :_id id)))
-
-(defn export-data
-  [data]
-  (dissoc (assoc data :id (str (:_id data))) :_id))

 ;; HTTP
 (def firebase-send-uri "https://fcm.googleapis.com/fcm/send")


Rebind request id for delayed push notifications.

--- src/forces_assemble/handler.clj
+++ src/forces_assemble/handler.clj
@@ -68,11 +68,13 @@
 (defn add-event-to-channel
   [channel-id event]
   (let [push-delay (:delay event)
-        added-event (db/add-event-to-channel channel-id event)]
+        added-event (db/add-event-to-channel channel-id event)
+        local-request-id request-id]
     (if push-delay
       (at/at (+ (* 1000 push-delay) (at/now))
-             #((log/info (str "Pushing after " push-delay " s. delay"))
-               (push-event channel-id added-event))
+             #((binding [request-id local-request-id]
+                 (log/info (str "Pushing after " push-delay " s. delay"))
+                 (push-event channel-id added-event)))
              push-thread-pool)
       (push-event channel-id added-event))
     added-event))


reminder about contributing.md now that it's thorough enough

--- src/gh_active_issues/github.clj
+++ src/gh_active_issues/github.clj
@@ -59,7 +59,7 @@
    (if (= (:type issue) "pull request")
      "Thanks for your pull request!"
      "Thanks for reporting your issue!")
-   (format " This is [one of my %s active issues](%s). Use that link to check how soon your issue will be answered. Cheers."
+   (format " This is [one of my %s active issues](%s). Use that link to check how soon your issue will be answered. Don't forget to check your issue against this project's CONTRIBUTING.md. Cheers."
            issues-count
            (full-url-for (str "/#" (:id issue))))))


alias, require quote equivalent

alias, require quote equivalent

--- src/hackerrank/clojure_libs.clj
+++ src/hackerrank/clojure_libs.clj
@@ -6,7 +6,7 @@

 ;;; The baseline: require
 ;; witout require it should throw Exception
-(clojure.string/split to-split #",")
+;; (clojure.string/split to-split #",")

 ;; now should work
 ;; (require 'clojure.string)
@@ -14,6 +14,14 @@

 ;; mutliple requires
 ;; every time new REPL - needed require
-(require 'clojure.string 'clojure.test)
-(clojure.string/join " " splitted)
-(clojure.test/is (= 1 2))
+;; (require 'clojure.string 'clojure.test)
+;; (clojure.string/join " " splitted)
+;; (clojure.test/is (= 1 2))
+
+; clojure.string map to folder %classpath%/clojure/string.clj
+
+;; alias
+;; (require '[clojure.string :as string])
+;; the same as
+;; (require ['clojure.string :as 'string])
+;; (string/capitalize "foo")


implemented user/get-user

implemented user/get-user

--- src/moomoo/users.clj
+++ src/moomoo/users.clj
@@ -11,5 +11,9 @@
   nil)

 (defn get-user [user-id]
-  )
+  (apply hash-map
+         (map-indexed #(if (even? %1)
+                         (keyword %2)
+                         %2)
+         (wcar* (car/hgetall (str "user:" user-id))))))


Three tests added into core_test.clj

Three tests added into core_test.clj

--- test/zg/core_test.clj
+++ test/zg/core_test.clj
@@ -23,3 +23,27 @@
     [function-name]
     (clojure.test/function? function-name))

+;
+; Tests for various functions
+;
+
+(deftest test-start-server-existence
+    "Check that the zg.core/start-server definition exists."
+    (testing "if the zg.core/start-server definition exists."
+        (is (callable? 'zg.core/start-server))))
+
+(deftest test-get-and-check-port-existence
+    "Check that the zg.core/get-and-check-port definition exists."
+    (testing "if the zg.core/get-and-check-port definition exists."
+        (is (callable? 'zg.core/get-and-check-port))))
+
+(deftest test-get-port-existence
+    "Check that the zg.core/get-port definition exists."
+    (testing "if the zg.core/get-port definition exists."
+        (is (callable? 'zg.core/get-port))))
+
+(deftest test--main-existence
+    "Check that the zg.core/-main definition exists."
+    (testing "if the zg.core/-main definition exists."
+        (is (callable? 'zg.core/-main))))
+


Remove dead peer-config schema entry.

Remove dead peer-config schema entry.

--- src/onyx/schema.cljc
+++ src/onyx/schema.cljc
@@ -676,7 +676,6 @@
    (s/optional-key :onyx.peer/storage.s3.multipart-copy-part-size) s/Int
    (s/optional-key :onyx.peer/storage.s3.multipart-copy-threshold) s/Int
    (s/optional-key :onyx.peer/publisher-liveness-timeout-ms) PosInt
-   (s/optional-key :onyx.peer/coordinator-snapshot-every-n-barriers) PosInt
    (s/optional-key :onyx.peer/coordinator-max-sleep-ms) PosInt
    (s/optional-key :onyx.peer/coordinator-barrier-period-ms) PosInt
    (s/optional-key :onyx.peer/idle-min-sleep-ns) PosInt


updated the TODO list

updated the TODO list

--- src/paredit/core.clj
+++ src/paredit/core.clj
@@ -1,3 +1,11 @@
+; todo
+; 1. emit text deltas, not plain text replacement (or IDEs will not like it)
+; 2. write with clojure.zip functions the close-* stuff
+; 3. write the string related stuff
+; ... ?
+; 4. add support for more clojure-related source code ( #{}, #""... )
+; ... and all the other paredit stuff ...
+
 (ns paredit.core
   (:use clojure.contrib.def)
   (:use clojure.test)
@@ -229,7 +237,7 @@
 	                 "\\| " "\\(| "
 	                 "\\\\| " "\\\\ (|) "}]
 	    [")"         :paredit-close-round
-	                {#_"(a b |c [])" #_"(a b c [])|"
+	                {"(a b |c [])" "(a b c [])|"
 	                 #_"(a b |c   )" #_"(a b c)|"
                    #_"( a,  b |[a b ]   )" #_"( a,  b [a b ])|"
                    #_"( a,  b [|a b ]   )" #_"( a,  b [a b ])|"
@@ -316,7 +324,7 @@
   "true if character at offset offset is in a code
    position, e.g. not in a string, regexp, literal char or comment"
   [s offset]
-  (not (#{\" \; \\} (-> (parse s offset) :parents peek :type))))
+  (not (#{\" \; \\} (-> (parse s offset) :parents peek :tag))))

 (defn insert
   "insert what at offset. offset shifted by what's length, selection length unchanged"
@@ -438,4 +446,3 @@
 (defvar *text* (atom {:text "" :offset 0 :length 0})
   "defines a text, with :offset being the cursor position,
    and :length being a possible selection (may be negative)")
-


Add error handler plugin to intro example

--- docs-src/modules/ROOT/examples/com/wsscode/pathom/book/intro/demo.cljs
+++ docs-src/modules/ROOT/examples/com/wsscode/pathom/book/intro/demo.cljs
@@ -20,4 +20,5 @@
                   ::p/placeholder-prefixes #{">"}}
      ::p/mutate  pc/mutate-async
      ::p/plugins [(pc/connect-plugin {::pc/register [answer answer-plus-one]})
+                  p/error-handler-plugin
                   p/trace-plugin]}))


write ref files to correct path with ns subdir

--- src/main/cljs_api_gen/write.clj
+++ src/main/cljs_api_gen/write.clj
@@ -30,7 +30,7 @@
                                split-ns-and-name]]
     [cljs-api-gen.clojure-api :refer [lang-symbols->parent]]
     [cljs-api-gen.syntax :refer [syntax-map]]
-    [me.raynes.fs :refer [exists? mkdir mkdirs]]
+    [me.raynes.fs :refer [exists? mkdir mkdirs parent]]
     [stencil.core :as stencil]
     ))

@@ -334,6 +334,7 @@
   [item]
   (encode/assert-lossless (:full-name item))
   (let [filename (item-filename item)]
+    (mkdir (parent filename))
     (spit (str filename ".md")
       (stencil/render-string
         (slurp "templates/ref.md")


cljs compatible symbol check in defn macro

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -2685,7 +2685,7 @@
                  [name doc-string? attr-map? ([params*] prepost-map? body)+ attr-map?])}
   defn (core/fn defn [&form &env name & fdecl]
          ;; Note: Cannot delegate this check to def because of the call to (with-meta name ..)
-         (if (core/instance? clojure.lang.Symbol name)
+         (if (core/instance? #?(:clj clojure.lang.Symbol :cljs Symbol) name)
            nil
            (throw
              #?(:clj (IllegalArgumentException. "First argument to defn must be a symbol")


Obvious fixes to scope analysis phase.

Obvious fixes to scope analysis phase.

--- src/skylark/scope_analysis.clj
+++ src/skylark/scope_analysis.clj
@@ -30,14 +30,17 @@
        (:star)
        (rec)
        (:subscript) ;; not pure
-       (let [[o ss] x
-             [o E] (Alhs o E)]
+       (let [[o ss] t
+             [o E] (Alhs fields o E)]
          (A* (list h o) ss E))
        (:select) ;; not pure
-       (let [[o n] x
-             [o E] (Alhs o E)]
+       (let [[o n] t
+             [o E] (Alhs fields o E)]
          [(list h o n) E])
        (:argument) ;; for use in def
+       (let [[name type default] t
+             [name E] (Alhs fields name E)]
+         [[name type default] E])
        ($syntax-error)))
    :else ($syntax-error)))

@@ -51,6 +54,7 @@
 (defn A
   ([x] (A x null-env))
   ([x E]
+     (DBG :A x E)
      (let [i (meta x)
            w (fn [[x E]] [(with-meta x i) E])]
        (cond
@@ -79,7 +83,7 @@
                   [clauses E] (thread-args
                                () (fn [[expr target] E]
                                     (let [[expr E] (A expr E)
-                                          [target E] (Alhs target E)]
+                                          [target E] (Alhs [:assigned] target E)]
                                       [[expr target] E])) clauses E)
                   [body E] (A body E)]
               (w [(list h clauses body) E]))
@@ -88,23 +92,40 @@
                   [value E] (A value E)]
               (w [(list* h name value) E]))
             (:def)
-            (let [[name [args star-arg more-args kwarg] rettype body decorators] t
+            (let [[name [args star-arg more-args kw-arg] rettype body decorators] t
                   [decorators E] (A* () decorators E)
-                  [name E] (Alhs name E)
-                  [args EE] (Alhs* args null-env)
-                  [star-arg EE] (Alhs star-arg EE)
-                  [more-args EE] (Alhs* more-args EE)
-                  [kwarg EE] (Alhs kwarg EE)
-                  [rettype EE] (A rettype EE)
+                  [name E] (Alhs [:assigned] name E)
+                  ;; Process arguments once in environment E for their type and default
+                  [args E] (vec (A* () args E))
+                  [star-arg E] (A star-arg E)
+                  [more-args E] (vec (A* () more-args E))
+                  [kw-arg E] (A kw-arg E)
+                  [rettype E] (A rettype E)
+                  ;; Process arguments once as lhs in inner environment EE for their name
+                  [args EE] (vec (Alhs* () [:assigned] args null-env))
+                  [star-arg EE] (Alhs [:assigned] star-arg EE)
+                  [more-args EE] (vec (Alhs* () [:assigned] more-args EE))
+                  [kw-arg EE] (Alhs [:assigned] kw-arg EE)
                   [body EE] (A body EE)]
-              (w [(list h name [args star-arg more-args kwarg] rettype body decorators EE) E]))
+              (w [(list h name [args star-arg more-args kw-arg] rettype body decorators EE) E]))
+            (:argument) ;; for use in def
+            (let [[name type default] t]
+              (w (A* (list h name) [type default] E)))
             (:class)
             (let [[name superclasses body decorators] t
                   [decorators E] (A* () decorators E)
-                  [name E] (Alhs name E)
-                  [superclasses E] (Alhs* () superclasses E)
+                  [name E] (Alhs [:assigned] name E)
+                  [superclasses E] (A* () superclasses E)
                   [body EE] (A body null-env)]
               (w [(list h name superclasses body decorators EE) E]))
+            (:lambda)
+            (let [[[args star-arg more-args kw-arg] body] t
+                  [args EE] (vec (Alhs* () [:assigned] args null-env))
+                  [star-arg EE] (Alhs [:assigned] star-arg EE)
+                  [more-args EE] (vec (Alhs* () [:assigned] more-args EE))
+                  [kw-arg EE] (Alhs [:assigned] kw-arg EE)
+                  [body EE] (A body EE)]
+              (w [(list h name [args star-arg more-args kw-arg] body EE) E]))
             (:yield :yield-from)
             (w (A* (list h) t (assoc E :yield true)))
             (:nonlocal :global)
@@ -112,7 +133,7 @@
             (:del) ;; maybe we need a special category for :del ?
             (Alhs [:assigned] x E)
             (:import :from)
-            (w (NIY))
+            [x E] ;; untouched in this pass
             (:assign-expr)
             (let [[ls r] t
                   [rhs E] (A r E)
@@ -152,6 +173,6 @@
             ($syntax-error)))
         (symbol? x)
         [x (update-in E [:referenced] #(conj % x))]
-        (or (literal? x) (#{:False :True :None :zero-uple :empty-list :empty-dict} x))
+        (or (literal? x) (#{:False :True :None :zero-uple :empty-list :empty-dict} x) (nil? x))
         [x E]
         :else ($syntax-error x)))))


Moved components into separate file

Moved components into separate file


Make sure to stop the synth. This prevents it from making some garbage noise at the end of the program.

--- src/rule110/core.clj
+++ src/rule110/core.clj
@@ -42,4 +42,5 @@
   (reduce (fn [s v] (-> s step draw-grid midi/play-grid))
           (random-grid 100 25)
           (range 250))
+  (midi/stop)
   nil)


docfix

docfix

--- src/soy_clj/core.clj
+++ src/soy_clj/core.clj
@@ -16,8 +16,7 @@
   (atom (cache/lu-cache-factory {})))

 (defn set-cache
-  "Sets the cache for parsed templates. If set to `nil`, templates will be
-  parsed on each invocation of `build`."
+  "Sets the cache for parsed templates."
   [cache]
   (reset! template-cache cache))

@@ -32,7 +31,7 @@
     (.. builder (build) (compileToTofu))))

 (defn parse
-  "Given the filename (or a vector of filenames) of a Closure template on the
+  "Given the filename (or a sequence of filenames) of a Closure template on the
   classpath, parses the templates and returns a compiled set of templates."
   [file-or-files]
   (let [files (vec (flatten (vector file-or-files)))]
@@ -54,7 +53,6 @@
 (defn- camelize-keys
   ^java.util.Map [m]
   (let [f (fn [[k v]] (if (keyword? k) [(camel-case k) v] [k v]))]
-    ;; only apply to maps
     (walk/postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m)))

 (def ^:private content-kind
@@ -68,7 +66,7 @@
 (def ^:private content-kind-enum (set/map-invert content-kind))

 (defn render
-  "Given a compiled set of templates, renders the named template with the given
+  "Given a parsed set of templates, renders the named template with the given
   data and returns the result as a string as well as the _kind_ of data in the
   template (e.g. `:html`). Data keys of the form `:one-two` are converted into
   template variables of the form `oneTwo`."


Restore full movement solution space.

Restore full movement solution space.

I had swapped the order of a subtraction function which was yielding
incorrect positionings, and thought it was due to trig errors. Now that
I spotted that, restoring the subtraction adds one more candidate
solution, and makes motions even more efficient.

--- src/afterglow/transform.clj
+++ src/afterglow/transform.clj
@@ -185,7 +185,7 @@
   fixture's center position as the default target value to stay close
   to."
   [angle center-value half-circle-value & {:keys [target-value] :or {target-value center-value}}]
-  (let [candidates (map #(angle-to-dmx-value % center-value half-circle-value) [angle (+ two-pi angle)])
+  (let [candidates (map #(angle-to-dmx-value % center-value half-circle-value) [angle (+ angle two-pi) (- angle two-pi)])
         legal (filter #(<= 0 % 255.99) candidates)]
     (debug "candidates:" candidates)
     (debug "legal:" legal)


fixed typo

fixed typo

--- src/asset_minifier/core.clj
+++ src/asset_minifier/core.clj
@@ -43,7 +43,7 @@
             compressed-length   (.length target)]
         {:sources (map #(.getName %) sources)
          :target (.getName target)
-         :original-szie uncompressed-length
+         :original-size uncompressed-length
          :compressed-size compressed-length
          :gzipped-size (.length tmp)})))

@@ -108,7 +108,7 @@
   [assets & [opts]]
   (into {}
    (for [[target path] assets]
-     [target
+     [[path target]
       (cond
         (.endsWith target ".js")  (minify-js path target opts)
         (.endsWith target ".css") (minify-css path target opts)


support running without s3 creds (disables cache)

--- src/synterify/s3.clj
+++ src/synterify/s3.clj
@@ -2,11 +2,17 @@
   (:require [aws.sdk.s3 :as s3]
             [digest :as digest]))

-(defonce cred {:access-key (System/getenv "S3_KEY"), :secret-key (System/getenv "S3_SECRET")})
+(def cred {:access-key (System/getenv "S3_KEY")
+           :secret-key (System/getenv "S3_SECRET")})

-(defonce bucket "synterify-images")
+(def bucket "synterify-images")

-(s3/create-bucket cred bucket)
+(def have-creds? (and
+                   (:access-key cred)
+                   (:secret-key cred)))
+
+(when have-creds?
+  (s3/create-bucket cred bucket))

 (defn- get-key-by-url
   [url]
@@ -14,16 +20,20 @@

 (defn put-image
   [url file]
-  (let [key (get-key-by-url url)]
-    (s3/put-object cred bucket key file)
-    (s3/update-object-acl cred bucket key (s3/grant :all-users :read))))
+  (when have-creds?
+    (let [key (get-key-by-url url)]
+      (s3/put-object cred bucket key file)
+      (s3/update-object-acl cred bucket key (s3/grant :all-users :read)))))

 (defn image-exists?
   [url]
-  (s3/object-exists? cred bucket (get-key-by-url url)))
+  (if have-creds?
+    (s3/object-exists? cred bucket (get-key-by-url url))
+    false))

 (defn get-image
   [url]
-  (:content
-   (s3/get-object cred bucket (get-key-by-url url))))
+  (when have-creds?
+    (:content
+     (s3/get-object cred bucket (get-key-by-url url)))))


Factor-out a function

Factor-out a function

--- src/braid/server/events.clj
+++ src/braid/server/events.clj
@@ -5,15 +5,17 @@
     [braid.server.db :as db]
     [braid.server.sync-helpers :as sync-helpers]))

+(defn add-user-to-recent-threads-in-group!
+  [user-id group-id]
+  (doseq [t (db/recent-threads {:user-id user-id :group-id group-id
+                                :num-threads 5})]
+    (db/user-show-thread! user-id (t :id))))

 (defn user-join-group!
   [user-id group-id]
   (db/user-add-to-group! user-id group-id)
   (db/user-subscribe-to-group-tags! user-id group-id)
-  ; add user to recent threads in group
-  (doseq [t (db/recent-threads {:user-id user-id :group-id group-id
-                                :num-threads 5})]
-    (db/user-show-thread! user-id (t :id)))
+  (add-user-to-recent-threads-in-group! user-id group-id)
   (sync-helpers/broadcast-group-change group-id [:braid.client/new-user (db/user-by-id user-id)]))

 (defn register-user!


fix docstring syntax

fix docstring syntax

--- src/brainbot/nozzle/sys.clj
+++ src/brainbot/nozzle/sys.clj
@@ -58,7 +58,7 @@
     (validate-main-section res die)
     res))

-(defn make-system [iniconfig command-sections]
+(defn make-system
   "create a system map. the system map is where we store our
   configuration data and some state. the system map contains the followings keys:

@@ -68,6 +68,7 @@
   :thread-pool the thread pool which should be used by workers
   :name->obj an atom, mapping section names as specified in the ini
              config to the objects which we created."
+  [iniconfig command-sections]
   {:iniconfig iniconfig
    :command-sections command-sections
    :config (parse-main-section iniconfig)


fix accounts-events test

fix accounts-events test

--- test/cljs/status_im/test/accounts/events.cljs
+++ test/cljs/status_im/test/accounts/events.cljs
@@ -9,9 +9,11 @@
             [status-im.ui.screens.accounts.events :as account-events]
             [status-im.constants :as constants]))

+(def account-id "5648abf29215d3817bec65007be83a0f11d13ad6")
+
 (def account-from-realm
   {:last-updated        1502965625859
-   :address             "f8fa50a736618badf21c9d0e9a7605a2b268789b"
+   :address             "c348abf29215d3817bec65007be83a0f11d13ad6"
    :email               nil
    :signed-up?          true
    :phone               nil
@@ -27,7 +29,7 @@
    :public-key          "0x049b3a8c04f2c5bccda91c1f5e6434ae72957e93a31c0301b4563eda1d6ce419f63c503ebaee143115f96c1f04f232a7a22ca0454e9ee3d579ad1f870315b151d0"})

 (def new-account
-  {:address             "c296367a939e0957500a25ca89b70bd64b03004e"
+  {:address             account-id
    :signed-up?          true
    :name                "Disloyal Trusting Rainbowfish"
    :updates-private-key "3849071831f581f5e2a4f095a53e0a697144b32ea6de9e92cc08936f2efa40d2f1702bdb131356df0930a3a0d301221f2b5"
@@ -68,6 +70,7 @@
     (test-fixtures)

     (rf/dispatch [:initialize-db])
+    (rf/dispatch [:set :accounts/current-account-id account-id])

     (let [accounts (rf/subscribe [:get-accounts])]


Remove unused render-markdown path

Remove unused render-markdown path

--- src/clj/clojuredocs/api.clj
+++ src/clj/clojuredocs/api.clj
@@ -23,9 +23,10 @@
   (when (empty? body)
     {:error-message "Looks like your example is blank."}))

-(defn has-valid-var [{:keys [ns name library-url]}]
-  (when-not (and ns name library-url)
-    {:error-message "Please provide the library url, namespace, and name of the var."}))
+(defn has-valid-var [ex]
+  (let [{:keys [ns name library-url] :as v} (:var ex)]
+    (when-not (and ns name library-url)
+      {:error-message "Please provide the library url, namespace, and name of the var."})))

 (def example-schema
   {:name :example
@@ -85,10 +86,10 @@
               (mon/insert! :examples entity)
               {:body "ok"
                :status 200
-               :headers {"Content-Type" "text/plain"}}))))))
+               :headers {"Content-Type" "text/plain"}})))))))

-    (ANY "/render-markdown" []
-    (fn [r]
-      (let [body (util/response-body r)]
-        {:body (when body (util/markdown body))
-         :headers {"Content-Type" "text/html;charset=utf-8"}}))))
+#_(use 'clojure.pprint)
+
+#_(->> (mon/fetch :examples)
+     (take 10)
+     pprint)


fix game log dump during damage prevention

--- src/clj/game/core-rules.clj
+++ src/clj/game/core-rules.clj
@@ -141,11 +141,12 @@
                state :runner nil (str "Prevent any of the " n " " (name type) " damage?") ["Done"]
                (fn [choice]
                  (let [prevent (get-in @state [:damage :damage-prevent type])]
+                   (when prevent
+                     (trigger-event state side :prevented-damage type prevent))
                    (system-msg state :runner
                                (if prevent
-                                 (do (str "prevents " (if (= prevent Integer/MAX_VALUE) "all" prevent)
+                                 (str "prevents " (if (= prevent Integer/MAX_VALUE) "all" prevent)
                                           " " (name type) " damage")
-                                     (trigger-event state side :prevented-damage type prevent))
                                  "will not prevent damage"))
                    (resolve-damage state side type (max 0 (- n (or prevent 0))) args)))
                {:priority 10}))


campaign getters now return Campaign records

--- src/clj/yambox/database.clj
+++ src/clj/yambox/database.clj
@@ -40,6 +40,9 @@
 (defn to-underscore [m]
   (p/map-keys (fn [k] (-> k name (s/replace "-" "_") keyword)) m))

+(defn to-dash [m]
+  (p/map-keys (fn [k] (-> k name (s/replace "_" "-") keyword)) m))
+
 (sc/defn ^:always-validate add-campaign
   [campaign :- Campaign]
   (prn (to-underscore campaign))
@@ -55,16 +58,24 @@
                            :where [:= :slug slug]}))]
     (-> res first vals first (> 0))))

+(defn queryset-to-campaign [qs]
+  (-> qs
+      first
+      to-dash
+      schemas/strict-map->Campaign))
+
 (sc/defn get-campaign-by-slug :- Campaign
   [slug :- sc/Str]
-  (j/query @db-spec
-    (sql/format {:select [:*]
-                 :from [:campaigns]
-                 :where [:= :slug slug]})))
+  (let [res (j/query @db-spec
+              (sql/format {:select [:*]
+                           :from [:campaigns]
+                           :where [:= :slug slug]}))]
+    (queryset-to-campaign res)))

 (sc/defn get-campaign-by-wallet-id :- Campaign
   [wallet-id :- sc/Int]
-  (j/query @db-spec
-    (sql/format {:select [:*]
-                 :from [:campaigns]
-                 :where [:= :wallet_id wallet-id]})))
+  (let [res (j/query @db-spec
+              (sql/format {:select [:*]
+                           :from [:campaigns]
+                           :where [:= :wallet_id wallet-id]}))]
+    (queryset-to-campaign res)))


Add Strokes and bootstrap it at startup.

--- src/cljs/om_sente/core.cljs
+++ src/cljs/om_sente/core.cljs
@@ -9,9 +9,12 @@
   (:require [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [taoensso.sente :as s]
-            [cljs.core.async :as async :refer [<! >! chan]]))
+            [cljs.core.async :as async :refer [<! >! chan]]
+            [strokes :refer [d3]]))

 (enable-console-print!)
+
+(strokes/bootstrap)

 ;; create the Sente web socket connection stuff when we are loaded:


add # to tagged literal form since it is a prefix, and we cannot represent the following symbol

--- src/cljs_api_gen/syntax.clj
+++ src/cljs_api_gen/syntax.clj
@@ -61,6 +61,9 @@
    {:desc "dispatch"         :char  \#    :form "#"              :clj-doc doc2     :edn-doc (edn-doc "-dispatch-character")}

    ;; dispatch syntax
+   {:desc "tagged-literal"                :form "#"              :clj-doc doc4     :edn-doc (edn-doc "tagged-elements")
+          :clj-added "1.4.0"}
+
    {:desc "regex"            :dchar \"    :form "#\"\""          :clj-doc doc2}
    {:desc "set"              :dchar \{    :form "#{}"            :clj-doc doc1     :edn-doc (edn-doc "sets")}
    {:desc "function"         :dchar \(    :form "#()"            :clj-doc doc2}


unit tests for filter/breakout on same, different granularities :scream_cat: #1257

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -1304,3 +1304,39 @@
                      :aggregation  ["count"]
                      :filter       ["TIME_INTERVAL" (id :checkins :timestamp) "last" "week"]}})
         :data :rows first first)))
+
+;; Make sure that when referencing the same field multiple times with different units we return the one
+;; that actually reflects the units the results are in.
+;; eg when we breakout by one unit and filter by another, make sure the results and the col info
+;; use the unit used by breakout
+(defn- date-bucketing-unit-when-you [& {:keys [breakout-by filter-by]}]
+  (with-temp-db [_ (checkins:1-per-day)]
+    (let [results (driver/process-query
+                   {:database (db-id)
+                    :type     :query
+                    :query     {:source_table (id :checkins)
+                                :aggregation  ["count"]
+                                :filter       ["TIME_INTERVAL" (id :checkins :timestamp) "current" filter-by]
+                                :breakout     [["datetime_field" (id :checkins :timestamp) "as" breakout-by]]}})]
+      {:rows (-> results :row_count)
+       :unit (-> results :data :cols first :unit)})))
+
+(datasets/expect-with-datasets sql-engines
+  {:rows 1, :unit :day}
+  (date-bucketing-unit-when-you :breakout-by "day", :filter-by "day"))
+
+(datasets/expect-with-datasets sql-engines
+  {:rows 7, :unit :day}
+  (date-bucketing-unit-when-you :breakout-by "day", :filter-by "week"))
+
+(datasets/expect-with-datasets sql-engines
+  {:rows 1, :unit :week}
+  (date-bucketing-unit-when-you :breakout-by "week", :filter-by "day"))
+
+(datasets/expect-with-datasets sql-engines
+  {:rows 1, :unit :quarter}
+  (date-bucketing-unit-when-you :breakout-by "quarter", :filter-by "day"))
+
+(datasets/expect-with-datasets sql-engines
+  {:rows 1, :unit :hour}
+  (date-bucketing-unit-when-you :breakout-by "hour", :filter-by "day"))


(PDB-5484) storage-test/fact-path-gc: remove extraneous binding

--- test/puppetlabs/puppetdb/scf/storage_test.clj
+++ test/puppetlabs/puppetdb/scf/storage_test.clj
@@ -482,25 +482,20 @@
                     #{}))

         (testing "multiple types for path and all types change"
-          (let [expected #{{:path "a" :value_type_id (type-id :int)}
-                           {:path "a" :value_type_id (type-id :obj)}
-                           {:path "a#~0" :value_type_id (type-id :int)}
-                           {:path "a#~foo" :value_type_id (type-id :str)}
-                           {:path "a" :value_type_id (type-id :str)}}]
-            (check-gc [["c-x" {"a" 1}]
-                       ["c-y" {"a" [0]}]
-                       ["c-x" {"a" {"foo" "bar"}}]
-                       ["c-y" {"a" "two"}]]
-                      #{{:path "a" :value_type_id (type-id :int)}
-                        {:path "a" :value_type_id (type-id :obj)}
-                        {:path "a#~0" :value_type_id (type-id :int)}
-                        {:path "a#~foo" :value_type_id (type-id :str)}
-                        {:path "a" :value_type_id (type-id :str)}}
-                      ;; Q: Why didn't "a" :int stick around?
-                      #{{:path "a" :value_type_id (type-id :int)}
-                        {:path "a" :value_type_id (type-id :obj)}
-                        {:path "a#~foo" :value_type_id (type-id :str)}
-                        {:path "a" :value_type_id (type-id :str)}})))
+          (check-gc [["c-x" {"a" 1}]
+                     ["c-y" {"a" [0]}]
+                     ["c-x" {"a" {"foo" "bar"}}]
+                     ["c-y" {"a" "two"}]]
+                    #{{:path "a" :value_type_id (type-id :int)}
+                      {:path "a" :value_type_id (type-id :obj)}
+                      {:path "a#~0" :value_type_id (type-id :int)}
+                      {:path "a#~foo" :value_type_id (type-id :str)}
+                      {:path "a" :value_type_id (type-id :str)}}
+                    ;; Q: Why didn't "a" :int stick around?
+                    #{{:path "a" :value_type_id (type-id :int)}
+                      {:path "a" :value_type_id (type-id :obj)}
+                      {:path "a#~foo" :value_type_id (type-id :str)}
+                      {:path "a" :value_type_id (type-id :str)}}))

         (testing "everything to nothing"
           (check-gc [["c-x" {"a" 1}]


Sane indentation

Sane indentation

--- src/computer_build/vhdl.clj
+++ src/computer_build/vhdl.clj
@@ -1,12 +1,14 @@
 (ns computer_build.vhdl)

-(defn lines [& strings]
-  (apply str (interpose "\n" strings))
+(defn indented-lines [strings]
+  (map #(str (apply str (take 1 (cycle ["  "]))) %) strings)
   )

-(defn indented-lines [indent & strings]
-  (apply lines (map #(str "  " %) strings))
-  )
+(defn indent-lines [lines]
+  (if (empty? lines) '()
+    (if (string? (first lines)) (cons (first lines) (indent-lines (rest lines)))
+      (concat (indented-lines (indent-lines (first lines))) (indent-lines (rest lines)))
+      )))

 (defn spaces [& strings]
   (apply str (interpose " " strings))
@@ -20,22 +22,23 @@
 (defmethod to-vhdl :default [arg] "unimplemented")
 (defmethod to-vhdl 'entity [entity]
   (let [[type name ports & architecture] entity]
-    (lines
+    (apply str (interpose "\n" (indent-lines
+    (list
       (spaces "entity" name "is")
       "port("
-      ;(spaces (concat '(port) (first ports)))
-      ;(interpose " " (concat '(port) (first ports)))
-      (apply str (interpose ";\n" (map to-vhdl (map #(cons 'port %) ports))))
+      (map #(apply str %)
+           (partition 2 (concat (interpose ";"
+               (map to-vhdl (map #(cons 'port %) ports))) [""])))
       ");"
       (str "end " name ";")

       (str "architecture arch_" name " of " name " is")
       "begin"
-      (apply lines (map to-vhdl architecture))
+      (map to-vhdl architecture)
       (str "end arch_" name ";")
+  ))))))

-      ;(lines (map to-vhdl (map ports #(concat '(port) %))))
-  )))
+; does not generate lines like block-level methods do
 (defmethod to-vhdl 'port [port]
   (let [[type id direction type] port]
     (str "  " (keyword-to-str id) ": " (keyword-to-str direction) " " type)
@@ -43,23 +46,23 @@

 (defmethod to-vhdl 'process [process]
   (let [[type ports & definition] process]
-    (indented-lines 1
+    (list
       (str "process(" (apply str (interpose "," (map keyword-to-str ports))) ")")
       "begin"
-      (apply lines (map to-vhdl definition))
+      (map to-vhdl definition)
       "end process;"
       )))

 (defmethod to-vhdl 'case [statement]
   (let [[type target & cases] statement]
-    (indented-lines 2
+    (list
       (spaces "case" (keyword-to-str target) "is")
-      ;(lines (map #(str "when" (str "\"" (first %) "\""))
-      (apply lines (map #(str "when \"" (first %) "\" => " (to-vhdl (second %)) \;)
-           (partition 2 cases)))
+      (map #(str "when \"" (first %) "\" => " (to-vhdl (second %)) \;)
+           (partition 2 cases))
       "end case;"
     )))

+; does not generate lines like block-level methods do
 (defmethod to-vhdl '<= [statement]
   (let [[type target expression] statement]
     (str (keyword-to-str target) " <= " (keyword-to-str expression))
@@ -70,6 +73,5 @@
     (println "library ieee;")
     (println "use ieee.std_logic_1164.all;")
     (println (to-vhdl (first entities)))
-    ;(println (lines (map to-vhdl entities)))
     )
   )


Capitalize VHDL keywords in Clojure

Capitalize VHDL keywords in Clojure

--- src/computer_build/vhdl.clj
+++ src/computer_build/vhdl.clj
@@ -2,10 +2,10 @@
   (:use clojure.contrib.str-utils))

-(def std-logic "std_logic")
+(def std-logic "STD_LOGIC")

 (defn std-logic-vector [start end]
-  (str "std_logic_vector(" start " downto " end ")"))
+  (str "STD_LOGIC_VECTOR(" start " downto " end ")"))

 (defn indented-lines [strings] (map (partial str "  ") strings))
@@ -36,17 +36,17 @@
 (defmethod to-vhdl :entity [[type name ports defs & architecture]]
   (apply str (interpose "\n" (indent-lines
   (list
-    (spaces "entity" name "is")
-    "port("
+    (spaces "ENTITY" name "is")
+    "PORT("
     (commaify (map to-vhdl (map (partial cons :port) ports)))
     ");"
-    (str "end " name ";")
+    (str "END " name ";")

-    (str "architecture arch_" name " of " name " is")
+    (str "ARCHITECTURE arch_" name " OF " name " IS")
     (map to-vhdl defs)
-    "begin"
+    "BEGIN"
     (with-meta (map to-vhdl architecture) {:noindent true})
-    (str "end arch_" name ";"))))))
+    (str "END arch_" name ";"))))))

 ; does not generate lines like block-level methods do
 (defmethod to-vhdl :port [[type id direction type]]
@@ -54,37 +54,37 @@

 (defmethod to-vhdl :process [[type ports & definition]]
   (list
-    (str "process(" (str-join "," (map keyword-to-str ports)) ")")
-    "begin"
+    (str "PROCESS(" (str-join "," (map keyword-to-str ports)) ")")
+    "BEGIN"
     (with-meta (map to-vhdl definition) {:noindent true})
-    "end process;"))
+    "END PROCESS;"))

 (defmethod to-vhdl :case [[type target & cases]]
   (list
-    (spaces "case" (keyword-to-str target) "is")
-    (map #(str (spaces "when" (quoted-str (first %)) "=>" (to-vhdl (second %))) \;)
+    (spaces "CASE" (keyword-to-str target) "IS")
+    (map #(str (spaces "WHEN" (quoted-str (first %)) "=>" (to-vhdl (second %))) \;)
          (partition 2 cases))
-    "end case;"))
+    "END CASE;"))

 ; does not generate lines like block-level methods do
 (defmethod to-vhdl :<= [[type target expression]]
   (spaces (keyword-to-str target) "<=" (keyword-to-str expression)))

 (defmethod to-vhdl :signal [[type sig type]]
-  (str "signal " (name sig) " : " type ";"))
+  (str "SIGNAL " (name sig) " : " type ";"))

 (defmethod to-vhdl :deftype [[type name values]]
   (let [valuelist (str-join ", " values)]
-    (spaces "type" name "is" "(" valuelist ");")))
+    (spaces "TYPE" name "IS" "(" valuelist ");")))

 (defmethod to-vhdl :if [[type condition & body]]
   (list
-    (spaces "if" (to-vhdl condition) "then")
+    (spaces "IF" (to-vhdl condition) "THEN")
     (with-meta (map to-vhdl body) {:noindent true})
-    "end if;"))
+    "END IF;"))

 (defmethod to-vhdl :and [[type condA condB]]
-  (spaces (to-vhdl condA) "and" (to-vhdl condB)))
+  (spaces (to-vhdl condA) "AND" (to-vhdl condB)))

 (defmethod to-vhdl :event [[type target]]
   (str (keyword-to-str target) "'EVENT"))
@@ -95,6 +95,6 @@

 (defn generate-vhdl [& entities]
   (do
-    (println "library ieee;")
-    (println "use ieee.std_logic_1164.all;")
+    (println "LIBRARY ieee;")
+    (println "USE ieee.std_logic_1164.all;")
     (println (to-vhdl (first entities)))))


(MAINT) Brevity is beautiful

(MAINT) Brevity is beautiful

--- test/unit/puppetlabs/puppetserver/certificate_authority_test.clj
+++ test/unit/puppetlabs/puppetserver/certificate_authority_test.clj
@@ -868,7 +868,7 @@
                             :value    {:dns-name ["subject"
                                                   "onefish"
                                                   "twofish"]}}
-                           ;; These extensions come form the csr_attributes.yaml file
+                           ;; These extensions come form csr_attributes.yaml
                            {:oid      "1.3.6.1.4.1.34380.1.1.1"
                             :critical false
                             :value    "ED803750-E3C7-44F5-BB08-41A04433FE2E"}


Delete play

Delete play


Added bomb sound

Added bomb sound

--- desktop/src-common/ds3/bomb.clj
+++ desktop/src-common/ds3/bomb.clj
@@ -36,6 +36,7 @@
         bomb2 (texture bomb :set-region 3 0 3 4)
         bomb-animation (animation 0.2 [bomb1 bomb2])
         animation-delta (/ (rand-int 1000) 1000.0)]
+    (sound "bomb2.ogg" :play)
     (assoc bomb1 :bomb-animation (animation 0.1 [bomb1 bomb2]) :total-time animation-delta
       :bomb? true :width bomb-width :height bomb-height :id :bomb :x x :y y
       :render-layer 75 :translate-x 0 :translate-y bomb-height


Made Friend workflow for Mobile App.

Made Friend workflow for Mobile App.

--- web/src/sound_effector/controllers/auth/facebook_with_friend.clj
+++ web/src/sound_effector/controllers/auth/facebook_with_friend.clj
@@ -1,14 +1,16 @@
 (ns sound-effector.controllers.auth.facebook-with-friend
   (:require
+    [clojure.data.json :as json]
     [clojure.string :as string]
     [crypto.random :as random]
+    [clj-http.client :as http]
+    [ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
     [ring.util.codec :refer [url-encode]]
     [ring.util.response :refer [redirect response status content-type header]]
     [compojure.core :refer [defroutes context GET]]
     [cemerick.friend :as friend]
+    [cemerick.friend.workflows :refer [make-auth]]
     [liberator.core :refer [resource]]
-    [clj-http.client :as http]
-    [cemerick.friend.workflows :refer [make-auth]]
     [sound-effector.models.user :as user]
     [sound-effector.models.role :as role]))

@@ -113,6 +115,36 @@
                               "
Description : " error-description
                               "
Request : " request))))

+(defn- handle-json-error-result [body]
+  (->
+    (response (json/write-str body))
+    (status 400)
+    (content-type "application/json")
+    (header "Pragma" "no-cache")))
+
+(defn login-for-mobile-app [request]
+  (let [access-token (get-in request [:params :access-token])]
+    (if (not (nil? access-token))
+      (if-let [facebook-user-info (get-user-info access-token)]
+        (if-let [user (user/read provider-id (:id facebook-user-info))]
+          (let [authentication (make-auth {:identity (:id user) :user user :roles #{::role/user}})]
+            (->
+              (response (json/write-str {:message "Login completed. :D"}))
+              (status 200)
+              (content-type "application/json")
+              (header "Pragma" "no-cache")
+              (friend/merge-authentication authentication)))
+          (->
+            (response (json/write-str {:message "Will you join us?" :creating-user (assoc facebook-user-info :provider-id provider-id)}))
+            (status 200)
+            (content-type "application/json")
+            (header "Pragma" "no-cache")
+            (header "X-CSRF-Token" *anti-forgery-token*)
+            (assoc :session (assoc (:session request) :creating-user
+                                           (assoc facebook-user-info :provider-id provider-id)))))
+        (handle-json-error-result {:message "Couln't get the user information in Facebook!" :access-token access-token}))
+      (handle-json-error-result {:message "Couln't get the access token!"}))))
+
 (defn workflow []
   (fn [request]
     (cond
@@ -122,6 +154,5 @@
       (= (:uri request) (get-in client-config [:callback :path]))
       (calledback request)

-      (= (:uri request) "/users/new/done")
-      (let [user (get-in request [:flash :user])]
-        (make-auth {:identity (:id user) :user user :roles #{::role/user}})))))
+      (= (:uri request) "/auth/facebook/app")
+      (login-for-mobile-app request))))


Point users to :onyx/batch? under bulk? doc

--- src/onyx/information_model.cljc
+++ src/onyx/information_model.cljc
@@ -184,7 +184,7 @@
              :added "0.8.0"}

             :onyx/bulk?
-            {:doc "Boolean value indicating whether the function in this catalog entry denoted by `:onyx/fn` should take a single segment, or the entire batch of segments that were read as a parameter. When set to `true`, this function's return value is ignored. The segments are identically propagated to the downstream tasks."
+            {:doc "Boolean value indicating whether the function in this catalog entry denoted by `:onyx/fn` should take a single segment, or the entire batch of segments that were read as a parameter. When set to `true`, this task's `:onyx/fn` return value is ignored. The segments are identically propagated to the downstream tasks. The primary use of `:onyx/bulk?` is for side-effecting functions. Please see `:onyx/batch?` if you require the return value from the `:onyx/fn`."
              :type :boolean
              :default false
              :tags [:function]


GAWB-1019: added last modified column to workspace list (#575)

Added last modified column

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspaces_list.cljs
@@ -162,6 +162,10 @@
                                  (if description (-> description split-lines first)
                                                  [:span {:style {:fontStyle "italic"}}
                                                   "No description provided"])])}
+           {:as-text common/format-date
+            :header "Last Modified Date" :starting-width 300
+            :content-renderer (fn [date]
+                                [:div {:style {:paddingLeft 14}} (common/format-date date) ])}
            {:header "Access Level" :starting-width 118 :resizable? false
             :sort-by #(case % "OWNER" 0 "WRITER" 1 "READER" 2 "NO ACCESS" 3 4) :sort-initial :asc
             :content-renderer
@@ -192,6 +196,7 @@
                       {:name ws-name :href ws-href :status (:status ws) :disabled? disabled?
                        :protected? (get-in ws ["workspace" "realm"])}
                       (get-workspace-description ws)
+                      (get-in ws ["workspace" "lastModified"])
                       (ws "accessLevel")
                       nil]))}]]))
    :component-did-update


[#841] Fix typo

[#841] Fix typo

--- backend/src/akvo/lumen/endpoint.clj
+++ backend/src/akvo/lumen/endpoint.clj
@@ -60,5 +60,5 @@
   (http/unprocessable-entity entity))

 (defmethod variant->response ::lib/redirect
-  [[_ localtion] _]
+  [[_ location] _]
   (http/redirect location))


Use a dash.

Use a dash.

--- src/dsbdp/main.clj
+++ src/dsbdp/main.clj
@@ -42,10 +42,10 @@
                 waited (.getWaitedTime t-info)
                 blocked (.getBlockedTime t-info)]
             (println (str t-id "," t-name "," cpu-time "," user-time "," waited "," blocked ","
-                       (delta-cntr (str "cpu" t-id) cpu-time) ","
-                       (delta-cntr (str "user" t-id) user-time) ","
-                       (delta-cntr (str "waited" t-id) waited) ","
-                       (delta-cntr (str "blocked" t-id) blocked)))))))))
+                       (delta-cntr (str "cpu-" t-id) cpu-time) ","
+                       (delta-cntr (str "user-" t-id) user-time) ","
+                       (delta-cntr (str "waited-" t-id) waited) ","
+                       (delta-cntr (str "blocked-" t-id) blocked)))))))))

 (defn -main [& args]
   (println "Starting dsbdp main...")


misc changes for production

misc changes for production

--- src/etaoin/api.clj
+++ src/etaoin/api.clj
@@ -42,6 +42,8 @@
    :phantom 8910})

 (def default-locator "xpath")
+(def locator-xpath "xpath")
+(def locator-css "css selector")

 ;;
 ;; utils
@@ -438,19 +440,23 @@
   in case of unsupported clause."
   [driver q]
   (cond
+    (= q :active)
+    (get-active-element* driver)
+
+    (keyword? q)
+    [locator-xpath (q-xpath {:id q})]
+
     (string? q)
     [(:locator @driver) q]

-    (and (map? q)
-         (:xpath q))
-    ["xpath" (:xpath q)]
-
-    (and (map? q)
-         (:css q))
-    ["css selector" (:css q)]
+    (and (map? q) (:xpath q))
+    [locator-xpath (:xpath q)]
+
+    (and (map? q) (:css q))
+    [locator-css (:css q)]

     (map? q)
-    ["xpath" (q-xpath q)]
+    [locator-xpath (q-xpath q)]

     :else
     (throw+ {:type :etaoin/query
@@ -524,7 +530,9 @@
    //div[@id='content'] for XPath,
    div.article for CSS selector

-   - a keyword :active that means the current active element
+   - a keyword `:active` that means the current active element
+
+   - any keyword `value` that is converted to XPath `.//*[@id='<value>']`

    - a map with either :xpath or :css keys with a string term, e.g:
    {:xpath \"//div[@id='content']\"} or
@@ -544,9 +552,6 @@
 "
   [driver q]
   (cond
-    (= q :active)
-    (get-active-element* driver)
-
     (vector? q)
     (loop [el (query driver (first q))
            q-rest (rest q)]
@@ -1121,6 +1126,10 @@
     resp
     (:value resp)))

+(defn js-localstorage-clear
+  [driver]
+  (js-execute driver "localStorage.clear()"))
+
 (defn add-script [driver url]
   (let [script
         (str "var s = document.createElement('script');"
@@ -1162,10 +1171,15 @@
 ;; locators
 ;;

-
-(defn by [driver locator]
+(defn use-locator [driver locator]
   (swap! driver assoc :locator locator)
   driver)
+
+(defn use-xpath [driver]
+  (use-locator driver locator-xpath))
+
+(defn use-css [driver]
+  (use-locator driver locator-css))

 (defmacro with-locator [driver locator & body]
   `(let [old# (-> ~driver deref :locator)]
@@ -1176,11 +1190,11 @@
          (swap! ~driver assoc :locator old#)))))

 (defmacro with-xpath [driver & body]
-  `(with-locator ~driver "xpath"
+  `(with-locator ~driver locator-xpath
      ~@body))

 (defmacro with-css [driver & body]
-  `(with-locator ~driver "css selector"
+  `(with-locator ~driver locator-css
      ~@body))

 ;;
@@ -1324,11 +1338,27 @@

 (def disabled? (complement enabled?))

-(defn has-text? [driver text]
-  (with-http-error
-    (let [q (format "//*[contains(text(),'%s')]" text)]
-      (query driver {:xpath q})
-      true)))
+(defn has-text?
+  ([driver text]
+   (has-text? driver {:tag :*} text))
+  ([driver q text]
+   (let [[locator term] (q-expand driver q)
+         term1 (format "%s[contains(text(), '%s')]" term text)
+         term2 (format "%s//*[contains(text(), '%s')]" term text)]
+     (when-not (= locator locator-xpath)
+       (throw+ {:type :etaoin/locator
+                :driver @driver
+                :message "Only XPath locator works here."
+                :text text
+                :q q}))
+     (or
+      (with-http-error
+        (find-element* driver locator term1)
+        true)
+      (with-http-error
+        (find-element* driver locator term2)
+        true)
+      false))))

 (defn has-class-el? [driver el class]
   (let [classes (get-element-attr-el driver el "class")]
@@ -1407,8 +1437,9 @@
 (defn wait-has-alert [driver & [opt]]
   (wait-predicate #(has-alert? driver) opt))

-(defn wait-has-text [driver text & [opt]]
-  (wait-predicate #(has-text? driver text) opt))
+(defn wait-has-text
+  [driver q text & [opt]]
+  (wait-predicate #(has-text? driver q text) opt))

 (defn wait-has-class [driver q class & [opt]]
   (wait-predicate #(has-class? driver q class) opt))


improve convo distribution processing time

- support :consistency on c* queries
- run callbacks manuall on the :participant_feed_posts
- insert :participant_feed_posts with the low-level
  c* record api, and use :consistency :local-one

this sidesteps any re-selects etc and for 5k
users processing goes from 2m20s down to 10s - 15x faster

and i think we can do much better

--- src/er_cassandra/record.clj
+++ src/er_cassandra/record.clj
@@ -234,7 +234,8 @@

 (s/defschema InsertOptsSchema
   {(s/optional-key :if-not-exists) s/Bool
-   (s/optional-key :using) UpsertUsingSchema})
+   (s/optional-key :using) UpsertUsingSchema
+   (s/optional-key :consistency) ConsistencyLevelSchema})

 (s/defn insert-statement
   "returns a Hayt insert statement"
@@ -272,6 +273,7 @@
    (s/optional-key :if-exists) s/Bool
    (s/optional-key :if-not-exists) s/Bool
    (s/optional-key :using) UpsertUsingSchema
+   (s/optional-key :consistency) ConsistencyLevelSchema
    (s/optional-key :set-columns) UpdateColumnsSchema})

 (s/defn update-statement


remove old kibana machine

remove old kibana machine

--- src/terraboot/elasticsearch.clj
+++ src/terraboot/elasticsearch.clj
@@ -186,15 +186,6 @@
                                                      :subnet_id (vpc-id-of "aws_subnet" "public-a")
                                                      :iam_instance_profile (vpc-id-of "aws_iam_instance_profile" "logstash")})

-              (aws-instance (vpc-unique "kibana") {
-                                                   :ami default-ami
-                                                   :vpc_security_group_ids [(vpc-id-of "aws_security_group" "kibana")
-                                                                            (vpc-id-of "aws_security_group" "allow-elb-kibana")
-                                                                            (vpc-id-of "aws_security_group" "sends_influx")
-                                                                            (vpc-id-of "aws_security_group" "all-servers")]
-                                                   :subnet_id (vpc-id-of "aws_subnet" "private-a")
-                                                   :associate_public_ip_address true
-                                                   })

               (elb "kibana" resource {:name "kibana"
                                       :health_check {:healthy_threshold 2


Use fake closures instead of funlike records

--- src/aurora/language.cljs
+++ src/aurora/language.cljs
@@ -2,6 +2,58 @@
   (:require [clojure.set :refer [union intersection difference subset?]])
   (:require-macros [aurora.macros :refer [console-time set!! conj!! disj!! assoc!! apush apush* avec]]
                    [aurora.language :refer [deffact]]))
+
+;; CLJS UTILS
+
+(def munge-map
+  {"-" "_"
+   " " "_SPACE_"
+   "." "_DOT_"
+   ":" "_COLON_"
+   "+" "_PLUS_"
+   ">" "_GT_"
+   "<" "_LT_"
+   "=" "_EQ_"
+   "~" "_TILDE_"
+   "!" "_BANG_"
+   "@" "_CIRCA_"
+   "#" "_SHARP_"
+   "'" "_SINGLEQUOTE_"
+   "\"" "_DOUBLEQUOTE_"
+   "%" "_PERCENT_"
+   "^" "_CARET_"
+   "&" "_AMPERSAND_"
+   "*" "_STAR_"
+   "|" "_BAR_"
+   "{" "_LBRACE_"
+   "}" "_RBRACE_"
+   "[" "_LBRACK_"
+   "]" "_RBRACK_"
+   "/" "_SLASH_"
+   "\\" "_BSLASH_"
+   "?" "_QMARK_"})
+
+(def munge-regexes
+  (into-array
+   (for [find (keys munge-map)]
+     (js/RegExp. (str "\\" find) "gi"))))
+
+(def munge-replaces
+  (into-array (vals munge-map)))
+
+;; TODO doesn't handle reserved names or namespaced symbols
+(defn munge-part [part]
+  (areduce munge-regexes i part part
+           (.replace part (aget munge-regexes i) (aget munge-replaces i))))
+
+(defn munge [sym]
+  (let [parts (.split (name sym) ".")
+        last-part (.pop parts)]
+    (.push parts (munge-part last-part))
+    (.join parts ".")))
+
+(defn resolve [namespaced]
+  (js/eval (str (namespace namespaced) "." (munge (name namespaced)))))

 ;; TODO facts and plans need to be serializable

@@ -73,9 +125,6 @@
                      (aget values i)
                      (recur (+ i 1)))))))))

-(defn id->fact-shape [id]
-  (js/eval (str (namespace id) "." (name id)))) ;; TODO assumes facts are created by deffact
-
 (defn fact-shape [id madlib&keys]
   (let [split-madlib&keys (clojure.string/split madlib&keys #"\[|\]")
         [madlib keys] [(take-nth 2 split-madlib&keys) (map keyword (take-nth 2 (rest split-madlib&keys)))]]
@@ -139,7 +188,7 @@

   (= x x)
   (= x (fact (fact-shape ::eg "[a] has a [b] with a [c]") #js ["a" "b" "c"]))
-  (= x (fact (id->fact-shape ::eg) #js ["a" "b" "c"]))
+  (= x (fact (resolve ::eg) #js ["a" "b" "c"]))
   (= x (fact eg #js ["a" "b" "c"]))
   (= x (->eg "a" "b" "c"))
   (= (Fact. nil #js ["a" "b" "c"]) (Fact. nil #js ["a" "b" "c"]))
@@ -245,6 +294,72 @@

   )

+;; FLOWS
+
+(defrecord Union [nodes])
+(defrecord FilterMap [nodes fun&args])
+(defrecord Index [nodes key-ixes])
+(defrecord Lookup [nodes index-node key-ixes val-ixes])
+
+(defn flow->nodes [flow]
+  (:nodes flow))
+
+;; FLOW PLAN
+
+(defrecord FlowPlan [node->flow flow->node])
+
+(defn flow-plan->flow-state [{:keys [node->flow]}]
+  (let [node->state (into-array (for [_ node->flow] nil))
+        node->out-nodes (into-array (for [_ node->flow] #js []))
+        node->facts (into-array (for [_ node->flow] #js []))
+        node->update! (into-array (for [_ node->flow] nil))]
+    (dotimes [node (count node->flow)]
+      (let [flow (nth node->flow node)]
+        (aset node->state node
+              (condp = (type flow)
+                Union (transient #{})
+                FilterMap nil
+                Index (transient {})
+                Lookup nil))
+        (doseq [in-node (:nodes flow)]
+          (apush (aget node->out-nodes in-node) node))
+        (aset node->update! node
+              (condp = (type flow)
+                Union (union-update!)
+                FilterMap (filter-map-update! (apply (resolve (first (:fun&args flow))) (rest (:fun&args flow))))
+                Index (index-update! (:key-ixes flow))
+                Lookup (lookup-update! (:index-node flow) (:key-ixes flow) (:val-ixes flow))))))
+    (FlowState. node->state node->out-nodes node->facts node->update!)))
+
+(defn memory->node [memory]
+  (case memory
+    :known 0
+    :pretended 1
+    :remembered 2
+    :forgotten 3))
+
+(defn memory->nodes [memory]
+  (case memory
+    :known [0]
+    :pretended [1]
+    :remembered [2]
+    :forgotten [3]
+    :known&pretended [0 1]))
+
+(def empty-flow-plan
+  (FlowPlan. [(Union. #{}) (Union. #{}) (Union. #{}) (Union. #{})] {}))
+
+(defn add-output [flow-plan node memory]
+  (update-in flow-plan [:node->flow (memory->node memory) :nodes] conj node))
+
+(defn add-flow [{:keys [node->flow flow->node] :as flow-plan} flow]
+  (if-let [node (flow->node flow)]
+    [flow-plan node]
+    (let [node (count node->flow)
+          node->flow (conj node->flow flow)
+          flow->node (assoc flow->node flow node)]
+      [(FlowPlan. node->flow flow->node) node])))
+
 ;; IXES

 (defn ix-of [vector value]
@@ -264,12 +379,45 @@
 (defn expr->fun [vars expr]
   (apply js/Function (conj (vec vars) (str "return " expr ";"))))

+(defn when->fun [vars expr]
+  (let [when-fun (expr->fun vars expr)]
+    (fn [fact]
+      (let [values (.-values fact)]
+        (when (.apply when-fun nil values)
+          fact)))))
+
+(defn let->fun [vars expr]
+  (let [let-fun (expr->fun vars expr)]
+    (fn [fact]
+      (let [values (.-values fact)
+            new-values (aclone values)
+            new-value (.apply let-fun nil values)]
+        (apush new-values new-value)
+        (Fact. nil new-values nil)))))
+
+(defn when-let->fun [name-ix vars expr]
+  (let [let-fun (expr->fun vars expr)]
+    (fn [fact]
+      (let [values (.-values fact)
+            old-value (aget values name-ix)
+            new-value (.apply let-fun nil values)]
+        (when (= old-value new-value)
+          fact)))))
+
 ;; PATTERNS

 (defn pattern->vars [pattern]
   (vec (distinct (filter symbol? (.-values pattern)))))

-(defn pattern->constructor [pattern source-vars]
+(defn pattern->filter [pattern]
+  `(pattern->filter* ~(.-shape pattern)))
+
+(defn pattern->filter* [shape]
+  (fn [fact]
+    (when (= shape (.-shape fact))
+      fact)))
+
+(defn pattern->constructor [source-vars pattern]
   (let [shape (.-shape pattern)
         values (.-values pattern)
         source-ixes #js []
@@ -279,12 +427,15 @@
         (do
           (apush source-ixes (ix-of source-vars value))
           (apush sink-ixes ix))))
-    (fn [fact]
-      (let [source (.-values fact)
-            sink (aclone values)]
-        (dotimes [i (alength source-ixes)]
-          (aset sink (aget sink-ixes i) (aget source (aget source-ixes i))))
-        (Fact. shape sink nil)))))
+    `(pattern->constructor* ~shape ~values ~source-ixes ~sink-ixes)))
+
+(defn pattern->constructor* [shape values source-ixes sink-ixes]
+  (fn [fact]
+    (let [source (.-values fact)
+          sink (aclone values)]
+      (dotimes [i (alength source-ixes)]
+        (aset sink (aget sink-ixes i) (aget source (aget source-ixes i))))
+      (Fact. shape sink nil))))

 (defn pattern->deconstructor [pattern]
   (let [shape (.-shape pattern)
@@ -306,21 +457,23 @@
         (do
           (apush constant-values value)
           (apush constant-ixes ix))))
-    (fn [fact]
-      (when (= shape (.-shape fact))
-        (let [source (.-values fact)]
+    `(pattern->deconstructor* ~constant-values ~constant-ixes ~var-ixes ~dup-value-ixes ~dup-var-ixes)))
+
+(defn pattern->deconstructor* [constant-values constant-ixes var-ixes dup-value-ixes dup-var-ixes]
+  (fn [fact]
+    (let [source (.-values fact)]
+      (loop [i 0]
+        (if (< i (alength constant-values))
+          (when (= (aget constant-values i) (aget source (aget constant-ixes i)))
+            (recur (+ i 1)))
           (loop [i 0]
-            (if (< i (alength constant-values))
-              (when (= (aget constant-values i) (aget source (aget constant-ixes i)))
+            (if (< i (alength dup-value-ixes))
+              (when (= (aget source (aget dup-value-ixes i)) (aget source (aget dup-var-ixes i)))
                 (recur (+ i 1)))
-              (loop [i 0]
-                (if (< i (alength dup-value-ixes))
-                  (when (= (aget source (aget dup-value-ixes i)) (aget source (aget dup-var-ixes i)))
-                    (recur (+ i 1)))
-                  (let [sink (make-array (alength var-ixes))]
-                    (dotimes [i (alength var-ixes)]
-                      (aset sink i (aget source (aget var-ixes i))))
-                    (Fact. nil sink nil)))))))))))
+              (let [sink (make-array (alength var-ixes))]
+                (dotimes [i (alength var-ixes)]
+                  (aset sink i (aget source (aget var-ixes i))))
+                (Fact. nil sink nil)))))))))

 (comment
   (deffact eg "[a] has a [b] with a [c]")
@@ -343,124 +496,6 @@
   ((pattern->deconstructor (->eg 'a 'a 'a)) (->eg "a" "a" "a"))
   )

-;; FUNLIKE
-
-(defrecord ShapeFun [shape])
-(defrecord ConstructorFun [vars pattern])
-(defrecord DeconstructorFun [pattern])
-(defrecord WhenFun [vars expr])
-(defrecord LetFun [vars expr])
-
-(defn funlike->fun [funlike]
-  (condp = (type funlike)
-    ShapeFun (let [{:keys [shape]} funlike]
-               (fn [x]
-                 (when (= shape (.-shape x))
-                   x)))
-    ConstructorFun (let [{:keys [vars pattern]} funlike]
-                     (pattern->constructor pattern vars))
-    DeconstructorFun (let [{:keys [pattern]} funlike]
-                       (pattern->deconstructor pattern))
-    WhenFun (let [{:keys [vars expr]} funlike
-                  when-fun (expr->fun vars expr)]
-              (fn [fact]
-                (when (.apply when-fun nil (.-values fact))
-                  fact)))
-    LetFun (let [{:keys [vars expr]} funlike
-                 let-fun (expr->fun vars expr)]
-             (fn [fact]
-               (let [values (.-values fact)
-                     new-value (.apply let-fun nil values)
-                     new-values (aclone values)]
-                 (apush new-values new-value)
-                 (Fact. nil new-values nil))))))
-
-;; FLOWS
-
-(defrecord Union [nodes])
-(defrecord FilterMap [nodes funlike])
-(defrecord Index [nodes key-ixes])
-(defrecord Lookup [nodes index-node key-ixes val-ixes])
-
-(defn flow->nodes [flow]
-  (:nodes flow))
-
-;; FLOW PLAN
-
-(defrecord FlowPlan [node->flow flow->node])
-
-(defn flow-plan->flow-state [{:keys [node->flow]}]
-  (let [node->state (into-array (for [_ node->flow] nil))
-        node->out-nodes (into-array (for [_ node->flow] #js []))
-        node->facts (into-array (for [_ node->flow] #js []))
-        node->update! (into-array (for [_ node->flow] nil))]
-    (dotimes [node (count node->flow)]
-      (let [flow (nth node->flow node)]
-        (aset node->state node
-              (condp = (type flow)
-                Union (transient #{})
-                FilterMap nil
-                Index (transient {})
-                Lookup nil))
-        (doseq [in-node (:nodes flow)]
-          (apush (aget node->out-nodes in-node) node))
-        (aset node->update! node
-              (condp = (type flow)
-                Union (union-update!)
-                FilterMap (filter-map-update! (funlike->fun (:funlike flow)))
-                Index (index-update! (:key-ixes flow))
-                Lookup (lookup-update! (:index-node flow) (:key-ixes flow) (:val-ixes flow))))))
-    (FlowState. node->state node->out-nodes node->facts node->update!)))
-
-(defn memory->node [memory]
-  (case memory
-    :known 0
-    :pretended 1
-    :remembered 2
-    :forgotten 3))
-
-(defn memory->nodes [memory]
-  (case memory
-    :known [0]
-    :pretended [1]
-    :remembered [2]
-    :forgotten [3]
-    :known&pretended [0 1]))
-
-(def empty-flow-plan
-  (FlowPlan. [(Union. #{}) (Union. #{}) (Union. #{}) (Union. #{})] {}))
-
-(defn add-output [flow-plan node memory]
-  (update-in flow-plan [:node->flow (memory->node memory) :nodes] conj node))
-
-(defn add-flow [{:keys [node->flow flow->node] :as flow-plan} flow]
-  (if-let [node (flow->node flow)]
-    [flow-plan node]
-    (let [node (count node->flow)
-          node->flow (conj node->flow flow)
-          flow->node (assoc flow->node flow node)]
-      [(FlowPlan. node->flow flow->node) node])))
-
-(comment
-  (deffact edge "[x] has an edge to [y]")
-  (deffact connected "[x] is connected to [y]")
-
-  (def known&pretended [0 1])
-
-  (let [plan empty-flow-plan
-        [plan edges] (add-flow plan (FilterMap. known&pretended (ShapeFun. edge)))
-        [plan connecteds] (add-flow plan (FilterMap. known&pretended (ShapeFun. connected)))
-        [plan edges-index] (add-flow plan (Index. [edges] #js [1]))
-        [plan connecteds-index] (add-flow plan (Index. [connecteds] #js [0]))
-        [plan edges-lookup] (add-flow plan (Lookup. [edges-index] connecteds-index #js [1] #js [0 3]))
-        [plan connecteds-lookup] (add-flow plan (Lookup. [connecteds-index] edges-index #js [0] #js [2 1]))
-        [plan new-connecteds] (add-flow plan (FilterMap. [edges edges-lookup connecteds-lookup] (ConstructorFun. '[x z] (->connected 'x 'z))))
-        plan (add-output plan new-connecteds :pretended)
-        state (flow-plan->flow-state plan)]
-    (apush* (aget (:node->facts state) 0) #js [(->edge 0 1) (->edge 1 2) (->edge 2 3) (->edge 3 1)])
-    (-> (fixpoint! state) :node->state (aget 1) persistent!))
-  )
-
 ;; CLAUSES

 (defrecord Recall [memory pattern]) ;; memory is one of :known :pretended :remembered :forgotten :known&pretended
@@ -476,23 +511,23 @@
 (defn add-clause [plan nodes vars clause]
   (condp = (type clause)
     Recall (let [{:keys [memory pattern]} clause
-                 [plan node-a] (add-flow plan (FilterMap. (memory->nodes memory) (ShapeFun. (.-shape pattern))))
-                 [plan node-b] (add-flow plan (FilterMap. [node-a] (DeconstructorFun. pattern)))]
+                 [plan node-a] (add-flow plan (FilterMap. (memory->nodes memory) (pattern->filter pattern)))
+                 [plan node-b] (add-flow plan (FilterMap. [node-a] (pattern->deconstructor pattern)))]
              [plan [node-b] (pattern->vars pattern)])
     Compute (let [{:keys [pattern]} clause]
               (condp = (.-shape pattern)
                 Let (when (every? (set vars) (:vars pattern))
-                      (let [funlike (if (contains? (set vars) (:name pattern))
-                                      (WhenFun. vars (str "cljs.core.equals(" (:name pattern) "," (:expr pattern) ")"))
-                                      (LetFun. vars (:expr pattern)))
-                            [plan node] (add-flow plan (->FilterMap nodes funlike))]
+                      (let [fun&args (if (contains? (set vars) (:name pattern))
+                                       `(when-let->fun ~(ix-of vars (:name pattern)) ~vars ~(:expr pattern))
+                                       `(let->fun ~vars ~(:expr pattern)))
+                            [plan node] (add-flow plan (->FilterMap nodes fun&args))]
                         [plan [node] (conj vars (:name pattern))]))
                 When (when (every? (set vars) (:vars pattern))
-                       (let [[plan node] (add-flow plan (->FilterMap nodes (WhenFun. vars (:expr pattern))))]
+                       (let [[plan node] (add-flow plan (->FilterMap nodes `(when->fun ~vars ~(:expr pattern))))]
                          [plan [node] vars]))))
     Output (let [{:keys [memory pattern]} clause
                  _ (assert (every? (set vars) (pattern->vars pattern)))
-                 [plan output-node] (add-flow plan (FilterMap. nodes (ConstructorFun. vars pattern)))
+                 [plan output-node] (add-flow plan (FilterMap. nodes (pattern->constructor vars pattern)))
                  plan (add-output plan output-node memory)]
              [plan nodes vars])))


[core] Make 'split-hostport a tiny bit safer.

* Add 'trash collector for remaining bits after 'str/split.
* Add TODO for robust error-checking. :-)

--- src/birdie_tell/core.clj
+++ src/birdie_tell/core.clj
@@ -67,8 +67,7 @@
       (split-hostport \"hostname:1234\")
       ;=> [\"hostname\" 1234]"
   [host-port]
-  ;; TODO: add error checking
-  (let [[ip-addr port] (str/split host-port #":")
+  (let [[ip-addr port & trash] (str/split host-port #":")
         port (Integer/parseInt port)]
     [ip-addr port]))


connected-rooms does not include own exit if :undefined.

--- src/isla/story.clj
+++ src/isla/story.clj
@@ -33,8 +33,10 @@
 (defrecord Room [name summary items exit]
   QueryableRoom
   (connected-rooms [this story]
-    (set (conj (filter (fn [x] (= this (:exit x))) (vals (:rooms story)))
-               (:exit this)))))
+    (let [this-as-exits (filter (fn [x] (= this (:exit x))) (vals (:rooms story)))]
+      (if (not= :undefined (:exit this))
+        (conj this-as-exits (:exit this))
+        this-as-exits))))

 (defrecord Story [player rooms]
   QueryableStory


Rename service name in broker catalog to 'RabbitMQ for PCF'

Signed-off-by: Chris Hedley <711c73f64afdce07b7e38039a96d2224209e9a6c@cghsystems.net>

--- src/rabbitmq-broker/src/clojure/io/pivotal/pcf/rabbitmq/config.clj
+++ src/rabbitmq-broker/src/clojure/io/pivotal/pcf/rabbitmq/config.clj
@@ -116,7 +116,7 @@
      :bindable    true
      :requires    []
      :tags        ["rabbitmq" "messaging" "message-queue" "amqp" "stomp" "mqtt" "pivotal"]
-     :metadata    {"displayName"         "RabbitMQ for Pivotal CF"
+     :metadata    {"displayName"         "RabbitMQ for PCF"
                    "longDescription"     long-desc
                    "imageUrl"            img-url
                    ;; backwards compatibility


Actually point to the right URL for instructions

--- src/clj/medusa/alert.clj
+++ src/clj/medusa/alert.clj
@@ -54,7 +54,7 @@
                          "\n"
                          "2. Reply-All to this email to let the list know that you are investigating. Include the bug number so we can help out."
                          "\n"
-                         "3. Triage the alert. You can find instructions here: " alert-url
+                         "3. Triage the alert. You can find instructions here: https://docs.telemetry.mozilla.org/tools/alerts.html#triaging-a-telemetry-alert-email"
                          "\n\n"
                          "If you have any problems, please ask for help on the #telemetry IRC channel or on Slack in #fx-metrics. We'll give you a hand."
                          "\n\n"


use system getenv

use system getenv

--- src/clj/scrabble/api.clj
+++ src/clj/scrabble/api.clj
@@ -7,7 +7,7 @@
             [compojure.handler :refer [site]]
             [scrabble.core :as scrabble]
             ;; import env
-            [environ.core :refer [env]]
+            #_[environ.core :refer [env]]
             [ring.adapter.jetty :as jetty]
             [ring.middleware.json :refer [wrap-json-response]]
             [ring.middleware.defaults :refer [api-defaults wrap-defaults]]))
@@ -47,5 +47,5 @@
   (wrap-json-response app-routes api-defaults))

 (defn -main [& [port]]
-  (let [port (Integer. (or port (env :port) 5000))]
+  (let [port (Integer. (or port (System/getenv "PORT") 5000))]
     (jetty/run-jetty (site #'app) {:port port :join? false})))


fix js-obj macro to return empty object if no key values

--- src/main/clojure/cljs/core.cljc
+++ src/main/clojure/cljs/core.cljc
@@ -2313,11 +2313,13 @@
                            (filter (complement sym-or-str?) (keys kvs))
                            (repeatedly gensym))
              obj (gensym "obj")]
-    `(let [~@(apply concat (clojure.set/map-invert expr->local))
-           ~obj ~(js-obj* (filter-on-keys core/string? kvs))]
-       ~@(map (core/fn [[k v]] `(aset ~obj ~k ~v)) sym-pairs)
-       ~@(map (core/fn [[k v]] `(aset ~obj ~v ~(core/get kvs k))) expr->local)
-       ~obj)))
+    (if (empty? rest)
+      (js-obj* '())
+      `(let [~@(apply concat (clojure.set/map-invert expr->local))
+            ~obj ~(js-obj* (filter-on-keys core/string? kvs))]
+        ~@(map (core/fn [[k v]] `(aset ~obj ~k ~v)) sym-pairs)
+        ~@(map (core/fn [[k v]] `(aset ~obj ~v ~(core/get kvs k))) expr->local)
+        ~obj))))

 (core/defmacro alength [a]
   (vary-meta


CMR-718: Changing expected scores.

CMR-718: Changing expected scores.

--- test/cmr/system_int_test/search/collection_keyword_search_test.clj
+++ test/cmr/system_int_test/search/collection_keyword_search_test.clj
@@ -155,7 +155,7 @@
            "SUPER" [coll9]))

     (testing "Boost on fields"
-      (are [keyword-str scores] (= scores
+      (are [keyword-str scores] (= (map #(/ % 2.0) scores)
                                    (map :score (:refs (search/find-refs :collection
                                                                         {:keyword keyword-str}))))
            ;; short-name