CMR-1586: Updated test

CMR-1586: Updated test

--- metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/search_test.clj
+++ metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/search_test.clj
@@ -104,26 +104,42 @@
     (is (= 200 status ))
     (is (= [(:concept-id coll1)] (map :concept-id concepts)))))

+(defn- save-collection
+  "Given a provider-id, unique number, and attribute map, save a version of the collection."
+  [provider-id uniq-num attributes]
+  (let [concept (util/collection-concept provider-id uniq-num attributes)
+        {:keys [concept-id revision-id]} (util/save-concept concept)]
+    (assoc concept :revision-id revision-id :concept-id concept-id)))
+
 (deftest find-collections
-  (let [coll1 (util/create-and-save-collection "REG_PROV" 1 1 {:extra-fields {:entry-id "entry-1"
-                                                                                :entry-title "et1"
-                                                                                :version-id "v1"
-                                                                                :short-name "s1"}})
-        coll2-2 (util/create-and-save-collection "REG_PROV" 2 2 {:extra-fields {:entry-id "entry-2"
-                                                                                :entry-title "et2"
-                                                                                :version-id "v1"
-                                                                                :short-name "s2"}})
-        coll2-1 (assoc coll2-2 :revision-id 1)
-        coll3 (util/create-and-save-collection "SMAL_PROV1" 3 1 {:extra-fields {:entry-id "entry-3"
-                                                                                :entry-title "et3"
-                                                                                :version-id "v3"
-                                                                                :short-name "s3"}})
-        coll4-3 (util/create-and-save-collection "SMAL_PROV2" 4 3 {:extra-fields {:entry-id "entry-1"
-                                                                                :entry-title "et1"
-                                                                                :version-id "v3"
-                                                                                :short-name "s4"}})
-        coll4-1 (assoc coll4-3 :revision-id 1)
-        coll4-2 (assoc coll4-3 :revision-id 2)]
+  (let [coll1 (save-collection "REG_PROV" 1 {:extra-fields {:entry-id "entry-1"
+                                                            :entry-title "et1"
+                                                            :version-id "v1"
+                                                            :short-name "s1"}})
+        coll2-1 (save-collection "REG_PROV" 2 {:extra-fields {:entry-id "entry-2"
+                                                              :entry-title "et2"
+                                                              :version-id "v1"
+                                                              :short-name "s2"}})
+        coll2-2 (save-collection "REG_PROV" 2 {:extra-fields {:entry-id "entry-2"
+                                                              :entry-title "et2"
+                                                              :version-id "v2"
+                                                              :short-name "s2"}})
+        coll3 (save-collection "SMAL_PROV1" 3 {:extra-fields {:entry-id "entry-3"
+                                                              :entry-title "et3"
+                                                              :version-id "v3"
+                                                              :short-name "s3"}})
+        coll4-1 (save-collection "SMAL_PROV2" 4 {:extra-fields {:entry-id "entry-1"
+                                                                :entry-title "et1"
+                                                                :version-id "v3"
+                                                                :short-name "s4"}})
+        coll4-2 (save-collection "SMAL_PROV2" 4 {:extra-fields {:entry-id "entry-1"
+                                                                :entry-title "et1"
+                                                                :version-id "v4"
+                                                                :short-name "s4"}})
+        coll4-3 (save-collection "SMAL_PROV2" 4 {:extra-fields {:entry-id "entry-1"
+                                                                :entry-title "et1"
+                                                                :version-id "v5"
+                                                                :short-name "s4"}})]
     (testing "find-with-parameters"
       (are2 [collections params]
             (= (set collections)
@@ -149,18 +165,19 @@
             [coll4-3] {:provider-id "SMAL_PROV2" :entry-id "entry-1" :latest true}

             "regular provider - short-name, version-id"
-            [coll2-2] {:short-name "s2" :version-id "v1" :latest true}
+            [coll2-2] {:short-name "s2" :version-id "v2" :latest true}

             "small provider - short-name, version-id"
-            [coll4-3] {:short-name "s4" :version-id "v3" :latest true}
-
+            [coll4-3] {:short-name "s4" :version-id "v5" :latest true}
+
+            ;; TODO - this should change when the "find latest" logic is updated
             "small provider - match multiple - version-id"
-            [coll3 coll4-3] {:version-id "v3" :latest true}
+            [coll3 coll4-1] {:version-id "v3" :latest true}

             ;; This test verifies that the provider-id is being used with the small_providers
             ;; table. Otherwise we would get both coll3 and coll4 back (see previous test).
             "small provider - provider-id, version-id"
-            [coll4-3] {:provider-id "SMAL_PROV2" :version-id "v3" :latest true}
+            [coll4-3] {:provider-id "SMAL_PROV2" :version-id "v5" :latest true}

             "mixed providers - entry-title"
             [coll1 coll4-3] {:entry-title "et1" :latest true}
@@ -178,7 +195,7 @@
             [coll4-3] {:concept-id (:concept-id coll4-1) :latest true}

             "concept-id and version-id - latest"
-            [coll4-3] {:concept-id (:concept-id coll4-1) :version-id "v3" :latest true}
+            [coll4-3] {:concept-id (:concept-id coll4-1) :version-id "v5" :latest true}

             "find none - bad provider-id"
             [] {:provider-id "PROV_NONE" :latest true}
@@ -197,7 +214,7 @@
             [coll4-1 coll4-2 coll4-3] {:concept-id (:concept-id coll4-1)}

             "concept-id and version-id - all revisions"
-            [coll4-1 coll4-2 coll4-3] {:concept-id (:concept-id coll4-1) :version-id "v3"}))))
+            [coll4-1] {:concept-id (:concept-id coll4-1) :version-id "v3"}))))

 (deftest get-expired-collections-concept-ids
   (let [time-now (tk/now)


add checks in jreTypeSolver

add checks in jreTypeSolver

--- src/app/symbol_solver/type_solver.clj
+++ src/app/symbol_solver/type_solver.clj
@@ -43,6 +43,10 @@
   "Solve classes part of the standard libraries. For now unfortunately it uses the standard library where this code is executed, not an arbitrary one"
   []
   (fn [name-to-solve]
+    (when (nil? name-to-solve)
+      (throw (IllegalArgumentException. "null name received")))
+    (when (not (instance? String name-to-solve))
+      (throw (IllegalArgumentException. (str "name received is not a string, it is" (class name-to-solve)))))
     (if (.startsWith name-to-solve "java.lang.")
       (solve-system-class name-to-solve)
       (if (simple-name? name-to-solve)


appease the linter.

appease the linter.

--- src/metabase/query_processor/parameters.clj
+++ src/metabase/query_processor/parameters.clj
@@ -27,11 +27,11 @@
     "Q3" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/JULY))
     "Q4" (t/first-day-of-the-month (.withMonthOfYear (t/date-time year) DateTimeConstants/OCTOBER))))

-(defn- week-range [^DateTime dt]
-  ;; weeks always start on SUNDAY and end on SATURDAY
-  ;; NOTE: in Joda the week starts on Monday and ends on Sunday, so to get the right Sunday we rollback 1 week
-  {:end   (.withDayOfWeek dt DateTimeConstants/SATURDAY)
-   :start (.withDayOfWeek ^DateTime (t/minus dt (t/weeks 1)) DateTimeConstants/SUNDAY)})
+;(defn- week-range [^DateTime dt]
+;  ;; weeks always start on SUNDAY and end on SATURDAY
+;  ;; NOTE: in Joda the week starts on Monday and ends on Sunday, so to get the right Sunday we rollback 1 week
+;  {:end   (.withDayOfWeek dt DateTimeConstants/SATURDAY)
+;   :start (.withDayOfWeek ^DateTime (t/minus dt (t/weeks 1)) DateTimeConstants/SUNDAY)})

 (defn- month-range [^DateTime dt]
   {:end   (t/last-day-of-the-month dt)
@@ -42,9 +42,9 @@
   {:end   (t/last-day-of-the-month (t/plus dt (t/months 2)))
    :start (t/first-day-of-the-month dt)})

-(defn- year-range [^DateTime dt]
-  {:end   (t/last-day-of-the-month (.withMonthOfYear dt DateTimeConstants/DECEMBER))
-   :start (t/first-day-of-the-month (.withMonthOfYear dt DateTimeConstants/JANUARY))})
+;(defn- year-range [^DateTime dt]
+;  {:end   (t/last-day-of-the-month (.withMonthOfYear dt DateTimeConstants/DECEMBER))
+;   :start (t/first-day-of-the-month (.withMonthOfYear dt DateTimeConstants/JANUARY))})

 (defn- absolute-date->range
   "Take a given string description of an absolute date range and return a MAP with a given `:start` and `:end`.
@@ -72,30 +72,30 @@
          (m/map-vals (partial tf/unparse (tf/formatters :year-month-day))))))

-(defn- relative-date->range
-  "Take a given string description of a relative date range such as 'lastmonth' and return a MAP with a given
-   `:start` and `:end` as iso8601 string formatted dates.  Values should be appropriate for the given REPORT-TIMEZONE."
-  [value report-timezone]
-  (let [tz        (t/time-zone-for-id report-timezone)
-        formatter (tf/formatter "yyyy-MM-dd" tz)
-        today     (.withTimeAtStartOfDay (t/to-time-zone (t/now) tz))]
-    (->> (condp = value
-           "past7days"  {:end   (t/minus today (t/days 1))
-                         :start (t/minus today (t/days 7))}
-           "past30days" {:end   (t/minus today (t/days 1))
-                         :start (t/minus today (t/days 30))}
-           "thisweek"   (week-range today)
-           "thismonth"  (month-range today)
-           "thisyear"   (year-range today)
-           "lastweek"   (week-range (t/minus today (t/weeks 1)))
-           "lastmonth"  (month-range (t/minus today (t/months 1)))
-           "lastyear"   (year-range (t/minus today (t/years 1)))
-           "yesterday"  {:end   (t/minus today (t/days 1))
-                         :start (t/minus today (t/days 1))}
-           "today"      {:end   today
-                         :start today})
-         ;; the above values are JodaTime objects, so unparse them to iso8601 strings
-         (m/map-vals (partial tf/unparse formatter)))))
+;(defn- relative-date->range
+;  "Take a given string description of a relative date range such as 'lastmonth' and return a MAP with a given
+;   `:start` and `:end` as iso8601 string formatted dates.  Values should be appropriate for the given REPORT-TIMEZONE."
+;  [value report-timezone]
+;  (let [tz        (t/time-zone-for-id report-timezone)
+;        formatter (tf/formatter "yyyy-MM-dd" tz)
+;        today     (.withTimeAtStartOfDay (t/to-time-zone (t/now) tz))]
+;    (->> (condp = value
+;           "past7days"  {:end   (t/minus today (t/days 1))
+;                         :start (t/minus today (t/days 7))}
+;           "past30days" {:end   (t/minus today (t/days 1))
+;                         :start (t/minus today (t/days 30))}
+;           "thisweek"   (week-range today)
+;           "thismonth"  (month-range today)
+;           "thisyear"   (year-range today)
+;           "lastweek"   (week-range (t/minus today (t/weeks 1)))
+;           "lastmonth"  (month-range (t/minus today (t/months 1)))
+;           "lastyear"   (year-range (t/minus today (t/years 1)))
+;           "yesterday"  {:end   (t/minus today (t/days 1))
+;                         :start (t/minus today (t/days 1))}
+;           "today"      {:end   today
+;                         :start today})
+;         ;; the above values are JodaTime objects, so unparse them to iso8601 strings
+;         (m/map-vals (partial tf/unparse formatter)))))

 ;;; +-------------------------------------------------------------------------------------------------------+
@@ -148,92 +148,92 @@
 ;;; +-------------------------------------------------------------------------------------------------------+

-(defn- extract-dates [value report-timezone]
-  (if-not (contains? relative-dates value)
-    ;; absolute date range
-    (absolute-date->range value)
-    ;; relative date range
-    (relative-date->range value report-timezone)))
-
-(defn- expand-date-range-param [report-timezone {[target param-name] :target, param-type :type, param-value :value, :as param}]
-  (if-not (= param-type "date")
-    param
-    (let [{:keys [start end]} (extract-dates param-value report-timezone)]
-      [(assoc param :target [target (str param-name ":start")], :value start)
-       (assoc param :target [target (str param-name ":end")],   :value end)])))
-
-(defn- substitute-param [param-name value query]
-  ;; TODO: escaping and protection against SQL injection!
-  (s/replace query (re-pattern (str "\\{\\{" param-name "\\}\\}")) value))
-
-(defn- substitute-all-params [query-dict [{:keys [value], [_ param-name] :target, :as param} & rest]]
-  (if param
-    (if-not (and value (string? param-name))
-      (substitute-all-params query-dict rest)
-      (let [query (update-in query-dict [:native :query] (partial substitute-param param-name value))]
-        (substitute-all-params query rest)))
-    query-dict))
-
-;; these are various regex patterns used by the functions below to parse/extract our custom clauses
-;; an "outer-clause" is of the form [[PREFIX ...]] and an "inner-clause" is of the form <...>
-;; an incomplete clause is any clause which has an unsubstituted parameter left in it.  e.g. [[AND foo={{bar}}]]
-(def ^:private ^:const outer-clause-pattern            #"\[\[.*?\]\]")
-(def ^:private ^:const outer-clause-prefix-pattern     #"^\[\[(.*?)\s.*\]\]$")
-(def ^:private ^:const incomplete-outer-clause-pattern #"\[\[.*?\{\{.*?\}\}.*?\]\]")
-(def ^:private ^:const inner-clause-pattern            #"<(.*?)>")
-(def ^:private ^:const incomplete-inner-clause-pattern #"<.*?\{\{.*?\}\}.*?>")
-
-(defn- remove-incomplete-clauses
-  "Scans the native query body and removes any custom clauses which were not substituted with a parameter."
-  [query-dict]
-  (let [find-and-replace (fn [sql]
-                           (-> sql
-                               (s/replace incomplete-outer-clause-pattern "")
-                               (s/replace incomplete-inner-clause-pattern "")))]
-    (update-in query-dict [:native :query] find-and-replace)))
-
-(defn- format-outer-clause
-  "Formats an outer clause, finding all inner clauses and joining them via `AND` and then concatenating that onto the clause prefix.
-   e.g. \"[[WHERE <foo='bar'> <tou='can'>]]\" -> \"WHERE foo='bar' AND tou='can'\""
-  [clause]
-  (let [prefix (second (re-find outer-clause-prefix-pattern clause))]
-    ;; re-seq produces a vector for each match like [matched-form grouping1] and we only want grouping1.
-    (str prefix " " (s/join " AND " (map second (re-seq inner-clause-pattern clause))))))
-
-(defn- process-outer-clauses
-  "Takes a native query body and completely processes all included outer clauses present."
-  [query-dict]
-  (if-let [outer-clauses (re-seq outer-clause-pattern (get-in query-dict [:native :query]))]
-    (update-in query-dict [:native :query] (fn [q]
-                                             (loop [sql                   q
-                                                    [outer-clause & rest] outer-clauses]
-                                               (if outer-clause
-                                                 (recur (s/replace-first sql outer-clause (format-outer-clause outer-clause)) rest)
-                                                 sql))))
-    query-dict))
-
-(defn- process-inner-clauses
-  "Takes a native query body and completely processes all included inner clauses present.
-   e.g. \"<foo='bar'>\" -> \"foo='bar'\""
-  [query-dict]
-  (if-let [inner-clauses (re-seq inner-clause-pattern (get-in query-dict [:native :query]))]
-    (update-in query-dict [:native :query] (fn [q]
-                                             (loop [sql                      q
-                                                    [[orig stripped] & rest] inner-clauses]
-                                               (if orig
-                                                 (recur (s/replace-first sql orig stripped) rest)
-                                                 sql))))
-    query-dict))
-
-(defn- expand-params-native [{:keys [driver], :as query-dict} params]
-  (if-not (driver/driver-supports? driver :native-parameters)
-    query-dict
-    (let [report-timezone (get-in query-dict [:settings :report-timezone])
-          params          (flatten (map (partial expand-date-range-param report-timezone) params))]
-      (-> (substitute-all-params query-dict params)
-          remove-incomplete-clauses
-          process-outer-clauses
-          process-inner-clauses))))
+;(defn- extract-dates [value report-timezone]
+;  (if-not (contains? relative-dates value)
+;    ;; absolute date range
+;    (absolute-date->range value)
+;    ;; relative date range
+;    (relative-date->range value report-timezone)))
+;
+;(defn- expand-date-range-param [report-timezone {[target param-name] :target, param-type :type, param-value :value, :as param}]
+;  (if-not (= param-type "date")
+;    param
+;    (let [{:keys [start end]} (extract-dates param-value report-timezone)]
+;      [(assoc param :target [target (str param-name ":start")], :value start)
+;       (assoc param :target [target (str param-name ":end")],   :value end)])))
+;
+;(defn- substitute-param [param-name value query]
+;  ;; TODO: escaping and protection against SQL injection!
+;  (s/replace query (re-pattern (str "\\{\\{" param-name "\\}\\}")) value))
+;
+;(defn- substitute-all-params [query-dict [{:keys [value], [_ param-name] :target, :as param} & rest]]
+;  (if param
+;    (if-not (and value (string? param-name))
+;      (substitute-all-params query-dict rest)
+;      (let [query (update-in query-dict [:native :query] (partial substitute-param param-name value))]
+;        (substitute-all-params query rest)))
+;    query-dict))
+;
+;;; these are various regex patterns used by the functions below to parse/extract our custom clauses
+;;; an "outer-clause" is of the form [[PREFIX ...]] and an "inner-clause" is of the form <...>
+;;; an incomplete clause is any clause which has an unsubstituted parameter left in it.  e.g. [[AND foo={{bar}}]]
+;(def ^:private ^:const outer-clause-pattern            #"\[\[.*?\]\]")
+;(def ^:private ^:const outer-clause-prefix-pattern     #"^\[\[(.*?)\s.*\]\]$")
+;(def ^:private ^:const incomplete-outer-clause-pattern #"\[\[.*?\{\{.*?\}\}.*?\]\]")
+;(def ^:private ^:const inner-clause-pattern            #"<(.*?)>")
+;(def ^:private ^:const incomplete-inner-clause-pattern #"<.*?\{\{.*?\}\}.*?>")
+;
+;(defn- remove-incomplete-clauses
+;  "Scans the native query body and removes any custom clauses which were not substituted with a parameter."
+;  [query-dict]
+;  (let [find-and-replace (fn [sql]
+;                           (-> sql
+;                               (s/replace incomplete-outer-clause-pattern "")
+;                               (s/replace incomplete-inner-clause-pattern "")))]
+;    (update-in query-dict [:native :query] find-and-replace)))
+;
+;(defn- format-outer-clause
+;  "Formats an outer clause, finding all inner clauses and joining them via `AND` and then concatenating that onto the clause prefix.
+;   e.g. \"[[WHERE <foo='bar'> <tou='can'>]]\" -> \"WHERE foo='bar' AND tou='can'\""
+;  [clause]
+;  (let [prefix (second (re-find outer-clause-prefix-pattern clause))]
+;    ;; re-seq produces a vector for each match like [matched-form grouping1] and we only want grouping1.
+;    (str prefix " " (s/join " AND " (map second (re-seq inner-clause-pattern clause))))))
+;
+;(defn- process-outer-clauses
+;  "Takes a native query body and completely processes all included outer clauses present."
+;  [query-dict]
+;  (if-let [outer-clauses (re-seq outer-clause-pattern (get-in query-dict [:native :query]))]
+;    (update-in query-dict [:native :query] (fn [q]
+;                                             (loop [sql                   q
+;                                                    [outer-clause & rest] outer-clauses]
+;                                               (if outer-clause
+;                                                 (recur (s/replace-first sql outer-clause (format-outer-clause outer-clause)) rest)
+;                                                 sql))))
+;    query-dict))
+;
+;(defn- process-inner-clauses
+;  "Takes a native query body and completely processes all included inner clauses present.
+;   e.g. \"<foo='bar'>\" -> \"foo='bar'\""
+;  [query-dict]
+;  (if-let [inner-clauses (re-seq inner-clause-pattern (get-in query-dict [:native :query]))]
+;    (update-in query-dict [:native :query] (fn [q]
+;                                             (loop [sql                      q
+;                                                    [[orig stripped] & rest] inner-clauses]
+;                                               (if orig
+;                                                 (recur (s/replace-first sql orig stripped) rest)
+;                                                 sql))))
+;    query-dict))
+;
+;(defn- expand-params-native [{:keys [driver], :as query-dict} params]
+;  (if-not (driver/driver-supports? driver :native-parameters)
+;    query-dict
+;    (let [report-timezone (get-in query-dict [:settings :report-timezone])
+;          params          (flatten (map (partial expand-date-range-param report-timezone) params))]
+;      (-> (substitute-all-params query-dict params)
+;          remove-incomplete-clauses
+;          process-outer-clauses
+;          process-inner-clauses))))

 ;;; +-------------------------------------------------------------------------------------------------------+


new QA smart-contract addresses

new QA smart-contract addresses

--- src/name_bazaar/shared/smart_contracts.cljs
+++ src/name_bazaar/shared/smart_contracts.cljs
@@ -1,34 +1,22 @@
-(ns name-bazaar.shared.smart-contracts)
-
-(def smart-contracts
-  {:auction-offering-factory {:name "AuctionOfferingFactory",
-                              :address "0x959113e1c88d7e866e168ded02bf5cf8aaba2e0f"},
-   :buy-now-offering-factory {:name "BuyNowOfferingFactory",
-                              :address "0xcaf0523f1ca2985b5cbba8a42a8cc413ff7512d0"},
-   ;; Ropsten BaseRegistrarImplementation
-   ;; https://ropsten.etherscan.io/address/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85
-   :eth-registrar {:name "NameBazaarDevRegistrar",
-                   :address "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85"},
-   :buy-now-offering {:name "BuyNowOffering",
-                      :address "0x57001d4d427b9c862544b56b84a5520db10206b0"},
-   ;; Ropsten ReverseRegistrar
-   ;; https://ropsten.etherscan.io/address/0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c
-   :reverse-registrar {:name "NamebazaarDevReverseRegistrar",
-                       :address "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c"},
-   ;; Ropsten PublicResolver
-   ;; https://ropsten.etherscan.io/address/0x42d63ae25990889e35f215bc95884039ba354115
-   :public-resolver {:name "NamebazaarDevPublicResolver",
-                     :address "0x42D63ae25990889E35F215bC95884039Ba354115"},
-   :reverse-name-resolver {:name "NamebazaarDevNameResolver",
-                           :address "0x0000000000000000000000000000000000000000"},
-   ;; Ropsten ENSRegistry
-   ;; https://docs.ens.domains/ens-deployments
-   ;; https://ropsten.etherscan.io/address/0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e
-   :ens {:name "ENSRegistry",
-         :address "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},
-   :offering-registry {:name "OfferingRegistry",
-                       :address "0x501fa189c6ed1789cf6be5728c5e4b0a94d0c4b2"},
-   :district0x-emails {:name "District0xEmails",
-                       :address "0x1383405e11d179581ae3128c0c1698be29e40565"},
-   :auction-offering {:name "AuctionOffering",
-                      :address "0x0fc5ae5770a8188e1dcf46777020c186884d44dc"}})+(ns name-bazaar.shared.smart-contracts)
+    (def smart-contracts
+      ;; Ropsten ENSRegistry
+      ;; https://docs.ens.domains/ens-deployments
+      ;; https://ropsten.etherscan.io/address/0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e
+      {:ens {:name "ENSRegistry" :address "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"}
+       ;; Ropsten BaseRegistrarImplementation
+       ;; https://ropsten.etherscan.io/address/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85
+       :eth-registrar {:name "NameBazaarDevRegistrar" :address "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85"}
+       :offering-registry {:name "OfferingRegistry" :address "0xcf94DD1Efe4bf21eb7E9435b77eB27E5657CCE3d"}
+       :buy-now-offering {:name "BuyNowOffering" :address "0xcf56BEfA85Dc6c5dD433a09CbD3FD584E8A172ef"}
+       :buy-now-offering-factory {:name "BuyNowOfferingFactory" :address "0x02ae694b714B3307E368213E75f08567BaaBBf4a"}
+       :auction-offering {:name "AuctionOffering" :address "0xBc32f7375aF7b9F4FCc5be5b76ea7f84f91dbee8"}
+       :auction-offering-factory {:name "AuctionOfferingFactory" :address "0x35cc9F93f81bf6Ce63f15008Ec925BE09fF46F9A"}
+       :district0x-emails {:name "District0xEmails" :address "0x2A33bC3710164Cf85b6c61c9Ec6edc685Fc13022"}
+       :reverse-name-resolver {:name "NamebazaarDevNameResolver" :address "0x0000000000000000000000000000000000000000"}
+       ;; Ropsten PublicResolver
+       ;; https://ropsten.etherscan.io/address/0x42d63ae25990889e35f215bc95884039ba354115
+       :public-resolver {:name "NamebazaarDevPublicResolver" :address "0x42D63ae25990889E35F215bC95884039Ba354115"}
+       ;; Ropsten ReverseRegistrar
+       ;; https://ropsten.etherscan.io/address/0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c
+       :reverse-registrar {:name "NamebazaarDevReverseRegistrar" :address "0x6F628b68b30Dc3c17f345c9dbBb1E483c2b7aE5c"}})


add cond tests

add cond tests

--- src/test/clojure/clojure/test/core_test.clj
+++ src/test/clojure/clojure/test/core_test.clj
@@ -46,6 +46,18 @@
   [m default]
   (eval (map->case-src m default)))

+(defn map->cond-src
+  [m default]
+  (list 'fn '[input]
+        (apply list 'cond
+               (concat (mapcat (fn [[k v]] [(list '= 'input (list 'quote k))
+                                           (list 'quote v)]) m)
+                       [:else default]))))
+
+(defn map->cond-fn
+  [m default]
+  (eval (map->cond-src m default)))
+
 (defn case-test-constant
   "Generate a test constant that might appear in a case expression."
   []
@@ -64,6 +76,16 @@
     (when-not (contains? case-map k)
       (assert= (% k) default k))))

+(defspec cond-spec
+  map->cond-fn
+  [^{:tag (hash-map `case-test-constant long)} cond-map
+   ^keyword default]
+  (doseq [k (keys cond-map)]
+    (assert= (% k) (cond-map k) k))
+  (doseq [k (range 100)]
+    (when-not (contains? cond-map k)
+      (assert= (% k) default k))))
+
 (defn encountered-in-walk
   "Returns a frequency map of items encountered while walking
    obj, using a walk-fn from e.g. clojure.walk."


patch figwheel to load goog.string.format ns

--- cljs/src/dev/plastic/dev/figwheel.cljs
+++ cljs/src/dev/plastic/dev/figwheel.cljs
@@ -3,9 +3,19 @@
   (:require [clojure.string :as string]
             [figwheel.client :as figwheel]
             [figwheel.client.socket :as socket]
-            [figwheel.client.utils :as utils]))
+            [figwheel.client.utils :as utils]
+            [figwheel.client.file-reloading :as reloading]))

 ; note: figwheel does not play well with advanced optimizations, do not include it
+
+(log "patching figwheel's ns-to-js-file")
+(def original-ns-to-js-file reloading/ns-to-js-file)
+(set! reloading/ns-to-js-file
+  (fn [ns]
+    (let [res (original-ns-to-js-file ns)]
+      (condp = res
+        "goog/string/format.js" "goog/string/stringformat.js"
+        res))))

 (def need-loophole? true)


using multimethod instead

using multimethod instead

--- src/celestial/persistency/systems.clj
+++ src/celestial/persistency/systems.clj
@@ -114,15 +114,6 @@
 (defn system-ip [id]
   (get-in (get-system id) [:machine :ip]))

-#_(def hyp-to-v {
-   :openstack ov/validate-entity
-   :freenas fv/validate-entity
-   :physical ph/validate-entity
-   :proxmox pv/validate-entity
-   :docker dv/validate-entity
-   :aws av/validate-entity
-   :vcenter vc/validate-entity})
-
 (validation :type-exists (when-not-nil t/type-exists? "type not found, create it first"))

 (validation :user-exists (when-not-nil u/user-exists? "user not found"))


simplify arithmetic dsl

simplify arithmetic dsl

--- src/clj/algorithms_clj/arithmetic.clj
+++ src/clj/algorithms_clj/arithmetic.clj
@@ -15,13 +15,14 @@
 (defn add [& args] (into [:add] args))
 (defn mul [& args] (into [:mul] args))

+(defn rator [e] (first e))
+(defn rands [e] (rest e))
+
 (defn cst? [n] (number? n))
 (defn sym? [v] (string? v))
 (defn op? [e] (vector? e))
-(defn add? [e] (and (op? e) (= (first e) :add)))
-(defn mul? [e] (and (op? e) (= (first e) :mul)))
-
-(defn rands [e] (rest e))
+(defn add? [e] (and (op? e) (= (rator e) :add)))
+(defn mul? [e] (and (op? e) (= (rator e) :mul)))

 ;; ----------------------------------------------------------------------------
@@ -34,12 +35,6 @@
     (mul (cst 0) (sym "x") (sym "y"))
     (mul (cst 1) (sym "y") (cst 2))
     (add (cst 0) (sym "x"))))
-
-(def expr-2
-  (add 1 2
-    (mul 0 "x" "y")
-    (mul 1 "y" 2)
-    (add 0 "y")))

 ;; ----------------------------------------------------------------------------

@@ -66,16 +61,14 @@
     :else e))

 (defn evaluate
-  [env expr]
-  (walk/postwalk (partial eval-cata env) expr))
+  [env e]
+  (walk/postwalk #(eval-cata env %) e))

 ;; ----------------------------------------------------------------------------

 (defn- optimize-op
   [[rator & rands] binary-op neutral]
-  (let [groups (group-by cst? rands)
-        csts (get groups true)
-        vars (get groups false)
+  (let [{csts true vars false} (group-by cst? rands)
         sum-cst (reduce binary-op neutral csts)]
     (cond
       (empty? vars) (cst sum-cst)
@@ -85,20 +78,19 @@
       )))

 (defn- optimize-add [e]
-  (cond
-    (add? e) (optimize-op e + 0)
-    :else e))
+  (if (add? e)
+    (optimize-op e + 0)
+    e))

 (defn- optimize-mul [e]
-  (cond
-    (mul? e) (if (some #{0} e) (cst 0) (optimize-op e * 1))
-    :else e))
+  (if (mul? e)
+    (if (some #{0} e)
+      (cst 0)
+      (optimize-op e * 1))
+    e))

-(defn optimize
-  [e]
-  (walk/postwalk
-    (comp optimize-mul optimize-add)
-    e))
+(defn optimize [e]
+  (walk/postwalk (comp optimize-mul optimize-add) e))

 ;; ----------------------------------------------------------------------------
@@ -108,10 +100,10 @@
   (if (string? x) (get env x x) x))

 (defn partial-eval
-  [env expr]
+  [env e]
   (walk/postwalk
-    (comp optimize-mul optimize-add (partial replace-var env))
-    expr))
+    (comp optimize-mul optimize-add #(replace-var env %))
+    e))

 ;; ----------------------------------------------------------------------------


Removed trends prep and cleanup steps from workflow - both happen in analyze-trends

--- src/clj/forma/hadoop/jobs/scatter.clj
+++ src/clj/forma/hadoop/jobs/scatter.clj
@@ -191,15 +191,6 @@
                                              (hfs-seqfile reli-path)
                                              (hfs-seqfile rain-stretch-path)))))

-              cleanseries
-              ([:tmp-dirs clean-series]
-                 "Screen out extremely cloudy pixels. Currently doesn't
-                  actually run the timeseries cleaning function"
-                 (?- (hfs-seqfile clean-series)
-                     (forma/dynamic-clean
-                      est-map
-                      (hfs-seqfile adjusted-series-path))))
-
               trends
               ([:tmp-dirs trends-path]
                  "Runs the trends processing."
@@ -207,13 +198,6 @@
                      (forma/analyze-trends
                       est-map
                       (hfs-seqfile clean-series))))
-
-              trends-cleanup
-              ([:tmp-dirs cleanup-path]
-                 "Clean up data after trends to improve join
-                  performance. Joins kill us with lots of observations"
-                 (?- (hfs-seqfile cleanup-path)
-                     (forma/trends-cleanup (hfs-seqfile trends-path))))

               fire-step
               ([:tmp-dirs fire-path]


Fixed logic error in handler.clj.

Fixed logic error in handler.clj.

--- src/clj/org/openforis/ceo/handler.clj
+++ src/clj/org/openforis/ceo/handler.clj
@@ -48,11 +48,11 @@
 (defn- no-cross-traffic? [{:keys [headers]}]
   (when-let [referer (get headers "referer")]
     (when-let [host (get headers "host")]
-      (not (str/includes? referer host)))))
+      (str/includes? referer host))))

-(defn authenticated-routing-handler [{:keys [uri request-method] :as request}]
+(defn authenticated-routing-handler [{:keys [uri request-method params] :as request}]
   (let [{:keys [auth-type auth-action handler] :as route} (get routes [request-method uri])
-        user-id      (get-in request [:params :userId] -1)
+        user-id      (:userId params -1)
         next-handler (if route
                        (if (condp = auth-type
                              :user       (pos? user-id)


update session handler

update session handler

--- src/clj/org/openforis/ceo/handler.clj
+++ src/clj/org/openforis/ceo/handler.clj
@@ -2,7 +2,7 @@
   (:require [clojure.data.json :as json]
             [clojure.edn       :as edn]
             [clojure.string    :as str]
-            [clojure.set       :refer [intersection]]
+            [clojure.set       :as set]
             [ring.middleware.absolute-redirects :refer [wrap-absolute-redirects]]
             [ring.middleware.content-type       :refer [wrap-content-type]]
             [ring.middleware.default-charset    :refer [wrap-default-charset]]
@@ -191,12 +191,21 @@
         (handler (assoc request :params (merge params get-params post-params))))
       (handler request))))

-(defn wrap-merge-session [handler]
-  (fn [{:keys [params session] :as request}]
-    (let [intersection (intersection (set (keys params)) (set (keys session)))]
+(def updateable-session-keys [:tokenKey])
+
+(defn wrap-persistent-session [handler]
+  (fn [request]
+    (let [{:keys [params session]} request
+          to-update    (select-keys params updateable-session-keys)
+          session      (apply dissoc session (keys to-update))
+          intersection (set/intersection (set (keys params)) (set (keys session)))
+          response     (handler (update request :params merge session))]
       (when-not (empty? intersection)
-        (log-str "WARNING! The following params are being overwritten by session values: " intersection)))
-    (handler (update request :params merge session))))
+        (log-str "WARNING! The following params are being overwritten by session values: " intersection))
+      (if (and (contains? response :session)
+               (nil? (:session response)))
+        response
+        (update response :session #(merge session % to-update))))))

 (defn wrap-exceptions [handler]
   (fn [request]
@@ -211,7 +220,7 @@
 (defn wrap-common [handler]
   (-> handler
       wrap-request-logging
-      wrap-merge-session
+      wrap-persistent-session
       wrap-keyword-params
       wrap-edn-params
       wrap-json-params


Fix api link.

Fix api link.

--- src/clj/quil_site/controllers/api.clj
+++ src/clj/quil_site/controllers/api.clj
@@ -19,7 +19,7 @@
                    (into (sorted-map)))
              categories)))

-(def all-fns (edn/read-string (slurp "api-2.2.3.clj")))
+(def all-fns (edn/read-string (slurp "api-2.2.4.clj")))

 (def fns-by-categories (split-into-categories all-fns))


wip hybrid-cache

wip hybrid-cache

--- src/cljc/commos/delta/compscribe.cljc
+++ src/cljc/commos/delta/compscribe.cljc
@@ -5,12 +5,14 @@
                                                 put!
                                                 alts!
                                                 pipe
-                                                go go-loop]]
+                                                go go-loop
+                                                mult tap untap]]
                :cljs [cljs.core.async :refer [chan close!
                                               <! >!
                                               put!
                                               alts!
-                                              pipe]])
+                                              pipe
+                                              mult tap untap]])
             [clojure.walk :refer [prewalk postwalk]]
             [commos.shared.core :refer [flatten-keys]])
   #?(:cljs (:require-macros [cljs.core.async.macros :refer [go-loop go]])))
@@ -333,6 +335,54 @@
       #_(println "unsubscribing" (::identifier (meta unsubs-fn)))
       (unsubs-fn))))

+(defn- hybrid-cache
+  "Caches on endpoints.  Sends the current sum to a new subscriber,
+  continues with deltas."
+  [service]
+  (let [subscribe-ch (chan)
+        cancel-ch (chan)]
+    (go-loop [subs {}
+              ch->identifier {}]
+      (let [[msg port] (alts! [subscribe-ch
+                               cancel-ch])]
+        (case port
+          subscribe-ch
+          (let [[this identifier target] msg
+                [m :as cache]
+                (or (get subs identifier)
+                    (let [ch-in (chan)
+                          m (mult ch-in)]
+                      (subscribe (assoc service :cached-service this)
+                                 identifier
+                                 ch-in)
+                      [m #{} ch-in]))]
+            (tap m target)
+            (recur (assoc subs identifier (update cache 1 conj target))
+                   (assoc ch->identifier target identifier)))
+          cancel-ch
+          (let [[this target] msg]
+            (if-let [identifier (get ch->identifier target)]
+              (let [[m chs ch-in :as cache] (get subs identifier)
+                    chs (disj chs target)
+                    ch->identifier (dissoc ch->identifier target)]
+                (untap m target)
+                (close! target)
+                (if (empty? chs)
+                  (do
+                    (cancel service ch-in)
+                    (recur (dissoc subs identifier)
+                           ch->identifier))
+                  (recur (assoc subs identifier (assoc cache 1 chs))
+                         ch->identifier)))
+              (recur subs
+                     ch->identifier))))))
+    (reify
+      IStream
+      (subscribe [this identifier target]
+        (put! subscribe-ch [this identifier target]))
+      (cancel [this target]
+        (put! cancel-ch [this target])))))
+
 (defn compscriber
   [service]
   (let [service (map->CompscribeService {:source-service service


modified nav seq

modified nav seq

--- src/cljs/cljspazzer/client/pages.cljs
+++ src/cljs/cljspazzer/client/pages.cljs
@@ -2,6 +2,7 @@
   (:require [om.core :as om :include-macros true]
             [sablono.core :as html :refer-macros [html]]
             [cljspazzer.client.utils :as utils]))
+(def nav-seq (concat (map str "#abcdefghijklmnopqrstuvwxyz") ["all"]))

 (defn nav-item [x]
   (html [:li
@@ -15,7 +16,7 @@

 (defn browse-page [data]
   (html [:div.browse
-         [:div.collection-nav [:ul (map nav-item "abcdefghijklmnopqrstuvwxyz")]]
+         [:div.collection-nav [:ul (map nav-item nav-seq)]]
          [:div.artist-list [:ul (map artist-item (:artists data))]]
          [:div.artist-detail [:ul (map album-item (:albums data))]]]
         ))


wiring up the things that exist in the main nav

--- src/cljs/cljspazzer/client/pages.cljs
+++ src/cljs/cljspazzer/client/pages.cljs
@@ -83,11 +83,13 @@
    [:ul (map nav-item nav-seq)]])

 (defn main-nav-partial []
-  [:div.main-nav
-    [:i.fa.fa-search.active {:title "Browse"}]
-    [:i.fa.fa-play-circle {:title "Play"}]
-    [:i.fa.fa-list {:title "Playlists"}]
-    [:i.fa.fa-gear {:title "Settings"}]])
+  (let [browse-url "#/"
+        settings-url "#/admin"]
+    [:div.main-nav
+     [:a {:href browse-url} [:i.fa.fa-search.active {:title "Browse"}]]
+     [:i.fa.fa-play-circle {:title "Play"}]
+     [:i.fa.fa-list {:title "Playlists"}]
+     [:a {:href settings-url} [:i.fa.fa-gear {:title "Settings"}]]]))

 (defn artist-list-partial [artists]
   (let [artist-heading (utils/format "%s Artists" (count artists))]
@@ -167,6 +169,7 @@
     (render [this]
       (let [mounts ((:mounts data) "mounts")]
         (html [:div.admin
+               (main-nav-partial)
                [:div.pure-g
                 [:div.content.pure-u-1
                  [:ul (map mount-item mounts)]]


Remove magic number related to line-drawing tool

--- src/cljs/goya/components/drawing.cljs
+++ src/cljs/goya/components/drawing.cljs
@@ -260,9 +260,9 @@

 ;; =============================================================================

-(defn visit-pixels-for-line-segment [x0 y0 x1 y1]
+(defn visit-pixels-for-line-segment [x0 y0 x1 y1 doc-width]
   (let [coords (bresenham/bresenham x0 y0 x1 y1)
-        flat-coords (vec (map #(geometry/flatten-point-to-index % 64) coords))]
+        flat-coords (vec (map #(geometry/flatten-point-to-index % doc-width) coords))]
     (reset! visited-pixels (vec (concat @visited-pixels flat-coords)))))

 (defn paint-pixel [coord pixel-size]
@@ -300,7 +300,7 @@
       (set! (.-fillStyle preview-context) paint-color)
       (paint-pixels-for-pencil-tool (conj active-pixels-since-last-event [doc-x doc-y]) pixel-size)
       (visit-pixel doc-index)
-      (visit-pixels-for-line-segment doc-x doc-y last-x last-y)
+      (visit-pixels-for-line-segment doc-x doc-y last-x last-y doc-canvas-width)
       (reset! guistate/transient-state
               (assoc @guistate/transient-state :last-mouse-pos [doc-x doc-y]))))

@@ -421,7 +421,7 @@
                     (when (= paint-tool :line)
                       (let [last-x ((get-in @guistate/transient-state [:mouse-down-pos]) 0)
                             last-y ((get-in @guistate/transient-state [:mouse-down-pos]) 1)]
-                        (visit-pixels-for-line-segment doc-x doc-y last-x last-y)))
+                        (visit-pixels-for-line-segment doc-x doc-y last-x last-y doc-width)))
                     (when (= paint-tool :fill)
                       (visit-pixels-for-fill-tool doc-x doc-y (get-in @app [:main-app :image-data]) doc-width doc-height))
                     (when (= paint-tool :picker)


small fix

small fix

--- src/cljs/salava/page/ui/settings.cljs
+++ src/cljs/salava/page/ui/settings.cljs
@@ -21,7 +21,7 @@
                   (if (and (= "error" (:status data)) (= (:message data) "page/Evidenceerror"))
                     (swap! state assoc :message (keyword (:message data))
                            :page {:id id
-                                  :tag tags
+                                  :tags tags
                                   :password password
                                   :visibility "public"})
                     (navigate-to next-url)


Minor docstring improvements.

Minor docstring improvements.

--- src/clojure/buddy/auth/middleware.clj
+++ src/clojure/buddy/auth/middleware.clj
@@ -7,7 +7,7 @@

 (defn wrap-authentication
   "Ring middleware that enables authentication
-  for your routes."
+  for your ring handler."
   [handler backend]
   (fn [request]
     (let [request (assoc request :auth-backend backend)
@@ -21,7 +21,7 @@

 (defn wrap-authorization
   "Ring middleware that enables authorization
-  workflow you your ring handler."
+  workflow for your ring handler."
   [handler & [backend]]
   (fn [request]
     (let [backend (or backend (:auth-backend request))]


- Simplify all the scripts

- Simplify all the scripts

--- src/clojure/spring/surf/webscript.clj
+++ src/clojure/spring/surf/webscript.clj
@@ -35,3 +35,9 @@
     (.putAll view-model-orig (k2s view-model))
     model))

+(defn create-script
+  "Create a script for the processor(s)"
+  [f]
+  (reify spring.surf.webscript.WebScript
+      (run [this in out model]
+        (f in out model))))


moving to other machine

moving to other machine

--- src/clojure_dmap/phrasal_patterns.clj
+++ src/clojure_dmap/phrasal_patterns.clj
@@ -24,7 +24,7 @@
 ; :slots are the names of slots and their (frame) types
 ; :token-index is the index of the token we're trying to match
 ; so that means that  ome syntactical order is enforced in here
-(defstruct phrasal-pattern :tokens :frame :slots :token-index)
+(defstruct phrasal-pattern :tokens :frame :slots  :token-index )

 (defn dump-patterns []
@@ -88,9 +88,10 @@
 [pattern token]
 	(cond (and (not (complete-pattern? pattern))
 				(= token (nth (:tokens pattern) (:token-index pattern))))
-			(create-phrasal-pattern
+			(do (if (not (empty? (:slots pattern))) (println "advancing with slots:" (:slots pattern)))
+				(create-phrasal-pattern
 						(:tokens pattern) (:frame pattern)
-						(+ 1 (:token-index pattern)) (:slots pattern) )
+						(+ 1 (:token-index pattern)) (:slots pattern) ))
 		:t (do (println "advance pattern returning ***nil***") nil)))

@@ -101,6 +102,7 @@
 	(doseq [sym (keys completed-patterns)]
 			(doseq [rule (phrasal-patterns-map sym)]
 				(let [adv-rule (advance-pattern rule sym)]
+					(println "ADVANCED RULE:" adv-rule)
 					(add-pattern adv-rule) ))))

 (defn propagate-advances-generalize []


Added entry sorting to entries-by-tag.

Added entry sorting to entries-by-tag.

--- src/lambda_blog/templates/entries.clj
+++ src/lambda_blog/templates/entries.clj
@@ -77,6 +77,8 @@

 (defn entries-by-tag [{:keys [entries id] :as env}]
   (filtered-entries env
-                    (filter (fn [{:keys [tags]}]
-                              (contains? (into #{} (map :id tags)) id))
-                            entries)))
+                    (->> entries
+                         (filter (fn [{:keys [tags]}]
+                                   (contains? (into #{} (map :id tags)) id)))
+                         (sort-by :timestamp)
+                         reverse)))


Update dependencies

Update dependencies

--- src/leiningen/new/cljskel/project.clj
+++ src/leiningen/new/cljskel/project.clj
@@ -2,43 +2,43 @@
   :description "{{upper-name}} service"
   :url "http://wikis.in.nokia.com/NokiaMusicArchitecture/{{upper-name}}"

-  :dependencies [[ch.qos.logback/logback-classic "1.0.13"]
-                 [cheshire "5.2.0"]
-                 [clj-http "0.7.7"]
+  :dependencies [[ch.qos.logback/logback-classic "1.1.1"]
+                 [cheshire "5.3.1"]
+                 [clj-http "0.7.9"]
                  [clj-time "0.6.0"]
                  [com.ovi.common.logging/logback-appender "0.0.45"]
-                 [com.ovi.common.metrics/metrics-graphite "2.1.22"]
+                 [com.ovi.common.metrics/metrics-graphite "2.1.23"]
                  [com.yammer.metrics/metrics-logback "2.2.0"]
                  [compojure "1.1.6" :exclusions [javax.servlet/servlet-api]]
                  [environ "0.4.0"]
                  [metrics-clojure "1.0.1"]
                  [metrics-clojure-ring "1.0.1"]
-                 [nokia/instrumented-ring-jetty-adapter "0.1.5"]
+                 [nokia/instrumented-ring-jetty-adapter "0.1.7"]
                  [nokia/ring-utils "1.2.1"]
                  [org.clojure/clojure "1.5.1"]
-                 [org.clojure/data.json "0.2.3"]
+                 [org.clojure/data.json "0.2.4"]
                  [org.clojure/data.xml "0.0.7"]
                  [org.clojure/data.zip "0.1.1"]
                  [org.clojure/tools.logging "0.2.6"]
                  [org.eclipse.jetty/jetty-server "8.1.14.v20131031"]
-                 [org.slf4j/slf4j-api "1.7.5"]
-                 [org.slf4j/jcl-over-slf4j "1.7.5"]
-                 [org.slf4j/jul-to-slf4j "1.7.5"]
-                 [org.slf4j/log4j-over-slf4j "1.7.5"]
-                 [ring-middleware-format "0.3.1"]
+                 [org.slf4j/slf4j-api "1.7.6"]
+                 [org.slf4j/jcl-over-slf4j "1.7.6"]
+                 [org.slf4j/jul-to-slf4j "1.7.6"]
+                 [org.slf4j/log4j-over-slf4j "1.7.6"]
+                 [ring-middleware-format "0.3.2"]
                  [ring/ring-jetty-adapter "1.2.1" :exclusions [org.eclipse.jetty/jetty-server]]]

  :exclusions [commons-logging
               log4j]

-  :profiles {:dev {:dependencies [[com.github.rest-driver/rest-client-driver "1.1.32"
+  :profiles {:dev {:dependencies [[com.github.rest-driver/rest-client-driver "1.1.36"
                                    :exclusions [org.slf4j/slf4j-nop
                                                 javax.servlet/servlet-api
                                                 org.eclipse.jetty.orbit/javax.servlet]]
                                   [clj-http-fake "0.4.1"]
                                   [junit "4.11"]
                                   [midje "1.6.0"]
-                                  [rest-cljer "0.1.7"]]
+                                  [rest-cljer "0.1.11"]]
                    :plugins [[lein-rpm "0.0.5"]
                              [lein-midje "3.1.3"]
                              [jonase/kibit "0.0.8"]]}}


WIP Add different approach to stories-binder

--- src/cljs/hacker_agent/hacker-base.cljs
+++ src/cljs/hacker_agent/hacker-base.cljs
@@ -1,6 +1,7 @@
 (ns hacker-agent.hacker-base
   (:require-macros [cljs.core.async.macros :refer [go go-loop]])
   (:require [clojure.walk :as walk]
+            [clojure.set :as set]
             [cljs.core.async :as async :refer [put! chan <! >! close! merge mult tap]]
             [hacker-agent.utils :as utils :refer [dissoc-in]]))

@@ -182,6 +183,22 @@
     (custom-binder :add-fn add-change-fn
                    :change-fn add-change-fn)))

+(def stories-binder-old
+  (let [add-change-fn (fn [data path [event key val]]
+                        (let [list-path (into path [:list key])
+                              item-path (into path [:items val])
+                              new-data (swap! data assoc-in list-path val)
+                              old-set (into #{} (keys (:items (:top-stories2 new-data))))
+                              new-set (into #{} (vals (:list (:top-stories2 new-data))))
+                              old-stories (set/difference old-set new-set)]
+                          (doseq [id old-stories]
+                            (unbind! data (into path [:items id])))
+                          (bind! data item-path
+                                 (id->fbref val)
+                                 story-binder)))]
+    (custom-binder :add-fn add-change-fn
+                   :change-fn add-change-fn)))
+
 (defn item-binder [& {:keys [levels]}]
   (let [add-change-fn (fn [data path [event key val]]
                         (let [child-path (conj path key)]


inner trace -- handle nested structures better

--- src/com/billpiel/sayid/deep_trace2.clj
+++ src/com/billpiel/sayid/deep_trace2.clj
@@ -12,7 +12,7 @@

 (defn form->xform-map*
   [form]
-  (if (seq? form)
+  (if (coll? form)
     (let [x (macroexpand form)
           xx (clojure.walk/macroexpand-all form)] ;; TODO better way?
       (conj (mapcat form->xform-map* x)
@@ -168,11 +168,11 @@
             {(if (coll? xl)
                (sym-seq->parent xl)
                xl)
-             {:tree nil    ;; placeholder for trace tree
-              :xl xl              ;; expanded location
+             {:tree nil ;; placeholder for trace tree
+              :xl xl    ;; expanded location
               :orig (-> xl
-                       xl->xform
-                       xform->form)  ;; original symbol or value
+                        xl->xform
+                        xform->form) ;; original symbol or value
               :x (-> xl
                      xl->xform)
               :xlxp (xl->xlxp xl) ;; expanded locations expanded parent
@@ -199,21 +199,22 @@
              (apply merge))))

 (defn mk-tree-template
-  [src-map frm-meta fn-meta path parent-path & {:keys [macro?]}]
-
-  (let [sub-src-map (-> path
-                        path->sym
-                        src-map)
+  [src-map frm-meta fn-meta path-chain & {:keys [macro?]}]
+  (let [sub-src-map (util/$- -> path-chain
+                             last
+                             (remove #{:macro} $)
+                             path->sym
+                             src-map)
         form (if macro?
                (:orig sub-src-map)
                (:x sub-src-map))]
-    {:parent-path parent-path
+    {:inner-path-chain path-chain
      :name (if (seq? form)
              (first form)
              form)
      :form form
      :macro? macro?
-     :inner-path path
+     :inner-path (last path-chain)
      :parent-name (symbol (format "%s/%s"
                                   (-> fn-meta :ns str)
                                   (:name fn-meta)))
@@ -229,8 +230,6 @@
       (assoc :children (atom [])
              :inner-path nil)
       atom))
-
-(declare produce-recent-parent-tree-atom!)

 (defn get-recent-tree-at-inner-path
   [path recent-trees & {:keys [skip-closed-check]}]
@@ -263,17 +262,19 @@
          (:inner-path @tree-atom)
          tree-atom))

+(declare produce-recent-tree-atom!)
+
 (defn mk-recent-tree-at-inner-path
-  [inner-path recent-trees]
-  (if (nil? inner-path)
+  [path-chain recent-trees]
+  (if (empty? path-chain)
     (let [new-tree (get-temp-root-tree)]
       (push-to-recent-trees!  new-tree
                               recent-trees)
       new-tree)
-    (let [parent (produce-recent-parent-tree-atom! inner-path
-                                                   recent-trees)
+    (let [parent (produce-recent-tree-atom! (drop-last path-chain)
+                                            recent-trees)
           new-tree (-> (trace/mk-tree :parent @parent)
-                       (assoc :inner-path inner-path
+                       (assoc :inner-path (last path-chain)
                               :parent-path (:path @parent))
                        atom)]
       (push-to-recent-trees! new-tree
@@ -283,30 +284,19 @@
       new-tree)))

 (defn produce-recent-tree-atom!
-  [inner-path recent-trees & {:keys [skip-closed-check]}]
-  (if-let [tree-atom (get-recent-tree-at-inner-path inner-path
-                                                         recent-trees
-                                                         :skip-closed-check skip-closed-check)]
+  [inner-path-chain recent-trees & {:keys [skip-closed-check]}]
+  (if-let [tree-atom (get-recent-tree-at-inner-path (last inner-path-chain)
+                                                    recent-trees
+                                                    :skip-closed-check skip-closed-check)]
     tree-atom
-    (mk-recent-tree-at-inner-path inner-path
-                                  recent-trees)))
-
-(defn produce-recent-parent-tree-atom!
-  [inner-path recent-trees]
-  (let [parent-inner-path (some-> inner-path
-                                  not-empty
-                                  drop-last
-                                  vec)]
-    (if-let [parent (get-recent-tree-at-inner-path parent-inner-path
-                                                   recent-trees)]
-      parent
-      (mk-recent-tree-at-inner-path parent-inner-path recent-trees))))
+    (mk-recent-tree-at-inner-path inner-path-chain recent-trees)))

 (defn tr-fn
-  [inner-path [recent-trees] template f]
+  [recent-trees {:keys [inner-path-chain arg-forms] :as template} f]
   (fn [& args]
-    (let [this (-> @(produce-recent-tree-atom! inner-path
-                                               recent-trees)
+    (let [this (-> (produce-recent-tree-atom! inner-path-chain
+                                              recent-trees)
+                   deref
                    (merge template)
                    (assoc :args (vec args)
                           :arg-map (delay (zipmap (:arg-forms template)
@@ -328,10 +318,10 @@
       value)))

 (defn tr-macro
-  [path [recent-trees] template mcro v]
+  [recent-trees template mcro v]
   (def rt' @recent-trees)

-  (let [tree @(produce-recent-tree-atom! path
+  (let [tree @(produce-recent-tree-atom! (:inner-path-chain template)
                                          recent-trees
                                          :skip-closed-check true)]
     (-> tree
@@ -343,8 +333,9 @@

 (defn tr-let-ret
-  [path [recent-trees] template v]
-  (-> path
+  [recent-trees template v]
+  (-> template
+      :inner-path-chain
       (produce-recent-tree-atom! recent-trees)
       deref
       (merge template)
@@ -355,17 +346,15 @@
   v)

 (defn tr-let-bind
-  [path [recent-trees] v bnd-frm val-frm]
-  (-> path
-      (produce-recent-tree-atom! recent-trees)
+  [{:keys [inner-path-chain]} recent-trees v bnd-frm val-frm]
+  (-> (produce-recent-tree-atom! inner-path-chain recent-trees)
       deref
       (update-in [:let-binds] conj [v bnd-frm val-frm])
       (update-tree! recent-trees)))

 (defn tr-if-ret
-  [path [recent-trees] template v]
-  (-> path
-      (produce-recent-tree-atom! recent-trees)
+  [{:keys [inner-path-chain]} recent-trees template v]
+  (-> (produce-recent-tree-atom! inner-path-chain recent-trees)
       deref
       (merge template)
       (assoc :return v
@@ -374,18 +363,16 @@
   v)

 (defn tr-if-test
-  [path [recent-trees] v]
-  (-> path
-      (produce-recent-parent-tree-atom! recent-trees)
+  [{:keys [inner-path-chain]} recent-trees v]
+  (-> (produce-recent-tree-atom! inner-path-chain recent-trees)
       deref
       (assoc :args [v])
       (update-tree! recent-trees))
   v)

 (defn tr-if-branch
-  [path [recent-trees] test v]
-  (-> path
-      (produce-recent-parent-tree-atom! recent-trees)
+  [{:keys [inner-path-chain]} recent-trees test v]
+  (-> (produce-recent-tree-atom! inner-path-chain recent-trees)
       deref
       (assoc-in [:args 1] v)
       (update-tree! recent-trees))
@@ -394,70 +381,69 @@
 (declare xpand-form)

 (defn xpand-all
-  [form src-map fn-meta path parent-path]
+  [form src-map fn-meta path path-chain]
   (when-not (nil? form)
     (util/back-into form
                     (doall (map-indexed #(xpand-form %2
                                                      src-map
                                                      fn-meta
                                                      (conj path %)
-                                                     parent-path)
+                                                     path-chain)
                                         form)))))

 (defn xpand-fn-form
-  [head form path template]
+  [head form template]
   (cons (list `tr-fn
-              path
               '$$
               `'~template
               (first form))
         (rest form)))

 (defn xpand-macro-form
-  [head form path template]
+  [head form template]
   (list `tr-macro
-        path
         '$$
         `'~template
         (keyword head)
         form))

 (defn xpand-let-binds
-  [path binds]
+  [template binds]
   (vec (mapcat (fn [[b v]]
                  `(~b ~v
-                   ~'_ (tr-let-bind ~path ~'$$ ~b '~b '~v)))
+                      ~'_ (tr-let-bind ~template
+                                       ~'$$
+                                       ~b
+                                       '~b
+                                       '~v)))
                (partition 2 binds))))

 (defn xpand-let-form
-  [[_ binds & frms] path template]
-  (let [template' template]
-    `(tr-let-ret ~path
-                 ~'$$
-                 '~template'
-                 (let ~(xpand-let-binds path
-                                        binds)
-                   ~@frms))))
+  [[_ binds & frms] template]
+  `(tr-let-ret ~'$$
+               '~template
+               (let ~(xpand-let-binds template
+                                      binds)
+                 ~@frms)))

 (defn xpand-if-form
-  [[_ test then else] path template]
+  [[_ test then else] template]
   (let [template' (assoc template
                          :test-form `'~test)]
-    `(tr-if-ret ~path
-                ~'$$
+    `(tr-if-ret ~'$$
                 '~template'
-                (if (tr-if-test ~(conj path 1)
+                (if (tr-if-test ~template'
                                 ~'$$
                                 ~test)
-                  (tr-if-branch ~(conj path 2)
+                  (tr-if-branch ~template'
                                 ~'$$
                                 true
                                 ~then)
                   ~(when-not (nil? else)
-                     `(tr-if-branch ~(conj path 3)
-                                ~'$$
-                                false
-                                ~else))))))
+                     `(tr-if-branch ~template'
+                                    ~'$$
+                                    false
+                                    ~else))))))

 (defn get-form-meta-somehow
   [form]
@@ -465,64 +451,60 @@
       (-> form first meta)))

 (defn xpand-fn
-  [head form src-map fn-meta path parent-path]
-  (xpand-fn-form head
-                 (xpand-all form
-                            src-map
-                            fn-meta
-                            path
-                            path)
-                 path
-                 (mk-tree-template src-map
-                                   (get-form-meta-somehow form)
-                                   fn-meta
-                                   path
-                                   parent-path)))
+  [head form src-map fn-meta path path-chain]
+  (let [path-chain' (conj path-chain path)]
+    (xpand-fn-form head
+                   (xpand-all form
+                              src-map
+                              fn-meta
+                              path
+                              path-chain')
+                   (mk-tree-template src-map
+                                     (get-form-meta-somehow form)
+                                     fn-meta
+                                     path-chain'))))

 (defn xpand-macro
-  [head form src-map fn-meta path parent-path]
+  [head form src-map fn-meta path path-chain]
   (let [xform (with-meta (macroexpand form) (meta form))] ;; TODO be sure this is doing something
-    (xpand-macro-form head
-                      (xpand-form xform
-                                  src-map
-                                  fn-meta
-                                  path
-                                  path)
-                      path
-                      (mk-tree-template src-map
-                                        (get-form-meta-somehow form)
-                                        fn-meta
-                                        path
-                                        parent-path
-                                        :macro? true))))
+    (let [path' (conj path :macro)
+          path-chain' (conj path-chain path)]
+      (xpand-macro-form head
+                        (xpand-form xform
+                                    src-map
+                                    fn-meta
+                                    path'
+                                    path-chain')
+                        (mk-tree-template src-map
+                                          (get-form-meta-somehow form)
+                                          fn-meta
+                                          path-chain'
+                                          :macro? true)))))

 (defn xpand-if
-  [form src-map fn-meta path parent-path]
+  [form src-map fn-meta path path-chain]
   (xpand-if-form (xpand-all form
                             src-map
                             fn-meta
                             path
-                            path)
-                 path
+                            path-chain)
                  (mk-tree-template src-map
                                    (get-form-meta-somehow form)
                                    fn-meta
-                                   path
-                                   parent-path)))
+                                   path-chain)))

 (defn xpand-let
-  [form src-map fn-meta path parent-path]
-  (xpand-let-form (xpand-all form
-                             src-map
-                             fn-meta
-                             path
-                             path)
-                  path
-                  (mk-tree-template src-map
-                                    (get-form-meta-somehow form)
-                                    fn-meta
-                                    path
-                                    parent-path)))
+  [form src-map fn-meta path path-chain]
+  (let [path-chain' (conj path-chain path)]
+    (xpand-let-form (xpand-all form
+                               src-map
+                               fn-meta
+                               path
+                               path-chain')
+                    (mk-tree-template src-map
+                                      (get-form-meta-somehow form)
+                                      fn-meta
+                                      path-chain'))))

 (defn dot-sym?
   [sym]
@@ -531,26 +513,27 @@
        (.startsWith ".")))

 (defn xpand-form
-  [form src-map fn-meta & [path parent-path]]
-  (let [path' (or path [])]
+  [form src-map fn-meta & [path path-chain]]
+  (let [path' (or path [])
+        path-chain' (or path-chain [])
+        args [form src-map fn-meta path' path-chain']]
     (cond
       (seq? form)
       (let [head (first form)]
         (cond
-          (= 'let head) (xpand-let form src-map fn-meta path' parent-path)
-
-          (util/macro? head)
-          (xpand-macro head form src-map fn-meta path' parent-path)
-
-          (= 'if head) (xpand-if form src-map fn-meta path' parent-path)
+          (= 'let head) (apply xpand-let args)
+
+          (util/macro? head) (apply xpand-macro head args)
+
+          (= 'if head) (apply xpand-if args)

           (or (special-symbol? head)
               (dot-sym? head)) ;; TODO better way to detect these?
-          (xpand-all form src-map fn-meta path' parent-path)
-
-          :else (xpand-fn head form src-map fn-meta path' parent-path)))
-
-      (coll? form) (xpand-all form src-map fn-meta path' parent-path)
+          (apply xpand-all args)
+
+          :else (apply xpand-fn head args)))
+
+      (coll? form) (apply xpand-all args)
       :else form)))

 ;;TODO try-catch
@@ -558,7 +541,7 @@
   [form parent-fn-meta]
   (let [expr-map (mk-expr-mapping form)
         xform (xpand-form form expr-map parent-fn-meta)]
-    `(let [~'$$ [(atom {})]
+    `(let [~'$$ (atom {})
            ~'$return ~xform]
        (record-trace-tree! ~'$$)
        ~'$return)))
@@ -587,7 +570,7 @@
     tree-atom))

 (defn record-trace-tree!
-  [[tree-atom src-map]]
+  [tree-atom]
   (let [children (some-> (@tree-atom nil)
                          deref-children
                          :children
@@ -644,8 +627,22 @@
       trace/untrace-var*))

-(defn f1 [a] (let [b 4
-                   c (inc b)]
-               (if (= a b)
-                 (-> c inc str keyword)
-                 (->> [a b c] (map inc) (map even?)))))
+#_ (defn f1 [a] (inc 2) (empty? [0 [1 2 (-> a inc dec)]])) ;; TODO
+
+
+(defn f1 [a] (empty? [0 [1 2 (-> a inc dec)]]))
+
+#_ (deep-tracer {:qual-sym 'com.billpiel.sayid.deep-trace2/f1
+                 :meta' nil
+                 :ns' 'com.billpiel.sayid.deep-trace2})
+
+#_ (binding [trace/*trace-log-parent* {:id :root1 :children (atom [])}]
+  (let [f (deep-tracer {:qual-sym 'com.billpiel.sayid.deep-trace2/f1
+                        :meta' nil
+                        :ns' 'com.billpiel.sayid.deep-trace2})]
+    (f 2)
+    (-/p trace/*trace-log-parent*)))
+
+#_ (deep-tracer {:qual-sym 'xpojure.routes.home/home-page
+              :meta' nil
+              :ns' 'xpojure.routes.home})


added macro

added macro


Update comment about which version of clojure we install

--- src/docker_clojure/dockerfile/lein.clj
+++ src/docker_clojure/dockerfile/lein.clj
@@ -48,7 +48,7 @@
            "ENV PATH=$PATH:$LEIN_INSTALL"
            "ENV LEIN_ROOT 1"
            ""
-           "# Install clojure 1.10.1 so users don't have to download it every time"
+           "# Install clojure 1.10.3 so users don't have to download it every time"
            "RUN echo '(defproject dummy \"\" :dependencies [[org.clojure/clojure \"1.10.3\"]])' > project.clj \\"
            "  && lein deps && rm project.clj"])


CMR-3663 Adds test case for lowercase ACL target

--- access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/acl_search_test.clj
@@ -424,7 +424,10 @@
       ["ANY_ACL"] [fixtures/*fixture-system-acl*]

       "Provider target"
-      ["CATALOG_ITEM_ACL"] [fixtures/*fixture-provider-acl*])))
+      ["CATALOG_ITEM_ACL"] [fixtures/*fixture-provider-acl*]
+
+      "Provider target, case insensitive"
+      ["catalog_item_acl"] [fixtures/*fixture-provider-acl*])))

 (deftest acl-search-by-permitted-user-test
   (let [token (e/login (u/conn-context) "user1")


refine transactions tests

refine transactions tests

--- test/clj_money/models/transactions_test.clj
+++ test/clj_money/models/transactions_test.clj
@@ -273,15 +273,21 @@
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"
                :user-id "john@doe.com"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
                :type :asset
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Salary"
                :type :income
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Groceries"
                :type :expense
-               :entity-id "Personal"}]
+               :entity-id "Personal"
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -335,18 +341,25 @@
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"
                :user-id "john@doe.com"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
                :type :asset
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Salary"
                :type :income
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Bonus"
                :type :income
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Groceries"
                :type :expense
-               :entity-id "Personal"}]
+               :entity-id "Personal"
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -391,15 +404,21 @@
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"
                :user-id "john@doe.com"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
                :type :asset
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Salary"
                :type :income
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Groceries"
                :type :expense
-               :entity-id "Personal"}]
+               :entity-id "Personal"
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -466,15 +485,21 @@
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"
                :user-id "john@doe.com"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
                :type :asset
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Salary"
                :type :income
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Groceries"
                :type :expense
-               :entity-id "Personal"}]
+               :entity-id "Personal"
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -616,15 +641,21 @@
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"
                :user-id "john@doe.com"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
                :type :asset
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Salary"
                :type :income
-               :entity-id "Personal"}
+               :entity-id "Personal"
+               :commodity-id "USD"}
               {:name "Groceries"
                :type :expense
-               :entity-id "Personal"}]
+               :entity-id "Personal"
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -719,14 +750,21 @@
 (def change-account-context
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
-               :type :asset}
+               :type :asset
+               :commodity-id "USD"}
               {:name "Salary"
-               :type :income}
+               :type :income
+               :commodity-id "USD"}
               {:name "Rent"
-               :type :expense}
+               :type :expense
+               :commodity-id "USD"}
               {:name "Groceries"
-               :type :expense}]
+               :type :expense
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -801,12 +839,18 @@
 (def change-action-context
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
-               :type :asset}
+               :type :asset
+               :commodity-id "USD"}
               {:name "Salary"
-               :type :income}
+               :type :income
+               :commodity-id "USD"}
               {:name "Groceries"
-               :type :expense}]
+               :type :expense
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -878,14 +922,21 @@
 (def add-remove-item-context
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
-               :type :asset}
+               :type :asset
+               :commodity-id "USD"}
               {:name "Salary"
-               :type :income}
+               :type :income
+               :commodity-id "USD"}
               {:name "Pets"
-               :type :expense}
+               :type :expense
+               :commodity-id "USD"}
               {:name "Groceries"
-               :type :expense}]
+               :type :expense
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 3 2)
                    :entity-id "Personal"
                    :description "Paycheck"
@@ -1003,12 +1054,18 @@
 (def balance-delta-context
   {:users [(factory :user, {:email "john@doe.com"})]
    :entities [{:name "Personal"}]
+   :commodities [{:name "US Dollar"
+                  :symbol "USD"
+                  :type :currency}]
    :accounts [{:name "Checking"
-               :type :asset }
+               :type :asset
+               :commodity-id "USD"}
               {:name "Salary"
-               :type :income}
+               :type :income
+               :commodity-id "USD"}
               {:name "Groceries"
-               :type :expense}]
+               :type :expense
+               :commodity-id "USD"}]
    :transactions [{:transaction-date (t/local-date 2016 1 1)
                    :description "Paycheck"
                    :items [{:action :debit


Fixed another.

Fixed another.

--- test/onyx/log/prepare_join_cluster_test.clj
+++ test/onyx/log/prepare_join_cluster_test.clj
@@ -5,24 +5,24 @@

 (def entry (create-log-entry :prepare-join-cluster {:joiner :d}))

-(def f (extensions/apply-log-entry (:fn entry) (:args entry)))
+(def f (partial extensions/apply-log-entry (assoc entry :message-id 0)))

-(def rep-diff (partial extensions/replica-diff :prepare-join-cluster))
+(def rep-diff (partial extensions/replica-diff entry))

-(def rep-reactions (partial extensions/reactions :prepare-join-cluster))
+(def rep-reactions (partial extensions/reactions entry))

 (def old-replica {:pairs {:a :b :b :c :c :a} :peers [:a :b :c]})

-(let [new-replica (f old-replica 0)
-      diff (rep-diff old-replica new-replica (:args entry))
+(let [new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)
       reactions (rep-reactions old-replica new-replica diff {:id :d})]
   (fact (:prepared new-replica) => {:d :a})
   (fact diff => {:observer :d :subject :a})
   (fact reactions => [{:fn :notify-watchers :args {:observer :c :subject :d}}]))

 (let [old-replica (assoc-in old-replica [:prepared :e] :a)
-      new-replica (f old-replica 0)
-      diff (rep-diff old-replica new-replica (:args entry))
+      new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)
       reactions (rep-reactions old-replica new-replica diff {:id :d})]
   (fact (:prepared new-replica) => {:e :a :d :b})
   (fact diff => {:observer :d :subject :b})
@@ -31,8 +31,8 @@
 (let [old-replica (-> old-replica
                       (assoc-in [:prepared :e] :a)
                       (assoc-in [:prepared :f] :b))
-      new-replica (f old-replica 0)
-      diff (rep-diff old-replica new-replica (:args entry))
+      new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)
       reactions (rep-reactions old-replica new-replica diff {:id :d})]
   (fact (:prepared new-replica) => {:e :a :f :b :d :c})
   (fact diff => {:observer :d :subject :c})
@@ -42,8 +42,8 @@
                       (assoc-in [:prepared :e] :a)
                       (assoc-in [:prepared :f] :b)
                       (assoc-in [:prepared :g] :c))
-      new-replica (f old-replica 0)
-      diff (rep-diff old-replica new-replica (:args entry))
+      new-replica (f old-replica)
+      diff (rep-diff old-replica new-replica)
       reactions (rep-reactions old-replica new-replica diff {:id :d})]
   (fact (:prepared new-replica) => {:e :a :f :b :g :c})
   (fact diff => nil)


Remove an unused function

Remove an unused function

--- src/cljam/cigar.clj
+++ src/cljam/cigar.clj
@@ -1,5 +1,4 @@
-(ns cljam.cigar
-  (:require [clojure.string :as str]))
+(ns cljam.cigar)

 (defn parse
   "Parses CIGAR text, returns seq of lengths and operations."
@@ -22,22 +21,3 @@

 (def count-ref
   (memoize count-ref*))
-
-(defn substantial-seq [cigar seq]
-  (str/join
-   (loop [matches (parse cigar)
-          cursor  0
-          ret     []]
-     (if-let [[n op]  (first matches)]
-       (let [[cursor* ret*] (condp #(not (nil? (%1 %2))) op
-                              #{\M \= \X} [(+ cursor n)
-                                           (conj ret (subs seq cursor (+ cursor n)))]
-                              #{\D}       [cursor
-                                           (conj ret (str/join (repeat n "*")))]
-                              #{\N}       [cursor
-                                           (conj ret (str/join (repeat n ">")))]
-                              #{\S \I}    [(+ cursor n)
-                                           ret]
-                              [cursor ret])]
-         (recur (rest matches) cursor* ret*))
-       ret))))


add cljs.analyzer.api/empty-state & cljs.analyzer.api/with-state,
better captures how cljs.env is used semantically.

add cljs.analyzer.api/get-options accessor

--- src/main/clojure/cljs/analyzer/api.clj
+++ src/main/clojure/cljs/analyzer/api.clj
@@ -15,6 +15,17 @@
 ;; =============================================================================
 ;; Useful Utilities

+(defn empty-state
+  "Creates an empty compilation state Atom<Map>."
+  []
+  (env/default-compiler-env))
+
+(defmacro with-state
+  "Run the body with the given compilation state Atom<Map>."
+  [state body]
+  `(env/with-compiler-env ~state
+     ~@body))
+
 (defn empty-env
   "Creates an empty analysis environment."
   []
@@ -26,6 +37,11 @@
   (let [no-warnings (zipmap (keys ana/*cljs-warnings*) (repeat false))]
     `(binding [ana/*cljs-warnings* ~no-warnings]
        ~@body)))
+
+(defn get-options
+  "Return the compiler options from compiler state."
+  []
+  (get @env/*compiler* :options))

 (defn analyze
   "Given an environment, a map containing {:locals (mapping of names to bindings), :context


tests pass

tests pass


Make full use of make-error

Make full use of make-error

--- src/degasolv/resolver_core.clj
+++ src/degasolv/resolver_core.clj
@@ -517,40 +517,18 @@
                                       #(:problems
                                          (get % 1))
                                       candidate-results))}]))
-                            (let [{problem :problem} query-response]
+                            (let [{problem :problem} query-response
+                                  pkg-error (fn [reason]
+                                              (mkerror reason
+                                                       :alternative alternative
+                                                       :package-id id))]
                               (cond
                                 (= problem :empty-query-results)
-                                [:unsuccessful
-                                 {:problems
-                                  [
-                                   {:term clause
-                                    :alternative alternative
-                                    :found-packages found-packages
-                                    :present-packages present-packages
-                                    :absent-specs absent-specs
-                                    :reason :package-not-found
-                                    :package-id id}]}]
+                                (pkg-error :package-not-found)
                                 (= problem :unsatisfactory-query-results)
-                                [:unsuccessful
-                                 {:problems
-                                  [{:term clause
-                                    :alternative alternative
-                                    :found-packages found-packages
-                                    :present-packages present-packages
-                                    :absent-specs absent-specs
-                                    :reason :package-rejected
-                                    :package-id id}]}]
+                                (pkg-error :package-rejected)
                                 :else
-                                [:unsuccessful
-                                 {:problems
-                                  [{:term clause
-                                    :alternative alternative
-                                    :found-packages found-packages
-                                    :present-packages present-packages
-                                    :absent-specs absent-specs
-                                    :reason :seek-package-logic-error
-                                    :package-id id}]}]))
-                            )))))
+                                (pkg-error :seek-package-logic-error))))))))
 conj
 successful?
 ;; Hoisting


Remove weekly period for now (it'll be different data).

--- src/open_company/resources/report.clj
+++ src/open_company/resources/report.clj
@@ -13,8 +13,7 @@

 (def periods (into #{} (concat
                 (get-periods "Q" 4)
-                (get-periods "M" 12)
-                (get-periods "W" 52))))
+                (get-periods "M" 12))))

 (defn- key-for
   ([report] (key-for (:symbol report) (:year report) (:period report)))


(PE-2408) Change `seq?` to `sequential?`

--- src/puppetlabs/trapperkeeper/core.clj
+++ src/puppetlabs/trapperkeeper/core.clj
@@ -184,7 +184,7 @@
   `puppetlabs.trapperkeeper.core/-main` if you use `puppetlabs.trapperkeeper.core`
   as the `:main` namespace in your leinengen project."
   [& args]
-  {:pre [((some-fn seq? nil?) args)
+  {:pre [((some-fn sequential? nil?) args)
          (every? string? args)]}
   (try+
     (-> args


parse out the URLs in the playlist;

parse out the URLs in the playlist;


add autoincrement primary key

add autoincrement primary key

--- src/mvMusic/library/schema.clj
+++ src/mvMusic/library/schema.clj
@@ -25,7 +25,8 @@

 (def songs
   (jdb/create-table-ddl :songs
-                        [:file :nvarchar "PRIMARY KEY"]
+                        [:id_no :identity]
+                        [:file :nvarchar "UNIQUE"]
                         [:track :integer]
                         [:track_total :integer]
                         [:disc_no :integer]


Remove out of date comment.

Remove out of date comment.

--- src/open_company/resources/company.clj
+++ src/open_company/resources/company.clj
@@ -114,9 +114,7 @@

   Ensures the slug is valid, or returns `:invalid-slug`.

-  If everything is OK with the proposed new company, `true` is returned.
-
-  TODO: Use prismatic schema to validate company properties."
+  If everything is OK with the proposed new company, `true` is returned."
   ([_ :guard #(not (map? %))] :invalid-map)
   ([_ :guard #(and (:slug %) (not (slug/valid-slug? (:slug %))))] :invalid-slug)
   ([_ :guard #(or (not (string? (:name %))) (string/blank? (:name %)))] :invalid-name)


Remove unused let.

Remove unused let.

--- src/open_company/resources/section.clj
+++ src/open_company/resources/section.clj
@@ -87,7 +87,6 @@
          (map? user)]}
   (let [original-company (company/get-company conn company-slug) ; company before the update
         original-revision (get-section conn company-slug section-name original-timestamp) ; revision before the update
-        original-authorship (:author original-revision)
         merged-revision (merge (keywordize-keys original-revision) (keywordize-keys revision)) ; old revision updated with the new
         updated-at (common/current-timestamp)
         completed-revision (-> merged-revision


Fix default update preference

Fix default update preference

--- desktop/src/nightweb_desktop/utils.clj
+++ desktop/src/nightweb_desktop/utils.clj
@@ -24,7 +24,8 @@
 (def remote? (atom (read-pref :remote)))

 (when (nil? @update?)
-  (write-pref :update true))
+  (write-pref :update true)
+  (reset! update? true))

 ; language


CMR-3490: Get metadata-db JVM statistics job working

--- metadata-db-app/src/cmr/metadata_db/system.clj
+++ metadata-db-app/src/cmr/metadata_db/system.clj
@@ -27,7 +27,7 @@

 (def ^:private component-order
   "Defines the order to start the components."
-  [:log :caches :db :queue-broker :scheduler :web :nrepl])
+  [:log :caches :db :queue-broker :scheduler :unclustered-scheduler :web :nrepl])

 (def system-holder
   "Required for jobs"
@@ -47,9 +47,9 @@
               :parallel-chunk-size (config/parallel-chunk-size)
               :caches {acl/token-imp-cache-key (acl/create-token-imp-cache)
                        common-health/health-cache-key (common-health/create-health-cache)}
-              :scheduler (jobs/create-clustered-scheduler
-                          `system-holder :db
-                          (conj mdb-jobs/jobs (jvm-info/log-jvm-statistics-job)))
+              :scheduler (jobs/create-clustered-scheduler `system-holder :db mdb-jobs/jobs)
+              :unclustered-scheduler (jobs/create-scheduler
+                                      `system-holder [(jvm-info/log-jvm-statistics-job)])
               :queue-broker (queue-broker/create-queue-broker (config/queue-config))
               :relative-root-url (transmit-config/metadata-db-relative-root-url)}]
      (transmit-config/system-with-connections sys [:echo-rest]))))


chet the PO requested these changes
for these 6 fields to be in the views

ARgh!  the payload is needed because the "copyFromMethodRepo" needs the payload
we need the URL to access the payload

--- src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_importer.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/page/workspace/method_config_importer.cljs
@@ -40,21 +40,12 @@
   (map
     (fn [i]
       {:name (str "Configuration " (inc i))
-       :namespace (rand-nth ["Broad" "nci" "public"])
-       :rootEntityType "Task"
-       :workspaceName {:namespace (str "ws-ns-" (inc i))
-                       :name (str "ws-n-" (inc i))}
-       :methodStoreMethod {:methodNamespace (str "ms-ns-" (inc i))
-                           :methodName (str "ms-n-" (inc i))
-                           :methodVersion (str "ms-v-" (inc i))}
-       :methodStoreConfig {:methodConfigNamespace (str "msc-ns-" (inc i))
-                           :methodConfigName (str "msc-n-" (inc i))
-                           :methodConfigVersion (str "msc-v-" (inc i))}
-       :inputs {"Input 1" "[some value]"
-                "Input 2" "[some value]"}
-       :outputs {"Output 1" "[some value]"
-                 "Output 2" "[some value]"}
-       :prerequisites ["Predicate 1" "Predicate 2"]})
+       :url (str "http://agora-ci.broadinstitute.org/configurations/joel_test/jt_test_config/1")
+       :namespace (rand-nth ["Broad" "nci" "public" "ISB"])
+       :snapshotId (rand-nth (range 100))
+       :synopsis (str (rand-nth ["variant caller synopsis","gene analyzer synopsis","mutect synopsis"]) " " (inc i))
+       :createDate (str "20"(inc i) "-06-10T16:54:26Z")
+       :owner (rand-nth ["thibault@broadinstitute.org" "esalinas@broadinstitute.org"  ])})
     (range (rand-int 50))))

@@ -148,29 +139,18 @@
                            :style {:color (:button-blue style/colors) :textDecoration "none"}}
                           (conf "name")])}
                       {:header "Namespace" :starting-width 200}
-                      {:header "Type" :starting-width 100}
-                      {:header "Workspace Name" :starting-width 160}
-                      {:header "Method" :starting-width 210}
-                      {:header "Config" :starting-width 290}
-                      {:header "Inputs" :starting-width 200}
-                      {:header "Outputs" :starting-width 200}
-                      {:header "Prerequisites" :starting-width 200}]
+                      {:header "Snapshot Id" :starting-width 100}
+                      {:header "Synopsis" :starting-width 160}
+                      {:header "Create Date" :starting-width 210}
+                      {:header "Owner" :starting-width 290}]
             :data (map
                     (fn [config]
                       [config
                        (config "namespace")
-                       (config "rootEntityType")
-                       (clojure.string/join ":"
-                         (map #(get-in config ["workspaceName" %]) ["namespace" "name"]))
-                       (clojure.string/join ":"
-                         (map #(get-in config ["methodStoreMethod" %])
-                           ["methodNamespace" "methodName" "methodVersion"]))
-                       (clojure.string/join ":"
-                         (map #(get-in config ["methodStoreConfig" %])
-                           ["methodConfigNamespace" "methodConfigName" "methodConfigVersion"]))
-                       (utils/map-to-string (config "inputs"))
-                       (utils/map-to-string (config "outputs"))
-                       (clojure.string/join "," (config "prerequisites"))])
+                       (config "snapshotId")
+                       (config "synopsis")
+                       (config "createDate")
+                       (config "owner")])
                     (:method-confs @state))}])
         (:error-message @state) [:div {:style {:color "red"}}
                                  "FireCloud service returned error: " (:error-message @state)]


vcenter setup testing

vcenter setup testing

--- test/celestial/integration/puppet.clj
+++ test/celestial/integration/puppet.clj
@@ -11,7 +11,7 @@
     [celestial.workflows :only (reload puppetize destroy)]
     [celestial.config :only (path)]
     [celestial.redis :only (clear-all)]
-    [celestial.fixtures :only (with-conf redis-prox-spec redis-ec2-spec redis-type host puppet-ami)]))
+    [celestial.fixtures :only (with-conf redis-prox-spec redis-ec2-spec redis-vc-spec redis-type host puppet-ami)]))

 (defn run-cycle [spec type]
   (clear-all)
@@ -23,11 +23,13 @@
       (finally
         (destroy (assoc (p/get-system id) :system-id id))))))

-
-
 (fact "provisioning a proxmox instance" :integration :puppet :proxmox
       (with-conf
         (run-cycle redis-prox-spec redis-type)))
+
+(fact "provisioning a vcenter instance" :integration :puppet :vcenter
+      (with-conf
+        (run-cycle redis-vc-spec redis-type)))

 (fact "provisioning an ec2 instance" :integration :puppet :ec2
       "assumes a working ec2 defs in ~/.celestial.edn"


Use the reader to skip past the ns

Use the reader to skip past the ns

This should be more robust

--- src/refactor_nrepl/ns/dependencies.clj
+++ src/refactor_nrepl/ns/dependencies.clj
@@ -215,18 +215,13 @@

 (defn- file-content-sans-ns [file-content]
   (let [rdr (PushbackReader. (StringReader. file-content))
-        ns (edn/read rdr)
-        first-form (edn/read rdr)
-        first-str-beyond-ns (pr-str (first first-form))
-        content-split (->> first-str-beyond-ns
-                           Pattern/quote
-                           re-pattern
-                           (str/split file-content))]
-    (if (> (count content-split) 1)
-      (second content-split)
-      ;; If the split fails the macro will be found in the ns and it
-      ;; won't get pruned
-      file-content)))
+        ns (read rdr false :eof)
+        contents (atom [])]
+    (loop [form (read rdr false :eof)]
+      (when-not (= form :eof)
+        (swap! contents conj form)
+        (recur (read rdr false :eof))))
+    (str/join "\n" @contents)))

 (defn- macro-in-use? [file-content macro]
   (let [m (Pattern/quote (str macro))


Active-list-idx contd

Active-list-idx contd

--- src/app/db.cljs
+++ src/app/db.cljs
@@ -3,4 +3,5 @@

 (def default-value
-  {:dataview-visible? true})
+  {:dataview-visible? true
+   :active-list-idx 0})


New test for the function make-temporary-directory

--- test/clj_fileutils/fileutils_test.clj
+++ test/clj_fileutils/fileutils_test.clj
@@ -7,7 +7,7 @@
 ;  http://www.eclipse.org/legal/epl-v10.html
 ;
 ;  Contributors:
-;      Pavel Tisnovsky
+;      Pavel Tisnovsky
 ;

 (ns clj-fileutils.fileutils-test
@@ -116,3 +116,13 @@
         (is (thrown? NullPointerException (new-file "abc" nil)))
         (is (thrown? NullPointerException (new-file nil nil)))))

+(deftest test-make-temporary-directory-1
+    "Check the function clj-fileutils.fileutils/make-temporary-directory."
+    (testing "Check the function clj-fileutils.fileutils/make-temporary-directory."
+        (let [tempdir (make-temporary-directory)]
+            (println "Temporary directory" tempdir)
+            (is (not (nil? tempdir)))
+            (is (.startsWith (.getPath tempdir) "/tmp"))
+            (if tempdir
+                (remove-temporary-directory (.getPath tempdir))))))
+


Test for the function make-temporary-log-file-name

--- test/clj_fileutils/fileutils_test.clj
+++ test/clj_fileutils/fileutils_test.clj
@@ -136,3 +136,13 @@
             (if tempdir
                 (remove-temporary-directory (.getPath tempdir))))))

+(deftest test-make-temporary-log-file-name
+    "Check the function clj-fileutils.fileutils/make-temporary-log-file-name."
+    (testing "Check the function clj-fileutils.fileutils/make-temporary-log-file-name."
+        (let [templog (make-temporary-log-file-name)]
+            (println "Temporary log file" templog)
+            (is (not (nil? templog)))
+            (is (.startsWith templog "/tmp"))
+            (if templog
+                (-> (new java.io.File templog) .delete)))))
+