CMR-343: corrected test conditions

CMR-343: corrected test conditions

--- test/cmr/system_int_test/search/granule_search_test.clj
+++ test/cmr/system_int_test/search/granule_search_test.clj
@@ -7,6 +7,7 @@
             [cmr.system-int-test.data2.collection :as dc]
             [cmr.system-int-test.data2.granule :as dg]
             [cmr.common.services.messages :as msg]
+            [cmr.search.validators.messages :as vmsg]
             [cmr.system-int-test.data2.core :as d]))

 (use-fixtures :each (ingest/reset-fixture "CMR_PROV1" "CMR_PROV2" "CMR_T_PROV"))
@@ -210,39 +211,42 @@
       (are [cc-search items] (d/refs-match? items (search/find-refs :granule cc-search))
            {"cloud_cover" "-70.0,120.0"} [gran1 gran2 gran3 gran4 gran5]))
     (testing "search by cloud-cover with min value greater than max value"
-      (let [num-range "30,0"
-            {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
-            err (first errors)]
-        (is (= 422 status))
-        (msg/invalid-numeric-range-msg num-range)))
+      (let [min-value 30.0
+            max-value 0.0
+            num-range (format "%s,%s" min-value max-value)
+            {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
+            error (first errors)]
+        (is (= 422 status))
+        (is (= error (vmsg/min-value-greater-than-max  min-value max-value)))))
     (testing "search by cloud-cover with non numeric str"
       (let [num-range "c9c,"
             {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
-            err (first errors)]
-        (is (= 422 status))
-        (msg/invalid-numeric-range-msg num-range)))
+            error (first errors)]
+        (is (= 422 status))
+        (is (= error (msg/invalid-numeric-range-msg num-range)))))
     (testing "search by cloud-cover with non numeric str"
       (let [num-range ",99c"
             {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
-            err (first errors)]
-        (is (= 422 status))
-        (msg/invalid-numeric-range-msg num-range)))
+            error (first errors)]
+        (is (= 422 status))
+        (is (= error (msg/invalid-numeric-range-msg num-range)))))
     (testing "search by cloud-cover with non numeric str"
       (let [num-range ","
             {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
-            err (first errors)]
-        (is (= 422 status))
-        (msg/invalid-numeric-range-msg num-range)))
+            error (first errors)]
+        (is (= 422 status))
+        (is (= error (msg/invalid-numeric-range-msg num-range)))))
     (testing "search by cloud-cover with non numeric str"
       (let [num-range ""
             {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
-            err (first errors)]
-        (is (= 422 status))
-        (msg/invalid-numeric-range-msg num-range)))
+            error (first errors)]
+        (is (= 422 status))
+        (is (= error (msg/invalid-numeric-range-msg num-range)))))
     (testing "search by cloud-cover with invalid range"
       (let [num-range "30,c9c"
             {:keys [status errors]} (search/find-refs :granule {"cloud_cover" num-range})
-            err (first errors)]
-        (is (= 422 status))
-        (msg/invalid-numeric-range-msg num-range)))))
-
+            error (first errors)]
+        (is (= 422 status))
+        (is (= error (msg/invalid-numeric-range-msg num-range)))))))
+
+


CMR-336: added a test to exclude granules by echo_granule_id and concept_id

--- test/cmr/system_int_test/search/granule_search_test.clj
+++ test/cmr/system_int_test/search/granule_search_test.clj
@@ -242,5 +242,39 @@
                 :errors [(msg/invalid-numeric-range-msg num-range)]}
                (search/find-refs :granule {"cloud_cover" num-range})))))))

-
-
+;; exclude granules by echo_granule_id or concept_id params
+(deftest exclude-granules-by-echo-granule-n-concept-ids
+  (let [coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
+        coll2 (d/ingest "CMR_PROV2" (dc/collection {}))
+        gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:cloud-cover 0.8}))
+        gran2 (d/ingest "CMR_PROV1" (dg/granule coll1 {:cloud-cover 30.0}))
+        gran3 (d/ingest "CMR_PROV1" (dg/granule coll1 {:cloud-cover 120}))
+        gran4 (d/ingest "CMR_PROV2" (dg/granule coll2 {:cloud-cover -60.0}))
+        gran1-cid (get-in gran1 [:concept-id])
+        gran2-cid (get-in gran2 [:concept-id])
+        gran3-cid (get-in gran3 [:concept-id])
+        gran4-cid (get-in gran4 [:concept-id])
+        dummy-cid "D1000000004-PROV2"]
+    (index/flush-elastic-index)
+    (testing "fetch all granules with cloud-cover attrib"
+      (are [cc-search items] (d/refs-match? items (search/find-refs :granule cc-search))
+           {"cloud_cover" "-70,120"} [gran1 gran2 gran3 gran4]))
+    (testing "fetch all granules with cloud-cover attrib to exclude a single granule from the set"
+      (are [cc-search items] (d/refs-match? items (search/find-refs :granule cc-search))
+           {:exclude {:echo_granule_id [gran1-cid]}, :cloud_cover "-70,120"} [gran2 gran3 gran4]))
+    (testing "fetch all granules with cloud-cover attrib to exclude multiple granules from the set"
+      (are [cc-search items] (d/refs-match? items (search/find-refs :granule cc-search))
+           {:exclude {:echo_granule_id [gran1-cid gran2-cid]}, :cloud_cover "-70,120"} [gran3 gran4]))
+    (testing "fetch granules by echo granule ids to exclude multiple granules from the set"
+      (are [srch-params items] (d/refs-match? items (search/find-refs :granule srch-params))
+           {:exclude {:echo_granule_id [gran1-cid gran2-cid]}, :echo_granule_id [gran1-cid gran2-cid gran3-cid]} [gran3]))
+    (testing "fetch granules by echo granule ids to exclude multiple granules from the set by concept_id"
+      (are [srch-params items] (d/refs-match? items (search/find-refs :granule srch-params))
+           {:exclude {:concept_id [gran1-cid gran2-cid]}, :echo_granule_id [gran1-cid gran2-cid gran3-cid]} [gran3]))
+    (testing "fetch granules by echo granule ids to exclude a granule by invalid exclude param - dataset_id"
+      (let [srch-params {:exclude {:dataset-id [gran2-cid]}, :echo_granule_id [gran1-cid gran2-cid gran3-cid]}]
+        (is (= {:status 422
+                :errors [(msg/invalid-exclude-param-msg :dataset-id #{:echo-granule-id :concept-id})]}
+               (search/find-refs :granule srch-params)))))))
+
+


fix bug with malformed POST refactoring

fix bug with malformed POST refactoring

--- src/open_company/api/companies.clj
+++ src/open_company/api/companies.clj
@@ -113,15 +113,15 @@
   (let [[invalid-json? parsed] (common/malformed-json? ctx)
         with-reason (fn [r] (assoc parsed :malformed-reason r))]
     (cond invalid-json?
-          [true (with-reason  :malformed-json)]
+          [true (with-reason :malformed-json)]
           ;; Ensure all required keys are present and valid
           ;; s/check returns nil if data complies
-          (not (->> (keys common-res/CompanyMinimum)
-                    (select-keys (:data parsed))
-                    (s/check common-res/CompanyMinimum)))
+          (->> (keys common-res/CompanyMinimum)
+               (select-keys (:data parsed))
+               (s/check common-res/CompanyMinimum))
           [true (with-reason :missing-fields)]
           ;; Ensure all extra fields match with our sections
-          ;; if superset? at the end is true no extra fields are found
+          ;; if superset? returns true no superfluous fields are found
           (not (->> (into (set (keys common-res/CompanyMinimum))
                           (set (keys common-res/CompanyOptional)))
                     (cset/difference (-> parsed :data keys set))


FIX: the first build id specified in :builds-to-start or on the command line becomes the REPL build

fixes #600 #615

--- sidecar/src/figwheel_sidecar/repl_api.clj
+++ sidecar/src/figwheel_sidecar/repl_api.clj
@@ -152,8 +152,9 @@
       (alter-var-root #'*repl-api-system* (fn [_] system))
       (if (false? (:repl (config/figwheel-options config-data)))
         (loop [] (Thread/sleep 30000) (recur))
-        ;; really should get the given initial build id here
-        (fs/cljs-repl (:figwheel-system system))))))
+        (if-let [build-id (first (:build-ids (:data config-data)))]
+          (fs/cljs-repl (:figwheel-system system) build-id)
+          (fs/cljs-repl (:figwheel-system system)))))))

 ;; new start from lein code here


(SERVER-1072) Add `with-puppet-conf-files` test utility

This commit just has a minor refactor to our JRuby test utilities
that is useful in downstream projects like pe-puppet-server-extensions
and pe-aio.

--- test/unit/puppetlabs/services/jruby/jruby_testutils.clj
+++ test/unit/puppetlabs/services/jruby/jruby_testutils.clj
@@ -11,7 +11,8 @@
            (org.jruby.embed LocalContextScope)
            (puppetlabs.services.jruby.jruby_puppet_schemas JRubyPuppetInstance)
            (clojure.lang IFn)
-           (com.puppetlabs.puppetserver.jruby ScriptingContainer)))
+           (com.puppetlabs.puppetserver.jruby ScriptingContainer)
+           (java.io File)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Constants
@@ -28,6 +29,39 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; JRubyPuppet Test fixtures
+
+(schema/defn ^:always-validate with-puppet-conf-files
+  "Test fixture; Accepts a map with the following characteristics:
+
+  * keys are simple filenames (no paths) that will be created in puppet's $confdir
+  * values are paths to a test-specific file that should be copied to puppet's confdir,
+    a la `$confdir/<key>`.
+
+  For each entry in the map, copies the files into $confdir, runs the test function,
+  and then deletes all of the files from $confdir.
+
+  Optionally accepts a second argument `dest-dir`, which specifies the location
+  of Puppet's $confdir.  If this argument is not provided, defaults to
+  `jruby-testutils/conf-dir`."
+  ([puppet-conf-files]
+   (with-puppet-conf-files puppet-conf-files conf-dir))
+  ([puppet-conf-files :- {schema/Str (schema/pred (some-fn string? #(instance? File %)))}
+    dest-dir :- schema/Str]
+
+   (let [target-paths (reduce
+                       (fn [acc filename]
+                         (assoc acc filename (fs/file dest-dir filename)))
+                       {}
+                       (keys puppet-conf-files))]
+     (fn [f]
+       (doseq [filename (keys puppet-conf-files)]
+         (fs/copy+ (get puppet-conf-files filename)
+                   (get target-paths filename)))
+       (try
+         (f)
+         (finally
+           (doseq [target-path (vals target-paths)]
+             (fs/delete target-path))))))))

 (defn with-puppet-conf
   "This function returns a test fixture that will copy a specified puppet.conf
@@ -37,13 +71,7 @@
   ([puppet-conf-file]
    (with-puppet-conf puppet-conf-file conf-dir))
   ([puppet-conf-file dest-dir]
-   (let [target-path (fs/file dest-dir "puppet.conf")]
-     (fn [f]
-       (fs/copy+ puppet-conf-file target-path)
-       (try
-         (f)
-         (finally
-           (fs/delete target-path)))))))
+   (with-puppet-conf-files {"puppet.conf" puppet-conf-file} dest-dir)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; JRubyPuppet Test util functions


Set active board after clicking on a cell

--- src/ultimate_ttt/state_handler.cljs
+++ src/ultimate_ttt/state_handler.cljs
@@ -12,7 +12,8 @@

 (defonce app-state (atom {:main-board (board-helper/init-board)
                           :current-owner 1
-                          :boards (init-boards)}))
+                          :boards (init-boards)
+                          :active-board nil}))

 (defn- choose-next-owner []
   (let [current-owner (:current-owner @app-state)]
@@ -28,7 +29,19 @@
         new-board (board-helper/set-cell board-record (first coordinates) (second coordinates) current-owner)]
     (swap! board-cursor assoc :board new-board)))

+(defn- set-active-board [index]
+  (swap! app-state assoc :active-board (get-in @app-state [:boards index :board])))
+
+(defn is-active? [board]
+  (let [active-board (:active-board @app-state)]
+    (or
+      (nil? active-board)
+      (= board active-board))))
+
 (defn on-cell-click [index board-cursor]
-  (do
-    (change-cell-owner index board-cursor)
-    (change-current-owner)))
+  (let [board-record (:board @board-cursor)]
+    (when (is-active? board-record)
+      (change-cell-owner index board-cursor)
+      (change-current-owner)
+      (set-active-board index))))
+


output-splitter function has been fixed

output-splitter function has been fixed

--- core/src/cljc/hellhound/system/impl/splitter.cljc
+++ core/src/cljc/hellhound/system/impl/splitter.cljc
@@ -43,15 +43,8 @@

 (defn output-splitter
   "Create and return an output-splitter for the given `source` channel."
-  ([source]
-   (output-splitter source :single-thread))
-  ([source execution-mode]
-   (cond
-     (= execution-mode :single-thread) (OutputSplitter. source (atom []))
-     (= execution-mode :multi-thread) (ThreadedOutputSplitter. source (atom []) (threadpool 4))
-     :else (throw (ex-info (format "Don't know about '%s' execution mode."
-                                   execution-mode)
-                           :cause {:execution-mode execution-mode})))))
+  [source]
+  (OutputSplitter. source (atom [])))

 (comment


add validation to new access key request

--- src/wombats/handlers/access_key.clj
+++ src/wombats/handlers/access_key.clj
@@ -1,5 +1,23 @@
 (ns wombats.handlers.access-key
-  (:require [io.pedestal.interceptor.helpers :as interceptor]))
+  (:require [io.pedestal.interceptor.helpers :as interceptor]
+            [clojure.spec :as s]
+            [clj-time.core :as t]
+            [wombats.specs.utils :as sutils]))
+
+(def ^:private add-access-key-body-sample
+  #:access-key{:key "wt2017_alpha"
+               :max-number-of-uses 100
+               :expiration-date (str (t/plus (t/now)
+                                             (t/months 1)))
+               :description "Initial alpha key for WillowTree internal use only"})
+
+(def ^:private add-access-key-body-params
+  {:name "access-key-body"
+   :in "body"
+   :description "values for a access key"
+   :required true
+   :default (str add-access-key-body-sample)
+   :schema {}})

 (def ^:swagger-spec get-access-keys-spec
   {"/api/v1/access_keys"
@@ -16,17 +34,40 @@
                                      :status 200
                                      :body [])))))

+(s/def :access-key/id string?)
+(s/def :access-key/key string?)
+(s/def :access-key/max-number-of-uses #(instance? Long %))
+(s/def :access-key/number-of-uses #(instance? Long %))
+(s/def :access-key/expiration-date inst?)
+(s/def :access-key/description string?)
+
+(s/def ::new-access-key (s/keys :req [:access-key/key
+                                      :access-key/max-number-of-uses
+                                      :access-key/expiration-date
+                                      :access-key/description]))
+
 (def ^:swagger-spec add-access-key-spec
   {"/api/v1/access_keys"
    {:post {:description "Creates and returns a new access key"
            :tags ["access-key"]
            :operationId "add-access-keys"
+           :parameters [add-access-key-body-params]
            :responses {:200 {:description "add-access-key response"}}}}})

-(def get-access-keys
+(defn- format-new-access-key-request
+  [access-key]
+  (-> access-key
+      (update :access-key/expiration-date #(when % (read-string (str "#inst \"" % "\""))))))
+
+(def add-access-key
   (interceptor/before
-   ::get-access-keys
-   (fn [{:keys [response] :as context}]
-     (assoc context :response (assoc response
-                                     :status 200
-                                     :body [])))))
+   ::add-access-key
+   (fn [{:keys [request response] :as context}]
+     (let [access-key (->> (:edn-params request)
+                           (format-new-access-key)
+                           (sutils/validate-input ::new-access-key)
+                           (add-access-key-fields))]
+
+       (assoc context :response (assoc response
+                                       :status 200
+                                       :body access-key))))))


Added one more test for converting a constitutional role into a circle.

--- spec/freefrog/governance_circles_spec.clj
+++ spec/freefrog/governance_circles_spec.clj
@@ -71,7 +71,8 @@
         op [["Add" g/add-role]
             ["Remove" g/remove-role]
             ["Rename" g/rename-role "stuff"]
-            ["Update the purpose of" g/update-role-purpose "Stuff"]]]
+            ["Update the purpose of" g/update-role-purpose "Stuff"]
+            ["Convert into a circle" g/convert-to-circle]]]
     (it (format "doesn't %s the %s role" (first op) role)
       (should-throw IllegalArgumentException
         (format "'%s' role is defined in the Constitution." role)


More specs for core roles.

More specs for core roles.

--- spec/freefrog/governance_circles_spec.clj
+++ spec/freefrog/governance_circles_spec.clj
@@ -160,10 +160,12 @@
 (describe "Role Assignment"
   ;; Appendix A/Lead Link
   (it "can assign someone to a role")
+  (it "can assign someone to Lead Link role")

   ;; Section 2.4.2
   (it "can assign multiple people to a role")
   (it "can assign multiple people to a role with focuses")
+  (it "won't assign multiple people to core roles")

   ;; Section 2.4.3, Appendix A/Lead Link
   (it "can remove someone from a role"))
@@ -173,6 +175,9 @@
   ;; Section 2.5.1
   (it "won't assign the person in the Lead Link role to the Facilitator
     or Rep Link role")
+
+  ;; Section 2.5.2
+  (it "will only assign someone to an elected role with a term expiration date")

   ;; Section 2.5.3
   (it "can add domains")


Minor language updates

Minor language updates

--- spec/freefrog/governance_circles_spec.clj
+++ spec/freefrog/governance_circles_spec.clj
@@ -128,9 +128,9 @@

   ;; Section 2.5.3
   (it "can add/remove domains")
-  (it "doesn't update/remove any of the constitutional domains")
+  (it "won't update/remove any of the constitutional domains")
   (it "can add/remove accountabilities")
-  (it "doesn't update/remove any of the constitutional accountabilities"))
+  (it "won't update/remove any of the constitutional accountabilities"))

 (def subcircle-name "Development")
 (def subcircle-role-name "Programmer")


Minor reformatting.

Minor reformatting.

--- spec/freefrog/governance_roles_spec.clj
+++ spec/freefrog/governance_roles_spec.clj
@@ -99,13 +99,11 @@

     (it "can add a role to a circle with name, purpose, and domains"
       (should= (assoc sample-anchor :roles {role-name {:domains sample-domains}})
-        (g/add-role sample-anchor role-name
-                    nil sample-domains nil)))
+        (g/add-role sample-anchor role-name nil sample-domains nil)))

     (it "can add a role to a circle with name, purpose, and accountabilities"
       (should= (assoc sample-anchor :roles {role-name {:domains sample-domains}})
-        (g/add-role sample-anchor role-name
-                    nil sample-domains nil)))
+        (g/add-role sample-anchor role-name nil sample-domains nil)))

     (it "can add a role to a circle with everything"
       (should= (assoc sample-anchor :roles
@@ -173,11 +171,11 @@
           (g/update-role-purpose sample-anchor-with-role role-name "")))

       (should-not-update-missing-or-empty-roles g/update-role-purpose
-        "updating purpose"
-        "Stuff"))
+        "updating purpose" "Stuff"))

     ;; Section 1.1.b
-    (should-handle-collection-properly g/add-domain g/remove-domain
+    (should-handle-collection-properly g/add-domain
+                                       g/remove-domain
                                        :domains "Domain"
                                        sample-anchor-with-domain
                                        sample-anchor-with-domains
@@ -185,7 +183,8 @@
                                        sample-domain-2)

     ;; Section 1.1.c
-    (should-handle-collection-properly g/add-accountability g/remove-accountability
+    (should-handle-collection-properly g/add-accountability
+                                       g/remove-accountability
                                        :accountabilities "Accountability"
                                        sample-anchor-with-acc
                                        sample-anchor-with-accs


Remove commented button

Remove commented button

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -94,15 +94,7 @@
                         :action (button/button {:on-click #(om/set-state! owner :show-modal? true)
                                                 :kind :primary
                                                 :size :medium}
-                                               "Create New Token")
-                        #_(button/managed-button
-                                  {:loading-text "Creating..."
-                                   :failed-text "Failed to add token"
-                                   :success-text "Created"
-                                   :kind :primary
-                                   :size :medium
-                                   :on-click #(om/set-state! owner :show-modal? true)}
-                                  "Create New Token")}
+                                               "Create New Token")}
             (html
               [:div
                [:div.api-item


use email instead of name

use email instead of name

--- src-cljs/frontend/components/overlay.cljs
+++ src-cljs/frontend/components/overlay.cljs
@@ -156,7 +156,7 @@
     [:img {:src (utils/gravatar-url (:permission/cust entity))}]]
    [:div.access-details
     [:div.access-detail {:title (:permission/cust entity)}
-     [:div.access-name "Danny King"]]
+     [:div.access-name (:permission/cust entity)]]
     [:div.access-detail
      [:div.access-status "Was granted access today."]]]])

@@ -180,7 +180,7 @@
     [:img {:src (utils/gravatar-url (:access-request/cust entity))}]]
    [:div.access-details
     [:div.access-detail {:title (:access-request/cust entity)}
-     [:span.access-name "Danny King"]]
+     [:span.access-name (:access-request/cust entity)]]
     [:div.access-detail
      [:div.access-status
       (if (= :access-request.status/denied (:access-request/status entity))


Better breadcrumbs for the sections.

Better breadcrumbs for the sections.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -19,9 +19,6 @@

 (defn update-when [x pred f & args]
   (if pred (apply f x args) x))
-
-(defn row-for [{:keys [selected data]}]
-  (find-first #(= (:id %) selected) data))

 (defn uri-for-selection-change
   "Returns the uri to load because of change of selection. Returns nil
@@ -172,9 +169,16 @@
                 (dom/p nil (str "Latitude: " latitude))
                 (dom/p nil (str "Longitude: " longitude)))))))

+(defn row-for [{:keys [selected data]}]
+  (find-first #(= (:id %) selected) data))
+
 (defn title-for [cursor & {:keys [title-key] :or {title-key :name}}]
-  (some->> (get-in (row-for cursor) (if (vector? title-key) title-key (vector title-key)))
-           (str " - ")))
+  (let [row (row-for cursor)]
+    (get-in row (if (vector? title-key) title-key (vector title-key)))))
+
+(defn title-for-sensor [{:keys [selected]}]
+  (let [[type _] (str/split selected #"-")]
+    type))

 (defn programmes-table [cursor owner]
   (reify
@@ -233,30 +237,51 @@

         ;; TODO sort out duplication here, wrap (on/build table ...) calls probably.
         ;;
-        (let [{:keys [programmes projects properties devices sensor-select]} tables]
+        (let [{:keys [programmes projects properties devices sensors sensor-select]} tables]
+          (println ">>>> Sensors: " sensors)
           ;; (println "Tables: " tables)
           (html [:div
                  ;;(om/build clear-tables data)
                  [:h1 {:id "programmes"} (:title data)]
                  (om/build programmes-table programmes)

-                 [:h2 {:id "projects"} "Projects" [:small (title-for programmes)]]
+                 [:h2 {:id "projects"} "Projects"]
+                 [:ul {:class "breadcrumb"}
+                  [:li (title-for programmes)]]
                  (om/build table projects {:opts {:histkey :projects}})

-                 [:h2  {:id "properties"} "Properties" [:small (title-for programmes) (title-for projects)]]
+                 [:h2  {:id "properties"} "Properties"]
+                 [:ul {:class "breadcrumb"}
+                  [:li (title-for programmes)]
+                  [:li (title-for projects)]]
                  (om/build table properties {:opts {:histkey :properties}})

-                 [:h2 {:id "devices"} "Devices" [:small (title-for programmes) (title-for projects) (title-for properties :title-key :addressStreetTwo)]]
+                 [:h2 {:id "devices"} "Devices"]
+                 [:ul {:class "breadcrumb"}
+                  [:li (title-for programmes)]
+                  [:li (title-for projects)]
+                  [:li (title-for properties :title-key :addressStreetTwo)]]
                  (om/build table devices {:opts {:histkey :devices}})

                  (om/build device-detail devices)

-                 [:h2 {:id "sensors"} "Sensors" [:small (title-for programmes) (title-for projects) (title-for properties :title-key :addressStreetTwo) (title-for devices :title-key [:location :name])]]
+                 [:h2 {:id "sensors"} "Sensors"]
+                 [:ul {:class "breadcrumb"}
+                  [:li (title-for programmes)]
+                  [:li (title-for projects)]
+                  [:li (title-for properties :title-key :addressStreetTwo)]
+                  [:li (title-for devices :title-key [:location :name])]]
                  (om/build sensor/table data {:opts {:histkey :sensors
                                                      :path    :readings}})
                  (om/build sensor/define-data-set-button data)

                  [:h2 "Chart"]
+                 [:ul {:class "breadcrumb"}
+                  [:li (title-for programmes)]
+                  [:li (title-for projects)]
+                  [:li (title-for properties :title-key :addressStreetTwo)]
+                  [:li (title-for devices :title-key [:location :name])]
+                  [:li (title-for-sensor sensors)]]
                  [:div {:id "date-picker"}
                   (om/build dtpicker/date-picker data {:opts {:histkey :range}})]
                  (om/build chart-feedback-box (get-in data [:chart :message]))


Don't use role=button for an actual link

--- src-cljs/frontend/components/about.cljs
+++ src-cljs/frontend/components/about.cljs
@@ -393,6 +393,5 @@
      [:h2 "We're Hiring"]
      [:p.subheader "We're looking for amazing people to join us on this journey, want to join the team?"]
      [:a.btn.btn-cta
-      {:href "/jobs"
-       :role "button"}
+      {:href "/jobs"}
       "Join Us"]]]))


[CIRCLE-1350] Remove report error banner (#1497)

* [CIRCLE-1350] Remove report error banner

* clean up unused bindings

--- src-cljs/frontend/components/build.cljs
+++ src-cljs/frontend/components/build.cljs
@@ -59,25 +59,13 @@
        " if you're interested in the cause or if the problem persists."])))

 (defn report-error [{:keys [build show-premium-content?]} owner]
-  (let [build-id (build-model/id build)
-        build-url (:build_url build)
-        fail-reason (:fail_reason build)]
-    (when (and (:failed build)
-               (not show-premium-content?)
-               (not (config/enterprise?)))
-      [:div.alert.alert-danger.iconified
-       [:div [:img.alert-icon {:src (common/icon-path "Info-Error")}]]
-       (if (:infrastructure_fail build)
-         (infrastructure-fail-message owner fail-reason)
-         [:div.alert-wrap
-          "If you continue to get stuck, we suggest checking out our "
-          [:a (open-ext {:href "https://circleci.com/docs/troubleshooting/"})
-           "docs"]
-          " and/or our "
-          [:a {:href "https://discuss.circleci.com/"}
-           "community site"]
-          "."
-          [:span " Upgrading to a paid plan unlocks access to CircleCI engineering support, faster builds, and advanced features. Thanks!"]])])))
+  (when (and (:failed build)
+             (:infrastructure_fail build)
+             (not show-premium-content?)
+             (not (config/enterprise?)))
+    [:div.alert.alert-danger.iconified
+     [:div [:img.alert-icon {:src (common/icon-path "Info-Error")}]]
+     (infrastructure-fail-message owner (:fail_reason build))]))

 (defn sticky [{:keys [wrapper-class content-class content]} owner]
   (reify


Tidy up.

Tidy up.

--- src-cljs/kixi/hecuba/tabs/profiles.cljs
+++ src-cljs/kixi/hecuba/tabs/profiles.cljs
@@ -440,8 +440,8 @@
                  (bs/panel
                   "Extension"
                   [:div
-                   (text-control item state owner :age ":age")
-                   (text-control item state owner :construction_date ":construction_date")]))]
+                   (text-control item state owner :age "Age")
+                   (text-control item state owner :construction_date "Construction Date")]))]
               [:p "No extensions."]))])]))))

 (defn heating-systems-row [profiles owner]
@@ -543,7 +543,7 @@
                   "Storey"
                   [:div
                    (text-control item state owner :storey_type "Storey Type")
-                   (text-control item state owner :storey ":Storey")
+                   (text-control item state owner :storey "Storey")
                    (text-control item state owner :heat_loss_w_per_k "Heat Loss W Per K")
                    (text-control item state owner :heat_requirement_kwth_per_year "Heat Requirement kWh Per Year")]))]
               [:p "No storeys recorded."]))])]))))


Forgot to map vec over result of permutations.

In my previous fix I'd applied vec to the result of permutations, which turned the *outer* list to a vector, but didn't change any of the contained collections, all of which remained lists. Mapping vec across the result fixes that.

--- src/clojush/problems/software/last_index_of_zero.clj
+++ src/clojush/problems/software/last_index_of_zero.clj
@@ -56,11 +56,11 @@
    ^{:domain-label "vectors of all zeros"}
    [(map #(vec (repeat (inc %) 0)) (range 50)) 30 20]
    ^{:domain-label "permutations of a 4 item vector with one zero"}
-   [(vec (permutations [0 5 -8 9])) 20 4]
+   [(map vec (permutations [0 5 -8 9])) 20 4]
    ^{:domain-label "permutations of a 4 item vector with two zeros"}
-   [(vec (permutations [0 0 -8 9])) 20 4]
+   [(map vec (permutations [0 0 -8 9])) 20 4]
    ^{:domain-label "permutations of a 4 item vector with three zeros"}
-   [(vec (permutations [0 0 0 9])) 20 4]
+   [(map vec (permutations [0 0 0 9])) 20 4]
    ^{:domain-label "random cases"}
    [(fn [] (random-sequence-with-at-least-one-zero 5 20)) 100 100]
    ])


Show search results on map

Show search results on map

--- src/cljs/gtfve/components/maps_panel.cljs
+++ src/cljs/gtfve/components/maps_panel.cljs
@@ -18,7 +18,6 @@
                            :mapTypeId (:ROADMAP map-types)
                            :zoom 15})

-(defn maps-canvas [ui owner]
 (defn maps-canvas-dev [ui _]
   (reify
     om/IRenderState
@@ -56,6 +55,7 @@
     (render [_]
       (html [:noscript]))))

+(defn maps-canvas [{:keys [ui data]} owner]
   (reify
     om/IInitState
     (init-state [_]
@@ -85,10 +85,14 @@
       (when-let [kill-ch (:kill-ch (om/get-state owner))]
         (put! kill-ch (js/Date.))))
     om/IRenderState
-    (render-state [_ state]
-      (html
-       [:div.maps-viewport
-        [:div.maps-canvas {:ref "gmap"}]]))))
+    (render-state [_ {:keys [gmap] :as state}]
+      (let [stops (:stops-search-results data)]
+        (html
+         (into [:div.maps-viewport [:div.maps-canvas {:ref "gmap"}]]
+               (when gmap
+                 (om/build-all stop-marker stops {:key :stop/id
+                                                  :state {:gmap gmap}}))
+               ))))))

 (defn map-toolbar-button [{:keys [link control active?]} owner]
   (reify
@@ -134,4 +138,4 @@
     (render [_]
       (html [:div.maps-panel
              (om/build maps-toolbar ui)
-             (om/build maps-canvas ui)]))))
+             (om/build maps-canvas {:ui ui :data data})]))))


Support service queries.

Support service queries.

--- src/cmr_edsc_stubs/data/fake_response.clj
+++ src/cmr_edsc_stubs/data/fake_response.clj
@@ -28,29 +28,102 @@
         ids (gen-ids "GES_DISC" "S000" svcs)]
     (zipmap ids svcs)))

+(defn make-metadata
+  ([concept-type concept-id]
+    (make-metadata
+     "GES_DISC" (str (java.util.UUID/randomUUID)) concept-type concept-id))
+  ([provider-id native-id concept-type concept-id]
+    {:revision-id 1
+     :deleted false
+     :format "application/vnd.nasa.cmr.umm+json"
+     :provider-id provider-id
+     :user-id "cmr-edsc-stubs"
+     :native-id native-id
+     :concept-id concept-id
+     :revision-date "2017-09-27T18:20:46Z"
+     :concept-type concept-type}))
+
+(defn make-collection-metadata
+  [concept-id]
+  (assoc (make-metadata "collection" concept-id)
+         :has-variables true
+         :has-transforms true
+         :has-formats false))
+
+(defn make-service-metadata
+  [concept-id]
+  (make-metadata "service" concept-id))
+
+(defn make-variable-metadata
+  [concept-id]
+  (make-metadata "variable" concept-id))
+
 (defn make-variables-services-associations
   [vars svcs]
-  (json/generate-string
-    {:variables (keys vars)
-     :services (keys svcs)}))
+  {:variables (keys vars)
+   :services (keys svcs)})
+
+(defn get-item-payload
+  [[meta-data umm-data]]
+  {:meta meta-data
+   :umm umm-data})
+
+(defn get-item-assocns-payload
+  [[meta-data umm-data associations]]
+  (assoc (get-item-payload [meta-data umm-data])
+         :associations associations))
+
+(defn get-result-payload
+  [items]
+  {:hits (count items)
+   :took 42
+   :items items})
+
+(defn get-concept-ids
+  [params]
+  (let [concept-id (:concept_id params)]
+    (println "type:" (type concept-id))
+    (if (seq concept-id)
+      concept-id
+      [concept-id])))
+
+(defn get-concept-id
+  [params]
+  (first (get-concept-ids params)))

 (defn get-umm-json-ges-disc-airx3std-collection
   []
-  (let [metadata (data-sources/get-ges-disc-airx3std-collection-metadata :json)
-        umm (data-sources/get-ges-disc-airx3std-collection :json)
+  (let [umm-data (data-sources/get-ges-disc-airx3std-collection
+                  :json [:json :edn])
         vars (get-ges-disc-variables-map)
-        svcs (get-ges-disc-services-map)]
-    (str
-      "{\"hits\": 1,
-        \"took\": 27,
-        \"items\": [{"
-        "\"meta\":" metadata ","
-        "\"associations\":" (make-variables-services-associations vars svcs) ","
-        "\"umm\":" umm
-      "}]}")))
+        svcs (get-ges-disc-services-map)
+        meta-data (make-collection-metadata (first (keys svcs)))
+        assocns (make-variables-services-associations vars svcs)]
+    (->> [[meta-data umm-data assocns]]
+         (map get-item-assocns-payload)
+         (get-result-payload)
+         (json/generate-string))))
+
+(defn get-umm-json-ges-disc-airx3std-variables
+  [params]
+  (let [vars (get-ges-disc-variables-map)]
+    ))
+
+(defn get-umm-json-ges-disc-airx3std-services
+  [params]
+  (let [svcs (get-ges-disc-services-map)
+        concept-id (get-concept-id params)
+        umm-data (svcs concept-id)
+        meta-data (make-service-metadata concept-id)]
+    (println "concept-id: " concept-id)
+    (->> [[meta-data umm-data]]
+         (map get-item-payload)
+         (get-result-payload)
+         (json/generate-string))))

 (defn handle-prototype-request
   [path-w-extension params headers query-string]
   (case path-w-extension
     "collections" (get-umm-json-ges-disc-airx3std-collection)
-    "variables" "{}"))
+    "variables" (get-umm-json-ges-disc-airx3std-variables params)
+    "services" (get-umm-json-ges-disc-airx3std-services params)))


handle new tamaric type structure; fix pprint nav

--- src/com/billpiel/sayid/string_output2.clj
+++ src/com/billpiel/sayid/string_output2.clj
@@ -328,6 +328,10 @@
        (remove #(-> % second nil?))
        (into {})))

+(defn tkn->simple-type
+  [t]
+  (-> t :type first))
+
 (defn apply-type-colors-to-token
   [token]
   (let [type->color {:int :cyan
@@ -338,9 +342,9 @@
                      :truncator :black}
         type->bg-color {:truncator :white}]
     (merge token
-           (when-let [color (type->color (:type token))]
+           (when-let [color (type->color (tkn->simple-type token))]
              {:fg-color color})
-           (when-let [color (type->bg-color (:type token))]
+           (when-let [color (type->bg-color (tkn->simple-type token))]
              {:bg-color color}))))

 (defn mk-text-props
@@ -495,41 +499,41 @@
         {:keys [start start-line]} n']
     (when (and start start-line)
       (-> start
-          (+ start-line)
+          (+ (* 2 start-line))
           inc))))

 (defn find-up-node
   [z]
   (let [up (some-> z z/up z/node)]
-    (if (= (:type up) :map-entry)
+    (if (= (tkn->simple-type up) :map-entry)
       (some-> z z/up z/up z/node)
       up)))

 (defn find-out-node
   [z]
   (let [up (some-> z z/up z/node)]
-    (if (= (:type up) :map-entry)
+    (if (= (tkn->simple-type up) :map-entry)
       (some-> z z/up z/up z/node)
       up)))

 (defn find-in-node
   [z]
   (let [down (some-> z z/down z/node)]
-    (if (= (:type down) :map-entry)
+    (if (= (tkn->simple-type down) :map-entry)
       (some-> z z/down z/down z/right z/node)
       down)))

 (defn find-prev-node
   [z]
   (let [up (some-> z z/up z/node)]
-    (if (= (:type up) :map-entry)
+    (if (= (tkn->simple-type up) :map-entry)
       (some-> z z/up z/left z/down z/right z/node)
       (some-> z z/left z/node))))

 (defn find-next-node
   [z]
   (let [up (some-> z z/up z/node)]
-    (if (= (:type up) :map-entry)
+    (if (= (tkn->simple-type up) :map-entry)
       (some-> z z/up z/right z/down z/right z/node)
       (some-> z z/right z/node))))


Response body on http response

Response body on http response

--- src/com/wsscode/pathom/diplomat/http.cljc
+++ src/com/wsscode/pathom/diplomat/http.cljc
@@ -11,6 +11,7 @@
 (s/def ::as ::encode-type)
 (s/def ::form-params any?)
 (s/def ::debug? boolean?)
+(s/def ::body any?)

 (s/def ::request (s/keys :req [::url]
                          :opt [::method
@@ -20,7 +21,8 @@
                                ::as
                                ::debug?]))

-(s/def ::response (s/keys :req [::headers]))
+(s/def ::response (s/keys :req [::headers]
+                          :opt [::body]))

 (defn request
   ([{::keys [driver] :as request}]


edeposit/edeposit#454 kosmeticke upravy.

--- src/edeposit/amqp/kramerius/xml/foxml.clj
+++ src/edeposit/amqp/kramerius/xml/foxml.clj
@@ -39,8 +39,8 @@
      [:foxml:property {:VALUE "Active" :NAME "info:fedora/fedora-system:def/model#state"}]
      [:foxml:property {:VALUE "fedoraAdmin" :NAME "info:fedora/fedora-system:def/model#ownerId"}]
      [:foxml:property {:VALUE (.toString created) :NAME "info:fedora/fedora-system:def/model#createdDate"}]
-     [:foxml:property {:VALUE (.toString last-modified) :NAME "info:fedora/fedora-system:def/view#lastModifiedDate"}]
-     ]
+     [:foxml:property {:VALUE (.toString last-modified) :NAME "info:fedora/fedora-system:def/view#lastModifiedDate"}]]
+
     (for [dc dcs]
       [:foxml:datastream {:VERSIONABLE "true" :STATE "A" :CONTROL_GROUP "X" :ID "DC"}
        [:foxml:datastreamVersion {:FORMAT_URI "http://www.openarchives.org/OAI/2.0/oai_dc/"
@@ -50,12 +50,14 @@
                                   :ID "DC.1"}
         [:foxml:xmlContent (to-sexp-dc dc)]]]
       )
+
     (for [mods-one mods]
       [:foxml:datastream {:VERSIONABLE "true" :STATE "A" :CONTROL_GROUP "X" :ID "BIBLIO_MODS"}
        [:foxml:xmlContent
         [:mods:modsCollection {:xmlns:mods "http://www.loc.gov/mods/v3"}
          [:mods:mods {:version "3.3"}
           (map to-sexp (:content mods-one))]]]])
+
     [:foxml:datastream {:VERSIONABLE "false" :STATE "A" :CONTROL_GROUP "E" :ID "IMG_FULL"}
      [:foxml:datastreamVersion {:MIMETYPE (-> full-file :mimetype) :CREATED created :ID "IMG_FULL.0"}
       [:foxml:contentLocation


cleanup buffer

cleanup buffer

--- src/main/clojure/clojure/tools/reader.clj
+++ src/main/clojure/clojure/tools/reader.clj
@@ -13,7 +13,7 @@
                             default-data-readers *default-data-reader-fn*
                             *read-eval* *data-readers* *suppress-read*])
   (:require [clojure.tools.reader.reader-types :refer
-             [read-char unread peek-char indexing-reader? source-logging-push-back-reader
+             [read-char unread peek-char indexing-reader? source-logging-push-back-reader source-logging-reader?
               get-line-number get-column-number get-file-name string-push-back-reader log-source]]
             [clojure.tools.reader.impl.utils :refer :all] ;; [char ex-info? whitespace? numeric? desugar-meta]
             [clojure.tools.reader.impl.errors :as err]
@@ -971,7 +971,14 @@
   ([] (read *in* true nil))
   ([reader] (read reader true nil))
   ([{eof :eof :as opts :or {eof :eofthrow}} reader] (read* reader (= eof :eofthrow) eof nil opts (LinkedList.)))
-  ([reader eof-error? sentinel] (read* reader eof-error? sentinel nil {} (LinkedList.))))
+  ([reader eof-error? sentinel]
+   (let [ret (read* reader eof-error? sentinel nil {} (LinkedList.))]
+     (when (source-logging-reader? reader)
+       (let [^StringBuilder buf (:buffer @(.source-log-frames ^SourceLoggingPushbackReader reader))
+             len (.length buf)]
+         (when (pos? len)
+           (.delete buf 0 len))))
+     ret)))

 (defn read-string
   "Reads one object from the string s.


better spectrum rendering

better spectrum rendering

--- src/main/clojure/mikera/spectral/core.clj
+++ src/main/clojure/mikera/spectral/core.clj
@@ -3,6 +3,7 @@
   (:require [clojure.core.matrix :as mat])
   (:require [mikera.image.core :as img])
   (:require [mikera.image.colours :as col])
+  (:require [mikera.image.spectrum :as spec])
   (:import [mikera.matrixx Matrix AMatrix])
   (:import [java.awt.image BufferedImage]))

@@ -12,9 +13,10 @@

 (defonce buf (buffer 44100)) ;; create a buffer to store the audio

-(def snare (sample (freesound-path 26903)))
+(def snare (sample (freesound-path 26903)))
+(def snare (sample (freesound-path 68447)))

-(def snare-buf (load-sample (freesound-path 26903)))
+(def samp-buf (load-sample (freesound-path 68447)))

   ;; ============================================
   ;; buffer fun
@@ -30,7 +32,7 @@
   (Thread/sleep 1000)
   (stop))

-(def arr (into-array Double/TYPE (buffer-read snare-buf)))
+(def arr (into-array Double/TYPE (buffer-read samp-buf)))

 (defn mag
   (^double [^double a ^double b]
@@ -38,20 +40,21 @@

 (defn fft-matrix [^doubles arr]
   (let [n (count arr)
-        length 1024
+        length 8192   ;; length of FFT window
         half-length (quot length 2)
+        height (min 400 (quot half-length 2))
         fft (mikera.matrixx.algo.FFT. (int length))
         tarr (double-array (* 2 length))
-        stride 50
+        stride 100
         ts (quot (- n length) stride)
-        result-array (double-array (* half-length ts))]
+        result-array (double-array (* height ts))]
     (dotimes [i ts]
       (System/arraycopy arr (* i stride) tarr 0 length)
       (.realForward fft tarr)
-      (dotimes [j half-length]
+      (dotimes [j height]
         (aset result-array (+ i (* j ts))
               (mag (aget tarr (* j 2)) (aget tarr (inc (* j 2)))))))
-    (Matrix/wrap half-length ts result-array)))
+    (Matrix/wrap height ts result-array)))

 (defn colour ^long [^double val]
   (let [lval (* (inc (Math/log val)) 0.9)]
@@ -72,9 +75,11 @@
           h (.getHeight bi)]
       (dotimes [x w]
         (dotimes [y h]
-          (.setRGB bi (int x) (- (dec h) (int y)) (unchecked-int (colour (.get M (int y) (int x)) ))))))
+          (.setRGB bi (int x) (- (dec h) (int y)) (unchecked-int (spec/heatmap (* 0.01 (.get M (int y) (int x))) ))))))
     bi))

 (def M (fft-matrix arr))

-(img/show (render M))+(defn demo-code []
+
+  (img/show (render M)))


volumes validations

volumes validations

--- test/celestial/test/persistency.clj
+++ test/celestial/test/persistency.clj
@@ -2,7 +2,8 @@
  (:require
    [celestial.roles :refer (admin)]
    [celestial.persistency :refer (validate-type validate-quota user-exists? validate-user)]
-   [celestial.fixtures.data :refer (redis-type user-quota)]
+   [aws.validations :as awsv]
+   [celestial.fixtures.data :refer (redis-type user-quota redis-ec2-spec)]
    [celestial.fixtures.core :refer (is-type? with-m?)])
  (:use midje.sweet)
  (:import clojure.lang.ExceptionInfo))
@@ -47,3 +48,9 @@
      (validate-user {:username "foo" :password "bar" :roles ["foo"] :envs []})  =>
        (throws ExceptionInfo (with-m? {:roles '(({0 ("role must be either #{:celestial.roles/anonymous :celestial.roles/user :celestial.roles/admin}")}))} ))
       )
+
+(fact "aws volumes validations"
+  (awsv/validate-entity redis-ec2-spec) => {}
+  #_(awsv/validate-entity
+    (merge-with merge redis-ec2-spec {:aws {:volumes [{:device "do"}]}} )) => {}
+  )


fix before clean

fix before clean

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/clj/brains_brain/core.clj
+++ src/clj/brains_brain/core.clj
@@ -31,11 +31,13 @@
   (let [cellw 3
         cellh 3
         ]
-    (doseq [x (range 1 size cell-size)
-            y (range 1 size cell-size)]
+    (doseq [x (range 0 size cell-size)
+            y (range 0 size cell-size)]
       (draw g
-            (rect x y (dec cell-size))
+            ;;            (rect x y (dec cell-size))
+            (rect x y cell-size)
             (style :background :white ;; "#F03232"
+                   :foreground :black ; broader
                    )
             )
       )))


add descriptive message to Amped Up

add descriptive message to Amped Up

--- src/clj/game/cards-events.clj
+++ src/clj/game/cards-events.clj
@@ -12,7 +12,8 @@
                                                (lose :corp :credit (min 5 (:credit corp))))}} card))}

    "Amped Up"
-   {:effect (effect (gain :click 3) (damage :brain 1 {:unpreventable true :card card}))}
+   {:msg "gain [Click][Click][Click] and suffer 1 brain damage"
+    :effect (effect (gain :click 3) (damage :brain 1 {:unpreventable true :card card}))}

    "Apocalypse"
    {:req (req (and (some #{:hq} (:successful-run runner-reg))


WebSocket support.

WebSocket support.

Draft WebSocket support.

--- src/clj/http/async/client.clj
+++ src/clj/http/async/client.clj
@@ -22,6 +22,12 @@
   (:import (java.io ByteArrayOutputStream)
            (java.util.concurrent LinkedBlockingQueue)
            (com.ning.http.client AsyncHttpClient AsyncHttpClientConfig$Builder)
+           (com.ning.http.client.websocket WebSocket
+                                           WebSocketUpgradeHandler$Builder
+                                           WebSocketListener
+                                           WebSocketByteListener
+                                           WebSocketTextListener
+                                           WebSocketCloseCodeReasonListener)
            (com.ning.http.client.providers.netty NettyAsyncHttpProviderConfig)))

 ;; # Client Lifecycle
@@ -275,6 +281,108 @@
   [resp]
   (:raw-url resp))

+;; websocket
+(defprotocol IWebSocket
+  (-sendText [this text])
+  (-sendByte [this byte]))
+
+(extend-protocol IWebSocket
+  WebSocket
+  (-sendText [ws text]
+    (.sendTextMessage ws text))
+  (-sendByte [ws byte]
+    (.sendMessage ws byte)))
+
+(defn send
+  "Send message via WebSocket."
+  [ws & {text :text
+         byte :byte}]
+  (when (satisfies? IWebSocket ws)
+    (if text
+      (-sendText ws text)
+      (-sendByte ws byte))))
+
+(defn create-ws-text-listener
+  "Creates WebSocket text listener."
+  [cb]
+  (reify
+    WebSocketTextListener
+    (^{:tag void} onMessage [_ #^String s]
+      (println "ws msg:" s)
+      (cb s))
+    (^{:tag void} onFragment [_ #^String s #^boolean last]
+      (println "ws frag:" s ", last:" last))
+
+    WebSocketListener
+    (^{:tag void} onOpen [_ #^WebSocket ws]
+      (println "ws open:" ws))
+    (^{:tag void} onClose [_ #^WebSocket ws]
+      (println "ws close:" ws))
+    (^{:tag void} onError [_ #^Throwable t]
+      (println "ws error:" t))
+
+
+    WebSocketCloseCodeReasonListener
+    (onClose [_ ws code reason]
+      (println "ws close:" ws ", code:" code ", reason:" reason))
+    ))
+
+(defn create-ws-byte-listener
+  "Creates WebSocket binary listner."
+  [cb]
+  (reify
+    WebSocketByteListener
+    (^{:tag void} onMessage [_ #^bytes b]
+      (println "ws msg:" (alength b))
+      (cb b))
+    (^{:tag void} onFragment [_ #^bytes b #^boolean last]
+      (println "ws frag:" (alength b) ", last:" last))
+
+    WebSocketListener
+    (^{:tag void} onOpen [_ #^WebSocket ws]
+      (println "ws open:" ws))
+    (^{:tag void} onClose [_ #^WebSocket ws]
+      (println "ws close:" ws))
+    (^{:tag void} onError [_ #^Throwable t]
+      (println "ws error:" t))
+
+
+    WebSocketCloseCodeReasonListener
+    (onClose [_ ws code reason]
+      (println "ws close:" ws ", code:" code ", reason:" reason))
+    ))
+
+(defn websocket
+  "Opens WebSocket connection."
+  {:tag WebSocket}
+  [client #^String url & {text-cb :text byte-cb :byte}]
+  (let [b (WebSocketUpgradeHandler$Builder.)]
+    (when text-cb (.addWebSocketListener b (create-ws-text-listener text-cb)))
+    (when byte-cb (.addWebSocketListener b (create-ws-byte-listener byte-cb)))
+    (.get (.executeRequest client (prepare-request :get url) (.build b)))))
+
+;; closing
+(defprotocol IClosable
+  (-close [this])
+  (-open? [this]))
+
+(extend-protocol IClosable
+  AsyncHttpClient
+  (-close [client] (.close client))
+  (-open? [client] (not (.isClosed client)))
+
+  WebSocket
+  (-close [soc] (.close soc))
+  (-open? [soc] (.isOpen soc)))
+
 (defn close
   "Closes client."
-  ([client] (.close client)))
+  [client]
+  (when (satisfies? IClosable client)
+    (-close client)))
+
+(defn open?
+  "Checks if client is open."
+  [client]
+  (when (satisfies? IClosable client)
+    (-open? client)))


update recipient count

update recipient count

--- src/clj/salava/badge/main.clj
+++ src/clj/salava/badge/main.clj
@@ -446,3 +446,11 @@
   (if user-id
     (select-badge-id-by-old-id-user-id {:user_id user-id :old_id old-id} (into {:result-set-fn first :row-fn :id} (u/get-db ctx)))
     (select-badge-content-id-by-old-id {:old_id old-id} (into {:result-set-fn first :row-fn :badge_content_id} (u/get-db ctx)))))
+
+(defn update-recipient-count [ctx user-id user_badge_id]
+  (let [badge-id (-> (select-badge-id-by-user-badge-id {:user_badge_id user_badge_id} (into {:result-set-fn first} (u/get-db ctx))) :badge_id)
+        existing-ids (select-user-badge-id-with-badge-id {:user_id user-id :badge_id badge-id} (into {:row-fn :id} (u/get-db ctx)))]
+    (if (some #(= :social %) (get-in ctx [:config :core :plugins]))
+      (so/create-connection-badge-by-badge-id! ctx user-id user_badge_id))
+    (when (empty? (rest existing-ids))
+      (update-badge-recipient-count! {:badge_id badge-id} (u/get-db ctx)))))


make it actually work

make it actually work

--- src/cljs/hackernews/core.cljs
+++ src/cljs/hackernews/core.cljs
@@ -1,14 +1,4 @@
 (ns hackernews.core
-  (:require-macros [cljs.core.async.macros :refer [go go-loop]])
-  (:require [om.core :as om :include-macros true]
-            [om-tools.core :refer-macros [defcomponent]]
-            [sablono.core :refer-macros [html]]
-            [hackernews.utils :refer [send!]]
-            [cljs-http.client :as http]
-            [cljs.core.async :refer [alts! chan put!]]))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Utils & constants(ns hackernews.core
   (:require-macros [cljs.core.async.macros :refer [go go-loop]])
   (:require [om.core :as om :include-macros true]
             [om-tools.core :refer-macros [defcomponent]]
@@ -110,92 +100,3 @@
           (do
             (swap! app-state handle-event! event)))
         (recur)))))
-.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(enable-console-print!)
-
-(def hacker-news-source
-  "https://hn.algolia.com/api/v1/search_by_date?tags=story&hitsPerPage=200")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; UI Rendering
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defcomponent headline-view
-  [hit owner]
-  (render [_]
-    (let [{:keys [title url]} hit]
-      (html [:h4
-             [:a {:href url}
-              title]]))))
-
-(defcomponent root-view
-  [data owner]
-  (render [_]
-    (html
-      [:div.container
-       [:div.row
-        [:div.col-xs-10.col-xs-offset-2
-         [:h1 (:text data)]]]
-
-       [:div.row
-        [:div.col-xs-2
-         [:button.btn.btn-primary.pull-right
-          {:on-click (send! owner {:type :load-request})}
-          "Load"]]
-        [:div.col-xs-10
-         (om/build-all headline-view
-                       (-> data :headlines :hits)
-                       {:key :objectID})]]
-
-       [:div.row
-        [:div.col-xs-10.col-xs-offset-2
-         [:code (pr-str data)]]]])))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Event Handling
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defn fetch-hackernews-data
-  []
-  (go
-    {:type :load-response
-     :response (<! (http/get hacker-news-source
-                             {:with-credentials? false}))}))
-
-(defn handle-event!
-  [app event]
-  (case (:type event)
-    :load-request (update-in app [:events] conj (fetch-hackernews-data))
-
-    :load-response (let [{:keys [response]} event]
-                     (if (= (:status response) 200)
-                       (assoc app :headlines (:body response))
-                       (assoc app :errors response)))
-    (assoc app :last-event event)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; App setup.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defonce app-state
-  (atom {:text "Hello Funjs!"
-         :events #{}}))
-
-(defn main
-  []
-  (let [ui-events (chan)]
-    (om/root root-view
-             app-state
-             {:target (. js/document (getElementById "app"))
-              :shared {:event-channel ui-events}})
-
-    (swap! app-state update :events conj ui-events)
-
-    (go-loop []
-      (let [[event channel] (alts! (seq (@app-state :events)))]
-        (if (nil? event)
-          (swap! app-state update :events disj channel)
-          (do
-            (swap! app-state handle-event! event)))
-        (recur)))))


point to our new browse

point to our new browse

--- src/clojars/web/dashboard.clj
+++ src/clojars/web/dashboard.clj
@@ -33,7 +33,7 @@
      " and then check out the "
      (link-to "http://wiki.github.com/ato/clojars-web/tutorial"
               "tutorial") ". Alternatively, "
-     (link-to "/repo" "browse") " the repository."]
+     (link-to "/projects" "browse") " the repository."]
     [:h2 "Recently pushed jars"]
     (unordered-list (map jar-link (recent-jars)))))


Made  return a vector rather than a lazy sequence.

--- src/clojush/pushgp/pushgp.clj
+++ src/clojush/pushgp/pushgp.clj
@@ -1,3 +1,4 @@
+
 (ns clojush.pushgp.pushgp
   (:require [clojure.java.io :as io]
             [clj-random.core :as random]
@@ -26,7 +27,7 @@
    to being mutated from a parent). The individuals in generation
    0 are a special case and should not have this flag present."
   [genome]
-  (map #(dissoc % :random-insertion) genome))
+  (mapv #(dissoc % :random-insertion) genome))

 (defn make-pop-agents
   "Makes the population of agents containing the initial random individuals in the population.
@@ -184,3 +185,4 @@
                                           (install-next-generation pop-agents child-agents @push-argmap)
                                           (recur (inc generation)))
                   :else  (final-report generation best @push-argmap))))))))
+


Finished easy tests for trends analysis

Finished easy tests for trends analysis

--- test/forma/trends/analysis_test.clj
+++ test/forma/trends/analysis_test.clj
@@ -1,5 +1,6 @@
 (ns forma.trends.analysis-test
-  (:use [forma.trends.analysis] :reload)
+  (:use [forma.trends.analysis] :reload
+        [clojure.math.numeric-tower :only (sqrt floor abs expt)])
   (:use midje.sweet
         [forma.presentation.ndvi-filter :only (ndvi reli rain Yt)])
   (:require [incanter.core :as i]
@@ -23,7 +24,9 @@
   (idx [1 2 3]) => [1 2 3])

 (fact
-  (windowed-map ols-trend 2 [1 2 50]) => (apply roughly [1. 48.]))
+  (first (windowed-map ols-trend 2 [1 2 50])) => (roughly (first [1. 48.])))
+(fact
+  (last (windowed-map ols-trend 2 [1 2 50])) => (roughly (last [1. 48.])))

 (fact
   (transpose [[1 2 3] [4 5 6]] ) => [[1 4] [2 5] [3 6]])
@@ -50,6 +53,7 @@
  [2 50] (roughly 48. 0.00000001))

 (tabular
+ "check min-short-trend"
  (fact
    (min-short-trend ?long ?short ?ts) => ?expected)
  ?long ?short ?ts ?expected
@@ -59,5 +63,30 @@
  3      2    [1 2 3 4 3 2 0] (roughly -1.25))

 (fact
+  "check expt-residuals"
   (let [y Yt
-        X (idx Yt)]))+        X (idx Yt)
+        power 2]
+    (last (expt-residuals y X power))) => 0.04430432657988476)
+
+(tabular
+ (fact
+   "check scaled-vector"
+   (scaled-vector ?scalar ?coll) => ?expected)
+ ?scalar ?coll ?expected
+ 1 [1 2 3] [1 2 3]
+ 2 [1 2 3] [2 4 6]
+ 1.5 [1 2 3] [1.5 3.0 4.5]
+ )
+
+(defn still-to-do
+  "long-stats
+   first-order-conditions
+   hansen-mats
+   trend-stats
+   harmonic-series
+   k-harmonic-matrix
+   harmonic-seasonal-decomposition
+  "
+
+  )


fixed tests

fixed tests

--- test/forma/trends/analysis_test.clj
+++ test/forma/trends/analysis_test.clj
@@ -161,6 +161,7 @@

 (def ts-tap
+  "sample tap that mimics 2 identical pixels (each with the same time series)"
   (vec (repeat 2 {:start 0 :end 271 :ndvi ndvi :reli reli :rain rain})))

 (defn long-trend-results
@@ -171,8 +172,8 @@
   start and end index don't matter for this application, but are left
   in there anyway to ensure forward compatibility"
   [m]
-  (transpose (telescoping-long-trend 23 135 136 ndvi reli rain)))
-
+  (let [[ndvi-ts reli-ts rain-ts] ((juxt :ndvi :reli :rain) m)]
+    (transpose (telescoping-long-trend 23 135 136 ndvi-ts reli-ts rain-ts))))

 (def long-trend-query
   (<- [?han-stat ?long-drop ?long-tstat]
@@ -182,23 +183,9 @@

 (fact
  "duplicate time series will produce two sets of identical results, given that :distinct is set to false; otherwise, results would "
- long-trend-query => (produces '([[1.2393550741169639 1.2133709085855648]
-                                  [2.4915869043482424 1.3049908881259853]
-                                  [1.1504228201940752 0.5951173333726173]]
-                                 [[1.2393550741169639 1.2133709085855648]
-                                  [2.4915869043482424 1.3049908881259853]
-                                  [1.1504228201940752 0.5951173333726173]])))
-
-;; informative tests (leave in for now)
-
-;; (defn create-tap
-;;   [n ts]
-;;   (vec (repeat n (schema/timeseries-value 0 ts))))
-
-;; (defn myfunc [m]
-;;   (let [coll (vector (:series m))]
-;;     (hansen-stat (first coll))))
-
-;; (defn test-myfunc []
-;;   (?<- (stdout) [?han] (time-src ?series) (myfunc ?series :> ?han)))
-
+ long-trend-query => (produces [[[1.2393550741169639 1.2133709085855648]
+                                 [2.4915869043482424 1.3049908881259853]
+                                 [1.1504228201940752 0.5951173333726173]]
+                                [[1.2393550741169639 1.2133709085855648]
+                                 [2.4915869043482424 1.3049908881259853]
+                                 [1.1504228201940752 0.5951173333726173]]]))


Convert delay tests to manifold

Convert delay tests to manifold

--- test/icecap/handlers/delay_test.clj
+++ test/icecap/handlers/delay_test.clj
@@ -1,9 +1,11 @@
 (ns icecap.handlers.delay-test
   (:require [schema.core :as s]
             [icecap.handlers.core :refer [execute get-schema]]
-            [clojure.core.async :refer [take! chan close!]]
-            [icecap.handlers.delay :refer :all]
-            [clojure.test :refer :all])
+            [icecap.handlers.delay :as hd]
+            [clojure.test :refer :all]
+            [manifold.stream :as ms]
+            [manifold.deferred :as md]
+            [clojure.core.async :as async])
   (:import (java.lang Thread)))

 (defn fake-clock
@@ -35,8 +37,8 @@
   []
   (let [{:keys [advance add-waiter]} (fake-clock)
         timeout (fn [^long ms]
-                  (let [c (chan)]
-                    (add-waiter ms false (fn [] (close! c)))
+                  (let [c (async/chan)]
+                    (add-waiter ms false #(async/close! c))
                     c))]
     [advance {#'clojure.core.async/timeout timeout}]))

@@ -56,9 +58,9 @@
                     [advance redefs] (fake-timeout)]
                 (with-redefs-fn redefs
                   (fn []
-                    (let [c (execute step)]
+                    (let [s (execute step)]
                       (assert (still-open?) "before adding callback")
-                      (take! c (fn [_] (reset! state false)))
+                      (md/chain (ms/take! s) (fn [_] (reset! state false)))
                       (assert (still-open?) "after adding callback")
                       (advance 5)
                       (assert (still-open?) "before trigger")


bump example reps

bump example reps

--- example/project.clj
+++ example/project.clj
@@ -1,4 +1,4 @@
-(defproject figwheel-example "0.1.6-SNAPSHOT"
+(defproject figwheel-example "0.1.7-SNAPSHOT"
   :description "Just an example of using the lein-figwheel plugin"
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
@@ -8,11 +8,11 @@
                  [sablono "0.2.16"]
                  [crate "0.2.4"]
                  [jayq "2.4.0"]
-                 [figwheel "0.1.6-SNAPSHOT"]]
+                 [figwheel "0.1.7-SNAPSHOT"]]

   :plugins [[lein-ring "0.8.13"]
             [lein-cljsbuild "1.0.3"]
-            [lein-figwheel "0.1.6-SNAPSHOT"]]
+            [lein-figwheel "0.1.7-SNAPSHOT"]]

   ;; this is used for testing an external server
   :ring { :handler example.server/static-server }


[FLINK-10951][tests] Set yarn.nodemanager.vmem-check-enabled to false (#7149)

--- flink-jepsen/src/jepsen/flink/hadoop.clj
+++ flink-jepsen/src/jepsen/flink/hadoop.clj
@@ -40,11 +40,14 @@

 (defn yarn-site-config
   [test]
-  {:yarn.resourcemanager.hostname        (resource-manager (:nodes test))
-   :yarn.log-aggregation-enable          "true"
+  {:yarn.log-aggregation-enable          "true"
+
+   :yarn.nodemanager.log-dirs            yarn-log-dir
    :yarn.nodemanager.resource.cpu-vcores "8"
+   :yarn.nodemanager.vmem-check-enabled  "false"
+
    :yarn.resourcemanager.am.max-attempts "99999"
-   :yarn.nodemanager.log-dirs            yarn-log-dir})
+   :yarn.resourcemanager.hostname        (resource-manager (:nodes test))})

 (defn core-site-config
   [test]


(PCP-854) Honor max-message-size for orchestrator connections

Previously, this setting was only being used to control the max message
size for connections from pxp-agents. That caused orchestrator messages
to use the default 64k limit, which is too small for task requests
involving large metadata. We now thread that setting through to the
outbound connections pcp-broker makes.

--- src/puppetlabs/pcp/broker/core.clj
+++ src/puppetlabs/pcp/broker/core.clj
@@ -735,6 +735,7 @@
         client (pcp-client/connect {:server uri
                                     :ssl-context ssl-context
                                     :type "server"
+                                    :max-message-size (:max-message-size broker)
                                     :on-connect-cb (partial on-controller-connect! broker pcp-uri)
                                     :on-close-cb (partial forget-controller-subscription broker pcp-uri
                                                           controller-disconnection-ms)}


use simple pipeline as default

use simple pipeline as default

--- backend/test/lambdaui/testpipeline/core.clj
+++ backend/test/lambdaui/testpipeline/core.clj
@@ -32,14 +32,14 @@
         trigger-pipeline (lambdacd/assemble-pipeline pipe-with-trigger/pipeline-structure {:home-dir (util/create-temp-dir) :name "TRIGGER PIPELINE" })
         long-running-pipeline (lambdacd/assemble-pipeline long-running-pipe/pipeline-structure {:home-dir (util/create-temp-dir) :name "LONG-RUNNING PIPELINE"})]

-    (reset! current-pipeline trigger-pipeline)
+    (reset! current-pipeline simple-pipeline)

     (reset! server

             (let [routes

                   (routes
-                    (ui/ui-for trigger-pipeline :showStartBuildButton true)
+                    (ui/ui-for simple-pipeline :showStartBuildButton true)
                     (context "/long-running" []
                       (ui/ui-for long-running-pipeline :showStartBuildButton true :contextPath "/long-running")
                       )
@@ -64,4 +64,4 @@

 (defn start []
   (stop)
-  (-main))+  (-main))


when-let is nicer, but polling is whack...

--- clojure/src/dnd/core.cljs
+++ clojure/src/dnd/core.cljs
@@ -74,23 +74,21 @@

 (defn popper! [queue]
   (go-loop [q queue]
-    (when-not (empty? @queue)
-      (let [next-action (peek @queue)
-            action-name (first next-action)
-            args        (rest next-action)
-            function    (case action-name
-                          "move" move-handler
-                          "get"  get-handler
-                          "drop" drop-handler
-                          "inventory" show-inventory
-                          )]
+    (when-let [next-action (peek @queue)
+               action-name (first next-action)
+               args        (rest next-action)
+               function    (case action-name
+                             "move" move-handler
+                             "get"  get-handler
+                             "drop" drop-handler
+                             "inventory" show-inventory
+                             )]

-        (apply function args)
-        (swap! queue pop)))
+      (apply function args)
+      (swap! queue pop))

     (<! (timeout 100))
-    (recur queue))
-  )
+    (recur queue)))

 ;(defn herp [term client]


push events onto queue, game loop pops and applies events

--- clojure/src/dnd/core.cljs
+++ clojure/src/dnd/core.cljs
@@ -1,11 +1,14 @@
 (ns dnd.core
   (:require
     [ cljs.nodejs :as nodejs ]
+    [ cljs.core.async :refer [chan close! <! timeout] ]
     [ dnd.level :as level ]
     [ dnd.character :as character]
     [ dnd.showScreen :as show ]
     [ dnd.keyboard :as keyboard ]
-    ))
+    )
+  (:require-macros
+    [cljs.core.async.macros :as m :refer [go-loop]]))

 (nodejs/enable-util-print!)

@@ -47,16 +50,35 @@
     (character/drop-item! level character lastItem)
     (show/show-screen term @level)))

+(defn popper [queue]
+  (go-loop [q queue]
+    (if (not (empty? @queue))
+      (let [next-action (peek @queue)]
+        ;(println next-action)
+        (apply move-handler next-action)
+        (swap! queue pop))
+      nil)
+
+    (<! (timeout 100))
+    (recur queue))
+  )
+
 (defn -main []
   (.clear term)
   (teardown term)
   (setup term)

+  (def queue (atom #queue []))
+  (defn pusher! [action & arguments] (swap! queue conj arguments))
+
   (keyboard/HandleCharacterKeys term level character)
-  (.on keyboard/emitter "move" move-handler)
-  (.on keyboard/emitter "get" get-handler)
-  (.on keyboard/emitter "drop" drop-handler)
-  (show/show-screen term @level))
+  (.on keyboard/emitter "move" (partial pusher! "move"))
+  (.on keyboard/emitter "get"  (partial pusher! "get"))
+  (.on keyboard/emitter "drop" (partial pusher! "drop"))
+  (show/show-screen term @level)
+  (popper queue)
+  )
+

 (set! *main-cli-fn* -main)


Remove unnecessary import

Remove unnecessary import

--- clojure/src/euler/001.clj
+++ clojure/src/euler/001.clj
@@ -1,8 +1,7 @@
 ; https://projecteuler.net/problem=1

 (ns euler.001
-  (require [clojure.set :refer :all]
-           [clojure.test :refer [is]]))
+  (require [clojure.set :refer :all]))

 (defn multiple-of-n? [n, num]
   (zero? (mod num n)))


CMR-2717: Fixing bad merge of access control routes.

--- access-control-app/src/cmr/access_control/api/routes.clj
+++ access-control-app/src/cmr/access_control/api/routes.clj
@@ -1,41 +1,34 @@
 (ns cmr.access-control.api.routes
   "Defines the HTTP URL routes for the application."
   (:require
-  [compojure.core :refer :all]
+   [cheshire.core :as json]
+   [clojure.string :as str]
+   [cmr.access-control.data.access-control-index :as index]
+   [cmr.access-control.data.acl-schema :as acl-schema]
+   [cmr.access-control.services.acl-search-service :as acl-search]
+   [cmr.access-control.services.acl-service :as acl-service]
+   [cmr.access-control.services.group-service :as group-service]
+   [cmr.access-control.test.bootstrap :as bootstrap]
+   [cmr.acl.core :as acl]
+   [cmr.common-app.api-docs :as api-docs]
+   [cmr.common-app.api.routes :as cr]
+   [cmr.common.api.context :as context]
+   [cmr.common.api.errors :as api-errors]
+   [cmr.common.cache :as cache]
+   [cmr.common.concepts :as cc]
+   [cmr.common.log :refer (debug info warn error)]
+   [cmr.common.mime-types :as mt]
+   [cmr.common.services.errors :as errors]
+   [cmr.common.util :as util]
+   [cmr.common.validations.core :as validation]
+   [cmr.common.validations.json-schema :as js]
+   [compojure.core :refer :all]
    [compojure.handler :as handler]
    [compojure.route :as route]
    [ring.middleware.json :as ring-json]
    [ring.middleware.keyword-params :as keyword-params]
    [ring.middleware.nested-params :as nested-params]
    [ring.middleware.params :as params]))
-    [cheshire.core :as json]
-    [clojure.string :as str]
-    [cmr.access-control.test.bootstrap :as bootstrap]
-    [cmr.access-control.data.access-control-index :as index]
-    [cmr.access-control.data.acl-schema :as acl-schema]
-    [cmr.access-control.services.acl-search-service :as acl-search]
-    [cmr.access-control.services.acl-service :as acl-service]
-    [cmr.access-control.services.group-service :as group-service]
-    [cmr.acl.core :as acl]
-    [cmr.common-app.api-docs :as api-docs]
-    [cmr.common-app.api.routes :as cr]
-    [cmr.common.api.context :as context]
-    [cmr.common.api.errors :as api-errors]
-    [cmr.common.cache :as cache]
-    [cmr.common.concepts :as cc]
-    [cmr.common.log :refer (debug info warn error)]
-    [cmr.common.mime-types :as mt]
-    [cmr.common.services.errors :as errors]
-    [cmr.common.util :as util]
-    [cmr.common.validations.core :as validation]
-    [cmr.common.validations.json-schema :as js]
-    [compojure.core :refer :all]
-    [compojure.handler :as handler]
-    [compojure.route :as route]
-    [ring.middleware.json :as ring-json]
-    [ring.middleware.keyword-params :as keyword-params]
-    [ring.middleware.nested-params :as nested-params]
-    [ring.middleware.params :as params]))

 ;;; Utility Functions


Refactored nREPL service to use get-in-config

--- src/puppetlabs/trapperkeeper/services/nrepl/nrepl_service.clj
+++ src/puppetlabs/trapperkeeper/services/nrepl/nrepl_service.clj
@@ -11,11 +11,10 @@
 (def ^{:private true} default-bind-addr  "0.0.0.0")

 (defn- startup-nrepl
-  [config]
-  {:pre [(map? config)]}
-  (let [enabled?     (parse-bool (get-in config [:nrepl :enabled]))
-        port         (get-in config [:nrepl :port] default-nrepl-port)
-        bind         (get-in config [:nrepl :host] default-bind-addr)]
+  [get-in-config]
+  (let [enabled?     (parse-bool (get-in-config [:nrepl :enabled]))
+        port         (get-in-config [:nrepl :port] default-nrepl-port)
+        bind         (get-in-config [:nrepl :host] default-bind-addr)]
     (if enabled?
       (do (log/info "Starting nREPL service on" bind "port" port)
           (nrepl/start-server :port port :bind bind))
@@ -38,9 +37,9 @@

    The nrepl service will only start if enabled is set to true, and the port specified which port nREPL should bind to.
    If no port is specified then the default port of 7888 is used."
-  {:depends [[:config-service get-config]]
+  {:depends [[:config-service get-in-config]]
    :provides [shutdown]}
-  (let [nrepl-server (startup-nrepl (get-config))]
+  (let [nrepl-server (startup-nrepl get-in-config)]
     {:shutdown (partial shutdown-nrepl nrepl-server)}))


WIP2 Converting popover-form-demo to re-com components and stripping it back.

--- src/re_demo/popover_form_demo.cljs
+++ src/re_demo/popover_form_demo.cljs
@@ -1,17 +1,12 @@
 (ns re-demo.popover-form-demo
   (:require [reagent.core    :as    reagent]
-            [re-com.util     :as    util]
             [re-com.box      :refer [h-box v-box box gap]]
-            [re-com.core    :refer  [button label spinner progress-bar checkbox radio-button]]
-            [re-com.dropdown :refer [single-dropdown find-choice filter-choices-by-keyword]]
+            [re-com.core    :refer  [button checkbox radio-button]]
+            [re-com.dropdown :refer [single-dropdown]]
             [re-com.popover  :refer [popover make-button make-link]]))

 (def show-this-popover? (reagent/atom false))
-
-
-;; ----- PRIMARY FORM
-
 (def initial-form-data (reagent/atom {}))
 (def form-data (reagent/atom {:checkbox1      false
                               :checkbox2      true
@@ -22,18 +17,14 @@
 (defn form-initialise
   []
   (reset! initial-form-data @form-data)
-  (reset! show-this-popover? true)
-  (println "Initialised PRIMARY form: form-data" form-data)
-  (util/console-log-prstr "Initialised PRIMARY form: form-data" form-data))
+  (reset! show-this-popover? true))

 (defn form-submit
-  [event]
+  []
   (let [selected-file ""] ;; (aget (.-target event) "file")
     (swap! form-data assoc :file (.-value selected-file))
     (reset! show-this-popover? false)
-    (println "Submitted PRIMARY form: form-data" form-data)
-    (util/console-log-prstr "Submitted PRIMARY form: form-data" form-data)
     false)) ;; Prevent default "GET" form submission to server

@@ -41,208 +32,75 @@
   []
   (reset! form-data @initial-form-data)
   (reset! show-this-popover? false)
-  (util/console-log-prstr "Cancelled PRIMARY form: form-data" form-data)
   false) ;; Returning false prevent default "GET" form submission to server in on-click event for forms
-
-
-(defn sample-form-DELETE!
-  []
-  [:div {:style {:padding "5px" :background-color "cornsilk" :border "1px solid #eee"}} ;; [:form {:name "pform" :on-submit pform-submit}
-   [:h4 "Checkboxes and Radio buttons"]
-   [:div.container-fluid
-    [:div.row
-     [:div.col-lg-6
-      [:div.checkbox
-       [:label
-        [:input
-         {:type      "checkbox"
-          :name      "cb1"
-          :checked   (:checkbox1 @form-data)
-          :on-change #(swap! form-data assoc :checkbox1 (-> % .-target .-checked))}
-         "Red (toggle disabled)"]]]
-      [:div.checkbox
-       [:label
-        [:input
-         {:type      "checkbox"
-          :name      "cb2"
-          :checked   (:checkbox2 @form-data)
-          :on-change #(swap! form-data assoc :checkbox2 (-> % .-target .-checked))}
-         "Green (initially checked)"]]]
-      [:div.checkbox
-       [:label
-        [:input
-         {:type      "checkbox"
-          :name      "cb3"
-          :disabled  (not (:checkbox1 @form-data))
-          :checked   (:checkbox3 @form-data)
-          :on-change #(swap! form-data assoc :checkbox3 (-> % .-target .-checked))}
-         (if (:checkbox1 @form-data) "Blue" "Blue (disabled)")]]] ;; (str "Blue" (when-not (:checkbox1 @form-data) " (disabled)"))
-      ]
-     [:div.col-lg-6
-      [:div.radio
-       [:label {:for "pf-radio1"}
-        [:input#pf-radio1
-         {:type      "radio"
-          :name      "rgroup"                             ;; TODO: REMOVE ???????????
-          :value     "1"                                  ;; TODO: REMOVE??????
-          :checked   (= (:radio-group @form-data) "1")    ;; TODO: A bit nasty, ideally get from value
-          :on-change #(swap! form-data assoc :radio-group (-> % .-target .-value))} ;; (-> % .-target .-value) ==> "1" ???????????
-         "Hue"]]]
-      [:div.radio
-       [:label {:for "pf-radio2"}
-        [:input#pf-radio2
-         {:type      "radio"
-          :name      "rgroup"
-          :value     "2"
-          :checked   (= (:radio-group @form-data) "2")
-          :on-change #(swap! form-data assoc :radio-group (-> % .-target .-value))}
-         "Saturation (initially checked)"]]]
-      [:div.radio
-       [:label {:for "pf-radio3"}
-        [:input#pf-radio3
-         {:type      "radio"
-          :name      "rgroup"
-          :value     "3"
-          :disabled  (not (:checkbox1 @form-data))
-          :checked   (= (:radio-group @form-data) "3")
-          :on-change #(swap! form-data assoc :radio-group (-> % .-target .-value))}
-         (str "Luminance" (when-not (:checkbox1 @form-data) " (disabled)"))]]]
-      ]]]
-
-   [:hr {:style {:margin "10px 0 10px"}}]
-   [button
-    :label [:span [:span.glyphicon.glyphicon-ok] " Apply"]
-    :on-click form-submit
-    :class "btn-primary"]
-   [:span " "]
-   [button
-    :label [:span [:span.glyphicon.glyphicon-remove] " Cancel"]
-    :on-click form-cancel]
-   ])
-
-
-(defn sample-form
-  []
-  [v-box
-   ;{:style {:padding "5px" :background-color "cornsilk" :border "1px solid #eee"}} ;; [:form {:name "pform" :on-submit pform-submit}
-   :children [[:h4 "Checkboxes and Radio buttons"]
-              [:div.container-fluid
-               [:div.row
-                [:div.col-lg-6
-
-                 [checkbox
-                  :label     "Red (toggle disabled)"
-                  :model     (:checkbox1 @form-data)
-                  :on-change #(swap! form-data assoc :checkbox1 (-> % .-target .-checked))]
-
-                 #_[:div.checkbox
-                  [:label
-                   [:input
-                    {:type      "checkbox"
-                     :name      "cb1"
-                     :checked   (:checkbox1 @form-data)
-                     :on-change #(swap! form-data assoc :checkbox1 (-> % .-target .-checked))}
-                    "Red (toggle disabled)"]]]
-
-                 [:div.checkbox
-                  [:label
-                   [:input
-                    {:type      "checkbox"
-                     :name      "cb2"
-                     :checked   (:checkbox2 @form-data)
-                     :on-change #(swap! form-data assoc :checkbox2 (-> % .-target .-checked))}
-                    "Green (initially checked)"]]]
-                 [:div.checkbox
-                  [:label
-                   [:input
-                    {:type      "checkbox"
-                     :name      "cb3"
-                     :disabled  (not (:checkbox1 @form-data))
-                     :checked   (:checkbox3 @form-data)
-                     :on-change #(swap! form-data assoc :checkbox3 (-> % .-target .-checked))}
-                    (if (:checkbox1 @form-data) "Blue" "Blue (disabled)")]]] ;; (str "Blue" (when-not (:checkbox1 @form-data) " (disabled)"))
-                 ]
-                [:div.col-lg-6
-                 [:div.radio
-                  [:label {:for "pf-radio1"}
-                   [:input#pf-radio1
-                    {:type      "radio"
-                     :name      "rgroup"                             ;; TODO: REMOVE ???????????
-                     :value     "1"                                  ;; TODO: REMOVE??????
-                     :checked   (= (:radio-group @form-data) "1")    ;; TODO: A bit nasty, ideally get from value
-                     :on-change #(swap! form-data assoc :radio-group (-> % .-target .-value))} ;; (-> % .-target .-value) ==> "1" ???????????
-                    "Hue"]]]
-                 [:div.radio
-                  [:label {:for "pf-radio2"}
-                   [:input#pf-radio2
-                    {:type      "radio"
-                     :name      "rgroup"
-                     :value     "2"
-                     :checked   (= (:radio-group @form-data) "2")
-                     :on-change #(swap! form-data assoc :radio-group (-> % .-target .-value))}
-                    "Saturation (initially checked)"]]]
-                 [:div.radio
-                  [:label {:for "pf-radio3"}
-                   [:input#pf-radio3
-                    {:type      "radio"
-                     :name      "rgroup"
-                     :value     "3"
-                     :disabled  (not (:checkbox1 @form-data))
-                     :checked   (= (:radio-group @form-data) "3")
-                     :on-change #(swap! form-data assoc :radio-group (-> % .-target .-value))}
-                    (str "Luminance" (when-not (:checkbox1 @form-data) " (disabled)"))]]]
-                 ]]]
-
-              [:hr {:style {:margin "10px 0 10px"}}]
-              [button
-               :label [:span [:span.glyphicon.glyphicon-ok] " Apply"]
-               :on-click form-submit
-               :class "btn-primary"]
-              [:span " "]
-              [button
-               :label [:span [:span.glyphicon.glyphicon-remove] " Cancel"]
-               :on-click form-cancel]
-              ]
-   ])

 (defn popover-form
   []
-  [:div
-   [:h3 "Primary Form"]
-   [:p "Here is a form which has some events"]
-   [sample-form]])
+  [v-box
+   :children [[:h4 "Checkboxes and Radio buttons"]
+              [h-box
+               :children [[v-box
+                           :size     "auto"
+                           :children [[checkbox
+                                       :label     "Red (toggle disabled)"
+                                       :model     (:checkbox1 @form-data)
+                                       :on-change #(swap! form-data assoc :checkbox1 %)]
+                                      [checkbox
+                                       :label     "Green (initially checked)"
+                                       :model     (:checkbox2 @form-data)
+                                       :on-change #(swap! form-data assoc :checkbox2 %)]
+                                      [checkbox
+                                       :label     (str "Blue" (when (:checkbox1 @form-data) " (disabled)"))
+                                       :model     (:checkbox3 @form-data)
+                                       :disabled  (:checkbox1 @form-data)
+                                       :on-change #(swap! form-data assoc :checkbox3 %)]]]
+                          [v-box
+                           :size     "auto"
+                           :children [[radio-button
+                                       :label     "Hue"
+                                       :value     "1"
+                                       :model     (:radio-group @form-data)
+                                       :on-change #(swap! form-data assoc :radio-group "1")]
+                                      [radio-button
+                                       :label     "Saturation (initially checked)"
+                                       :value     "2"
+                                       :model     (:radio-group @form-data)
+                                       :on-change #(swap! form-data assoc :radio-group "2")]
+                                      [radio-button
+                                       :label     (str "Luminance" (when (:checkbox1 @form-data) " (disabled)"))
+                                       :value     "3"
+                                       :model     (:radio-group @form-data)
+                                       :disabled  (:checkbox1 @form-data)
+                                       :on-change #(swap! form-data assoc :radio-group "3")]]]]]
+              [:hr {:style {:margin "10px 0 10px"}}]
+              [h-box
+               :gap      "10px"
+               :children [[button
+                           :label [:span [:span.glyphicon.glyphicon-ok] " Apply"]
+                           :on-click form-submit
+                           :class "btn-primary"]
+                          [button
+                           :label [:span [:span.glyphicon.glyphicon-remove] " Cancel"]
+                           :on-click form-cancel]]]]])

 (defn popover-title
   []
-  [:div "Arbitrary " [:strong "markup"] " example (" [:span {:style {:color "red"}} "red text"] ")"
-   [button :label "×" :on-click form-cancel
+  [:div "Arbitrary " [:strong "markup "] [:span {:style {:color "red"}} "title"]
+   [button
+    :label "×"
+    :on-click form-cancel
     :class "close"
-    :style {:font-size "36px" :margin-top "-8px"}]
-   ])
-
-
-(defn red-button
-  []
-  [:input.btn.btn-danger
-   {:type     "button"
-    :value    "Popover Form"
-    :style    {:flex-grow 0
-               :flex-shrink 1
-               :flex-basis "auto"}
-    :on-click #(if @show-this-popover?
-                 (form-cancel)
-                 (form-initialise))
-    }])
+    :style {:font-size "36px" :margin-top "-8px"}]])

 (defn show
   []
-  (let [popover-content {:width         500
-                         :title         [popover-title]
-                         :close-button? false            ;; We have to add our own close button because it does more than simply close the popover
-                         :body          [popover-form]}
+  (let [popover-content {:width             500
+                         :title             [popover-title]
+                         :close-button?     false            ;; We have to add our own close button because it does more than simply close the popover
+                         :body              [popover-form]}
         popover-options {:arrow-length      15
                          :arrow-width       10
                          :backdrop-callback form-cancel
@@ -250,6 +108,11 @@
     [popover
      :position :below-center
      :showing? show-this-popover?
-     :anchor   [red-button]
+     :anchor   [button
+                :label    "Popover Form"
+                :on-click #(if @show-this-popover?
+                            (form-cancel)
+                            (form-initialise))
+                :class    "btn btn-danger"]
      :popover  popover-content
      :options  popover-options]))


fix android webview svg

fix android webview svg

Signed-off-by: Pedro Pombeiro <f8c34e1c5d363d76a4b9e8313641f62c1029c3e7@users.noreply.github.com>

--- src/status_im/ui/components/svgimage.cljs
+++ src/status_im/ui/components/svgimage.cljs
@@ -51,7 +51,5 @@
            :third-party-cookies-enabled false
            :scroll-enabled              false
            :bounces                     false
-           :scales-page-to-fit          platform/android?
            :style                       {:width @width :height (* @width k) :background-color :transparent}
-           :origin-whitelist             #js ["*"]
            :source                      {:html (html uri @width (* @width k))}}]]))))


Ensure only one segment is retried in colors-flow-test

--- test/onyx/peer/colors_flow_test.clj
+++ test/onyx/peer/colors_flow_test.clj
@@ -171,9 +171,19 @@
 (def green-out-calls
   {:lifecycle/before-task-start inject-green-out-ch})

+(def retry-counter
+  (atom (long 0)))
+
+(def retry-calls
+  {:lifecycle/after-retry-segment (fn retry-count-inc [event message-id rets lifecycle]
+                                    (swap! retry-counter inc))})
+
+
 (def lifecycles
   [{:lifecycle/task :colors-in
     :lifecycle/calls :onyx.peer.colors-flow-test/colors-in-calls}
+   {:lifecycle/task :colors-in
+    :lifecycle/calls :onyx.peer.colors-flow-test/retry-calls}
    {:lifecycle/task :colors-in
     :lifecycle/calls :onyx.plugin.core-async/reader-calls}
    {:lifecycle/task :red-out
@@ -256,6 +266,7 @@
 (fact (into #{} green) => green-expectatations)
 (fact (into #{} red) => red-expectatations)
 (fact (into #{} blue) => blue-expectatations)
+(fact @retry-counter => 1)

 (close! colors-in-chan)


added tenses for turn-off

added tenses for turn-off

--- src/babel/english/lexicon-verbcoach.clj
+++ src/babel/english/lexicon-verbcoach.clj
@@ -2119,6 +2119,9 @@
     {:phrasal-verb true
      :synsem {:cat :verb
               :sem {:pred :turn-off}
+              :english {:past "turned off"
+                        :present {:3sing "turns off"}
+                        :participle "turning off"}
               :subcat {:3 {:cat :prep
                            :sem {:pred :off}}}}}


kafka streams first exp has been failed

kafka streams first exp has been failed

--- extra_components/kafka/src/clj/hellhound/kafka/core.clj
+++ extra_components/kafka/src/clj/hellhound/kafka/core.clj
@@ -43,9 +43,11 @@

 (reset! _builder nil)

+(def ss (stream "something"))
 (def a (streams {"application.id"    "test.app"
-                 "bootstrap.servers" ["localhost:29092"]}))
+                 "retries"           "1"
+                 "bootstrap.servers" ["localhost:9092"]}))

-(.forEach s cb)
-  ;;(.start a))
-  ;;(.close a))
+(.foreach ss cb)
+(.start a)
+(.close a)


Change wording in placeholder to be more reasonable

--- src/discuss/translations.cljs
+++ src/discuss/translations.cljs
@@ -34,7 +34,7 @@
         :discussion {:add-position "Nichts von all dem. Ich habe eine andere Idee"
                      :add-position-heading "Ich denke, "
                      :add-position-placeholder "wir dieses oder jenes machen sollten"
-                     :add-reason-placeholder "aus diesen und jenen Gründen"
+                     :add-reason-placeholder "dieser Grund dafür existiert"
                      :bubble/congrats "Sie haben das Ende der Diskussion erreicht. Suchen Sie sich einen anderen Einstiegspunkt in dem Artikel, um weiter zu diskutieren."
                      :current      "Aktuelle Diskussion"
                      :reference/missing "Sie müssen sich auf eine Textstelle beziehen"


Tidy up the translations

Tidy up the translations

--- src/discuss/translations.cljs
+++ src/discuss/translations.cljs
@@ -1,39 +1,32 @@
 (ns discuss.translations
   (:require [discuss.utils.common :as lib]))

-(def translations {:de {:common     {
-                                     :and             "und"
+(def translations {:de {:common     {:and             "und"
                                      :author          "Autor"
                                      :back            "Zurück"
                                      :chars-remaining "Zeichen verbleibend"
                                      :hello           "Hallo"
-                                     :issue           "Diskussionsthema"
-                                     }
+                                     :issue           "Diskussionsthema"}
                         :discussion {:add-argument "Ein neues Argument hinzufügen"
                                      :current      "Aktuelle Diskussion"
                                      :restart      "Neustarten"
                                      :submit       "Abschicken"}
-                        :references {
-                                     :jump       "Springe in die Diskussion"
+                        :references {:jump       "Springe in die Diskussion"
                                      :usages     "In welchen Argumenten wird dieser Textausschnitt verwendet?"
-                                     :where-used "Wo wird diese Referenz verwendet?"
-                                     }}
+                                     :where-used "Wo wird diese Referenz verwendet?"}}
                    :en {:common     {:and             "and"
                                      :author          "Author"
                                      :back            "Back"
                                      :chars-remaining "characters remaining"
                                      :hello           "Hello"
-                                     :issue           "Issue"
-                                     }
+                                     :issue           "Issue"}
                         :discussion {:add-argument "Add a new argument"
                                      :current      "Current Discussion"
                                      :restart      "Restart"
                                      :submit       "Submit"}
-                        :references {
-                                     :jump       "Jump into the discussion"
+                        :references {:jump       "Jump into the discussion"
                                      :usages     "In which arguments has this reference been used?"
-                                     :where-used "Where has this reference been used?"
-                                     }}})
+                                     :where-used "Where has this reference been used?"}}})

 (defn translate
   "Get translation string according to currently configured language."


Add another field to the app-state

Add another field to the app-state

--- src/discuss/utils/common.cljs
+++ src/discuss/utils/common.cljs
@@ -38,7 +38,8 @@
                 :clipboard  {:selections nil
                              :current    nil}
                 :sidebar    {:show? true}
-                :common     {:references []}}))
+                :common     {:references []
+                             :reference-usages {}}}))

 (defn str->int
   "Convert String to Integer."


remove dead code

remove dead code

--- src/clj/lambdacd/internal/execution.clj
+++ src/clj/lambdacd/internal/execution.clj
@@ -27,10 +27,6 @@
              (if (is-finished key value)
                new-result
                (recur new-result))))))))
-
-(defn- process-channel-result [c ctx]
-  (async/<!!
-    (process-channel-result-async c ctx)))

 (defn- process-final-result [step-result ctx]
   (let [new-step-result (assoc step-result :status (get step-result :status :undefined))]


adverts published in all countries

adverts published in all countries

--- src/clj/salava/extra/application/db.clj
+++ src/clj/salava/extra/application/db.clj
@@ -179,7 +179,7 @@
                                   :markdown_text (u/alt-markdown criteria)})})))

 (defn advert-owners "return all users in country where badge is advertised" [ctx country]
-  (let [owners (select-advert-owners {:country country} (u/get-db ctx))]
+  (let [owners (if-not (string/blank? country) (select-advert-owners {:country country} (u/get-db ctx)) (select-all-owners {} (u/get-db ctx)))]
     owners))

 (defn insert-advert-owners! "Creates event owners for advert" [ctx data]


Change implementation of clearing contact.

Change the implementation of clearing the newly added contact from
directly manipulating the value property of the (contact) input field to
manipulating the :text component of the application state.

This change moves ClojureScript code from "Windows UI code that directly
manipulates the UI controls" to "MVC-style" code that changes the model
(`app-state`) which results in changing the view.

Amazing.

--- basic/om-tut/src/om_tut/core.cljs
+++ basic/om-tut/src/om_tut/core.cljs
@@ -37,7 +37,9 @@
         new-contact (-> input .-value parse-contact)]
     (when new-contact
       (om/transact! data :contacts #(conj % new-contact))
-      (set! (.-value input) ""))))
+      ;; Clear the (contact) text field **not** by directly setting the value of the HTML component by by setting the
+      ;; state of the application state tagged by :text.
+      (om/set-state! owner :text ""))))

 (defn middle-name [{:keys [middle middle-initial]}]
   (cond


Removed blank? from validation namespace as there's already one in str-utils.

Signed-off-by: James Reeves <9dadf8ecafa226c8f7c16002bdcb090267879343@weavejester.com>

--- src/compojure/validation/predicates.clj
+++ src/compojure/validation/predicates.clj
@@ -1,9 +1,4 @@
 (ns compojure.validation)
-
-(defn blank?
-  "True if x is nil or an empty string."
-  [x]
-  (or (nil? x) (= x "")))

 (defn present?
   "True if x is not nil and not an empty string."


Use more correct 409 response for undeletable jobs

--- src/engulf/web_views/jobs.clj
+++ src/engulf/web_views/jobs.clj
@@ -33,7 +33,7 @@
     (if (:ended-at job)
       (do (jmgr/delete-job-by-uuid uuid)
           (json-resp 200 {:message "Deleted"}))
-      (json-resp 500 {:message "Could not delete, still running!"}))
+      (json-resp 409 {:message "Could not delete, still running!"}))
     (json-resp 404 {:message "Not found!"})))

 (defpage "/jobs" {:keys [page per-page]}


Starting problem 73. (Tic-Tac-Toe Board)

--- src/fourclojure/4_clojure.clj
+++ src/fourclojure/4_clojure.clj
@@ -60,7 +60,7 @@
 ; 4. Combine sets found in parts 2 and 3
 ; Well, didn't manage to find correct solution as per above, now trying wikipedia way:
 ; https://en.wikipedia.org/wiki/Power_set
-(defn- ^:private op-f [e t]
+(defn- op-f [e t]
   (map #(conj % e) t))

 (defn powerset [s]