Tweak some options

Tweak some options

--- src/overtone_workspace/grunbles.clj
+++ src/overtone_workspace/grunbles.clj
@@ -4,11 +4,11 @@
 ;; Inspired by an example in an early chapter of the SuperCollider book

 (definst grumble [freq 440 freq-mul 1 speed 6 attack 10 release 50]
-  (let [snd (mix (map #(* (lf-tri (* % freq-mul freq))
+  (let [snd (mix (map #(* (saw (* % freq-mul freq))
                           (max 0 (+ (lf-noise1:kr speed)
                                     (env-gen (perc attack release) :action FREE))))
                       [1 (/ 2 3) (/ 3 2) 2]))]
-    (pan2 snd (sin-osc:kr 1))))
+    (pan2 snd (sin-osc:kr 50))))

 ;;(stop)
 ;; (grumble)


fix bad counting bug for :user-vote-counts

--- src/polismath/math/conversation.clj
+++ src/polismath/math/conversation.clj
@@ -212,10 +212,11 @@
                   (count (nm/colnames rating-mat)))

    :user-vote-counts
-                (plmb/fnk [rating-mat]
+                (plmb/fnk [raw-rating-mat]
                   ; For deciding in-conv below; filter ptpts based on how much they've voted
                   (->> (mapv
-                         (fn [rowname row] [rowname (count (remove nil? row))])
+                         (fn [rowname row]
+                           [rowname (count (remove nil? row))])
                          (nm/rownames rating-mat)
                          (nm/get-matrix rating-mat))
                        (into {})))


More tests for creation via different args

--- test/cljc/spec_tools/core_test.cljc
+++ test/cljc/spec_tools/core_test.cljc
@@ -39,7 +39,8 @@

     (testing "creation"
       (is (= (st/spec integer?)
-             (st/spec {:pred integer?}))))
+             (st/spec {:pred integer?})
+             (st/spec integer? {}))))

     (testing "wrapped predicate work as a predicate"
       (is (true? (my-integer? 1)))
@@ -83,6 +84,7 @@
   (testing "creation"
     (is (= (st/doc integer? {:description "kikka"})
            (st/doc {:pred integer?, :description "kikka"})
+           (st/doc integer? {:description "kikka"})
            (st/spec {:pred integer?, :description "kikka", :spec/type nil}))))

   (testing "just docs, #12"


(maint) Refactor handle-request for reuse

This change doesn't have any value for this project on its own, but it
is necessary for downstream consumers (like PE) which will consume this
code directly.

--- src/clj/puppetlabs/services/request_handler/request_handler_core.clj
+++ src/clj/puppetlabs/services/request_handler/request_handler_core.clj
@@ -265,18 +265,31 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Public

+(defn handle-request*
+  [request jruby-instance config]
+  (->> request
+    wrap-params-for-jruby
+    (as-jruby-request config)
+    clojure.walk/stringify-keys
+    make-request-mutable
+    (.handleRequest jruby-instance)
+    response->map))
+
+(defmacro with-error-handling
+  [request & body]
+  `(sling/try+
+     ~@body
+     (catch bad-request? e#
+       (output-error ~request e# 400))
+     (catch jruby-timeout? e#
+       (output-error ~request e# 503))))
+
+; NB - this function is basically copied into the PE version of puppet server.
+; If you change this function, you should probably change the corresponding
+; function in puppetlabs.enterprise.services.request-handler.request-handler-service
+
 (defn handle-request
   [request jruby-service config]
-  (sling/try+
+  (with-error-handling request
     (jruby/with-jruby-puppet jruby-instance jruby-service
-      (->> request
-           wrap-params-for-jruby
-           (as-jruby-request config)
-           clojure.walk/stringify-keys
-           make-request-mutable
-           (.handleRequest jruby-instance)
-           response->map))
-    (catch bad-request? e
-      (output-error request e 400))
-    (catch jruby-timeout? e
-      (output-error request e 503))))
+      (handle-request* request jruby-instance config))))


STORM-549: "topology.enable.message.timeouts" does nothing

The ability to turn off message timeouts doesn't work.
The value is a true/false value that is represented as
a Java Boolean. The check for the truthiness used the
clojure not function. The idea was, turn off message
timeouts if "topology.enable.message.timeouts" is not true.
Unfortunately this won't worth with clojure's definition of
truthiness as:

(not (Boolean. false))

evaluates to true.

This commit updates the logic to compare the Java Boolean
"topology.enable.message.timeouts" to false using the
= function which will work.

--- storm-core/src/clj/backtype/storm/daemon/executor.clj
+++ storm-core/src/clj/backtype/storm/daemon/executor.clj
@@ -301,7 +301,7 @@
         context (:worker-context executor-data)]
     (when tick-time-secs
       (if (or (system-id? (:component-id executor-data))
-              (and (not (storm-conf TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS))
+              (and (= false (storm-conf TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS))
                    (= :spout (:type executor-data))))
         (log-message "Timeouts disabled for executor " (:component-id executor-data) ":" (:executor-id executor-data))
         (schedule-recurring


[ci skip] People flow test.

[ci skip] People flow test.

--- test/onyx/peer/people_flow_test.clj
+++ test/onyx/peer/people_flow_test.clj
@@ -132,6 +132,58 @@
     :flow/to [:process-everyone]
     :flow/predicate :onyx.peer.people-flow-test/constantly-true}])

+(defn inject-people-in-ch [event lifecycle]
+  {:core.async/chan people-in-chan})
+
+(defn inject-children-out-ch [event lifecycle]
+  {:core.async/chan children-out-chan})
+
+(defn inject-adults-out-ch [event lifecycle]
+  {:core.async/chan adults-out-chan})
+
+(defn inject-athletes-wa-out-ch [event lifecycle]
+  {:core.async/chan athletes-wa-out-chan})
+
+(defn inject-everyone-out-ch [event lifecycle]
+  {:core.async/chan everyone-out-chan})
+
+(def people-in-calls
+  {:lifecycle/before-task :onyx.peer.min-peers-test/inject-people-in-ch})
+
+(def children-out-calls
+  {:lifecycle/before-task :onyx.peer.min-peers-test/inject-children-out-ch})
+
+(def adults-out-calls
+  {:lifecycle/before-task :onyx.peer.min-peers-test/inject-adults-out-ch})
+
+(def athletes-wa-out-calls
+  {:lifecycle/before-task :onyx.peer.min-peers-test/inject-athletes-wa-out-ch})
+
+(def everyone-out-calls
+  {:lifecycle/before-task :onyx.peer.min-peers-test/inject-everyone-out-ch})
+
+(def lifecycles
+  [{:lifecycle/task :people-in
+    :lifecycle/calls :onyx.peer.min-peers-test/people-in-calls}
+   {:lifecycle/task :people-in
+    :lifecycle/calls :onyx.plugin.core-async/reader-calls}
+   {:lifecycle/task :children-out
+    :lifecycle/calls :onyx.peer.min-peers-test/children-out-calls}
+   {:lifecycle/task :children-out
+    :lifecycle/calls :onyx.plugin.core-async/writer-calls}
+   {:lifecycle/task :adults-out
+    :lifecycle/calls :onyx.peer.min-peers-test/adults-out-calls}
+   {:lifecycle/task :adults-out
+    :lifecycle/calls :onyx.plugin.core-async/writer-calls}
+   {:lifecycle/task :athletes-wa-out
+    :lifecycle/calls :onyx.peer.min-peers-test/athletes-wa-out-calls}
+   {:lifecycle/task :athletes-wa-out
+    :lifecycle/calls :onyx.plugin.core-async/writer-calls}
+   {:lifecycle/task :everyone-out
+    :lifecycle/calls :onyx.peer.min-peers-test/everyone-out-calls}
+   {:lifecycle/task :everyone-out
+    :lifecycle/calls :onyx.plugin.core-async/writer-calls}])
+
 (defn child? [event old {:keys [age]} all-new max-child-age]
   (<= age max-child-age))


Moved dns-alt-names test

Moved dns-alt-names test

--- test/puppetlabs/master/certificate_authority_test.clj
+++ test/puppetlabs/master/certificate_authority_test.clj
@@ -355,13 +355,6 @@
             (is (utils/public-key? key))
             (is (= 512 (utils/keylength key)))))

-        (finally
-          (fs/delete serial-number-file)
-          (fs/delete-dir ssldir)))))
-
-  (deftest initialize-master!-alt-dns-names-test
-    (let [serial-number-file (temp-serial-number-file)]
-      (try
         (let [alt-names ["onefish", "twofish"]
               master-name "master"
               ca-name "Puppet CA: localhost"
@@ -386,6 +379,7 @@
                        "addition to the master name itsef.")))))

         (finally
+          (fs/delete serial-number-file)
           (fs/delete-dir ssldir)))))

   (deftest initialize!-test


Be tolerant of missing dev deps

Be tolerant of missing dev deps

--- web/src/immutant/web/middleware.clj
+++ web/src/immutant/web/middleware.clj
@@ -13,14 +13,18 @@
 ;; limitations under the License.

 (ns ^{:no-doc true} immutant.web.middleware
-    (:require [immutant.internal.util :refer [require-resolve]]))
+    (:require [immutant.internal.util :refer [try-resolve]]))

 (defn wrap-dev-middleware
   "Assumes ring/ring-devel is available on the classpath"
   [handler]
-  (let [wrap-reload           (require-resolve 'ring.middleware.reload/wrap-reload)
-        wrap-stacktrace       (require-resolve 'ring.middleware.stacktrace/wrap-stacktrace)
-        classpath-directories (require-resolve 'clojure.java.classpath/classpath-directories)]
-    (-> handler
-      (wrap-reload {:dirs (map str (classpath-directories))})
-      wrap-stacktrace)))
+  (let [wrap-reload           (try-resolve 'ring.middleware.reload/wrap-reload)
+        wrap-stacktrace       (try-resolve 'ring.middleware.stacktrace/wrap-stacktrace)
+        classpath-directories (try-resolve 'clojure.java.classpath/classpath-directories)]
+    (if wrap-reload
+      (-> handler
+        (wrap-reload {:dirs (map str (classpath-directories))})
+        wrap-stacktrace)
+      (do
+        (println "WARN: ring/ring-devel not found; reloading middleware not added")
+        handler))))


binding index-fn works as expected

binding index-fn works as expected

--- src/babel/english/lab.cljc
+++ src/babel/english/lab.cljc
@@ -15,14 +15,32 @@
 (defn nursery
   "very fast and easy sentences."
   []
-  (let [spec {:synsem {:cat :verb
+  (let [
+        small-lexicon
+        (into {}
+              (for [[k v] (:lexicon model)]
+                (let [filtered-v
+                      (filter #(or (= "I" (u/get-in % [:english :english]))
+                                   (= "sleep" (u/get-in % [:english :english])))
+                              v)]
+                  (if (not (empty? filtered-v))
+                    [k filtered-v]))))
+        indices (babel.index/create-indices
+                 small-lexicon babel.english.grammar/index-lexicon-on-paths)
+        index-fn (fn [spec] (babel.index/lookup-spec
+                             spec
+                             indices
+                             babel.english.grammar/index-lexicon-on-paths))
+        spec {:synsem {:cat :verb
                        :subcat []}
               :comp {:phrasal false}
               :head {:phrasal false}}]
     (repeatedly
      #(println
        (morph (binding [babel.generate/println? false
-                        babel.generate/truncate? true]
+                        babel.generate/truncate? true
+                        babel.generate/index-fn index-fn]
+
                 (time (generate spec model)))
               :show-notes false)))))

@@ -73,8 +91,8 @@

     (repeatedly #(println
                   (let [spec spec]
-                    (let [result (morph-ps (time (binding [babel.generate/println? false]
-                                                        babel.generate/truncate? false
+                    (let [result (morph-ps (time (binding [babel.generate/println? false
+                                                           babel.generate/truncate? false]
                                                    (wait wait-ms-for-generation
                                                       (fn []
                                                         (generate spec model))))))]


Only list people in "add person" if they're not already in the event, fixing #7

--- src/cljs/herder/event.cljs
+++ src/cljs/herder/event.cljs
@@ -1,10 +1,11 @@
 (ns herder.event
   (:require
    [herder.helpers :refer [convention-header nav!]]
-   [herder.getter :refer [get-data event-url]]
+   [herder.getter :refer [get-data get-mapped-data event-url]]
    [herder.state :refer [state]]
    [reagent.core :as r]
-   [ajax.core :refer [PATCH DELETE]]))
+   [ajax.core :refer [PATCH DELETE]]
+   [clojure.set :refer [difference]]))

 (defn get-person [id]
   (merge {:id id}
@@ -33,7 +34,8 @@
     (fn []
       (let [event (get-data [:event (:id @state) (:event_id @state)])
             convention (get-data [:convention (:id @state)])
-            days (+ 1 (/ (- (js/moment (:to convention)) (js/moment (:from convention))) 86400000))]
+            days (+ 1 (/ (- (js/moment (:to convention)) (js/moment (:from convention))) 86400000))
+            persons (get-mapped-data [:persons (:id @state)])]
         [:div {:class "container-fluid"}
          [convention-header :events]
          [:h2 "Event: " (:name event)]
@@ -58,7 +60,8 @@
                      :value (:person @val)
                      :on-change #(swap! val assoc :person (-> % .-target .-value))}
             [:option {:value ""} " Select "]
-            (for [{:keys [id name]} (get-data [:persons (:id @state)])]
+            (for [id (sort-by #(:name (get persons %)) (difference (set (keys persons)) (set (:persons event))))
+                  :let [name (:name (get persons id))]]
               ^{:key id} [:option {:value id} name])]

            [:button {:type "button"


Simplify

Simplify

--- src/reagent/impl/util.cljs
+++ src/reagent/impl/util.cljs
@@ -134,7 +134,7 @@
                (str "Property must be a map, not " (pr-str p1)))
        (merge p1 (merge-style p1 (merge-class p1 p2))))))
   ([p1 p2 & ps]
-   (apply merge-props (cons (merge-props p1 p2) ps))))
+   (apply merge-props (merge-props p1 p2) ps)))

 (def ^:dynamic *always-update* false)


wrap auth & sync routes in api-defaults

wrap auth & sync routes in api-defaults

--- src/chat/server/handler.clj
+++ src/chat/server/handler.clj
@@ -3,7 +3,7 @@
   (:require [org.httpkit.server :refer [run-server]]
             [compojure.route :refer [resources]]
             [compojure.core :refer [GET POST routes defroutes context]]
-            [ring.middleware.defaults :refer [wrap-defaults secure-site-defaults site-defaults]]
+            [ring.middleware.defaults :refer [wrap-defaults api-defaults secure-site-defaults site-defaults]]
             [ring.middleware.edn :refer [wrap-edn-params]]
             [clojure.string :as string]
             [clojure.tools.nrepl.server :as nrepl]
@@ -32,14 +32,10 @@
     (let [fail {:status 400 :headers {"Content-Type" "text/plain"}}]
       (cond
         (string/blank? password) (assoc fail :body "Must provide a password")
-
         (not (invites/verify-hmac hmac (str now token invite_id email))) (assoc fail :body "Invalid HMAC")
-
         (string/blank? invite_id) (assoc fail :body "Invalid invitation ID")
-
         ; TODO: be smarter about this
         (not (#{"image/jpeg" "image/png"} (:content-type avatar))) (assoc fail :body "Invalid image")
-

         :else
         (let [invite (db/with-conn (db/get-invite (java.util.UUID/fromString invite_id)))]
@@ -58,14 +54,16 @@
                :session (assoc (req :session) :user-id (user :id))
                :body ""}))))))

+  (POST "/logout" req
+    {:status 200 :session nil}))
+
+(defroutes api-routes
   (POST "/auth" req
     (if-let [user-id (let [{:keys [email password]} (req :params)]
                        (when (and email password)
                          (db/with-conn (db/authenticate-user email password))))]
       {:status 200 :session (assoc (req :session) :user-id user-id)}
-      {:status 401}))
-  (POST "/logout" req
-    {:status 200 :session nil}))
+      {:status 401})))

 (defroutes resource-routes
   (resources "/"))
@@ -75,20 +73,27 @@
                                     :port 6379}})

 (def app
-  (->
+  (routes
     (wrap-defaults
-      (routes
-        resource-routes
-        site-routes
-        sync-routes)
-      (-> site-defaults ; ssl stuff will be handled by nginx
+      (routes sync-routes api-routes)
+      (-> api-defaults
           (assoc-in [:session :cookie-attrs :secure] (= (env :environment) "prod"))
           (assoc-in [:session :store] (carmine/carmine-store *redis-conf*
                                                              {:expiration-secs (* 60 60 24 7)
-                                                              :key-prefix "lpchat"}))
-          (assoc-in [:security :anti-forgery]
-            {:read-token (fn [req] (-> req :params :csrf-token))})))
-      wrap-edn-params))
+                                                              :key-prefix "lpchat"}))))
+      (->
+        (wrap-defaults
+          (routes
+            resource-routes
+            site-routes)
+          (-> site-defaults ; ssl stuff will be handled by nginx
+              (assoc-in [:session :cookie-attrs :secure] (= (env :environment) "prod"))
+              (assoc-in [:session :store] (carmine/carmine-store *redis-conf*
+                                                                 {:expiration-secs (* 60 60 24 7)
+                                                                  :key-prefix "lpchat"}))
+              (assoc-in [:security :anti-forgery]
+                {:read-token (fn [req] (-> req :params :csrf-token))})))
+        wrap-edn-params)))

 (defonce server (atom nil))


print to a file

print to a file

--- src/clueweb_disqus/core.clj
+++ src/clueweb_disqus/core.clj
@@ -155,7 +155,8 @@
            (doseq [c content-to-write]
              (pprint c wrtr)
              (when (< 0 (get c "posts"))
-               (println (get c "id") threads-wrtr)))))
+               (binding [*out* threads-wrtr]
+                 (println (get c "id")))))))
         (if (.exists (java.io.File. stats-f-to-write))
           (let [cnt
                 (+ (read-string (slurp stats-f-to-write))


[#818] Confirm delete for user roles

[#818] Confirm delete for user roles

--- Dashboard/app/cljs/src/org/akvo/flow/dashboard/users/user_details.cljs
+++ Dashboard/app/cljs/src/org/akvo/flow/dashboard/users/user_details.cljs
@@ -83,9 +83,23 @@

 (defn actions [user-auth owner]
-  (om/component
-   (html
-    [:a {:on-click #(dispatch :user-auth/delete user-auth)} (b/icon :remove) " " (t> _delete)])))
+  (reify
+    om/IInitState
+    (init-state [this]
+      {:confirm-delete? false})
+    om/IRenderState
+    (render-state [this {:keys [confirm-delete?]}]
+      (html
+       (if confirm-delete?
+        [:span
+         [:strong (t> _delete) "?"]
+         (b/btn-link {:on-click #(do (om/set-state! owner :confirm-delete? false)
+                                     (dispatch :user-auth/delete user-auth))}
+                     (t> _yes))
+         " / "
+         (b/btn-link {:on-click #(om/set-state! owner :confirm-delete? false)} (t> _no))]
+        (b/btn-link {:on-click #(om/set-state! owner :confirm-delete? true)} :remove (t> _delete)))))))
+

 (defn role-label [{:strs [name]} owner]
   (om/component
@@ -193,6 +207,7 @@
                                   {:title (t> _resource)
                                    :cell-fn #(get % "objectPath")}
                                   {:title (t> _actions)
+                                   :class "text-center"
                                    :component actions}]})]))))

 (defn generate-apikeys [owner user]


Fix a typehint

Fix a typehint

--- src/frereth_common/util.clj
+++ src/frereth_common/util.clj
@@ -23,7 +23,7 @@
   [as]
   (map #(.toString %) as))

-(s/defn interpret-modifiers :- s/Keyword
+(s/defn interpret-modifiers :- [s/Keyword]
   [ms :- s/Int]
   ;; TODO: this implementation sucks
   (let [dict {Modifier/ABSTRACT :abstract


fix some referencing bugs in the template

--- src/leiningen/new/closp.clj
+++ src/leiningen/new/closp.clj
@@ -82,7 +82,7 @@

               [(str "src/cljs/{{san-path}}/home/views.cljs") (*render* "cljs/home/views.cljs")]

-              [(str "src/cljs/{{san-path}}/home/third_party/http_fx.cljs") (*render* "cljs/third_party/http_fx.cljs")]
+              [(str "src/cljs/{{san-path}}/third_party/http_fx.cljs") (*render* "cljs/third_party/http_fx.cljs")]

               [(str "src/cljs/{{san-path}}/user/events.cljs") (*render* "cljs/user/events.cljs")]
               [(str "src/cljs/{{san-path}}/user/helper.cljs") (*render* "cljs/user/helper.cljs")]


altlaw/load_all.clj: temporarily comment out jobs while porting

--- src/org/altlaw/load_all.clj
+++ src/org/altlaw/load_all.clj
@@ -1,22 +1,22 @@
 (ns org.altlaw.load-all
   (:require
-   org.altlaw.jobs.distindex
-   org.altlaw.jobs.genhtml
-   org.altlaw.jobs.getindexes
-   org.altlaw.jobs.graph
-   org.altlaw.jobs.graph-map
-   org.altlaw.jobs.link.linkincites
-   org.altlaw.jobs.link.linkincites-mapred
-   org.altlaw.jobs.link.linkoutcites
-   org.altlaw.jobs.link.linkoutcites-mapred
-   org.altlaw.jobs.link.mergedocs
-   org.altlaw.jobs.link.mergedocs-mapred
-   org.altlaw.jobs.procfiles.altcrawl
+;;    org.altlaw.jobs.distindex
+;;    org.altlaw.jobs.genhtml
+;;    org.altlaw.jobs.getindexes
+;;    org.altlaw.jobs.graph
+;;    org.altlaw.jobs.graph-map
+;;    org.altlaw.jobs.link.linkincites
+;;    org.altlaw.jobs.link.linkincites-mapred
+;;    org.altlaw.jobs.link.linkoutcites
+;;    org.altlaw.jobs.link.linkoutcites-mapred
+;;    org.altlaw.jobs.link.mergedocs
+;;    org.altlaw.jobs.link.mergedocs-mapred
+;;    org.altlaw.jobs.procfiles.altcrawl
    org.altlaw.jobs.procfiles.ohm1
-   org.altlaw.jobs.procfiles.ohm1-map
+;;    org.altlaw.jobs.procfiles.ohm1-map
    org.altlaw.jobs.procfiles.profed
-   org.altlaw.jobs.procfiles.profed-map
-   org.altlaw.jobs.uploadpages
+;;    org.altlaw.jobs.procfiles.profed-map
+;;    org.altlaw.jobs.uploadpages

    org.altlaw.test.run
    org.altlaw.test.www


comment run-all-tests

comment run-all-tests

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

--- test/aurora/btree_test.cljs
+++ test/aurora/btree_test.cljs
@@ -196,4 +196,6 @@
   500
   iterator-prop)

-(run-all-tests)
+(comment
+  (run-all-tests)
+  )


Tests for deep binding to not nested data.

--- test/decl_ui/core_test.cljs
+++ test/decl_ui/core_test.cljs
@@ -45,7 +45,12 @@
       (install! {} "{:user {:name \"John Smith\"}}"
                 "[:div#user-name #= [:user :name]]"
                 {} {})
-      (is (= "John Smith" (text (sel1 "#user-name"))))))
+      (is (= "John Smith" (text (sel1 "#user-name")))))
+    (testing "Deep binding to unnested data"
+      (install! {} "{:text \"Hello world\"}"
+                "[:div#result #= [:text]]"
+                {} {})
+      (is (= "Hello world" (text (sel1 "#result"))))))
   (testing "Callbacks"
     (testing "Simple invocation"
       (let [clicked (atom false)]
@@ -90,17 +95,20 @@
           (go (is (= "Hello" @received-value))
               (done)))))
     (testing "Invocation with deep binding"
-      (install! {} "{:user {:name \"John\"}}"
+      (install! {} "{:user {:name \"John\"} :text \"Hello world\"}"
                 "[:div
-                 [:button {:id \"btn\" :on-click (ui/handle-click #= [:user :name])}]
-                 [:div#user-name #= [:user :name]]]"
+                 [:button {:id \"btn\" :on-click (ui/handle-click #= [:user :name] #= [:text])}]
+                 [:div#user-name #= [:user :name]]
+                 [:div#text #= [:text]]]"
                 {}
-                {'ui/handle-click (fn [_ user-name]
+                {'ui/handle-click (fn [_ user-name text]
                                     (reset! user-name "Tom")
+                                    (reset! text "Bye!")
                                     nil)})                  ; Prevent warning.
       (click! (sel1 "#btn"))
       (async done
         (go (is (= "Tom" (text (sel1 "#user-name"))))
+            (is (= "Bye!" (text (sel1 "#text"))))
             (done))))))


Increase the Thread/sleep in the client test

--- test/picard/test/client.clj
+++ test/picard/test/client.clj
@@ -232,7 +232,7 @@

   ;; Need to sleep a second since the response might not have been
   ;; returned yet
-  (Thread/sleep 10)
+  (Thread/sleep 100)
   (client/request
    ["localhost" 4040]
    [{:path-info "/" :request-method "GET"}]
@@ -246,7 +246,7 @@
                          "content-length" "5"} "Hello"]
        :done nil))

-  (Thread/sleep 10)
+  (Thread/sleep 100)
   (client/request
    ["localhost" 4040]
    [{:path-info          "/zomg"
@@ -294,7 +294,7 @@
                             "content-length" "5"} nil]
            :done nil))

-      (Thread/sleep 10))
+      (Thread/sleep 100))
     (picard/shutdown-pool pool))

   (is (= 2 (count (netty-connect-evts)))))
@@ -326,7 +326,7 @@
                             "foo"         "bar"} nil]
            :done nil))

-      (Thread/sleep 10))
+      (Thread/sleep 100))
     (picard/shutdown-pool pool))

   (is (= 2 (count (netty-connect-evts)))))
@@ -352,7 +352,7 @@
            :response  [204 {:http-version [1 1]} nil]
            :done      nil))

-      (Thread/sleep 10))
+      (Thread/sleep 100))
     (picard/shutdown-pool pool)
     (is (= 2 (count (netty-connect-evts))))))

@@ -378,7 +378,7 @@
                             :http-version [1 1]} nil]
            :done      nil))

-      (Thread/sleep 10))
+      (Thread/sleep 100))
     (picard/shutdown-pool pool)
     (is (= 2 (count (netty-connect-evts))))))

@@ -405,7 +405,7 @@
                             :http-version [1 1]} nil]
            :done      nil))

-      (Thread/sleep 10))
+      (Thread/sleep 100))
     (picard/shutdown-pool pool)
     (is (= 2 (count (netty-connect-evts))))))


add a way to test for format-line's output

--- test/riemann/xymon_test.clj
+++ test/riemann/xymon_test.clj
@@ -5,6 +5,22 @@
   (:require [riemann.logging :as logging]))

 (logging/init)
+
+(deftest ^:xymon-format format-line-test
+  (let [pairs [[{}
+                "status . unknown \n"]
+               [{:host "foo" :service "bar"}
+                "status foo.bar unknown \n"]
+               [{:host "foo" :service "bar" :state "ok"}
+                "status foo.bar ok \n"]
+               [{:host "foo" :service "bar" :state "ok" :description "blah"}
+                "status foo.bar ok blah\n"]
+               [{:host "foo" :service "bar" :state "ok" :ttl 300}
+                "status+300 foo.bar ok \n"]
+               [{:host "example.com" :service "some.metric rate" :state "ok"}
+                "status example,com.some_metric_rate ok \n"]]]
+    (doseq [[event line] pairs]
+      (is (= line (format-line event))))))

 (deftest ^:xymon ^:integration xymon-test
          (let [k (xymon nil)]


(SERVER-882) Remove duplicate valid-path tests from integration test

--- test/integration/puppetlabs/general_puppet/general_puppet_int_test.clj
+++ test/integration/puppetlabs/general_puppet/general_puppet_int_test.clj
@@ -106,33 +106,7 @@
         (testing "the /static_file_content endpoint returns an error if file-path is not provided"
           (let [response (get-static-file-content "?code_id=foobar&environment=test")]
             (is (= 400 (:status response)))
-            (is (= error-message (:body response))))))
-      (let [error-message "Request Denied: A /static_file_content request must be a file within the files directory of a module or a module in an environment"
-            valid-paths ["modules/foo/files/bar.txt"
-                         "modules/foo/files/bar/"
-                         "modules/foo/files/bar/baz.txt"
-                         "environments/production/modules/foo/files/bar.txt"
-                         "environments/production/modules/foo/files/..conf..d../..bar..txt.."
-                         "environments/test/modules/foo/files/bar/baz.txt"
-                         "environments/dev/modules/foo/files/path/to/file/something.txt"]
-            invalid-paths ["modules/foo/manifests/bar.pp"
-                           "manifests/site.pp"
-                           "environments/foo/bar/files"
-                           "environments/../manifests/files/site.pp"
-                           "environments/production/files/~/.bash_profile"
-                           "environments/../modules/foo/files/site.pp"
-                           "environments/../modules/foo/lib/puppet/parser/functions/site.rb"
-                           "environments/production/modules/foo/files/../../../../../../site.pp"]]
-        (testing "valid requests return 200 and the file"
-          (doseq [path valid-paths]
-            (let [response (get-static-file-content (str path "?code_id=foobar&environment=production"))]
-              (is (= 200 (:status response)))
-              (is (= (str "production foobar " path "\n") (:body response))))))
-        (testing "invalid requests return 403 and the error message"
-          (doseq [path invalid-paths]
-            (let [response (get-static-file-content (str path "?code_id=foobar&environment=production"))]
-              (is (= 403 (:status response)))
-              (is (= error-message (:body response)))))))))))
+            (is (= error-message (:body response))))))))))

 (deftest ^:integration static-file-content-endpoint-test-no-code-content-command
   (logging/with-test-logging


[#146] Dummy config contains the akvosandbox key

So that the resolve-alias works

--- api/src/clojure/org/akvo/flow_api/component/akvo_flow_server_config.clj
+++ api/src/clojure/org/akvo/flow_api/component/akvo_flow_server_config.clj
@@ -35,7 +35,9 @@

 (defrecord DummyAkvoFlowServerConfig []
   component/Lifecycle
-  (start [this] this)
+  (start [this]
+    (assoc this
+      :flow-config (atom {"akvoflowsandbox" "something"})))
   (stop [this] this))

 (defn dummy-akvo-flow-server-config [_]


CMR-3286 pr comment

CMR-3286 pr comment

--- access-control-app/src/cmr/access_control/services/acl_authorization.clj
+++ access-control-app/src/cmr/access_control/services/acl_authorization.clj
@@ -85,9 +85,6 @@
      (:system-identity acl)
      false

-     ;;TODO the catalog item check is reduntant with the self permission check earlier,
-     ;;we might want to pass concept-id during update and create to remove this redundancy.
-     ;;Currently, concept-id is only specified for acl searches.
      (:provider-identity acl)
      (if (= (:target (:provider-identity acl)) "CATALOG_ITEM_ACL")
        (has-provider-access? context permission "CATALOG_ITEM_ACL"


Allow :managed-deps to be passed from cmd line @honzabrecka

--- plugin/src/leiningen/cljs_lambda.clj
+++ plugin/src/leiningen/cljs_lambda.clj
@@ -116,11 +116,11 @@

 (defn build
   "Write a zip file suitable for Lambda deployment"
-  [{{:keys [cljs-build cljs-build-id functions resource-dirs env managed-deps]} :cljs-lambda
+  [{{:keys [cljs-build cljs-build-id functions resource-dirs env] :as opts} :cljs-lambda
     :as project}]
   (log :verbose
        (with-out-str
-         (if managed-deps
+         (if (or (opts :managed-deps) (-> opts :keyword-args :managed-deps))
            (println "Note: You set the :managed-deps options to true, so dependencies won't be handled automatically.")
            (npm/npm project "install"))
          (cljsbuild/cljsbuild project "once" (:id cljs-build))))
@@ -187,7 +187,7 @@

   ([project subtask & args]
    (if-let [subtask-fn (task->fn subtask)]
-     (let [[pos kw]    (args/split-args args #{:publish :quiet})
+     (let [[pos kw]    (args/split-args args #{:publish :quiet :managed-deps})
            [kw quiet]  [(dissoc kw :quiet) (kw :quiet)]
            project     (augment-project project pos kw)
            meta-config (-> project :cljs-lambda :meta-config)]


Fix formatting

Fix formatting

--- src/braid/client/ui/styles/body.cljs
+++ src/braid/client/ui/styles/body.cljs
@@ -10,6 +10,7 @@
    ; prevent overscroll:
    {:height "100%"
     :overflow "hidden"}
+
    [:textarea :input
     {:font-family "inherit"
      :font-size "1em"}]])


Tweaked utility functions.

Tweaked utility functions.

--- src/cljc/cmr/client/common/util.cljc
+++ src/cljc/cmr/client/common/util.cljc
@@ -1,25 +1,33 @@
 (ns cmr.client.common.util
+  "Utility functions for general use by both the Clojure client and the
+  ClojureScript client."
   (:require
    [cmr.client.common.const :as const]
    #?(:clj [clojure.core.async :as async :refer [go go-loop]]
       :cljs [cljs.core.async :as async]))
   #?(:cljs (:require-macros [cljs.core.async.macros :refer [go go-loop]])))

-(def default-environment-type :prod)
-
 (defn get-endpoint
-  [environment-type service-key]
-  (->> (environment-type const/deployment-type)
-       (vector service-key)
-       (get-in const/endpoints)
-       (str (environment-type const/hosts))))
+  "Get the default endpoint for a given CMR service. If an environment type
+  is provided, override the default and get the endpoint for that type."
+  ([service-key]
+    (service-key const/default-endpoints))
+  ([environment-type service-key]
+   (->> (environment-type const/deployment-type)
+        (vector service-key)
+        (get-in const/endpoints)
+        (str (environment-type const/hosts)))))

 (defn get-default-endpoint
+  "Get the default endpoint; if the client options specify an endpoint, then
+  use that one."
   [options service-key]
   (or (:endpoint options)
-      (get-endpoint default-environment-type service-key)))
+      (get-endpoint service-key)))

 (defn parse-endpoint
+  "Given a string or a deployment environment and a service key, retur the
+  service endpoint."
   ([endpoint]
    (parse-endpoint endpoint nil))
   ([endpoint service-key]
@@ -28,6 +36,8 @@
      (get-endpoint endpoint service-key))))

 (defn ^:export with-callback
+  "A utility function for running a callback function when a channel receives
+  data."
   [chan callback]
   (go-loop []
     (if-let [response (async/<! chan)]
@@ -96,7 +106,7 @@

 (defmacro import-def
   "Import a single function or var:
-  ```clj
+  ```
   (import-def a b) => (def b a/b)
   ```"
   [from-ns def-name]
@@ -108,7 +118,7 @@

    This works for vars and functions, but not macros. Uses the same syntax as
    `potemkin.namespaces/import-vars`, namely:
-   ```clj
+   ```
    (import-vars
      [m.n.ns1 a b]
      [x.y.ns2 d e f])


Switch lesson groups to that of droppable when user drops a draggable <div>

And this completes the implementation for switching lesson groups using
the Timetable Builder.

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

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -1,7 +1,7 @@
 (ns ^{:doc "Code for Timetable Builder page"}
   cljs-nusmods.timetable
-  (:use [jayq.core :only [$ attr before children hide insert-after is parent
-                          prepend prevent remove-attr show text width]])
+  (:use [jayq.core :only [$ attr before children data hide insert-after is
+                          parent prepend prevent remove-attr show text width]])
   (:require [clojure.set]
             [clojure.string]
             [cljs-nusmods.select2 :as select2]
@@ -238,6 +238,19 @@
     (aset (aget js/document "location") "hash"
           (clojure.string/replace urlHashWithoutModule #"&$" ""))))

+(defn- update-document-location-hash-with-changed-lesson-group
+  "Updates a module's lesson type in `document.location.hash` with a changed
+   changed lesson group."
+  [moduleCode lessonTypeLongForm newLessonGroup]
+  (let [orgUrlHash (aget (aget js/document "location") "hash")
+        lessonType (Lesson-Type-Long-To-Short-Form lessonTypeLongForm)
+        newUrlHash (clojure.string/replace
+                     orgUrlHash
+                     (re-pattern (str moduleCode "_" lessonType "=[^&]+"))
+                     (str moduleCode "_" lessonType "=" newLessonGroup))]
+    (aset (aget js/document "location") "hash"
+          newUrlHash)))
+
 (def ^{:doc "Vector of <tBody> objects representing the days of the timetable
              in the Timetable Builder page"
        :private true
@@ -474,6 +487,15 @@
 (declare add-module-lesson-group)
 (declare timetable-prune-empty-rows)
 (declare add-missing-td-elements-replacing-lesson)
+(declare remove-lesson-group-html)
+(declare shift-lessons-upwards-to-replace-empty-slots)
+(declare update-ModulesSelected-for-affected-days)
+
+(def ^{:doc     "Key for a data attribute added to a draggable <div> helper
+                 when the helper has been dropped onto a droppable <div>.
+                 This is used to detect if a lesson group switch has occurred."
+       :private true}
+  LESSON-GROUP-CHANGE-KEY "lessonGroupChangeTo")

 (defn- lesson-draggable-start-evt-handler-maker
   "Returns a function that can be used as the `start` event handler for a
@@ -503,14 +525,14 @@
                    unselectedLessonGroupsMap)))]
       (set! Lessons-Created-By-Draggable augmentedTTLessonInfoSeq))))

-; TODO: Account for a user dropping the draggable lesson onto a different lesson
-;       from the one selected.
 (defn- lesson-draggable-stop-evt-handler-maker
   "Returns a function used as the `stop` event handler for a draggable lesson."
-  []
+  [moduleCode lessonType lessonGroup bgColorCssClass]
   (fn [evt ui]
-    (.css (aget ui "helper") "cursor" "grab")
-    (let [affectedDaysSet
+    (let [$helper         (aget ui "helper")
+          destLessonGroup (data $helper LESSON-GROUP-CHANGE-KEY)
+
+          affectedDaysSet
           (reduce (fn [daySet ttLessonInfo]
                     (conj daySet (:day ttLessonInfo)))
                   #{}
@@ -532,7 +554,35 @@
           (add-missing-td-elements-replacing-lesson $parentTd augTTLessonInfo)))

       (timetable-prune-empty-rows affectedDaysSet)
-      (set! Lessons-Created-By-Draggable nil))))
+      (set! Lessons-Created-By-Draggable nil)
+      (.css $helper "cursor" "grab")
+
+      ; User has dropped the draggable helper <div> onto a droppable
+      (if (not (nil? destLessonGroup))
+          (let [augTTLessonInfoSeq (remove-lesson-group-html moduleCode
+                                                             lessonType)
+                affectedDaysSet    (reduce (fn [daySet augTTLessonInfo]
+                                             (conj daySet
+                                                   (:day augTTLessonInfo)))
+                                           #{}
+                                           augTTLessonInfoSeq)]
+            ; remove the current lesson group
+            (doseq [augTTLessonInfo augTTLessonInfoSeq]
+              (let [day          (:day augTTLessonInfo)
+                    rowNum       (:rowNum augTTLessonInfo)
+                    ttLessonInfo (dissoc augTTLessonInfo :day :rowNum)]
+                (timetable-remove-lesson day rowNum ttLessonInfo)))
+
+            (shift-lessons-upwards-to-replace-empty-slots augTTLessonInfoSeq)
+            (timetable-prune-empty-rows affectedDaysSet)
+            (update-ModulesSelected-for-affected-days affectedDaysSet)
+
+            ; add the newly selected lesson group
+            (add-module-lesson-group moduleCode lessonType destLessonGroup
+                                     bgColorCssClass true)
+
+            (update-document-location-hash-with-changed-lesson-group
+              moduleCode lessonType destLessonGroup))))))

 (defn- make-added-lessons-draggable
   "Makes the <div> elements of selected lessons draggable."
@@ -543,32 +593,43 @@
     (.draggable $divElem
                 (js-obj "zIndex" 100
                         "helper" "clone"
-                        ; TODO: Replace this `revert` function with one
-                        ;       which detects whether a revert should
-                        ;       occur
-                        "revert" (fn [] true)
+                        "revert" "invalid"
                         "start"  (lesson-draggable-start-evt-handler-maker
                                    moduleCode lessonType lessonLabel
                                    bgColorCssClass)
-                        "stop"   (lesson-draggable-stop-evt-handler-maker)))))
+                        "stop"   (lesson-draggable-stop-evt-handler-maker
+                                   moduleCode lessonType lessonLabel
+                                   bgColorCssClass)))))

 (defn- make-fake-lessons-droppable
   "For 'fake' lessons created due to a lesson <div> being dragged, we make
    them droppable in order for the user to switch lesson groups."
-  [$divElemSeq]
-  (doseq [$divElem $divElemSeq]
-    (.droppable $divElem
-                (js-obj "tolerance" "intersect"
-
-                        "over"
-                        (fn [evt ui]
-                          (.removeClass $divElem "lesson-droppable-not-hover")
-                          (.addClass $divElem "lesson-droppable-hover"))
-
-                        "out"
-                        (fn [evt ui]
-                          (.removeClass $divElem "lesson-droppable-hover")
-                          (.addClass $divElem "lesson-droppable-not-hover"))))))
+  [augModuleSelectedLessonInfoSeq]
+  (doseq [augModuleSelectedLessonInfo augModuleSelectedLessonInfoSeq]
+    (let [$divElem (:divElem augModuleSelectedLessonInfo)]
+      (.droppable
+        $divElem
+        (js-obj "tolerance" "intersect"
+
+                "over"
+                (fn [evt ui]
+                  (.removeClass $divElem "lesson-droppable-not-hover")
+                  (.addClass $divElem "lesson-droppable-hover"))
+
+                "out"
+                (fn [evt ui]
+                  (.removeClass $divElem "lesson-droppable-hover")
+                  (.addClass $divElem "lesson-droppable-not-hover"))
+
+                "drop"
+                (fn [evt ui]
+                  (let [$helper (aget ui "helper")]
+                    ; Set a data attribute on the draggable helper to signal
+                    ; that the user has dropped the <div> on a droppable to
+                    ; change the lesson group
+                    (data $helper
+                          LESSON-GROUP-CHANGE-KEY
+                          (:lessonGroup augModuleSelectedLessonInfo)))))))))

 (defn- add-module-lesson-group
   "Adds a lesson group of a module to the timetable.
@@ -633,7 +694,7 @@

               ; lesson was added due to draggable <div>
               ; Make it droppable
-              (make-fake-lessons-droppable $divElemSeq))
+              (make-fake-lessons-droppable augLessonInfoSeq))
           augLessonInfoSeq))))

 (defn add-module


outer join query results on annotation and annotation evidence. We always want to see orthologues even if there is no annotation and/or not a selected evidence code

--- src/cljs/gointermod/utils/comms.cljs
+++ src/cljs/gointermod/utils/comms.cljs
@@ -12,7 +12,8 @@

 (defn make-base-query [identifier organism evidence-codes]
   (str "<query model=\"genomic\" view=\"Gene.id Gene.symbol Gene.secondaryIdentifier Gene.primaryIdentifier Gene.organism.shortName Gene.organism.taxonId Gene.homologues.homologue.id Gene.homologues.homologue.primaryIdentifier Gene.homologues.homologue.secondaryIdentifier Gene.homologues.homologue.symbol Gene.homologues.homologue.organism.shortName Gene.homologues.homologue.organism.taxonId Gene.homologues.dataSets.name Gene.homologues.dataSets.url Gene.goAnnotation.evidence.code.code Gene.goAnnotation.ontologyTerm.identifier Gene.goAnnotation.ontologyTerm.name Gene.goAnnotation.ontologyTerm.namespace\" sortOrder=\"Gene.symbol ASC\" constraintLogic=\"A and B and C and D and E\" name=\"intermod_go\" >
-    <constraint path=\"Gene.goAnnotation.qualifier\" op=\"IS NULL\" code=\"B\" />
+  <join path=\"Gene.goAnnotation\" style=\"OUTER\"/>
+  <join path=\"Gene.goAnnotation.evidence\" style=\"OUTER\"/><constraint path=\"Gene.goAnnotation.qualifier\" op=\"IS NULL\" code=\"B\" />
     <constraint path=\"Gene.goAnnotation.ontologyTerm.obsolete\" op=\"=\" value=\"false\" code=\"C\" />
     <constraint path=\"Gene.homologues.homologue\" code=\"A\" op=\"LOOKUP\" value=\"" identifier "\" extraValue=\"H. sapiens\"/>
     <constraint path=\"Gene.organism.shortName\" code=\"D\" op=\"=\" value=\"" (utils/get-abbrev organism) "\"/>


Fix metric store info string

Fix metric store info string

--- src/cyanite_remover/metric_store.clj
+++ src/cyanite_remover/metric_store.clj
@@ -159,7 +159,7 @@
     (log/info (str "The metric store has been created. "
                    "Keyspace: " keyspace ", "
                    "channel size: " chan-size ", "
-                   "batch size: " batch-size
+                   "batch size: " batch-size ", "
                    "batch rate: " batch-rate))
     (reify
       MetricStore


Add :db/doc as a default attribute.

Add :db/doc as a default attribute.

--- src/datomish/transact/bootstrap.cljc
+++ src/datomish/transact/bootstrap.cljc
@@ -23,6 +23,8 @@
    :db/valueType         {:db/valueType   :db.type/ref
                           :db/cardinality :db.cardinality/one}
    :db/cardinality       {:db/valueType   :db.type/ref
+                          :db/cardinality :db.cardinality/one}
+   :db/doc               {:db/valueType   :db.type/string
                           :db/cardinality :db.cardinality/one}
    :db/unique            {:db/valueType   :db.type/ref
                           :db/cardinality :db.cardinality/one}
@@ -70,7 +72,9 @@
    :db.cardinality/one   31
    :db.cardinality/many  32
    :db.unique/value      33
-   :db.unique/identity   34})
+   :db.unique/identity   34
+   :db/doc               35
+   })

 (defn tx-data []
   (concat


PLD: remove deprecated chimera import

PLD: remove deprecated chimera import

--- src/hatti/views/table.cljs
+++ src/hatti/views/table.cljs
@@ -16,7 +16,6 @@
             [hatti.views.record]
             [hatti.shared :as shared]
             [hatti.utils :refer [click-fn generate-html hyphen->camel-case]]
-            [chimera.core :refer [any?]]
             [cljsjs.slickgrid-with-deps]))

 (def default-num-displayed-records 25)


Nuke stress_test from orbit, it runs into prepared statements limits with > 1000 documents

--- test/clojurewerkz/cassaforte/stress_test.clj
+++ test/clojurewerkz/cassaforte/stress_test.clj
@@ -1,30 +0,0 @@
-(ns clojurewerkz.cassaforte.stress-test
-  (:require [clojurewerkz.cassaforte.test-helper :as th]
-            [clojurewerkz.cassaforte.client :as client]
-            [clojurewerkz.cassaforte.cql :refer :all]
-            [clojure.test :refer :all]
-            [clojurewerkz.cassaforte.query :refer :all]))
-
-(use-fixtures :each th/initialize!)
-
-(deftest insert-test
-  (doseq [n [10 1000 10000]]
-    (let [table  :users
-          docs   (map (fn [i]
-                        {:name (str "user_" i) :city (str "city_" i) :age (int i)})
-                      (take n (iterate inc 1)))]
-      (truncate table)
-      (println "Inserting " n " documents...")
-      (time (insert-batch table docs))
-      (is (= n (perform-count table))))))
-
-(deftest insert-test
-  (doseq [n [10 1000 3000]]
-    (let [table  :users
-          docs   (map (fn [i]
-                        {:name (str "user_" i) :city (str "city_" i) :age (int i)})
-                      (take n (iterate inc 1)))]
-      (truncate table)
-      (println "Inserting " n " documents with prepared statement...")
-      (time (client/prepared (insert-batch table docs)))
-      (is (= n (perform-count table))))))


Use writeWithoutResponse for ble writing to get faster response

--- src/re_natal_esp32control_app/devices/ble.cljs
+++ src/re_natal_esp32control_app/devices/ble.cljs
@@ -62,5 +62,5 @@
 (defn write [device-id service-id chara-id data]
   (-> (.retrieveServices BleManager device-id)
       (.then (fn [peri-info]
-               (.write BleManager device-id service-id chara-id
-                       (clj->js data))))))
+               (.writeWithoutResponse BleManager device-id service-id chara-id
+                                      (clj->js data))))))


added levantarse

added levantarse


slack-user not needed anymore

slack-user not needed anymore


Added with-command-line utility

Added with-command-line utility


Version 2.5.1-SNAPSHOT

Version 2.5.1-SNAPSHOT


Set clj-parent=5.2.13

Set clj-parent=5.2.13


modify build

modify build


Updates project.js

Updates project.js

Fixes name and description


Bump project.clj version

Bump project.clj version


release 2.2.9

release 2.2.9


welcome them twice!

welcome them twice!

--- src/kapellmeister/file.clj
+++ src/kapellmeister/file.clj
@@ -21,9 +21,11 @@
             DEFAULT)))

 (def SHOULD_WELCOME
-    (try (let [welcome (load-file WELCOME_LOCATION)]
-            (spit WELCOME_LOCATION (inc welcome))
-            (< welcome 2))
+    (try (let [times (load-file WELCOME_LOCATION)
+              should-welcome (< times 2)]
+            (when should-welcome
+                (spit WELCOME_LOCATION (inc times)))
+            should-welcome)
         (catch java.io.FileNotFoundException e
             (spit WELCOME_LOCATION 0)
             true)))


add generated namespace to :aot

add generated namespace to :aot

avoid warning, address #94

--- src/leiningen/ring/jar.clj
+++ src/leiningen/ring/jar.clj
@@ -26,7 +26,11 @@
              ((resolve 'ring.server.leiningen/serve) '~options))))))

 (defn add-main-class [project]
-  (update-project project assoc :main (symbol (main-namespace project))))
+  (let [main (symbol (main-namespace project))]
+    (->
+      project
+      (update-project assoc :main main)
+      (update-project update-in [:aot] #(-> % (conj main) distinct)))))

 (defn jar
   "Create an executable $PROJECT-$VERSION.jar file."


scheduler: Handle task-error status updates from Mesos.

This Mesos status means that the task was incorrectly specified in the
first place.  Cook wasn't handling it at all; we should consider the
task failed in this case.

--- scheduler/src/cook/mesos/scheduler.clj
+++ scheduler/src/cook/mesos/scheduler.clj
@@ -225,7 +225,8 @@
                                    #{:task-finished} :instance.status/success
                                    #{:task-failed
                                      :task-killed
-                                     :task-lost} :instance.status/failed)
+                                     :task-lost
+                                     :task-error} :instance.status/failed)
                  prior-job-state (:job/state (d/entity db job))
                  progress (try
                               (when (:data status)


CMR-1188: Switched to using delay/dereference in spatial lib to fix the defrecord/aot issue which is causing a compiler error.

--- spatial-lib/src/cmr/spatial/tile.clj
+++ spatial-lib/src/cmr/spatial/tile.clj
@@ -25,10 +25,10 @@

 (def modis-sin-tiles
   "A vector of ModisSinTile records read from an edn file"
-  (vec (let [tiles (read-string (slurp (clojure.java.io/resource "cmr/spatial/modis_tiles.edn")))]
+  (delay (vec (let [tiles (read-string (slurp (clojure.java.io/resource "cmr/spatial/modis_tiles.edn")))]
          (for [{:keys [h v coordinates]} tiles]
            (->ModisSinTile (vector h v)
-                           (d/calculate-derived (apply rr/ords->ring :geodetic coordinates)))))))
+                           (d/calculate-derived (apply rr/ords->ring :geodetic coordinates))))))))

 (defn geometry->tiles
   "Gets tiles which intersect the given geometry as a sequence of tuples, each tuple being a vector
@@ -36,4 +36,4 @@
    point, line, polygon, mbr and ring"
   [geometry]
   (let [geometry (d/calculate-derived geometry)]
-    (keep  #(when (intersects? % geometry) (:coordinates %)) modis-sin-tiles)))+    (keep  #(when (intersects? % geometry) (:coordinates %)) @modis-sin-tiles)))


(PE-3992) Remove 'not-found' route (again)

Remove the 'not-found' route / 404 handler from the compojure app.  This
was already deleted once, but resurrected accidentally (by me) in a
botched merge conflict resolution.

--- src/clj/puppetlabs/master/services/master/master_core.clj
+++ src/clj/puppetlabs/master/services/master/master_core.clj
@@ -34,8 +34,7 @@
     (compojure/context "/v2.0" request
                        (request-handler request))
     (compojure/context "/:environment" [environment]
-                       (legacy-routes request-handler environment))
-    (route/not-found "Not Found")))
+                       (legacy-routes request-handler environment))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Public


Clojure ETL full-dataset test incorrectly removes first element

The form of the test data uses a subvec with an index of 1:
(subvec (clojure.string/split "AEIOULNRST" #"") 1)
That removes the first element from the list so "A" is lost and
the current example fails that test. Fix it so the initial letter
is not removed and example is correct for test.

Signed-off-by: Geoff Lane <c3918f39022407dee6a0056ceca9b1aa80e8e4ce@zorched.net>

--- assignments/clojure/etl/etl_test.clj
+++ assignments/clojure/etl/etl_test.clj
@@ -22,13 +22,13 @@
            "u"  1 "v"  4 "w" 4 "x" 8 "y" 4
            "z" 10 }
          (etl/transform {
-             1 (subvec (clojure.string/split "AEIOULNRST" #"") 1)
-             2 (subvec (clojure.string/split "DG" #"") 1)
-             3 (subvec (clojure.string/split "BCMP" #"") 1)
-             4 (subvec (clojure.string/split "FHVWY" #"") 1)
-             5 (subvec (clojure.string/split "K" #"") 1)
-             8 (subvec (clojure.string/split "JX" #"") 1)
-            10 (subvec (clojure.string/split "QZ" #"") 1)
+             1 (clojure.string/split "AEIOULNRST" #"")
+             2 (clojure.string/split "DG" #"")
+             3 (clojure.string/split "BCMP" #"")
+             4 (clojure.string/split "FHVWY" #"")
+             5 (clojure.string/split "K" #"")
+             8 (clojure.string/split "JX" #"")
+            10 (clojure.string/split "QZ" #"")
          }))))

 (run-tests)


Destructure ofType on type->field-entry

Destructure ofType on type->field-entry


remved reviewed comment

remved reviewed comment


reload: use single 'require' call to load all namespaces


Fix timeout

Fix timeout

--- slackbot/src/org/teamweek/slackbot.clj
+++ slackbot/src/org/teamweek/slackbot.clj
@@ -141,7 +141,7 @@
                         :question-id (:db/id question)
                         :answer (:text (async/alt!!
                                          answer-chan ([text] text)
-                                         (async/timeout ten-minutes) ([_] "")))}))
+                                         (async/timeout ten-minutes) ([_] {:text ""})))}))
                []
                questions)]
       (send-to-user! conn username
@@ -376,8 +376,7 @@
   (def every-minute "0 * * * * ?")

   @(d/transact db-conn [(create-team "teamweek-org" slack-token every-minute
-                                     [["jonas" "jonas@gmail"]
-                                      ["notauser" "notauser"]]
+                                     [["jonas" "jonas@gmail"]]
                                      [{:text "How are you today?"
                                        :order 1}
                                       {:text "What are your plans for tomorrow?"


Show a discounts section

Show a discounts section

--- frontend/components/org_settings.cljs
+++ frontend/components/org_settings.cljs
@@ -562,6 +562,55 @@
                        :type "submit"}
                       "Change credit card"])]]]]]]))))))

+;; TODO: Where is the best place for utility functions like this
+;; true if the plan has an active Stripe discount coupon.
+;; false if the plan is nil (not loaded yet) or has no discount applied
+(defn plan-has-active-discount?
+  [plan]
+  (get-in plan [:discount :coupon :valid]))
+
+;; TODO: Where is the best place for utility functions like this
+;; Render a friendly human-readable version of a Stripe discount coupon.
+;; Stripe has a concention for this that does not seem to be documented, so we
+;; reverse engineer it here.
+;; Examples from Stripe are:
+;;   100% off for 6 months
+;;   $100.00 off for 6 months
+;;   $19.00 off for 12 months
+;;   25% off forever
+;;   100% off for 1 month
+(defn format-discount
+  [plan]
+  (let [{ duration-in-months :duration_in_months
+          percent-off        :percent_off
+          amount-off         :amount_off
+          duration           :duration
+          id                 :id}  (get-in plan [:discount :coupon])
+        discount-amount (if percent-off
+                          (str percent-off "%")
+                          (gstring/format "$%.2f" amount-off))
+        discount-period (cond (= duration "forever") "forever"
+                              (= duration-in-months 1) "for 1 month"
+                              :else (gstring/format "for %d months" duration-in-months))]
+    [:p "Your plan includes " discount-amount " off " discount-period
+        " (coupon code '" [:strong id] "')"]))
+
+;; Show a 'Discount' section showing the any Stripe discounts that are being
+;; appied the current plan.
+;; Important: If there are no discounts, we don't want to show anything. We do
+;; not want to temp happy, paying customers to search for discount codes.
+(defn- billing-discounts [app owner]
+  (reify
+    om/IRender
+    (render [_]
+      (html
+        (let [plan (get-in app state/org-plan-path)]
+          [:div.row-fluid
+            (when (plan-has-active-discount? plan)
+              [:fieldset
+                [:legend.span8 "Discounts"]
+                [:div.span8 (format-discount plan)]])])))))
+
 (defn- billing-invoice-data [app owner]
   (reify
     om/IRender
@@ -728,6 +777,7 @@
         [:div.plans
           (om/build billing-card app)
           (om/build billing-invoice-data app)
+          (om/build billing-discounts app)
           (om/build billing-invoices app)]))))

 (defn cancel [app owner]


correct tests for change in status code

correct tests for change in status code

--- ssclj/jar/test/com/sixsq/slipstream/ssclj/resources/credential_cloud_lifecycle_test_utils.clj
+++ ssclj/jar/test/com/sixsq/slipstream/ssclj/resources/credential_cloud_lifecycle_test_utils.clj
@@ -157,7 +157,7 @@
                  :request-method :post
                  :body (json/write-str create-import-href))
         (ltu/body->edn)
-        (ltu/is-status 403))
+        (ltu/is-status 400))

     ;; create a credential as a normal user
     (let [resp    (-> session-user


This is just returning a string

This is just returning a string

--- transactions/test/immutant/transactions_test.clj
+++ transactions/test/immutant/transactions_test.clj
@@ -40,7 +40,7 @@
     (.clear cache)
     (try
       (sql/db-do-commands spec
-        (try (sql/drop-table-ddl :things) (catch Exception _))
+        (sql/drop-table-ddl :things)
         (sql/create-table-ddl :things [:name "varchar(50)"]))
       (catch Exception _))
     (f)))


[#670] Removed unnecessary System/exit calls

--- backend/src/akvo/lumen/admin/add_tenant.clj
+++ backend/src/akvo/lumen/admin/add_tenant.clj
@@ -287,11 +287,9 @@
         (println "Credentials:")
         (pprint user-creds)))
     (catch java.lang.AssertionError e
-      (prn (.getMessage e))
-      (System/exit 0))
+      (prn (.getMessage e)))
     (catch Exception e
       (prn e)
       (prn (.getMessage e))
       (when (= (type e) clojure.lang.ExceptionInfo)
-        (prn (ex-data e)))
-      (System/exit 0))))
+        (prn (ex-data e))))))


Remove debug log entry

Remove debug log entry

--- src/onyx/log/zookeeper.clj
+++ src/onyx/log/zookeeper.clj
@@ -205,7 +205,6 @@

 (defmethod extensions/group-exists? ZooKeeper
   [{:keys [conn opts prefix] :as log} id]
-  (info "Children at:" (zk/children conn (pulse-path prefix)) "looking for" id)
   (zk/exists conn (str (pulse-path prefix) "/" id)))

 (defn find-job-scheduler [log]


server

server

--- src/otp_api_proxy/util.clj
+++ src/otp_api_proxy/util.clj
@@ -179,7 +179,7 @@

 (defn simple-otp-request-live-2 []
   (let [test-otp-url
-        (str "http://anaheim-otp.trilliumtransit.com/otp/routers/default/plan"
+        (str "http://anaheim-otp-server.trilliumtransit.com/otp/routers/default/plan"
              "?"
              (reduce str (interpose "&"
                                     [ "fromPlace=33.8046480634388,-117.915358543396"
@@ -198,7 +198,7 @@

 (defn simple-otp-request-live []
   (let [test-otp-url
-        (str "http://anaheim-otp.trilliumtransit.com/otp/routers/default/plan"
+        (str "http://anaheim-otp-server.trilliumtransit.com/otp/routers/default/plan"
              "?"
              (reduce str (interpose "&"
                                     [ "fromPlace=33.8046480634388,-117.915358543396"


add useful fn

add useful fn

--- dada-core/src/main/clojure/org/dada/core.clj
+++ dada-core/src/main/clojure/org/dada/core.clj
@@ -68,6 +68,9 @@
 (defn delete [#^View view value]
   (.update view '() '() (list (Update. value nil))))

+(defn delete-n [#^View view #^ISeq items]
+  (.update view '() '() (map (fn [item] (Update. item nil)) items)))
+
 ;;--------------------------------------------------------------------------------

 ;; TODO: should we register before reading data or vice versa... - can we do this without a lock ?


Ignore nil stream messages.

Ignore nil stream messages.

--- web/test-integration/immutant/web/integ_test.clj
+++ web/test-integration/immutant/web/integ_test.clj
@@ -122,7 +122,8 @@
       (loop []
         (let [v (.poll stream)]
           (when (not= v :http.async.client/done)
-            (swap! body conj (read-string (.toString v "UTF-8")))
+            (when v
+              (swap! body conj (read-string (.toString v "UTF-8"))))
             (recur))))
       (is (= 200 (-> response :status deref :code)))
       (is (= "chunked" (:transfer-encoding headers)))


Remove snapshot dependency on Mesomatic (#943)

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -155,7 +155,7 @@
                                  org.slf4j/slf4j-nop]]
                    ; Similarly, one could use an older version of the
                    ; mesomatic library in environments that require it
-                   [wyegelwe/mesomatic "1.0.1-r0-SNAPSHOT"]]}
+                   [twosigma/mesomatic "1.0.1-2018.08.28-df2c2ca"]]}

    :uberjar
    {:aot [cook.components]


Many changes to alert and alert-list. Restructured the demo to be similar to dropdown.

--- src/re_demo/dropdowns.cljs
+++ src/re_demo/dropdowns.cljs
@@ -8,12 +8,12 @@
             [reagent.core    :as    reagent]))

-(def demos [{:id "1" :label "Simple dropdown"}
-            {:id "2" :label "Dropdown with grouping"}
-            {:id "3" :label "Dropdown with filtering"}
-            {:id "4" :label "Keyboard support"}
-            {:id "5" :label "Other parameters"}
-            {:id "6" :label "Two dependent dropdowns"}])
+(def demos [{:id 1 :label "Simple dropdown"}
+            {:id 2 :label "Dropdown with grouping"}
+            {:id 3 :label "Dropdown with filtering"}
+            {:id 4 :label "Keyboard support"}
+            {:id 5 :label "Other parameters"}
+            {:id 6 :label "Two dependent dropdowns"}])

 (def countries [{:id "au" :label "Australia"}
@@ -313,30 +313,31 @@

 (defn panel
   []
-  (let [selected-demo-id (reagent/atom "1")]
-    (fn [] [v-box
-            :children [[:h3.page-header "Single Selection Dropdowns"]
-                       [h-box
-                        :gap      "50px"
-                        :children [[notes]
-                                   [v-box
-                                    :gap       "15px"
-                                    :size      "auto"
-                                    :min-width "500px"
-                                    :children  [[h-box
-                                                :gap      "10px"
-                                                :align    :center
-                                                :children [[label :label "Select a demo"]
-                                                           [single-dropdown
-                                                            :options   demos
-                                                            :model     selected-demo-id
-                                                            :width     "300px"
-                                                            :on-select #(reset! selected-demo-id %)]]]
-                                               [gap :size "0px"] ;; Force a bit more space here
-                                               (case @selected-demo-id
-                                                 "1" [demo1]
-                                                 "2" [demo2]
-                                                 "3" [demo3]
-                                                 "4" [demo4]
-                                                 "5" [demo5]
-                                                 "6" [demo6])]]]]]])))
+  (let [selected-demo-id (reagent/atom 1)]
+    (fn []
+      [v-box
+       :children [[:h3.page-header "Single Selection Dropdowns"]
+                  [h-box
+                   :gap      "50px"
+                   :children [[notes]
+                              [v-box
+                               :gap       "15px"
+                               :size      "auto"
+                               :min-width "500px"
+                               :children  [[h-box
+                                            :gap      "10px"
+                                            :align    :center
+                                            :children [[label :label "Select a demo"]
+                                                       [single-dropdown
+                                                        :options   demos
+                                                        :model     selected-demo-id
+                                                        :width     "300px"
+                                                        :on-select #(reset! selected-demo-id %)]]]
+                                           [gap :size "0px"] ;; Force a bit more space here
+                                           (case @selected-demo-id
+                                             1 [demo1]
+                                             2 [demo2]
+                                             3 [demo3]
+                                             4 [demo4]
+                                             5 [demo5]
+                                             6 [demo6])]]]]]])))


CMR-5129 Addresses PR comments.

CMR-5129 Addresses PR comments.

--- umm-lib/src/cmr/umm/iso_smap/granule/orbit.clj
+++ umm-lib/src/cmr/umm/iso_smap/granule/orbit.clj
@@ -2,9 +2,10 @@
   (:require
    [clojure.data.xml :as x]
    [clojure.string :as str]
+   [cmr.common.log :refer [info debug error]]
+   [cmr.common.util :as util]
    [cmr.common.validations.core :as v]
    [cmr.common.xml :as cx]
-   [cmr.common.util :as util]
    [cmr.spatial.encoding.gmd :as gmd]
    [cmr.spatial.messages :as msg]
    [cmr.spatial.validation :as sv]
@@ -39,7 +40,7 @@
     [record]
     (v/create-error-messages (v/validate validations record))))

-(defn build-orbit-string
+(defn- build-orbit-string
   "Builds ISO SMAP orbit string using umm values."
   [orbit]
   (let [{:keys [ascending-crossing start-lat start-direction end-lat end-direction]} orbit]
@@ -47,6 +48,14 @@
             ascending-crossing
             start-lat (convert-direction start-direction)
             end-lat (convert-direction end-direction))))
+
+(defn- coerce-float
+  "Coerce's string to float, catches exceptions and produces error message."
+  [field value]
+  (try
+    (Float. value)
+    (catch Exception e
+      (error e (format "For orbit field [%s] the value [%s] is not a number." field value)))))

 (defmethod gmd/encode cmr.umm.umm_granule.Orbit
   [orbit]
@@ -76,13 +85,13 @@
                            ascending-crossing
                            (or start-lat start-direction end-lat end-direction
                                (count orbit-str)))]
-           (Float. (str/trim (subs asc-c (inc (.indexOf asc-c ":")))))))
+           (coerce-float :ascending-crossing (str/trim (subs asc-c (inc (.indexOf asc-c ":")))))))
        (when start-lat
          (let [sl (subs orbit-str
                         start-lat
                         (or start-direction end-lat end-direction
                             (count orbit-str)))]
-           (Float. (str/trim (subs sl (inc (.indexOf sl ":")))))))
+           (coerce-float :start-lat (str/trim (subs sl (inc (.indexOf sl ":")))))))
        (when start-direction
          (let [sd (subs orbit-str
                         start-direction
@@ -94,7 +103,7 @@
                         end-lat
                         (or end-direction
                             (count orbit-str)))]
-           (Float. (str/trim (subs el (inc (.indexOf el ":")))))))
+           (coerce-float :end-lat (str/trim (subs el (inc (.indexOf el ":")))))))
        (when end-direction
          (let [ed (subs orbit-str
                         end-direction)]


Cleaning up log when checking for dup polling locations

--- src/vip/data_processor/validation/v5/polling_location.clj
+++ src/vip/data_processor/validation/v5/polling_location.clj
@@ -33,7 +33,7 @@
    both Localities and Precincts. Usually, though not always,
    this is a misunderstanding, so let's warn if it happens."
   [{:keys [import-id] :as ctx}]
-  (log/info "Checking for Polling Places mapped to multiple levels for import: " import-id)
+  (log/info "Checking for Polling Places mapped to localities and precincts")
   (let [results
         (korma/exec-raw
          (:conn postgres/xml-tree-values)


JC | Added description strings to config vars

--- src/stonecutter/config.clj
+++ src/stonecutter/config.clj
@@ -24,15 +24,7 @@
            :rsa-keypair-file-path "Location of json file containing RSA keypair (for Open ID Connect)"
            ])

-(def env-var-set #{:port :host :base-url :mongo-port-27017-tcp-addr
-                :mongo-uri :client-credentials-file-path
-                :secure :email-script-path :app-name
-                :header-bg-color :header-font-color :header-font-color-hover
-                :static-resources-dir-path :logo-file-name
-                :favicon-file-name :admin-login :admin-password
-                :password-reset-expiry
-                :open-id-connect-id-token-lifetime-minutes
-                :rsa-keypair-file-path})
+(def env-var-set (->> vars (partition 2) (map first) set))

 (def roles {:default "default"
             :admin   "admin"})


Version update

Version update

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

--- src/conexp.clj
+++ src/conexp.clj
@@ -16,7 +16,7 @@

 (def *conexp-version* {:major 0,
 		       :minor 1,
-		       :timestamp 1263133147192,
+		       :timestamp 1264974270492,
 		       :qualifier "pre-alpha"})

 (defn conexp-version


Update test for multiple recipient addresses.

--- src/clj/com/draines/postal/message.clj
+++ src/clj/com/draines/postal/message.clj
@@ -83,7 +83,7 @@
            :subject "Test"
            :body "Test!"}]
     (is (= "Subject: Test" (re-find #"Subject: Test" (message->str m))))
-    (is (re-find #"Cc: baz@bar.dom, quux@bar.dom" (message->str m)))))
+    (is (re-find #"Cc: baz@bar.dom, Quux <quux@bar.dom>" (message->str m)))))

 (deftest test-multipart
   (let [m {:from "foo@bar.dom"


refactor code

refactor code

--- src/clj/salava/metabadge/metabadge.clj
+++ src/clj/salava/metabadge/metabadge.clj
@@ -5,7 +5,8 @@
             [clojure.core.cache :as cache]
             [clojure.string :refer [escape]]
             [slingshot.slingshot :refer :all]
-            [pantomime.mime :refer [extension-for-name mime-type-of]]))
+            [pantomime.mime :refer [extension-for-name mime-type-of]]
+            [clojure.core.reducers :as r]))

 (def no-of-days-in-cache 30)

@@ -41,9 +42,9 @@
       (if-let [data (fetch-json-data url)]
         (-> data
             (assoc :image (fetch-image ctx (:image data)))))
-    (catch Exception _
-      (log/error (str "Did not get required badge information: " id))
-      {}))))
+      (catch Exception _
+        (log/error (str "Did not get required badge information: " id))
+        {}))))

 (defn get-badge-data [ctx badge]
@@ -54,32 +55,47 @@
                             (cache/hit % key)
                             (cache/miss % key (public-badge-info ctx id)))) key)))

-(defn- expand-required-badges [ctx badges assertion-url]
-  (reduce (fn [result b]
-            (if-let [badge-info (get-badge-data ctx b) #_(public-badge-info ctx b)]
-              (conj result (-> b (assoc :badge-info badge-info
-                                        :current (= (:url b) assertion-url)))))) [] badges))
+#_(defn- expand-required-badges [ctx badges assertion-url]
+    (r/reduce (fn [result b]
+                (if-let [badge-info (get-badge-data ctx b)]
+                  (conj result (-> b (assoc :badge-info badge-info
+                                       :current (= (:url b) assertion-url)))))) [] badges))
+
+(defn- expand-required-badges [ctx badges assertion-url] ;;experiment with reducers
+  (->> badges
+       (r/map (fn [b] (-> b (assoc :badge-info (get-badge-data ctx b) :current (= (:url b) assertion-url)))) )
+       (r/foldcat)))

-(defn- process-metabadge [ctx metabadge assertion-url]
-  (let [content (:metabadge metabadge)]
-    (assoc metabadge :metabadge
-      (reduce
-        (fn [result m]
-          (conj result (-> m
-                           (assoc :required_badges (expand-required-badges ctx (:required_badges m) assertion-url) :milestone? (= assertion-url (get-in m [:badge :url])))
-                           (update-in [:badge] merge (get-badge-data ctx (:badge m)) ))))
-        []
-        content))))
+#_(defn- process-metabadge [ctx metabadge assertion-url]
+    (let [content (:metabadge metabadge)]
+      (assoc metabadge :metabadge
+        (r/reduce
+          (fn [result m]
+            (conj result (-> m
+                             (assoc :required_badges (expand-required-badges ctx (:required_badges m) assertion-url) :milestone? (= assertion-url (get-in m [:badge :url])))
+                             (update-in [:badge] merge (get-badge-data ctx (:badge m)) ))))
+          []
+          content))))
+
+(defn- process-metabadge [ctx metabadge assertion-url] ;;experiment with reducers
+  (->> (:metabadge metabadge)
+       (r/map (fn [m] (-> m
+                          (assoc :required_badges (expand-required-badges ctx (:required_badges m) assertion-url)
+                            :milestone? (= assertion-url (get-in m [:badge :url])))
+                          (update-in [:badge] merge (get-badge-data ctx (:badge m)) ))))
+       (r/foldcat)
+       (assoc metabadge :metabadge)))

 (defn check-metabadge [ctx assertion-url]
   (let [meta-data-url (str (get-in ctx [:config :factory :url]) "/v1/assertion/metabadge/?url=" (u/url-encode assertion-url))]
     (try
       (if-let [metabadge (fetch-json-data meta-data-url)]
         (let [processed-metabadge (process-metabadge ctx  metabadge assertion-url)]
-          (if (empty? (:metabadge processed-metabadge)) nil (assoc processed-metabadge :obf-url (get-in ctx [:config :factory :url])))))
+          (if (empty? (:metabadge processed-metabadge)) nil processed-metabadge)))
       (catch Exception e
         (log/error (str "Did not get metabadge information: " assertion-url))
         (log/error (.getMessage e))
         nil))))

+


Remove print

Remove print

--- src/cljs/koeeoadi/components/code.cljs
+++ src/cljs/koeeoadi/components/code.cljs
@@ -62,7 +62,6 @@
       string)))

 (defn code-line [line faces-by-name colors-by-id]
-  (println line)
   (apply dom/div #js {:className "code-line"}
     (map #(code-chunk (update-code % faces-by-name colors-by-id)) line)))

@@ -88,7 +87,7 @@
     (let [{code-background :code-background
            code-name :code/name
            faces-by-name :faces/by-name
-           colors-by-id :colors/by-id
+           colors-by-id :colors/by-id
            code-map :code/map} (om/props this)
           code-lines (group-lines (get-in code-map [code-name :code-chunks/list]))]
       (apply dom/code


new style

new style

--- clojure/src/dnd/character.cljs
+++ clojure/src/dnd/character.cljs
@@ -54,14 +54,14 @@
 (defn person [] (-> (item-maker
                     "☺"
                     (rand-rgb-vec)
-                    "a friendly person")
-                  (assoc :brain #{})))
+                    "a friendly person"
+                    :brain #{})))

 (defn tree [] (-> (item-maker
                     (coin-flip "O" "o")
                     (rand-rgb-vec)
-                    "a happy tree")
-                  (assoc :solid true)))
+                    "a happy tree"
+                    :solid true)))

 (defn pickaxe [] (item-maker
                    "T"
@@ -77,8 +77,7 @@
   (item-maker "☷" [130 130 130] "rubble"))

 (defn stone []
-  (-> (item-maker "▒" [130 130 130] "stone wall")
-      (assoc :solid true)))
+  (-> (item-maker "▒" [130 130 130] "stone wall" :solid true)))

 (defn redirect-character [character dx dy]
   (assoc character :direction (character-direction dx dy)))


private select* not has just one arity

private select* not has just one arity

--- src/er_cassandra/model/alia/delete.clj
+++ src/er_cassandra/model/alia/delete.clj
@@ -22,7 +22,8 @@
      (mlet [[record & _] (alia-select/select* session
                                               model
                                               key
-                                              record-or-key-value)
+                                              record-or-key-value
+                                              nil)

             primary-response (m/when record
                                (alia-upsert/delete-record


change to RC1

change to RC1

--- src/leiningen/new/figwheel/project.clj
+++ src/leiningen/new/figwheel/project.clj
@@ -4,7 +4,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}

-  :dependencies [[org.clojure/clojure "1.7.0-beta3"]
+  :dependencies [[org.clojure/clojure "1.7.0-RC1"]
                  [org.clojure/clojurescript "0.0-3297"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]{{#om?}}
                  [sablono "0.3.4"]


made akey* public

made akey* public

--- src/main/clojure/czlab/nettio/core.clj
+++ src/main/clojure/czlab/nettio/core.clj
@@ -1620,7 +1620,7 @@
   (HttpUtil/setContentLength msg (long len)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defn- akey*
+(defn akey*

   [k] (let [s (c/sname k)]
         (if-not (AttributeKey/exists s)


Make SVG map have unique ids

Make SVG map have unique ids

--- app/pyrexia/src/pyrexia/map.cljs
+++ app/pyrexia/src/pyrexia/map.cljs
@@ -75,6 +75,7 @@
             :let [value (get grid key)
                   x (first key)
                   y (second key)]]
+        ^{:key (keyword (str x "," y))}
         [:rect {:x (* x boxWidth)
                 :y (* y boxHeight)
                 :width boxWidth


documentation

documentation

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -181,16 +181,13 @@
      (comp-paths (- depth 1)))))

 (defn add-to-bolt-at-path
-  "bolt + path => partial trees"
+  "find all complements for bolt at given path, and create a partial tree: bolt + complement => partial tree"
   [bolt path model]
-  ;; add each complement to _bolt_:
-  (map (fn [each-comp]
-         (->
-          (dag_unify.core/assoc-in! (dag_unify.core/copy bolt) path each-comp)
-          ((fn [tree]
-             (if (:default-fn model)
-               ((:default-fn model) tree)
-               tree)))))
+  (map #(let [partial-tree
+              (dag_unify.core/assoc-in! (dag_unify.core/copy bolt) path %)]
+          (if (:default-fn model)
+            ((:default-fn model) partial-tree)
+            partial-tree))
        (gen (get-in bolt path) model 0)))

 (defn get-lexemes [model spec]


Add Foldable protocol.

Add Foldable protocol.

--- src/cats/protocols.cljc
+++ src/cats/protocols.cljc
@@ -69,6 +69,11 @@
     "Takes any context monadic value ctx and any value v, and puts
      the value v in the most minimal context of same type of ctx"))

+(defprotocol Foldable
+  "Abstraction of data structures that can be folded to a summary value."
+  (foldl [fctx f z xs] "Left-associative fold of a structure.")
+  (foldr [fctx f z xs] "Right-associative fold of a structure."))
+
 (defprotocol Monad
   "The Monad abstraction."
   (mreturn [m v])


Added fn?

Added fn?

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -143,6 +143,9 @@
 (defn symbol? [x]
   (and (goog/isString x)
        (= (.charAt x 0) \uFDD1)))
+
+(defn fn? [f]
+  (goog/isFunction f))

 (defn str
   "With no args, returns the empty string. With one arg x, returns


CMR-5201: Use the format that will be passed for OPeNDAP.


& is only here to stop a parse error, its never called.

--- src/midje/checking/checkers/simple.clj
+++ src/midje/checking/checkers/simple.clj
@@ -24,8 +24,7 @@
   (not actual))
 (defalias FALSEY falsey)

-(defchecker & "Any arity" [actual argument-matchers]
-  (reduce #(extended-= actual %) argument-matchers))
+(defchecker & "Any arity" [])

 (defchecker anything
   "Accepts any value."


Updating submitter.link to point to /records not /xref

--- src/ahnentafel/gedcom/data.clj
+++ src/ahnentafel/gedcom/data.clj
@@ -22,5 +22,7 @@
      :submitter (let [submitter-xref (:value (find-item header "SUBM"))
                       submitter (find-xref tree submitter-xref)]
                   {:name (:value (find-item submitter "NAME"))
-                   :link (str "/xref/" submitter-xref)}
+                   :link (str "/records/" submitter-xref)}
                   )}))
+
+(defn find-record [query])


Fix and simplify name, remove value-seq-for-map-or-array


add trivial cljs impl for start-system!, stop-system!, system-map

--- src/deferst/system.cljc
+++ src/deferst/system.cljc
@@ -311,7 +311,12 @@
      (d/chain
       dsys
       (fn [[_ system]]
-        (stop-system* system)))))
+        (stop-system* system)))
+
+     :cljs
+     (p/then
+      dsys
+      (fn [[_ system]] (stop-system* system)))))

 (defn start-system!
   "given a system-builder, start a system with the seed config
@@ -342,7 +347,10 @@
                     (throw
                      (ex-info "start-system! failed and unwound"
                               {:state st
-                               :error e}))))))))))
+                               :error e}))))))))
+
+     :cljs
+     (-> (run-state system-builder seed))))
 (defn- system-map*
   [system]
   (filter-system-map system))
@@ -356,7 +364,12 @@
      (d/chain
       dsys
       (fn [[_ system]]
-        (system-map* system)))))
+        (system-map* system)))
+
+     :cljs
+     (p/then
+      dsys
+      (fn [[_ system]] (system-map* system)))))

 (comment
   (require '[deferst.system :as dfs])


add is-delete flag to schema

add is-delete flag to schema

--- src/deltalog/schema.clj
+++ src/deltalog/schema.clj
@@ -4,6 +4,7 @@
   []
   {:id 1
    :timestamp (long 123456789)
+   :is-delete 0
    :data [1, "actual-name", "actual-email", 1]})

 (def user [:id, :name, :email, :state])


core: remove

core: remove

--- data/core.clj
+++ data/core.clj
@@ -1384,3 +1384,10 @@
         (if (pred f)
           (cons f (filter pred r))
           (filter pred r)))))))
+
+(defn remove
+  "Returns a lazy sequence of the items in coll for which
+  (pred item) returns false. pred must be free of side-effects."
+  {:added "1.0"}
+  [pred coll]
+  (filter (complement pred) coll))


some formatting and comments

some formatting and comments


fix function order

fix function order

--- src/shuppet/securitygroups.clj
+++ src/shuppet/securitygroups.clj
@@ -6,7 +6,6 @@
    [clojure.xml :as xml]
    [clojure.zip :as zip]
    [clojure.data.zip.xml :refer [xml1-> attr xml-> text text= attr=]]))
-

 (defn- xml-to-map [xml-string]
   (zip/xml-zip (xml/parse (java.io.ByteArrayInputStream. (.getBytes xml-string)))))
@@ -64,6 +63,12 @@
     (if-let [response (ec2-request (merge cr-params {"Action" "CreateSecurityGroup"}))]
       (do
         (first (xml-> (xml-to-map response) :groupId text))))))
+
+
+(defn process [action params]
+  (condp = (keyword action)
+    :CreateSecurityGroup (create params)
+    (ec2-request (merge params {"Action" (name action)}))))

 (defn- build-network-params [index [k v]]
   (if (= (name k) "IpRanges")
@@ -128,10 +133,7 @@
     (balance-ingress sg-id ingress)
     (balance-egress sg-id egress)))

-(defn process [action params]
-  (condp = (keyword action)
-    :CreateSecurityGroup (create params)
-    (ec2-request (merge params {"Action" (name action)}))))
+

 (defn ensure [opts]
 ;describe security group


wiring real pipeline-definition into new ui

--- src/lambdacd/new_ui.clj
+++ src/lambdacd/new_ui.clj
@@ -105,4 +105,4 @@

 (defn new-ui-routes [pipeline-def pipeline-state]
   (routes
-    (GET "/" [] (body (history (pipeline-state/history-for @pipeline-state)) (pipeline fake-pipeline-representation true)))))+    (GET "/" [] (body (history (pipeline-state/history-for @pipeline-state)) (pipeline (presentation/display-representation pipeline-def) true)))))


Abort if project is not available

Abort if project is not available

--- src/leiningen/droid.clj
+++ src/leiningen/droid.clj
@@ -55,6 +55,8 @@
   ([project]
      (help #'droid))
   ([project & [cmd & args]]
+     (when (and (nil? project) (not (#{"new" "help"} cmd)))
+       (abort "This subtask requires to be run from the project folder."))
      (case cmd
        ;; Standalone tasks
        "new" (if (< (count args) 2)


Tweaks to external

Tweaks to external

--- dev/src/yada/dev/external.clj
+++ dev/src/yada/dev/external.clj
@@ -14,16 +14,16 @@
   RouteProvider
   (routes [component]
     ["/"
-     [["console/home" (yada/resource (io/file "console/resources/static/index.html") {:id ::index})]
-      ["react/react.min.js" (yada/resource (io/resource "cljsjs/production/react.min.inc.js"))]
+     [["console/home" (-> "console/resources/static/index.html" io/file (yada/resource {:id ::index}))]
+      ["react/react.min.js" (-> "cljsjs/production/react.min.inc.js" io/resource yada/resource)]
       ["cljs" (files {:dir "target/cljs"})]

       ;; Customized css
-      ["material.min.css" (yada/resource (io/file "console/resources/static/material.min.css"))]
-      ["fonts.css" (yada/resource (io/file "console/resources/static/fonts.css"))]
-      ["mdl.woff2" (yada/resource (io/file "console/resources/static/mdl.woff2"))]
+      ["material.min.css" (-> "console/resources/static/material.min.css" io/file yada/resource)]
+      ["fonts.css" (-> "console/resources/static/fonts.css" io/file yada/resource)]
+      ["mdl.woff2" (-> "console/resources/static/mdl.woff2" io/file yada/resource)]

-      ["mdl" (resources-maybe {:prefix "META-INF/resources/webjars/material-design-lite/1.0.2"})]
+      ["mdl/" (resources-maybe {:prefix "META-INF/resources/webjars/material-design-lite/1.0.2/"})]

       ]]))


Add add-gutter to editor

Add add-gutter to editor

--- src/lt/objs/editor.cljs
+++ src/lt/objs/editor.cljs
@@ -370,6 +370,20 @@

 (defn fold-code [e]
   (.foldCode (->cm-ed e) (cursor e)))
+
+(defn add-gutter [e class-name width]
+  (let [gutter-classes (set (conj (js->clj (option e "gutters")) class-name))
+        gutter-div (dom/$ :div.CodeMirror-gutters (object/->content e))
+        gutter-divs (dom/$$ :div.CodeMirror-gutter gutter-div)
+        current-widths (reduce (fn [res gutter]
+                                 (let [gutter-class (clojure.string/replace-first (dom/attr gutter "class") "CodeMirror-gutter " "")]
+                                   (assoc res gutter-class (dom/width gutter)))
+                                 ) {} gutter-divs)
+        new-gutter-widths (assoc current-widths class-name width)]
+    (operation e (fn[]
+                   (set-options e {:gutters (clj->js gutter-classes)})
+                   (doseq [[k v] new-gutter-widths]
+                     (dom/set-css (dom/$ (str "div." k) gutter-div) {"width" (str v "px")}))))))

 ;;*********************************************************
 ;; Object


show error on 500 or 503 (#464)

show error on 500 or 503 (#464)

--- src/cljs/org/broadinstitute/firecloud_ui/utils.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/utils.cljs
@@ -152,7 +152,7 @@
            :headers (merge {"Authorization" (str "Bearer " @access-token)}
                            (:headers arg-map))
            :on-done (fn [{:keys [status-code] :as m}]
-                      (when (not= @server-down? (= status-code 503))
+                      (when (not= @server-down? (contains? #{500 503} status-code))
                         (swap! server-down? not))
                       ;; Handle auth token expiration
                       (when (and (= status-code 401) (not ignore-auth-expiration?))


Normalized TBoxes don't lose their defined symbols

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

--- src/conexp/contrib/dl/languages/description_graphs.clj
+++ src/conexp/contrib/dl/languages/description_graphs.clj
@@ -203,7 +203,8 @@
 							     (map tbox-map (used-map target)))))
 					    (make-dl-expression language target))])
 				   (vals rename-map)))]
-    new-tbox-map))
+    (into {} (for [target (keys tbox-map)]
+	       [target (-> target rename-map new-tbox-map)]))))

 ;; normalizing algorithm -- invokation point


Complete maps koans test

Complete maps koans test

--- clojure/koans/src/koans/05_maps.clj
+++ clojure/koans/src/koans/05_maps.clj
@@ -1,50 +1,50 @@
 (meditations
   "There are two ways to create maps"
-  (= __ (hash-map))
+  (= {} (hash-map))

   "Maps in clojure associate keys with values"
-  (= __ (count (hash-map)))
+  (= 0 (count (hash-map)))

   "A value must be supplied for each key"
-  (= {:a 1} (hash-map :a __))
+  (= {:a 1} (hash-map :a 1))

   "The size is the number of entries"
-  (= __ (count {:a 1 :b 2}))
+  (= 2 (count {:a 1 :b 2}))

   "You can look up the value for a given key"
-  (= __ (get {:a 1 :b 2} :b))
+  (= 2 (get {:a 1 :b 2} :b))

   "Maps can be used as lookup functions"
-  (= __ ({:a 1 :b 2} :a))
+  (= 1 ({:a 1 :b 2} :a))

   "And so can keywords"
-  (= __ (:a {:a 1 :b 2}))
+  (= 1 (:a {:a 1 :b 2}))

   "But map keys need not be keywords"
-  (= __ ({2006 "Torino" 2010 "Vancouver" 2014 "Sochi"} 2010))
+  (= "Vancouver" ({2006 "Torino" 2010 "Vancouver" 2014 "Sochi"} 2010))

   "You may not be able to find an entry for a key"
-  (= __ (get {:a 1 :b 2} :c))
+  (= nil (get {:a 1 :b 2} :c))

   "But you can provide your own default"
-  (= __ (get {:a 1 :b 2} :c :key-not-found))
+  (= :key-not-found (get {:a 1 :b 2} :c :key-not-found))

   "You can find out if a key is present"
-  (= __ (contains? {:a nil :b nil} :b))
+  (= true (contains? {:a nil :b nil} :b))

   "Or if it is missing"
-  (= __ (contains? {:a nil :b nil} :c))
+  (= false (contains? {:a nil :b nil} :c))

   "Maps are immutable, but you can create a new, 'changed' version"
-  (= {1 "January" 2 __} (assoc {1 "January" } 2 "February"))
+  (= {1 "January" 2 "February"} (assoc {1 "January" } 2 "February"))

   "You can also 'remove' an entry"
-  (= {__ __} (dissoc {1 "January" 2 "February"} 2))
+  (= {1 "January"} (dissoc {1 "January" 2 "February"} 2))

   "Often you will need to get the keys (which will be in hash order)"
-  (= (list __ __ __)
+  (= (list 2006 2010 2014)
      (sort (keys {2006 "Torino" 2010 "Vancouver" 2014 "Sochi"})))

   "Or the values"
-  (= (list "Sochi" "Torino" __)
+  (= (list "Sochi" "Torino" "Vancouver")
      (sort (vals {2006 "Torino" 2010 "Vancouver" 2014 "Sochi"}))))


confirm tap speed once before update

confirm tap speed once before update

--- src/metronome/core.cljs
+++ src/metronome/core.cljs
@@ -5,7 +5,6 @@
   (:require-macros [cljs.core.async.macros :refer [go]]))

 (defonce app-setup
-
   (do
     (enable-console-print!)))

@@ -88,6 +87,7 @@
   (reify
     om/IInitState
     (init-state [_] {:previous-click nil
+                     :previous-interval nil
                      :should-stop false})
     om/IDidMount
     (did-mount [_]
@@ -95,13 +95,21 @@
         (.addEventListener js/document "keydown" key-handler)
         (.addEventListener js/document "keyup" key-handler)))
     om/IRenderState
-    (render-state [_ {:keys [tempo-channel previous-click should-stop]}]
+    (render-state [_ {:keys [tempo-channel should-stop]}]
                   (dom/button #js {:className "btn btn-default btn-lg btn-block btn-tap-tempo"
                                    :onClick (fn []
                                               (let [m (millis)]
-                                                (om/set-state! owner :previous-click m)
-                                                (when-not (nil? previous-click)
-                                                  (put! tempo-channel (if should-stop false (- m previous-click))))))}
+                                                (when-let [previous-click (om/get-state owner :previous-click)]
+                                                  (let [interval (- m previous-click)
+                                                        previous-interval (om/get-state owner :previous-interval)]
+                                                    (when (or
+                                                            (nil? previous-interval)
+                                                            (and
+                                                              (> interval (* 0.8 previous-interval))
+                                                              (< interval (* 1.2 previous-interval))))
+                                                      (put! tempo-channel (if (om/get-state owner :should-stop) false interval)))
+                                                    (om/set-state! owner :previous-interval interval)))
+                                                (om/set-state! owner :previous-click m)))}
                               (if should-stop "stop" "tap tempo")))))

 (defn dots [meter owner]


Only refresh certain dirs.

Only refresh certain dirs.

--- dev-resources/src/cmr/client/dev.clj
+++ dev-resources/src/cmr/client/dev.clj
@@ -14,6 +14,13 @@
    [cmr.client.ingest.core :as ingest]
    [cmr.client.search.core :as search]))

+(repl/set-refresh-dirs
+   "src/clj"
+   "src/cljc"
+   "dev-resources/src")
+
+;;; Aliases
+
 (def reload #'repl/refresh)
 (def refresh #'repl/refresh)
 (def reset #'repl/refresh)


derp stray chars

derp stray chars

--- dfs-datastores-cascading/project.clj
+++ dfs-datastores-cascading/project.clj
@@ -25,7 +25,7 @@
                   [:url "http://twitter.com/sorenmacbeth"]]
                  [:developer
                   [:name "Sam Ritchie"]
-                  [:url "http://twitter.com/sritchie"]]]dddddd
+                  [:url "http://twitter.com/sritchie"]]]
   :javac-options ["-source" "1.6" "-target" "1.6"]
   :java-source-paths ["src/main/java" "src/test/java"]
   :junit ["src/test/java"]


Write some tests for n->bytes

Write some tests for n->bytes

--- test/caesium/util_test.clj
+++ test/caesium/util_test.clj
@@ -30,3 +30,15 @@
       "02" [2]
       "ff" [-1]
       "010203" [1 2 3])))
+
+(deftest n->bytes-test
+  (are [n expected] (u/array-eq expected (u/n->bytes 24 n))
+    0 (byte-array 24)
+    0M (byte-array 24)
+    1000000000000 (byte-array (into (vec (repeat 19 0))
+                                    [-24 -44 -91 16 0])))
+  (are [n expected] (u/array-eq expected (u/n->bytes 16 n))
+    0 (byte-array 16)
+    0M (byte-array 16)
+    1000000000000 (byte-array (into (vec (repeat 11 0))
+                                    [-24 -44 -91 16 0]))))


triggered effects desactivation

triggered effects desactivation

--- src/node/game/core.cljs
+++ src/node/game/core.cljs
@@ -49,11 +49,21 @@
       (swap! state assoc-in [side (first r)] 0)
       (swap! state update-in [side (first r)] #(max (- % (last r)) 0)))))

+(defn register-events [state side events card]
+  (doseq [e events]
+    (swap! state update-in [:events (first e)] #(conj % {:ability (last e) :card card}))))
+
+(defn unregister-events [state side card]
+  (doseq [e (:events (card-def card))]
+    (swap! state update-in [:events e]
+           #(remove (fn [effect] (= (get-in effect [:card :cid]) (:cid card))) %))))
+
 (defn desactivate [state side card]
   (let [c (dissoc card :counter :advance-counter :current-strength :abilities :rezzed)
         cdef (card-def card)]
     (when-let [leave-effect (:leave-play (card-def card))]
       (leave-effect state side card nil))
+    (unregister-events state side card)
     (when-let [mu (:memoryunits card)]
       (gain state :runner :memory mu))
     c))
@@ -199,7 +209,6 @@
           (swap! state assoc-in [:runner :rig :program]
                  (for [p (get-in @state [:runner :rig :program])]
                    (assoc p :current-strength nil)))
-          ;; (prn (get-in @state [:run :run-effect :end-run]))
           (when-let [end-run-effect (get-in @state [:run :run-effect :end-run])]
             (resolve-ability state side end-run-effect nil [(first server)])))
         (swap! state assoc :run nil))))
@@ -212,13 +221,6 @@
       (when (and (:ended run)
                  (empty? (get-in @state [:runner :prompt])) (empty? (get-in @state [:corp :prompt])))
         (handle-end-run state :runner)))))
-
-(defn register-events [state side events card]
-  (doseq [e events]
-    (swap! state update-in [:events (first e)] #(conj % {:ability (last e) :card card}))))
-
-(defn unregister-event [state side event card]
-  (swap! state update-in [:events event] #(remove (fn [effect] (= (:card effect) card)) %)))

 (defn trigger-event
   ([state side event] (trigger-event state side event nil))


fixed #132

fixed #132


Cleaning.

Cleaning.

--- src/ombs/view/pages.clj
+++ src/ombs/view/pages.clj
@@ -8,16 +8,6 @@
     ;[noir.util.anti-forgery :refer [anti-forgery-field]] ; security - need, add field fo srcf defence

     ) )
-
-; (defmacro create-error [tag content] `({:tag p :content ("message")}) )
-
-(defmacro defpage [pname rules & body]
-  "Marco for declaring pages. Incapsulate validating fields.
-  Redirect on self, when validation fails with attaching errors messages."
-  ;validate rules
-  ;if ok - body
-  ;else - redirect
-  )

 (h/deftemplate index "../resources/public/index.html" []
   [:#error] (h/content (errors-string))


fix(completion): add missing require for paredit.core

--- ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
+++ ccw.core/src/clj/ccw/editors/clojure/clojure_proposal_processor.clj
@@ -3,6 +3,7 @@
             [clojure.set :as set]
             [clojure.test :as test]
             [clojure.tools.nrepl :as repl]
+            [paredit.core   :as pc]
             [paredit.parser :as p]
             [paredit.loc-utils :as lu]
             [clojure.zip :as z]