Refactor test to be more DRY.

Refactor test to be more DRY.

--- spec/freefrog/rest_spec.clj
+++ spec/freefrog/rest_spec.clj
@@ -4,12 +4,26 @@
             [clj-http.client :as http-client]
             [freefrog.rest :as r]))

+(defn http-post-request
+  ([uri body]
+   (http-post-request uri body nil))
+  ([uri body options]
+   (http-client/post (str "http://localhost:3000/" uri)
+                     (merge {:throw-exceptions false
+                             :content-type :json
+                             :body body} options))))
+
+(defn http-get-request
+  ([]
+   (http-get-request "" nil))
+  ([uri]
+   (http-get-request uri nil))
+  ([uri options]
+   (http-client/get (str "http://localhost:3000/" uri) (merge {:throw-exceptions false} options))))
+
 (defn should-return-400 [spec-context circle-content response-content]
   (context spec-context
-    (with response (http-client/post "http://localhost:3000/circles"
-                                    {:throw-exceptions false
-                                     :content-type :json
-                                     :body circle-content}))
+    (with response (http-post-request "circles" circle-content))
     (it "should return a bad request"
       (should= 400 (:status @response))
       (should-contain response-content (:body @response)))))
@@ -20,23 +34,21 @@
   (after (r/reset-database))

   (it "should return status code 404 at the root"
-    (should= 404 (:status (http-client/get "http://localhost:3000" {:throw-exceptions false}))))
+    (should= 404 (:status (http-get-request))))

   (context "circles"
     (context "when no circles have been created"
-      (with response (http-client/get "http://localhost:3000/circles" {:throw-exceptions false}))
+      (with response (http-get-request "circles"))
       (it "should return an empty array"
           (should= 200 (:status @response))
           (should= "[]" (:body @response))))

     (context "when creating a circle"
-      (with response (http-client/post "http://localhost:3000/circles"
-                                      {:throw-exceptions false
-                                       :content-type :json
-                                       :body (json/generate-string
-                                               {:name "Test Circle!"
-                                                :lead-link-name "Bill"
-                                                :lead-link-email "bfinn@example.com"})}))
+      (with response (http-post-request "circles"
+                                        (json/generate-string
+                                          {:name "Test Circle!"
+                                           :lead-link-name "Bill"
+                                           :lead-link-email "bfinn@example.com"})))
       (it "should redirect to the location of the newly created resource"
         (should= 303 (:status @response))
         (should-contain "application/json" (get-in @response [:headers "Content-Type"]))
@@ -54,18 +66,14 @@

     (context "when creating and retrieving the created circle"
       (with location (get (json/parse-string
-                            (:body (http-client/post
-                                     "http://localhost:3000/circles"
-                                     {:throw-exceptions false
-                                      :content-type :json
-                                      :body (json/generate-string
-                                              {:name "Test Circle!"
-                                               :lead-link-name "Bill"
-                                               :lead-link-email "bfinn@example.com"})})))
+                            (:body (http-post-request
+                                     "circles"
+                                     (json/generate-string
+                                       {:name "Test Circle!"
+                                        :lead-link-name "Bill"
+                                        :lead-link-email "bfinn@example.com"}))))
                             "location"))
-      (with get-response (http-client/get (str "http://localhost:3000"
-                                               @location)
-                                      {:throw-exceptions false}))
+      (with get-response (http-get-request @location))
       (it "should return the content that was created"
           (should= 200 (:status @get-response))
           (should= {"lead-link" {"email" "bfinn@example.com"
@@ -73,21 +81,21 @@
                    (json/parse-string (:body @get-response)))))

     (context "when creating multiple circles"
-      (before (http-client/post "http://localhost:3000/circles"
-                                      {:content-type :json
-                                       :body (json/generate-string
-                                               {:name "Test Circle!"
-                                                :lead-link-name "Bill"
-                                                :lead-link-email "bfinn@example.com"})}))
+      (before (http-post-request "circles"
+                                 (json/generate-string
+                                   {:name "Test Circle!"
+                                    :lead-link-name "Bill"
+                                    :lead-link-email "bfinn@example.com"})
+                                 {:throw-exceptions true}))

-      (before (http-client/post "http://localhost:3000/circles"
-                                      {:content-type :json
-                                       :body (json/generate-string
-                                               {:name "Test Circle 2"
-                                                :lead-link-name "Bill"
-                                                :lead-link-email "bfinn@example.com"})}))
-      (with get-response (http-client/get "http://localhost:3000/circles"
-                                          {:throw-exceptions false}))
+      (before (http-post-request "circles"
+                                 (json/generate-string
+                                   {:name "Test Circle 2"
+                                    :lead-link-name "Bill"
+                                    :lead-link-email "bfinn@example.com"})
+                                 {:throw-exceptions true}))
+
+      (with get-response (http-get-request "circles"))

       (it "should return an array of created circles"
         (should= 200 (:status @get-response))
@@ -97,48 +105,39 @@

   (context "roles"
     (context "when requesting the list of roles for a non-existent circle"
-      (with roles-response (http-client/get (str "http://localhost:3000/circles/1234/roles")
-                                            {:throw-exceptions false}))
+      (with roles-response (http-get-request "circles/1234/roles"))
         (it "should 404"
           (should= 404 (:status @roles-response))))

     (context "when posting a new role to a non-existent circle"
-      (with roles-response (http-client/post
-                             (str "http://localhost:3000/circles/1234/roles")
-                             {:throw-exceptions false
-                              :content-type :json
-                              :body (json/generate-string
-                                      {:name "My Role!"})}))
+      (with roles-response (http-post-request
+                             "circles/1234/roles"
+                             (json/generate-string {:name "My Role!"})))
         (it "should 400 with a helpful error message"
             (should= 400 (:status @roles-response))
             (should-contain "Circle 1234 does not exist." (:body @roles-response))))

     (context "with a new circle"
       (with circle-location (get (json/parse-string
-                            (:body (http-client/post
-                                     "http://localhost:3000/circles"
-                                     {:throw-exceptions false
-                                      :content-type :json
-                                      :body (json/generate-string
-                                              {:name "Test Circle!"
-                                               :lead-link-name "Bill"
-                                               :lead-link-email "bfinn@example.com"})})))
-                            "location"))
+                                   (:body (http-post-request
+                                            "circles"
+                                             (json/generate-string
+                                                     {:name "Test Circle!"
+                                                      :lead-link-name "Bill"
+                                                      :lead-link-email "bfinn@example.com"}))))
+                                 "location"))

         (context "when requesting the list of roles"
-          (with roles-response (http-client/get (str "http://localhost:3000" @circle-location "/roles")
-                                                {:throw-exceptions false}))
+          (with roles-response (http-get-request (str @circle-location "/roles")))
           (it "should return an empty array"
               (should= 200 (:status @roles-response))
               (should= "[]" (:body @roles-response))))

         (context "creating a role"
-          (with roles-response (http-client/post
-                                 (str "http://localhost:3000" @circle-location "/roles")
-                                 {:throw-exceptions false
-                                  :content-type :json
-                                  :body (json/generate-string
-                                          {:name "My Role!"})}))
+          (with roles-response (http-post-request
+                                 (str @circle-location "/roles")
+                                 (json/generate-string
+                                          {:name "My Role!"})))
           (it "should redirect to the location of the newly created resource"
               (should= 303 (:status @roles-response))
               (should-contain "application/json"


better name

better name

--- src/vignette/media_types.clj
+++ src/vignette/media_types.clj
@@ -8,23 +8,23 @@

 (def archive-dir "archive")

-(defmulti image-type->thumb-prefix (fn [object-map] (:image-type object-map)))
+(defmulti image-type->path-prefix (fn [object-map] (:image-type object-map)))

-(defmethod image-type->thumb-prefix "avatars" [object-map]
+(defmethod image-type->path-prefix "avatars" [object-map]
   (:image-type object-map))

-(defmethod image-type->thumb-prefix "images" [object-map]
+(defmethod image-type->path-prefix "images" [object-map]
   (let [prefix (:image-type object-map)]
     (if-let [lang (query-opt object-map :lang)]
       (str lang "/" prefix)
       prefix)))

-(defmethod image-type->thumb-prefix :default [object-map]
+(defmethod image-type->path-prefix :default [object-map]
   (throw+ {:type ::error :message (str "unsupported image-type "
                                        (:image-type object-map))}))

 (defn thumb-map->prefix [object-map]
-  (let [prefix (image-type->thumb-prefix object-map)]
+  (let [prefix (image-type->path-prefix object-map)]
     (str prefix "/thumb" )))

 (defn revision
@@ -53,7 +53,7 @@

 (defn original-path
   [data]
-  (let [prefix (image-type->thumb-prefix data)
+  (let [prefix (image-type->path-prefix data)
         image-path (clojure.string/join "/" ((juxt top-dir middle-dir) data))
         filename (revision-filename data)]
     (if (nil? (revision data))


Handle nil values in match validations.

Handle nil values in match validations.

--- clj_record/test/validation_built_ins_test.clj
+++ clj_record/test/validation_built_ins_test.clj
@@ -8,11 +8,13 @@
     (is (matches-foo? "yes foo does"))
     (are (not (matches-foo? _1))
       "no bar doesn't"
-      nil)))
+      nil
+      123)))

 (deftest non-match-creates-an-anti-matching-fn-for-the-given-pattern
   (let [non-matches-foo? (vfn/non-match #"foo")]
     (is (not (non-matches-foo? "foo doesn't not")))
     (are (non-matches-foo? _1)
       "bar non-matches"
-      nil)))
+      nil
+      123)))


Fix `eval*` exception behaviour

Fix `eval*` exception behaviour

--- src/taoensso/carmine.clj
+++ src/taoensso/carmine.clj
@@ -164,11 +164,14 @@
   of a \"NOSCRIPT\" reply, reattempts with `eval`. Returns the final command's
   reply."
   [script numkeys key & args]
-  (try (return (with-replies (apply evalsha* script numkeys key args)))
-       (catch Exception e
-         (if (.startsWith (.getMessage e) "NOSCRIPT")
-           (apply eval script numkeys key args)
-           (throw e)))))
+  (let [r (->> (apply evalsha* script numkeys key args)
+               (with-replies :as-pipeline)
+               (first))]
+    (if (instance? Exception r)
+      (if (.startsWith (.getMessage ^Exception r) "NOSCRIPT")
+        (apply eval script numkeys key args)
+        (throw r))
+      (return r))))

 (def ^:private interpolate-script
   "Substitutes indexed KEYS[]s and ARGV[]s for named variables in Lua script.


Add impl for some geom functions for image shapes.

--- src/uxbox/main/geom.cljs
+++ src/uxbox/main/geom.cljs
@@ -141,6 +141,7 @@
     :text (size-rect shape)
     :rect (size-rect shape)
     :icon (size-rect shape)
+    :image (size-rect shape)
     :path (size-rect shape)))

 (defn- size-rect
@@ -678,6 +679,7 @@
      :text (text-transformation-matrix state shape)
      :circle (circle-transformation-matrix state shape)
      :icon (icon-transformation-matrix state shape)
+     :image (icon-transformation-matrix state shape)
      :path (path-transformation-matrix state shape)
      :group (group-transformation-matrix state shape))))


Fix syntax on migration decl.

Fix syntax on migration decl.


toggle grid from chat

toggle grid from chat

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -665,31 +665,44 @@
         (assoc-in [:chat :entity-id] entity-id)
         (update-in [:entity-ids] disj entity-id))))

-(defmethod control-event :chat-submitted
-  [browser-state message _ state]
-  (-> state
-      (assoc-in [:chat :body] nil)
-      (assoc-in [:chat :entity-id] nil)))
+(defn chat-cmd [body]
+  (when (seq body)
+    (last (re-find #"^/([^\s]+)" body))))

 (defmulti handle-cmd-chat (fn [state cmd]
                             (utils/mlog "handling chat command:" cmd)
                             cmd))

-;; TODO: more robust cmd parsing
 (defmethod handle-cmd-chat :default
   [state cmd chat]
-  (utils/mlog "unknown chat command:" cmd))
-
-(defmethod handle-cmd-chat "invite"
+  (utils/mlog "unknown chat command:" cmd)
+  state)
+
+(defmethod handle-cmd-chat "toggle-grid"
+  [state cmd chat]
+  (update-in state [:camera :show-grid?] not))
+
+(defmethod control-event :chat-submitted
+  [browser-state message _ state]
+  (-> state
+      (handle-cmd-chat (chat-cmd (get-in state [:chat :body])) (get-in state [:chat :body]))
+      (assoc-in [:chat :body] nil)
+      (assoc-in [:chat :entity-id] nil)))
+
+(defmulti post-handle-cmd-chat (fn [state cmd]
+                                 (utils/mlog "post-handling chat command:" cmd)
+                                 cmd))
+
+;; TODO: more robust cmd parsing
+(defmethod post-handle-cmd-chat :default
+  [state cmd chat]
+  (utils/mlog "unknown post chat command:" cmd))
+
+(defmethod post-handle-cmd-chat "invite"
   [state cmd body]
   (let [email (last (re-find #"/invite\s+([^\s]+)" body))]
     (sente/send-msg (:sente state) [:frontend/send-invite {:document/id (:document/id state)
                                                            :email email}])))
-
-(defn chat-cmd [body]
-  (when (seq body)
-    (last (re-find #"^/([^\s]+)" body))))
-
 (defmethod post-control-event! :chat-submitted
   [browser-state message _ previous-state current-state]
   (let [db (:db current-state)
@@ -707,7 +720,7 @@
                       ;; server will overwrite this
                       :server/timestamp (js/Date.)}])
     (when-let [cmd (chat-cmd (get-in previous-state [:chat :body]))]
-      (handle-cmd-chat current-state cmd (get-in previous-state [:chat :body])))))
+      (post-handle-cmd-chat current-state cmd (get-in previous-state [:chat :body])))))

 (defmethod control-event :aside-menu-toggled
   [browser-state message _ state]


Description of auto-transition project flag

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -708,7 +708,13 @@
                             :title "Code Signing Support"
                             :blurb [:p
                                     "Enable automatic importing of code-signing identities and provisioning "
-                                    "profiles into the system keychain to simplify the code-signing process."]})]]])))))
+                                    "profiles into the system keychain to simplify the code-signing process."]})
+            (describe-flag {:flag :auto-transition
+                            :title "Automated transition to 2.0 platform"
+                            :blurb [:p
+                                    "This enables running builds on our 2.0 platform even if they are only configured for the 1.0 platform. "
+                                    "It is available and turned on by default for projects we expect it to work for. "
+                                    "You can turn it off if it is not working well for you. "]})]]])))))

 (defn dependencies [project-data owner]
   (reify


remove debug code

remove debug code

--- src-cljs/frontend/core.cljs
+++ src-cljs/frontend/core.cljs
@@ -268,8 +268,7 @@
                                                                            :handle-key-up      handle-key-up})
         doc-watcher-id           (.getNextUniqueId (.getInstance IdGenerator))]

-    (db/setup-issue-listener! (:issue-db @state) "issue-db" comms (:tal @state) ;(:sente @state)
-                              )
+    (db/setup-issue-listener! (:issue-db @state) "issue-db" comms (:sente @state))

     ;; This will allow us to update the url and title when the doc name changes
     (db/add-attribute-listener (:db @state) :document/name doc-watcher-id #(cast! :db-document-name-changed {:tx-data (map ds/datom-read-api (:tx-data %))}))


Clean up console messages

Clean up console messages

--- src-shared/cljs/cljs_webrepl/repl_thread.cljs
+++ src-shared/cljs/cljs_webrepl/repl_thread.cljs
@@ -18,15 +18,14 @@
     :master))

 (defn- deserialize [reader event]
-  (let [transit (-> event (aget "data") (aget "transit"))]
-    (debugf "Deserialize: %s %s" (worker-type) transit)
+  (let [transit (aget event "data" "transit")]
+    (tracef "Deserialize: %s %s" (worker-type) transit)
     (t/read reader transit)))

 (defn- serialize [writer msg]
-  (debugf "Serialize: %s %s" (worker-type) msg)
-  (let [msg (t/write writer msg)]
-    (debugf "Serialized: %s %s" (worker-type) msg)
-    (js-obj "transit" msg)))
+  (tracef "Serialize: %s %s" (worker-type) msg)
+  (let [transit (t/write writer msg)]
+    (js-obj "transit" transit)))

 (defn post-message [target writer msg]
   (try
@@ -43,7 +42,7 @@
         writer     (t/writer :json)

         finally-fn (fn []
-                     (debugf "Cleaning up WebWorker %s" (worker-type))
+                     (infof "Cleaning up WebWorker %s" (worker-type))
                      (close! input-ch)
                      (close! output-ch)
                      (when close-fn


Fixed tests for the Daemon

Fixed tests for the Daemon

--- modules/daemons/src/test/clojure/org/immutant/daemons/test/Daemon.clj
+++ modules/daemons/src/test/clojure/org/immutant/daemons/test/Daemon.clj
@@ -33,9 +33,7 @@

 (use-fixtures :each
               (fn [f]
-                (binding [*daemon* (Daemon. (ClojureRuntime. (.getClassLoader Daemon))
-                                            "org.immutant.daemons.test.Daemon/start-daemon"
-                                            "org.immutant.daemons.test.Daemon/stop-daemon")]
+                (binding [*daemon* (Daemon. start-daemon stop-daemon)]
                   (f))))

 (deftest start-should-call-the-start-function
@@ -47,8 +45,8 @@
   (is (= "stopped" @daemon-status)))

 (deftest stop-should-not-raise-if-no-stop-function-provided
-  (.setStopFunction *daemon* nil)
-  (is (not-thrown? Exception  (.stop *daemon*))))
+  (binding [*daemon* (Daemon. start-daemon nil)]
+    (is (not-thrown? Exception (.stop *daemon*)))))

 (deftest it-should-be-started-after-start
   (.start *daemon*)
@@ -64,9 +62,9 @@
   (is (= "STOPPED" (.getStatus *daemon*))))

 (deftest it-should-not-be-stopped-after-stop-if-no-stop-function-provided
-  (.setStopFunction *daemon* nil)
-  (.start *daemon*)
-  (.stop *daemon*)
-  (is-not (.isStopped *daemon*))
-  (is (.isStarted *daemon*))
-  (is (= "STARTED" (.getStatus *daemon*))))
+  (binding [*daemon* (Daemon. start-daemon nil)]
+    (.start *daemon*)
+    (.stop *daemon*)
+    (is-not (.isStopped *daemon*))
+    (is (.isStarted *daemon*))
+    (is (= "STARTED" (.getStatus *daemon*)))))


Get rid of vertical space by specifying vertical-align property

--- src/cljs/org/broadinstitute/firecloud_ui/common/table_utils.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table_utils.cljs
@@ -105,7 +105,8 @@

 (defn- render-cell [{:keys [width onResizeMouseDown onSortClick sortOrder] :as props}]
-  [:div {:style (merge {:display "inline-block" :position "relative" :width width :minWidth 10}
+  [:div {:style (merge {:display "inline-block" :verticalAlign "bottom"
+                        :position "relative" :width width :minWidth 10}
                   (:cell-style props))}
    (when (:onResizeMouseDown props)
      [:div {:style {:position "absolute" :width 20 :top 0 :bottom 0 :left (- width 10) :zIndex 1


Bumps version to 1.51.2-SNAPSHOT

Bumps version to 1.51.2-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.51.1"
+(defproject cook "1.51.2-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Snapshot version

Snapshot version

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.23.0"
+(defproject cook "1.23.1-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Bumps version to 1.54.1-SNAPSHOT

Bumps version to 1.54.1-SNAPSHOT

--- scheduler/project.clj
+++ scheduler/project.clj
@@ -13,7 +13,7 @@
 ;; See the License for the specific language governing permissions and
 ;; limitations under the License.
 ;;
-(defproject cook "1.54.0"
+(defproject cook "1.54.1-SNAPSHOT"
   :description "This launches jobs on a Mesos cluster with fair sharing and preemption"
   :license {:name "Apache License, Version 2.0"}
   :dependencies [[org.clojure/clojure "1.8.0"]


Two functions to write products and repositories into database

--- src/arachnida/git_data_fetcher.clj
+++ src/arachnida/git_data_fetcher.clj
@@ -14,6 +14,7 @@
 (require '[arachnida.db-interface  :as db-interface])
 (require '[arachnida.git-interface :as git-interface])
 (require '[arachnida.commits-stat  :as commits-stat])
+(require '[arachnida.config        :as config])

 (defn repo-url->directory-name
     "Prepares local directory name from repository URL."
@@ -110,8 +111,30 @@
         (doseq [repository repolist]
             (process-repository product repository))))

+(defn write-repositories-for-product-into-db
+    [product-name repositories]
+    (doseq [repository repositories]
+        (let [repository-name (name (key repository))
+              repository-url  (val repository)]
+              (println "        " repository-name)
+              (println "            [" repository-url "]")
+              (db-interface/insert-repository db-spec/data-db product-name repository-name repository-url))))
+
+(defn write-products-and-repositories-into-db
+    [products-and-repositories]
+    (println "Writing products and repositories into database")
+    (doseq [product products-and-repositories]
+        (let [product-name (name (key product))
+              repositories (val product)]
+              (println "    " product-name)
+              (db-interface/insert-product db-spec/data-db product-name)
+              (write-repositories-for-product-into-db product-name repositories)))
+    (println "Done"))
+
 (defn process
     []
+    (let [products-and-repositories (config/load-repositories)]
+        (write-products-and-repositories-into-db products-and-repositories))
     (let [products (db-interface/read-product-list)]
         (doseq [product products]
             (process-product product))))


remove dag_unify.core/merge

remove dag_unify.core/merge

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -1455,12 +1455,11 @@
                                                    (if (not (= :none (get-in lexeme path :none)))
                                                      (do (log/debug (str (first lexeme-kv) " generating lexeme exceptional surface form: " (surface-form-fn lexeme)))
                                                          (list {(surface-form-fn lexeme)
-                                                                [(dag_unify.core/merge ;; TODO: why are we using merge here? use unify instead if possible.
-
-                                                                  lexeme
-                                                                  (unifyc (merge-fn lexeme)
-                                                                          {:italiano {:infinitive k
-                                                                                :exception true}}))]})))))
+                                                                [(unifyc
+                                                                  (dissoc-paths lexeme [[:italiano :italiano]])
+                                                                  (merge-fn lexeme)
+                                                                  {:italiano {:infinitive k
+                                                                              :exception true}})]})))))
                                                lexemes)))
                                    [
                                     ;; 1. past-tense exceptions


kill in-progress drawings if you open the menu

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -327,7 +327,8 @@
       (update-in [:menu] assoc
                  :open? true
                  :x (get-in state [:mouse :x])
-                 :y (get-in state [:mouse :y]))))
+                 :y (get-in state [:mouse :y]))
+      (assoc-in [:drawing :in-progress?] false)))

 (defmethod control-event :menu-closed
   [target message _ state]


Add vcs-type param to unfollowed-project POST

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -470,17 +470,19 @@
                  (gstring/format "/api/v1/project/%s/unfollow" (vcs-url/project-name (:vcs_url repo)))
                  :unfollow-repo
                  api-ch
+                 :params {:vcs-type (:vcs_type repo)}
                  :context repo))
   (analytics/track-unfollow-repo))

 (defmethod post-control-event! :unfollowed-project
-  [target message {:keys [vcs-url project-id]} previous-state current-state]
+  [target message {:keys [vcs-url project-id] :as repo} previous-state current-state]
   (let [api-ch (get-in current-state [:comms :api])]
     (button-ajax :post
                  (gstring/format "/api/v1/project/%s/unfollow" (vcs-url/project-name vcs-url))
                  :unfollow-project
                  api-ch
+                 :params {:vcs-type (:vcs_type repo)}
                  :context {:project-id project-id}))
   (analytics/track-unfollow-project))


Remove some of most common extract-single-element calls for perf

--- src/angelic/domains/discrete_manipulation.clj
+++ src/angelic/domains/discrete_manipulation.clj
@@ -91,16 +91,16 @@

 (def move-base-step-reward -2)

-(defn make-base-dir [s [dirname dir]]
-  (let [const (state/get-var s :const)
-        base  (state/get-var s [:base])
-        nbase (add-pos base dir)]
-    (when (contains? (get const [:freespace]) nbase)
-      (env-util/make-factored-primitive
-       [:base dirname]
-       {[:base] base [:parked?] false}
-       {[:base] nbase}
-       move-base-step-reward))))
+(defn make-base-dir
+  ([s dp] (make-base-dir (state/get-var s :const)  (state/get-var s [:base]) dp))
+  ([const base [dirname dir]]
+     (let [nbase (add-pos base dir)]
+       (when (contains? (get const [:freespace]) nbase)
+         (env-util/make-factored-primitive
+          [:base dirname]
+          {[:base] base [:parked?] false}
+          {[:base] nbase}
+          move-base-step-reward)))))

 (def move-gripper-step-reward -1)

@@ -365,7 +365,8 @@
            {})))

      angelic/ImplicitAngelicAction
-     (precondition-context-set [a ss] (env/precondition-context a (state-set/some-element ss)))
+     (precondition-context-set [a ss] (reach-context (state-set/get-known-var ss :const)
+                                                     (state-set/get-known-var ss [:base])))
      (can-refine-from-set? [a ss] (state-set/vars-known? ss [[:gripper-offset]]))
      (immediate-refinements-set- [a ss]
        (for [p (hierarchy/immediate-refinements- a (state-set/some-element ss))]
@@ -426,7 +427,9 @@
   (pessimistic-map- [_ s] {})

   angelic/ImplicitAngelicAction
-  (precondition-context-set [a ss] (env/precondition-context a (state-set/some-element ss)))
+  (precondition-context-set [a ss] (conj (reach-context (state-set/get-known-var ss :const)
+                                                        (state-set/get-known-var ss [:base]))
+                                         [:pos o] [:at-goal? o] [:holding]))
   (can-refine-from-set? [a ss] true)
   (immediate-refinements-set- [a ss]
    (for [p (hierarchy/immediate-refinements- a (state-set/some-element ss))][{} p]))
@@ -487,7 +490,9 @@
   (pessimistic-map- [_ s] {})

   angelic/ImplicitAngelicAction
-  (precondition-context-set [a ss] (env/precondition-context a (state-set/some-element ss)))
+  (precondition-context-set [a ss] (conj (reach-context (state-set/get-known-var ss :const)
+                                                        (state-set/get-known-var ss [:base]))
+                                         [:holding] [:object-at dst]))
   (can-refine-from-set? [a ss] true)
   (immediate-refinements-set- [a ss]
    (for [p (hierarchy/immediate-refinements- a (state-set/some-element ss))] [{} p]))
@@ -541,8 +546,13 @@
   angelic/ImplicitAngelicAction
   (precondition-context-set [a ss] (env/precondition-context a :dummy))
   (can-refine-from-set? [a ss] true)
-  (immediate-refinements-set- [a ss]
-    (for [p (hierarchy/immediate-refinements- a (state-set/some-element ss))] [{} p]))
+  (immediate-refinements-set- [this ss]
+    (let [const (state-set/get-known-var ss :const)
+          base  (state-set/get-known-var ss [:base])]
+      (if (= dst base) [[{} []]]
+          (for [dir dirs :let [a (make-base-dir const base dir)] :when a]
+            [{} [a this]])))
+   #_    (for [p (hierarchy/immediate-refinements- a (state-set/some-element ss))] [{} p])) ;slower
   (optimistic-set-and-reward- [a ss]
     (assert (state-set/vars-known? ss [[:base]]))
     [(state/set-var ss [:base] #{dst})
@@ -749,7 +759,8 @@
   (pessimistic-map- [_ s] {})

   angelic/ImplicitAngelicAction
-  (precondition-context-set [a ss] (env/precondition-context a (state-set/some-element ss)))
+  (precondition-context-set [a ss]
+    (conj (reach-to-context (state-set/get-known-var ss :const) o-dst) [:holding] [:object-at o-dst]))
   (can-refine-from-set? [a ss] true)
   (immediate-refinements-set- [a ss]
     (let [const (state-set/get-known-var ss :const)
@@ -785,6 +796,11 @@
   (pessimistic-set-and-reward- [a ss] nil)
   ))

+(defn go-drop-pc [o const]
+  (conj (apply clojure.set/union
+               (map #(conj (reach-to-context const %) [:object-at %])
+                    (get const [:goal o])))
+          [:holding]))

 (defn make-go-drop-hla [o]
  (reify
@@ -793,11 +809,7 @@
   (primitive? [_] false)

   env/ContextualAction
-  (precondition-context [_ s]
-    (conj (apply clojure.set/union
-                 (map #(conj (reach-to-context (state/get-var s :const) %) [:object-at %])
-                      (get (state/get-var s :const) [:goal o])))
-          [:holding]))
+  (precondition-context [_ s] (go-drop-pc o (state/get-var s :const)))

   hierarchy/HighLevelAction
   (immediate-refinements- [_ s]
@@ -814,7 +826,7 @@
   (pessimistic-map- [_ s] {})

   angelic/ImplicitAngelicAction
-  (precondition-context-set [a ss] (env/precondition-context a (state-set/some-element ss)))
+  (precondition-context-set [a ss] (go-drop-pc o (state-set/get-known-var ss :const)))
   (can-refine-from-set? [a ss] true)
   (immediate-refinements-set- [a ss]
     (for [o-dst (get (state-set/get-known-var ss :const) [:goal o])]


Set graceful shutdown for Jetty and join when run through -main.

--- src/boss_work_manager_configuration/app.clj
+++ src/boss_work_manager_configuration/app.clj
@@ -8,6 +8,7 @@
             [ring.util.response :as response]))

 (defn load-model
+  "Loads a token file and returns a Markov model using mk-model."
   [path]
   (with-open [r (io/reader path)]
     (let [tokens (line-seq r)
@@ -25,22 +26,32 @@
   (route/resources "/"))

 (defn wrap-data
+  "Adds arbitrary data to a Ring request map."
   [handler data-map]
   (fn [req]
     (handler (merge req data-map))))

 (defn web-app
+  "Creates a new web app using the given token file to populate a Markov model."
   [path]
   (let [{:keys [model real-chains]} (load-model path)]
     (-> main-routes
         json/wrap-json-response
         (wrap-data {::model model ::real-chains real-chains}))))

+(defn configure
+  "Configures a Jetty instance by setting graceful shutdown."
+  [jetty]
+  (.setGracefulShutdown jetty (* 60 1000))
+  (.setStopAtShutdown jetty true))
+
 (defn run-web-app
-  [port]
+  "Runs a webapp on the given port and joins with the current thread, if specified."
+  [port join?]
   (jetty/run-jetty (web-app "resources/class-names")
                    {:port port
-                    :join? false}))
+                    :join? join?
+                    :configurator configure}))

 (defn -main [port]
-  (run-web-app (Integer. port)))
+  (run-web-app (Integer. port) true))


bugfix

bugfix

--- src/ardoq/swagger/sync_overview_workspace.clj
+++ src/ardoq/swagger/sync_overview_workspace.clj
@@ -49,8 +49,7 @@

 (defn ensure-entry-in-overview-ws [client spec-root-component overview]
-  (if-let [workspace (common/find-existing-resource client (:overview-workspace overview) #(api-client/map->Workspace {}))]
-    (prn "Populating Overview workspace" overview)
+  (when-let [workspace (common/find-existing-resource client (:overview-workspace overview) #(api-client/map->Workspace {}))]
     (if-let [existing-component (->> (:name spec-root-component)
                                   (api-client/find-components-by-name client (:_id workspace))
                                   (filter #(= (:type %) (:overview-component-type overview)))


Sorted results by criteria id in Java API

--- src/clojure/alfresco_technical_validation/core.clj
+++ src/clojure/alfresco_technical_validation/core.clj
@@ -264,4 +264,4 @@
   ([source binaries neo4j-url]           (validate-java source binaries neo4j-url nil))
   ([source binaries neo4j-url status-fn] (validate-java (index-extension source binaries neo4j-url status-fn) status-fn))
   ([indexes status-fn]
-    (doall (concat (map java-ify-result (validate indexes status-fn)) (java-ify-missing-results)))))
+    (doall (sort-by #(get % "criteriaId") (concat (map java-ify-result (validate indexes status-fn)) (java-ify-missing-results))))))


show online users in sidebar

show online users in sidebar

--- src/chat/client/views/sidebar.cljs
+++ src/chat/client/views/sidebar.cljs
@@ -107,9 +107,9 @@

         (dom/h2 nil "Members")
         (apply dom/div #js {:className "users"}
-          (->> [{:nickname "foobar"
-                 :id (uuid/make-random-squuid)}
-                {:nickname "michael"
-                 :id (uuid/make-random-squuid)}]
+          (->> (@store/app-state :users)
+               vals
+               (filter (fn [user] (= :online (user :status))))
+               (remove (fn [user] (= (get-in @store/app-state [:session :user-id]) (user :id))))
                (map (fn [user]
                       (dom/div nil (om/build user-view user))))))))))


fixed palo refactoring (broken token regeneration)

--- src/cljs/swarmpit/component/api_access.cljs
+++ src/cljs/swarmpit/component/api_access.cljs
@@ -58,60 +58,56 @@
      :variant         "outlined"
      :margin          "normal"
      :multiline       true
-     :defaultValue    value
+     :value           value
      :InputProps      {:readOnly true
                        :style    {:fontFamily "monospace"}}
      :InputLabelProps {:shrink true}}))

 (defn old-token-form [api-token]
-  [(comp/typography
-     {:key "ost"}
-     ["Token for this user was already created. If you lost your token, please generate new one and "
-      "the former token will be revoked."])
+  [(comp/typography {:key "info"}
+                    ["Token for this user was already created. If you lost your token, please generate new one and "
+                     "the former token will be revoked."])
    (form-token (str "Bearer ..." (:mask api-token)))])

 (defn new-token-form [token]
-  [(comp/typography
-     {:key "nst"}
-     ["Copy your token and store it safely, value will be displayed only once."])
+  [(comp/typography {:key "notice"} "Copy your token and store it safely, value will be displayed only once.")
    (form-token (:token token))])

 (defn no-token-form []
-  [(comp/typography
-     {:key "nost1"} "Your user doesn't have any API token.")
-   (comp/typography
-     {:key "nost2"} "New token doesn't expire, but it can be revoked.")])
+  [(comp/typography {:key "notoken"} "Your user doesn't have any API token.")
+   (comp/typography {:key "info"} "New token doesn't expire, but it can be revoked or regenenerated.")])

-(rum/defc form-api-token < rum/static [{:keys [api-token token]}]
-  (let [state (if (and api-token (not token))
+(rum/defc form-api-token < rum/reactive []
+  (let [{:keys [api-token token]} (state/react state/form-value-cursor)
+        state (if (and api-token (not token))
                 :old
                 (if token :new :none))]
     (comp/grid
       {:item true
-       :key  "aag"
+       :key  "root"
        :xs   12
        :sm   6
        :md   7
        :lg   6}
       (comp/card
         {:className "Swarmpit-form-card"
-         :key       "aagc"}
+         :key       "card"}
         (comp/card-header
           {:className "Swarmpit-form-card-header"
-           :key       "aagch"
+           :key       "header"
            :title     (case state
                         :none "Create API token"
                         :old "API Token"
                         :new "New API token")})
         (comp/card-content
-          {:key "aagcc"}
+          {:key "content"}
           (comp/grid
             {:container true
-             :key       "aagccc"
+             :key       "outer"
              :spacing   40}
             (comp/grid
               {:item true
-               :key  "aagcccig"
+               :key  "inner"
                :xs   12}
               (case state
                 :old (old-token-form api-token)
@@ -119,17 +115,17 @@
                 :none (no-token-form))))
           (html
             [:div {:class "Swarmpit-form-buttons"
-                   :key   "aagccbtn"}
+                   :key   "actions"}
              (comp/button
                {:variant  "contained"
-                :key      "aagccbtnc"
+                :key      "submit"
                 :disabled false
                 :onClick  generate-handler
                 :color    "primary"}
                (case state :none "Generate" "Regenerate"))
              (comp/button
                {:variant  "outlined"
-                :key      "aagccbtnr"
+                :key      "remove"
                 :disabled (= :none state)
                 :onClick  remove-handler}
                "Remove")]))))))


radio keyboard control

radio keyboard control

--- src/cljs/re_form/inputs/radio_input_impl.cljs
+++ src/cljs/re_form/inputs/radio_input_impl.cljs
@@ -5,7 +5,8 @@
 (defn radio-input-styles
   [{:keys [h h2 h3 selection-bg-color hover-bg-color border]}]
   [:div.re-radio-group
-   {:display :inline-block}
+   {:display :inline-block
+    :outline :none}
    [:div.option {:cursor :pointer
                  :border-radius (u/px 2)
                  :line-height (u/px h3)
@@ -31,15 +32,33 @@
      [:.radio [:.inner-radio {:display :inline-block}]]]
     [:&:hover {:opacity 1 :background-color hover-bg-color}]]])

-(defn radio-input [{:keys [value on-change value-fn label-fn items] :as props}]
+(defn radio-input [{:keys [value-fn label-fn on-change] :as props}]
   (let [label-fn (or label-fn pr-str)
-        value-fn (or value-fn identity)]
-    [:div.re-radio-group
-     (doall
-      (for [i items]
-        [:div.option
-         {:key (pr-str i)
-          :class (when (= (value-fn i) value) "active")
-          :on-click #(on-change (value-fn i))}
-         [:span.radio [:div.inner-radio]]
-         [:span.value (label-fn i)]]))]))
+        value-fn (or value-fn identity)
+        arrow-handler (fn [e]
+                        (when-let [active (aget (.getElementsByClassName
+                                                 (.-target e) "active") 0)]
+                          (case (.-keyCode e)
+                            38 (when-let [prev-sibl (.-previousSibling active)]
+                                 (.click prev-sibl))
+                            40 (when-let [next-sibl (.-nextSibling active)]
+                                 (.click next-sibl))
+                            nil)))]
+
+    (r/create-class
+     {
+      :component-did-mount
+      (fn [this] (.addEventListener (r/dom-node this) "keydown" arrow-handler))
+
+      :component-will-unmount
+      (fn [this] (.removeEventListener (r/dom-node this) "keydown" arrow-handler))
+
+      :reagent-render
+      (fn [{:keys [value on-change items]}]
+        [:div.re-radio-group {:tab-index 0}
+         (for [i items] ^{:key (pr-str i)}
+           [:div.option
+            {:class (when (= (value-fn i) value) "active")
+             :on-click #(on-change (value-fn i))}
+            [:span.radio [:div.inner-radio]]
+            [:span.value (label-fn i)]])])})))


Don't decode + signs in URL paths. Fixes #164

--- src/clj/clojuredocs/pages/vars.clj
+++ src/clj/clojuredocs/pages/vars.clj
@@ -5,6 +5,7 @@
             [clojuredocs.search :as search]
             [clojuredocs.pages.common :as common]
             [clojuredocs.data :as data]
+            [ring.util.codec :as codec]
             [hiccup.core :as hc]))

 (defn ellipsis [s n]
@@ -110,7 +111,7 @@
         (map #($arglist name %) arglists))]]]])

 (defn var-page-handler [ns name]
-  (let [name (util/cd-decode (util/url-decode name))
+  (let [name (util/cd-decode (codec/url-decode name))
         {:keys [arglists name ns doc runtimes added file] :as v} (lookup-var ns name)]
     (fn [{:keys [user session uri]}]
       (when v


fix linked-in modal

fix linked-in modal

--- src/cljs/salava/core/ui/share.cljs
+++ src/cljs/salava/core/ui/share.cljs
@@ -5,9 +5,9 @@
             [salava.core.ui.helper :refer [private? base-url]]
             [markdown.core :refer [md->html]]
             [salava.core.time :refer [date-from-unix-time unix-time]]
-            [reagent-modals.modals :as m :refer [close-modal!]]
             [salava.core.i18n :refer [t]]
-            ))
+            [salava.core.ui.modal :as mo]))
+
 (def video-link-fi "")
 (def video-link-en "")

@@ -123,101 +123,56 @@

-(defn content-modal-render [url title {:keys [name authory licence url datefrom dateto] :as certification}]
-  [:div.badge-settings
-   [:div.modal-body
-    [:div.row
-     [:div.col-md-12
-      [:button {:type         "button"
-                :class        "close"
-                :data-dismiss "modal"
-                :aria-label   "OK"}
-       [:span {:aria-hidden             "true"
-               :dangerouslySetInnerHTML {:__html "×"}}]]]]
-    [:div.col-xs-12.certification
-                         [:div.row
-                          [:div.guide-text.margin-bottom
-                           [:h3 (t :core/Sharelinkedinaddcredit) ]
-                           [:p (str (t :core/Sharelinkedincopytip) ".")]
-                           [:div [:a {:href "#" :on-click #(open-linkedin-popup)}
-                                  (add-to-profile-image)]
-                            [:a {:href "https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME" :target "_blank"} (str " " (t :core/Sharelinkedinclickhere) ".")]]]]
-                         [:div.row
-                          [:div.col-md-6.copy-boxes
-                           [:form {:class "form-horizontal"}
-                            [input-button (t :core/Certificationname)  "name" name]
-                            [input-button (t :core/Certificationauthority) "authory" authory]
-                            [input-button (t :core/Licensenumber) "licence" licence]
-                            [input-date datefrom dateto]
-                            [input-button (t :core/Certificationurl) "url" url]]]
-                          (tutorial-video)
-                          ]]]
-   [:div.modal-footer
-    #_[:button {:type         "button"
-              :class        "btn btn-primary"
-              :data-dismiss "modal"}
-     (t :core/Close)]]])
-
-(defn linkedin-modal [url title certification]
-  (create-class {:reagent-render         (fn [url title public?] (content-modal-render url title certification))
-                 :component-will-unmount (fn []
-                                           (close-modal!))}))
-
-
-
-
-
-
-(defn linkedin-modal1 [url title certification]
+(defn content-modal-render [{:keys [url title certification]}]
+  (let [{:keys [name authory licence url datefrom dateto]} certification]
+    (fn []
+      [:div.badge-settings
+       [:div.modal-body
+        [:div.col-xs-12.certification
+         [:div.row.flip
+          [:div.guide-text.margin-bottom
+           [:h3 (t :core/Sharelinkedinaddcredit) ]
+           [:p (str (t :core/Sharelinkedincopytip) ".")]
+           [:div [:a {:href "#" :on-click #(open-linkedin-popup)}
+                  (add-to-profile-image)]
+            [:a {:href "https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME" :target "_blank"} (str " " (t :core/Sharelinkedinclickhere) ".")]]]]
+         [:div.row.flip
+          [:div.col-md-6.copy-boxes
+           [:form {:class "form-horizontal"}
+            [input-button (t :core/Certificationname)  "name" name]
+            [input-button (t :core/Certificationauthority) "authory" authory]
+            [input-button (t :core/Licensenumber) "licence" licence]
+            [input-date datefrom dateto]
+            [input-button (t :core/Certificationurl) "url" url]]]
+          (tutorial-video)
+          ]]]])))
+
+
+(defn linkedin-modal1 [{:keys [url title certification] }]
   (let [site-name (session/get-in [:share :site-name])
         hashtag (session/get-in [:share :hashtag])]
-    [:div.badge-settings
-     [:div.modal-body
-      [:div.row
-       [:div.col-md-12
-        [:button {:type         "button"
-                  :class        "close"
-                  :data-dismiss "modal"
-                  :aria-label   "OK"}
-         [:span {:aria-hidden             "true"
-                 :dangerouslySetInnerHTML {:__html "×"}}]]]]
-      [:div.certification
-       [:div.guide-text
-        [:h3  (t :core/Shareonlinkedin)]
-        [:div (str (t :core/Sharelinkedintip) "! "
-                   (t :core/Sharelinkedinprofile) ":") ]]
-       [:div
-        [:a {:class    "btn btn-oauth btn-linkedin text-center"
-             :href     "#"
-             :on-click (fn []
-                         (do
-
-                           #_(-> (js* "$('#reagent-modal .modal-dialog')")
-                               (.addClass "modal-lg" )
-                               (.removeClass "modal-sm"))
-                           (js/setTimeout #(open-linkedin-popup) 700)
-                           #_(close-modal!)
-                           (m/modal! [linkedin-modal url title certification] {:size :lg})
-                           )
-                         )}
-         [:i {:class "fa fa-linkedin"}]
-         (t :core/Addtoprofile)]]
-       [:div (str (t :core/Sharelinkedinupdate) ":") ]
-       [:div
-        [:a {:class "btn btn-oauth btn-linkedin" :href (str "https://www.linkedin.com/shareArticle?mini=true&url=" url "&title=" (js/encodeURIComponent title) "&summary=" (js/encodeURIComponent (str site-name ": " title)) "&source=" hashtag) :rel "nofollow" :target "_blank"}
-         [:i {:class "fa fa-linkedin"}]
-         (t :badge/Share)]
-        ]]]
-     [:div.modal-footer
-      #_[:button {:type         "button"
-                  :class        "btn btn-primary"
-                  :data-dismiss "modal"}
-         (t :core/Close)]]]))
-
-
-
-
-
+    (fn []
+      [:div.badge-settings
+       [:div.modal-body
+        [:div.certification
+         [:div.guide-text
+          [:h3  (t :core/Shareonlinkedin)]
+          [:div (str (t :core/Sharelinkedintip) "! "
+                     (t :core/Sharelinkedinprofile) ":") ]]
+         [:div
+          [:a {:class    "btn btn-oauth btn-linkedin text-center"
+               :href     "#"
+               :on-click #(do
+                            (js/setTimeout (open-linkedin-popup) 700)
+                            (mo/open-modal [:badge :linkedin2] {:url url :title title :certification certification}))}
+           [:i {:class "fa fa-linkedin"}]
+           (t :core/Addtoprofile)]]
+         [:div (str (t :core/Sharelinkedinupdate) ":") ]
+         [:div
+          [:a {:class "btn btn-oauth btn-linkedin" :href (str "https://www.linkedin.com/shareArticle?mini=true&url=" url "&title=" (js/encodeURIComponent title) "&summary=" (js/encodeURIComponent (str site-name ": " title)) "&source=" hashtag) :rel "nofollow" :target "_blank"}
+           [:i {:class "fa fa-linkedin"}]
+           (t :badge/Share)]
+          ]]]])))

@@ -244,23 +199,10 @@
                          (js/encodeURIComponent (str site-name ": " title))
                          "&url=" (js/encodeURIComponent url) "&hashtags=" hashtag)
             :target "_blank"}
-        [:i {:class "fa fa-twitter-square"}]]
-       ]
-                                        ;[:div.share-button
-                                        ;[:iframe {:id "tweet-button"
-                                        ;         :allowTransparency true
-                                        ;        :frameBorder 0
-                                        ;       :scrolling "no"
-                                        ;      :style {:width "55px"
-                                        ;             :height "20px"}
-                                        ;    :src (str "https://platform.twitter.com/widgets/tweet_button.html?size=medium&count=none&text="
-                                        ;             (js/encodeURIComponent (str "Open Badge Passport: " title))
-                                        ;            "&url=" (js/encodeURIComponent url) "&hashtags=OpenBadgePassport")}]]
-                                        ;[:div.share-button
-                                        ; [:script {:type "IN/Share" :data-url url}]]
+        [:i {:class "fa fa-twitter-square"}]]]
       [:div.share-button
        (if is-badge?
-         [:a {:href "#" :on-click #(m/modal! [linkedin-modal1 url title certification] {:size :sm} )}
+         [:a {:href "#" :on-click #(mo/open-modal [:badge :linkedin1] {:url url :title title :certification certification})}
           [:i {:title "LinkedIn Share" :class "fa fa-linkedin-square"}]]
          #_[:a {:href (str "https://www.linkedin.com/profile/add?_ed=0_JhwrBa9BO0xNXajaEZH4q5ax3e9v34rhyYLtaPv6h1UAvW5fJAD--ayg_G2AIDAQaSgvthvZk7wTBMS3S-m0L6A6mLjErM6PJiwMkk6nYZylU7__75hCVwJdOTZCAkdv&pfCertificationName=" title "&pfCertificationUrl=" url "&trk=onsite_html" )
                 :target "_blank"}


fix code stylish

fix code stylish

--- src/cljs/salava/core/ui/share.cljs
+++ src/cljs/salava/core/ui/share.cljs
@@ -44,8 +44,7 @@
               :target "_blank"}
           [:i {:title "LinkedIn Add to Profile" :class "inprofile fa fa-linkedin-square"}]]
          [:div.share-button
-          [:a {:href                                                                                (str "https://www.linkedin.com/shareArticle?mini=true&url=" url "&title=" title
-                                                                                "&summary=" (js/encodeURIComponent (str site-name ": " title)) "&source=" hashtag) :target "_blank"}
+          [:a {:href (str "https://www.linkedin.com/shareArticle?mini=true&url=" url "&title=" title "&summary=" (js/encodeURIComponent (str site-name ": " title)) "&source=" hashtag) :target "_blank"}
            [:i {:title "LinkedIn Share" :class "fa fa-linkedin-square"}]]]
          )]
       [:div.share-button


refactor entry->string func

refactor entry->string func

--- src/com/billpiel/mem_tracer/string_output.clj
+++ src/com/billpiel/mem_tracer/string_output.clj
@@ -115,6 +115,9 @@
                                                    :text "> "})
                                (color-code :fg* (dec depth) :bg 0 :bold false)
                                (:name entry)
+                               "  "
+                               (color-code :fg 7)
+                               (:id entry)
                                reset-color-code]))))

 (defn args-str
@@ -167,16 +170,32 @@
          "\n")))

 (defn entry->string
-  [entry]
-  (->> [(header->string entry)
-        "\n"
-        (args-str entry)
-        (return-str entry)
-        (clojure.string/join "" (mapcat entry->string (:children entry)))
-        (when (some-> entry :children not-empty) (return-str entry))
-        (throw-str entry)]
-       (remove nil?)
-       (clojure.string/join "")))
+  [entry & {:keys [post-head pre-args post-args pre-ret post-ret pre-ex post-ex children]
+            :or {post-head true pre-args true post-args true pre-ret true post-ret true pre-ex true post-ex true children true}}]
+  (let [has-children (some-> entry
+                             :children
+                             not-empty)]
+    (->> [[(header->string entry) "\n"]
+          (when pre-args
+            (args-str entry))
+          (when pre-ret
+            (return-str entry))
+          (when pre-ex
+            (throw-str entry))
+          (when has-children
+            [(mapcat entry->string
+                     (:children entry))
+             (when post-head
+               [(header->string entry) "\n"])
+             (when pre-args
+               (args-str entry))
+             (when post-ret
+               (return-str entry))
+             (when post-ex
+               (throw-str entry))])]
+         flatten
+         (remove nil?)
+         (clojure.string/join ""))))

 (defn print-entry
   [entry]


Keep attribute as possible set

Keep attribute as possible set

--- src/com/wsscode/pathom/connect/indexes.cljc
+++ src/com/wsscode/pathom/connect/indexes.cljc
@@ -3,7 +3,7 @@
             [com.wsscode.pathom.core :as p]
             [clojure.spec.alpha :as s]))

-(>def :com.wsscode.pathom.connect/attribute ::p/attribute)
+(>def :com.wsscode.pathom.connect/attribute (s/or :attribute ::p/attribute :set :com.wsscode.pathom.connect/attributes-set))
 (>def :com.wsscode.pathom.connect/attributes-set (s/coll-of ::p/attribute :kind set?))
 (>def :com.wsscode.pathom.connect/io-map (s/map-of :com.wsscode.pathom.connect/attribute :com.wsscode.pathom.connect/io-map))


Fixed bad merge

Fixed bad merge

--- src/ardoq/analytics_clj.clj
+++ src/ardoq/analytics_clj.clj
@@ -72,7 +72,7 @@
   ([^AnalyticsClient client ^String user-id ^String event properties & [{:keys [timestamp options callback]}]]
      (let [the-callback (if callback (reify Callback (onResponse [this success message] (callback success message))))
            properties (EventProperties. (into-array Object (apply concat (vec (map-keys name properties)))))
-           options (reduce (fn [t [k v]] (.put t (name k) v)) (context.) options)]
+           options (reduce (fn [t [k v]] (.put t (name k) v)) (context) options)]
        (.track client user-id event properties timestamp options the-callback))))

 (defn make-alias


use unify! rather than unify when possible

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -6,7 +6,7 @@
    [babel.exception :refer [exception]]
    #?(:cljs [babel.logjs :as log])
    #?(:clj [clojure.tools.logging :as log])
-   [dag_unify.core :refer [strip-refs unify]]))
+   [dag_unify.core :refer [strip-refs unify unify!]]))

 ;; TODO: use clojure.core/isa? and clojure.core/derive where possible
 ;; in here, e.g.: (derive ::human ::animal)
@@ -292,10 +292,10 @@
 ;; they lack a {:pred} value.
 (def verb-pred-defaults
   (map (fn [sem]
-         (unify {:synsem {:aux false
-                          :sem {:shared-with-obj false} ;; prevent matching reflexive verbs.
-                          :cat :verb}}
-                {:synsem {:sem sem}}))
+         (unify! {:synsem {:aux false
+                           :sem {:shared-with-obj false} ;; prevent matching reflexive verbs.
+                           :cat :verb}}
+                 {:synsem {:sem sem}}))

        [{:pred :abbracciare
          :active false


s/eating/thinking/

s/eating/thinking/

--- src/babel/english/demo.cljc
+++ src/babel/english/demo.cljc
@@ -22,9 +22,9 @@
                    :sem {:subj {:pred :cane}
                          :pred :mangiare}}}

-         {:demo-name "Sentences about Eating"
+         {:demo-name "Sentences about thinking"
           :synsem {:cat :verb
-                   :sem {:pred :mangiare}}}
+                   :sem {:pred :think}}}

          {:synsem {:cat :verb}
           :demo-name "Sentences"}


make multiple classes tests pass

make multiple classes tests pass


fixed metadata mapping -> rootcause of service been detached from stack on update

--- src/clj/swarmpit/docker/mapper/outbound.clj
+++ src/clj/swarmpit/docker/mapper/outbound.clj
@@ -140,25 +140,41 @@
     (str repository ":" tag)))

 (defn ->service-metadata
-  [service]
-  (let [autoredeploy (str (get-in service [:deployment :autoredeploy]))
+  [service image]
+  (let [autoredeploy (get-in service [:deployment :autoredeploy])
+        stack (:stack service)
         image-id (get-in service [:repository :imageId])
         distribution-id (get-in service [:distribution :id])
         distribution-type (get-in service [:distribution :type])
-        metadata {:swarmpit.service.deployment.autoredeploy autoredeploy
-                  :swarmpit.service.repository.image.id     image-id}]
-    (if (not-empty distribution-type)
-      (merge {:swarmpit.service.distribution.id   distribution-id
-              :swarmpit.service.distribution.type distribution-type} metadata)
-      metadata)))
+        metadata (volatile! {})]
+    (when (some? stack)
+      (vswap! metadata #(merge {:com.docker.stack.namespace stack
+                                :com.docker.stack.image     image} %)))
+    (when (some? autoredeploy)
+      (vswap! metadata #(merge {:swarmpit.service.deployment.autoredeploy (str autoredeploy)} %)))
+    (when (some? image-id)
+      (vswap! metadata #(merge {:swarmpit.service.repository.image.id image-id} %)))
+    (when (some? distribution-type)
+      (vswap! metadata #(merge {:swarmpit.service.distribution.id   distribution-id
+                                :swarmpit.service.distribution.type distribution-type} %)))
+    @metadata))
+
+(defn ->container-metadata
+  [service]
+  (let [stack (:stack service)
+        metadata (volatile! {})]
+    (when (some? stack)
+      (vswap! metadata #(merge {:com.docker.stack.namespace stack} %)))
+    @metadata))

 (defn ->service
   [service image]
   {:Name           (:serviceName service)
    :Labels         (merge
                      (->service-labels service)
-                     (->service-metadata service))
+                     (->service-metadata service image))
    :TaskTemplate   {:ContainerSpec {:Image   image
+                                    :Labels  (->container-metadata service)
                                     :Mounts  (->service-mounts service)
                                     :Secrets (:secrets service)
                                     :Env     (->service-variables service)}


redirect directly to service-list on login instead of index

--- src/cljs/swarmpit/component/page_login.cljs
+++ src/cljs/swarmpit/component/page_login.cljs
@@ -28,7 +28,7 @@
       (reset! local-state)
       (storage/add "token" (:token response))
       (dispatch!
-        (routes/path-for-frontend :index)))
+        (routes/path-for-frontend :service-list)))
     (fn [response]
       (swap! local-state assoc :message (:error response)))))


Removing accidental left over code tracking queries.

--- src/cmr/search/services/query_execution.clj
+++ src/cmr/search/services/query_execution.clj
@@ -139,11 +139,9 @@
                                    #(acl-service/filter-concepts context %)))]
     (post-process-query-result-features context query elastic-results query-results)))

-(def last-query (atom nil))

 (defmethod execute-query :elastic
   [context query]
-  (reset! last-query query)
   (let [pre-processed-query (pre-process-query-result-features context query)
         processed-query (r/resolve-collection-queries context pre-processed-query)
         collection-ids (ce/extract-collection-concept-ids processed-query)


Endpoint /user-glossary

Endpoint /user-glossary

--- src/zg/server.clj
+++ src/zg/server.clj
@@ -404,6 +404,7 @@
             "/users-atomic-typos"     (process-user-list     request title :atomic-typos)
             "/user-whitelist"         (process-user-info     request title :whitelist)
             "/user-blacklist"         (process-user-info     request title :blacklist)
+            "/user-glossary"          (process-user-info     request title :glossary)
             "/all-words/json"         (process-wordlist-json request nil)
             "/all-words/text"         (process-wordlist-text request nil)
             "/all-words/xml"          (process-wordlist-xml  request nil)


migrate uses db conn state

migrate uses db conn state

--- src/chat/server/migrate.clj
+++ src/chat/server/migrate.clj
@@ -8,7 +8,7 @@
 (defn migrate-2016-05-13
   "Threads have associated groups"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :thread/group
       :db/valueType :db.type/ref
       :db/cardinality :db.cardinality/one
@@ -17,9 +17,9 @@
   (let [threads (->> (d/q '[:find [?t ...]
                             :where
                             [?t :thread/id]]
-                          (d/db db/*conn*))
+                          (d/db db/conn))
                      (d/pull-many
-                       (d/db db/*conn*)
+                       (d/db db/conn)
                        [:thread/id
                         {:thread/mentioned [:user/id]}
                         {:thread/tag [:tag/group]}
@@ -35,7 +35,7 @@
                   author-grp (some-> author :user/id
                                      db/get-groups-for-user
                                      first :id)
-                  fallback-group (:group/id (d/pull (d/db db/*conn*) [:group/id] [:group/name "Braid"]))]
+                  fallback-group (:group/id (d/pull (d/db db/conn) [:group/id] [:group/name "Braid"]))]
               (cond
                 (seq (th :thread/tag))
                 (let [grp (get-in th [:thread/tag 0 :tag/group :db/id])]
@@ -63,16 +63,16 @@
                     (println "nil by author" (th :thread/id)))
                   [:db/add [:thread/id (th :thread/id)]
                    :thread/group [:group/id grp]])))))]
-    (d/transact db/*conn* tx)))
+    (d/transact db/conn tx)))

 (defn migrate-2016-05-07
   "Change how user preferences are stored"
   []
   ; rename old prefs
-  (d/transact db/*conn* [{:db/id :user/preferences
+  (d/transact db/conn [{:db/id :user/preferences
                           :db/ident :user/preferences-old}])
   ; create new entity type
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :user/preferences
       :db/valueType :db.type/ref
       :db/cardinality :db.cardinality/many
@@ -93,7 +93,7 @@
   ; migrate to new style
   (let [prefs (d/q '[:find (pull ?u [:user/id :user/preferences-old])
                      :where [?u :user/id]]
-                   (d/db db/*conn*))]
+                   (d/db db/conn))]
     (doseq [[p] prefs]
       (let [u-id (:user/id p)
             u-prefs (edn/read-string (:user/preferences-old p))]
@@ -103,7 +103,7 @@
 (defn migrate-2016-05-03
   "Add tag descriptions"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :tag/description
       :db/valueType :db.type/string
       :db/cardinality :db.cardinality/one
@@ -113,7 +113,7 @@
 (defn migrate-2016-04-29
   "Add group admins"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :group/admins
       :db/valueType :db.type/ref
       :db/cardinality :db.cardinality/many
@@ -123,7 +123,7 @@
 (defn migrate-2016-03-28
   "Add group settings"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :group/settings
       :db/valueType :db.type/string
       :db/cardinality :db.cardinality/one
@@ -133,7 +133,7 @@
 (defn migrate-2016-03-21
   "Add user preferences"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :user/preferences
       :db/valueType :db.type/string
       :db/cardinality :db.cardinality/one
@@ -143,7 +143,7 @@
 (defn migrate-2016-03-04
   "Add extension type as attribute"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :extension/type
       :db/valueType :db.type/keyword
       :db/cardinality :db.cardinality/one
@@ -153,7 +153,7 @@
 (defn migrate-2016-03-02
   "Add extension user"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :extension/user
       :db/valueType :db.type/ref
       :db/cardinality :db.cardinality/one
@@ -163,7 +163,7 @@
 (defn migrate-2016-02-26
   "Add extension schema"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :extension/id
       :db/valueType :db.type/uuid
       :db/cardinality :db.cardinality/one
@@ -203,17 +203,17 @@
   (let [give-nicks (->> (d/q '[:find (pull ?u [:user/id :user/email :user/nickname])
                                :where
                                [?u :user/id]]
-                             (d/db db/*conn*))
+                             (d/db db/conn))
                         (map first)
                         (filter (comp nil? :user/nickname))
                         (mapv (fn [u] [:db/add [:user/id (:user/id u)]
                                        :user/nickname (-> (:user/email u) (string/split #"@") first)])))]
-    (d/transact db/*conn* give-nicks)))
+    (d/transact db/conn give-nicks)))

 (defn migrate-2016-01-01
   "Change email uniqueness to /value, add thread mentions"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/id :user/email
       :db/unique :db.unique/value
       :db.alter/_attribute :db.part/db}
@@ -226,7 +226,7 @@
 (defn migrate-2015-12-19
   "Add user nicknames"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :user/nickname
       :db/valueType :db.type/string
       :db/cardinality :db.cardinality/one
@@ -238,8 +238,8 @@
   "Make content fulltext"
   []
   ; rename content
-  (d/transact db/*conn* [{:db/id :message/content :db/ident :message/content-old}])
-  (d/transact db/*conn* [{:db/ident :message/content
+  (d/transact db/conn [{:db/id :message/content :db/ident :message/content-old}])
+  (d/transact db/conn [{:db/ident :message/content
                                         :db/valueType :db.type/string
                                         :db/fulltext true
                                         :db/cardinality :db.cardinality/one
@@ -251,18 +251,18 @@
                                              {:message/user [:user/id]}
                                              {:message/thread [:thread/id]}])
                              :where [?e :message/id]]
-                           (d/db db/*conn*))
+                           (d/db db/conn))
                       (map first))]
     (let [msg-tx (->> messages
                       (map (fn [msg]
                              [:db/add [:message/id (msg :message/id)]
                               :message/content (msg :message/content-old)])))]
-      (d/transact db/*conn* (doall msg-tx)))))
+      (d/transact db/conn (doall msg-tx)))))

 (defn migrate-2015-07-29
   "Schema changes for groups"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [{:db/ident :tag/group
       :db/valueType :db.type/ref
       :db/cardinality :db.cardinality/one
@@ -294,15 +294,15 @@
   group and add all existing users and tags to that group"
   [group-name]
   (let [group (db/create-group! {:id (db/uuid) :name group-name})
-        all-users (->> (d/q '[:find ?u :where [?u :user/id]] (d/db db/*conn*)) (map first))
-        all-tags (->> (d/q '[:find ?t :where [?t :tag/id]] (d/db db/*conn*)) (map first))]
-    (d/transact db/*conn* (mapv (fn [u] [:db/add [:group/id (group :id)] :group/user u]) all-users))
-    (d/transact db/*conn* (mapv (fn [t] [:db/add t :tag/group [:group/id (group :id)]]) all-tags))))
+        all-users (->> (d/q '[:find ?u :where [?u :user/id]] (d/db db/conn)) (map first))
+        all-tags (->> (d/q '[:find ?t :where [?t :tag/id]] (d/db db/conn)) (map first))]
+    (d/transact db/conn (mapv (fn [u] [:db/add [:group/id (group :id)] :group/user u]) all-users))
+    (d/transact db/conn (mapv (fn [t] [:db/add t :tag/group [:group/id (group :id)]]) all-tags))))

 (defn migrate-2015-08-26
   "schema change for invites"
   []
-  (d/transact db/*conn*
+  (d/transact db/conn
     [
      ; invitations
      {:db/ident :invite/id


Proper column type

Proper column type

--- src/clj_crud/migrations.clj
+++ src/clj_crud/migrations.clj
@@ -106,7 +106,7 @@
                        table
                        (serial-id db)
                        [:text "VARCHAR(1024)"]
-                       [:account_id "VARCHAR(256)"]
+                       [:account_id "INTEGER"]
                        [:completed "INT"]
                        [:created_at "BIGINT"]
                        [:updated_at "BIGINT"])))


Fix impl rules not loaded until hot reload

--- src/cljc/precept/rules.cljc
+++ src/cljc/precept/rules.cljc
@@ -9,6 +9,7 @@
                  [precept.util :as util]
                  [clara.rules :as cr]
                  [clara.macros :as cm]
+                 [precept.impl.rules]
                  [clara.rules.dsl :as dsl]
                  [clara.rules.compiler :as com]
                  [clojure.spec.alpha :as s]))


Add utility for hiding a comp.

Add utility for hiding a comp.

--- src/cljs/koeeoadi/util.cljs
+++ src/cljs/koeeoadi/util.cljs
@@ -4,6 +4,9 @@
             [goog.array :refer [forEach]]
             [om.next :as om]
             [om.dom :as dom]))
+
+(defn display [pred]
+  (when-not pred #js {:display "none"}))

 (defn profile-start []
   (.profile js/console "Profile Run"))


Make case-inherited* meta-errors 1 for orphans

--- src/clojush/meta_errors.clj
+++ src/clojush/meta_errors.clj
@@ -793,7 +793,7 @@
         0))
     1))

-#_(defn inherited-errors-meta-error
+(defn inherited-errors-meta-error
   [ind evaluated-population argmap]
   (if (and (:parent1-errors ind)
            (:parent2-errors ind)
@@ -802,7 +802,7 @@
     0
     1))

-(defn inherited-errors-meta-error
+#_(defn inherited-errors-meta-error
   [ind evaluated-population argmap]
   (if (and (:parent1-errors ind)
            (:parent2-errors ind))
@@ -830,7 +830,7 @@
           (:errors ind)
           (:parent1-errors ind)
           (:parent2-errors ind))
-    (vec (repeat (count (:errors ind)) 0))))
+    (vec (repeat (count (:errors ind)) 1))))

 (defn case-inherited-non-zero-errors-meta-error
   [ind evaluated-population argmap]
@@ -843,4 +843,4 @@
           (:errors ind)
           (:parent1-errors ind)
           (:parent2-errors ind))
-    (vec (repeat (count (:errors ind)) 0))))
+    (vec (repeat (count (:errors ind)) 1))))


Adding commented code, so that we can fix the VFS problem

--- src/flycouchdb_webproject_example/handler.clj
+++ src/flycouchdb_webproject_example/handler.clj
@@ -8,7 +8,10 @@
             [cheshire.generate :refer [add-encoder encode-str remove-encoder]]
             [ring.util.response :as resp]
             [ring.adapter.jetty :as jetty]
-            [clojure.data.json :as json]))
+            [clojure.data.json :as json])
+  (:import [java.io File]
+           [java.net URL URLDecoder]
+           [org.jboss.vfs VFS VirtualFile VirtualFileFilter]))

 (defn json-response [data & [status]]
   {:status  (or status 200)
@@ -34,7 +37,18 @@

 (defn init []
   (println "Running migrations")
-  (migrate flydb)
+  ;(clojure.pprint/pprint (.getProtocol folder-path))
+  ;(->>
+  ;  (.getPath folder-path)
+  ;  (. URLDecoder decode)
+  ;  (File.)
+  ;  (.getAbsolutePath)
+  ;  (. VFS getChild)
+  ;  (.getChildren)
+  ;  first
+  ;  (.openStream)
+  ;  slurp
+  ;  clojure.pprint/pprint)
   (println "Migrations done!"))

 (def app


Coalesce and clarify code a bit

Coalesce and clarify code a bit

--- devcards/frontend/devcards/map.cljs
+++ devcards/frontend/devcards/map.cljs
@@ -205,13 +205,42 @@
           (apply line-to end)))}])

 (defn map-svg [things-in-columns edges]
-  (let [width 150
-        height 40
+  (let [box-width 150
+        box-height 40
         x-spacing 100
-        cs (coords things-in-columns)]
+        y-spacing 10
+        strut-spacing 20
+        arrow-radius 10
+
+        cs (coords things-in-columns)
+
+        box-x-position
+        (fn [x]
+          (* x (+ box-width x-spacing)))
+
+        box-y-position
+        (fn [y]
+          (* y (+ box-height y-spacing)))
+
+        arrow-start
+        (fn [x y]
+          [(+ box-width (box-x-position x))
+           (+ (/ box-height 2) (box-y-position y))])
+
+        arrow-end
+        (fn [x y]
+          [(box-x-position x)
+           (+ (/ box-height 2) (box-y-position y))])
+
+        strut-offset
+        (fn [tx ty]
+          (* strut-spacing (- (count (nth things-in-columns tx)) ty)))
+
+        strut-position
+        (fn [tx ty]
+          (- (first (arrow-end tx ty)) (strut-offset tx ty)))]
     (html
-     [:div {:style {;; :overflow "auto"
-                    :background "white"}}
+     [:div {:style {:background "white"}}
       [:svg {:width "2000"
              :height "300"
              :style {:background "white"}}
@@ -219,25 +248,17 @@
         (for [[from to] edges
               :let [[fx fy] (get cs from)
                     [tx ty] (get cs to)]]
-          (let [start (fn [x y]
-                        [(+ width (* x (+ width x-spacing)))
-                         (+ (/ height 2) (* y (+ height 10)))])
-                end (fn [x y]
-                      [(* x (+ width x-spacing))
-                       (+ (/ height 2) (* y (+ height 10)))])
-                steps-back (- (count (nth things-in-columns tx)) ty)
-                strut-offset (* 20 steps-back)]
-            (arrow (start fx fy)
-                   (end tx ty)
-                   (- (first (end tx ty)) strut-offset)
-                   10)))
+          (arrow (arrow-start fx fy)
+                 (arrow-end tx ty)
+                 (strut-position tx ty)
+                 arrow-radius))
         (for [[x things] (map-indexed vector things-in-columns)]
           (for [[y thing] (map-indexed vector things)]
             (when thing
-              [:g {:transform (str "translate(" (* x (+ width x-spacing)) "," (* y (+ height 10)) ")")}
+              [:g {:transform (str "translate(" (box-x-position x) "," (box-y-position y) ")")}
                [:rect.job {:fill "none"
-                           :width width
-                           :height height}]
+                           :width box-width
+                           :height box-height}]
                [:text {:x 10
                        :y 25}
                 thing]])))]]])))


[#2181] Force not empty strings as category name

--- backend/specs/akvo/lumen/specs/transformation.clj
+++ backend/specs/akvo/lumen/specs/transformation.clj
@@ -236,7 +236,7 @@
 (s/def ::transformation.derive-category/target (s/keys
                                                :req-un [::transformation.derive-category.target/column]))

-(s/def ::transformation.derive-category.derivation.text/mappings (s/coll-of (s/tuple (s/coll-of (s/nilable string?) :kind vector? :min-count 1) string?) :kind vector? :min-count 1))
+(s/def ::transformation.derive-category.derivation.text/mappings (s/coll-of (s/tuple (s/coll-of (s/nilable string?) :kind vector? :min-count 1) ::lumen.s/non-empty-string) :kind vector? :min-count 1))

 (s/def ::transformation.derive-category.derivation.number/op #{">" "<" ">=" "<=" "="})


fix blues example

fix blues example

--- examples/blues.clj
+++ examples/blues.clj
@@ -38,7 +38,7 @@

           (play-blues instr pitch))
       (at (+ time (* 0.5 dur))
-          (c-hat 0.1))
+          (closed-hat 0.1))
       (apply-at n-time #'play-seq
                 [(mod (inc count) 4) instr (next notes) (next durs) n-time odds]))))


1.3-ifying examples.argmap-regression

1.3-ifying examples.argmap-regression

--- src/examples/argmap_regression.clj
+++ src/examples/argmap_regression.clj
@@ -1,6 +1,6 @@
 (ns examples.argmap-regression
-  (:require [clojush] [clojure.contrib.math])
-  (:use [clojush] [clojure.contrib.math]))
+  (:use [clojush]
+	[clojure.math.numeric-tower]))

 ;; argmap_regression.clj
 ;; an example problem for clojush, a Push/PushGP system written in Clojure


tried to fix the cycle change problem

tried to fix the cycle change problem

--- src/mafia_votecount/scraper/team_liquid.clj
+++ src/mafia_votecount/scraper/team_liquid.clj
@@ -142,14 +142,10 @@
            (string/trim)
            (vector)
            (some #(let [lowercased (string/lower-case %)]
-                    (cond
-                         (and
-                           (.startsWith lowercased "day ")
-                           (not (.contains lowercased "vot"))) :day
-                         (and
-                           (.startsWith lowercased "night ")
-                           (not (.contains lowercased "vot"))) :night
-                         :else false)))))
+                  (and
+                     (or (.startsWith lowercased "day ")
+                         (.startsWith lowercased "night "))
+                     (not (.contains lowercased "vot")))))))

 (defn- cycle-changes [indexed hosts]
   (filter #(and (is-host? % hosts) (is-cycle-change? (:message (val %))))


fix: timeline cache removal fix

fix: timeline cache removal fix

Separates cache and batch because the key (/ function params) are different

--- src/main/clojure/pdok/featured/timeline.clj
+++ src/main/clojure/pdok/featured/timeline.clj
@@ -281,10 +281,11 @@
 (defn- batched-deleter [db dcb dcb-size dhb dhb-size flush-fn feature-cache]
   "Cache batched deleter (thrasher) of current and history"
   (let [batched-delete-cur (with-batch dcb dcb-size (partial delete-current db) flush-fn)
-        cache-batched-delete-cur (with-cache feature-cache batched-delete-cur cache-store-key cache-invalidate)
+        cache-remove-cur (with-cache feature-cache identity cache-store-key cache-invalidate)
         batched-delete-his (with-batch dhb dhb-size (partial delete-history db) flush-fn)]
     (fn [f]
-      (cache-batched-delete-cur (:_version f))
+      (cache-remove-cur f)
+      (batched-delete-cur (:_version f))
       (batched-delete-his f))))

 (defrecord Timeline [db root-fn path-fn


fix accidental coercion to rich nav

fix accidental coercion to rich nav

--- src/clj/com/rpl/specter/impl.cljc
+++ src/clj/com/rpl/specter/impl.cljc
@@ -400,6 +400,11 @@
 (defn comp-paths-internalized [path]
   (capture-params-internally (comp-paths* path)))

+(defn nav-type [n]
+  (if (satisfies? RichNavigator n)
+    :rich
+    :lean))
+
 (extend-protocol PathComposer
   nil
   (do-comp-paths [o]
@@ -416,7 +421,7 @@
                          (map capture-params-internally))
             combined (->> coerced
                           (map extract-nav)
-                          (partition-by type)
+                          (partition-by nav-type)
                           (map combine-same-types))

             result-nav (if (= 1 (count combined))


Add method for destroying database to database component

--- src/clj/comic_reader/database.clj
+++ src/clj/comic_reader/database.clj
@@ -28,7 +28,8 @@
       conn)))

 (defprotocol Database
-  (connection [database] "Returns a connection to the database."))
+  (connection [database] "Returns a connection to the database.")
+  (destroy [database] "Destroy the database."))

 (defrecord DatomicDatabase [config conn]

@@ -44,7 +45,10 @@
     (dissoc component :conn))

   Database
-  (connection [database] conn))
+  (connection [database] conn)
+
+  (destroy [database]
+    (d/delete-database (config/database-uri config))))

 (defn database? [e]
   (instance? DatomicDatabase e))


more ideas

more ideas

--- src/cljc/just_married/shared.cljc
+++ src/cljc/just_married/shared.cljc
@@ -11,3 +11,9 @@
    :map-type-id geo/map-type-id
    :center geo/map-center
    :maps geo/map-configs})
+
+(def sections
+  [:countdown
+   :find-us
+   :timeline
+   :accommodation])


Cache get-params, making whole vt processing 23% faster

--- src/cljs/asciinema_player/vt.cljs
+++ src/cljs/asciinema_player/vt.cljs
@@ -276,10 +276,12 @@
 (defn get-intermediate [vt n]
   (get-in vt [:parser :intermediate-chars n]))

+(def get-cached-params (memoize (fn [chars]
+                                  (let [groups (split-coll 0x3b chars)]
+                                    (map reduce-param groups)))))
+
 (defn get-params [vt]
-  (let [chars (get-in vt [:parser :param-chars])
-        groups (split-coll 0x3b chars)]
-    (map reduce-param groups)))
+  (get-cached-params (get-in vt [:parser :param-chars])))

 (defn get-param [vt n default]
   (let [v (nth (get-params vt) n 0)]


renaming

renaming

--- src/cljs/triboard/ai/minimax.cljs
+++ src/cljs/triboard/ai/minimax.cljs
@@ -11,20 +11,20 @@
   "One stage of the minimax algorithm:
    * Apply the maximizing or mininizing step to all transitions of the turn
    * Evaluate the lower level using the on-transition function"
-  [ai turn on-transition
+  [ai turn open-recur
    & {:keys [max-fn min-fn]
       :or {max-fn max, min-fn min}}]
   (apply
     (if (maximizing? ai turn) max-fn min-fn)
     (map
-      (fn [[coord transition]] (on-transition coord transition))
+      (fn [[coord transition]] (open-recur coord transition))
       (turn/transitions turn))))

 (defn minimax-step-by
   "One stage of the minimax algorithm, with custom comparison functions"
-  [key-fn ai turn on-transition]
+  [key-fn ai turn open-recur]
   (minimax-step
-    ai turn on-transition
+    ai turn open-recur
     :min-fn (partial min-key key-fn) ;; Lambda does not work here
     :max-fn (partial max-key key-fn)))

@@ -39,5 +39,4 @@
       (fn [_ transition]
         (minimax ai
           (turn/next-turn turn transition)
-          (dec depth))))
-    ))
+          (dec depth))))))


Preserve selection when hitting tab

Preserve selection when hitting tab

--- src/clojure/nightcode/editors.clj
+++ src/clojure/nightcode/editors.clj
@@ -285,45 +285,64 @@
   (let [^ParinferResult res (Parinfer/indentMode text (int x) (int line) nil)]
     {:x (.-cursorX res) :text (.-text res)}))

+(defn get-cursor-position
+  [^TextEditorPane text-area]
+  [(.getSelectionStart text-area) (.getSelectionEnd text-area)])
+
+(defn set-cursor-position!
+  [^TextEditorPane text-area & [start-pos end-pos]]
+  (if (and start-pos end-pos (not= start-pos end-pos))
+    (do
+      (.setSelectionStart text-area start-pos)
+      (.setSelectionEnd text-area end-pos))
+    (.setCaretPosition text-area start-pos)))
+
 (defn get-parinfer-state
   [^TextEditorPane text-area paren-mode?]
-  (let [old-pos (.getCaretPosition text-area)
-        old-x (.getCaretOffsetFromLineStart text-area)
-        old-line (.getCaretLineNumber text-area)
+  (let [cursor-position (get-cursor-position text-area)
+        [start-pos end-pos] cursor-position
+        selected? (not= start-pos end-pos)
+        [col row] (if selected?
+                    [0 0]
+                    [(.getCaretOffsetFromLineStart text-area)
+                     (.getCaretLineNumber text-area)])
         old-text (.getText text-area)
         result (if paren-mode?
-                 (paren-mode old-text old-x old-line)
-                 (indent-mode old-text old-x old-line))]
-    (mwm/get-state (:text result) old-line (:x result))))
+                 (paren-mode old-text col row)
+                 (indent-mode old-text col row))]
+    (if selected?
+      (mwm/get-state (:text result) cursor-position)
+      (mwm/get-state (:text result) row (:x result)))))

 (defn get-normal-state
   [^TextEditorPane text-area]
-  (let [position (.getCaretPosition text-area)
+  (let [position (get-cursor-position text-area)
         text (.getText text-area)]
     (assoc (mwm/get-state text position) :should-indent? true)))

-(defn add-indent-if-necessary
-  [lines text tags state]
-  (if (:should-indent? state)
-    (let [[cursor-line _] (mwm/position->row-col text (:cursor-position state))
-          indent-level (ts/indent-for-line tags cursor-line)]
-      [(update lines
-               cursor-line
-               (fn [line]
-                 (str (str/join (repeat indent-level " ")) (str/triml line))))
-       (+ (:cursor-position state) indent-level)])
-    [lines (:cursor-position state)]))
+(defn add-indent!
+  [^TextEditorPane text-area lines text tags state]
+  (let [start-pos (first (:cursor-position state))
+        [cursor-line _] (mwm/position->row-col text start-pos)
+        indent-level (ts/indent-for-line tags cursor-line)
+        lines (update lines
+                cursor-line
+                (fn [line]
+                  (str (str/join (repeat indent-level " ")) (str/triml line))))
+        text (str/join \newline lines)]
+    (.setText text-area text)
+    (.setCaretPosition text-area (+ start-pos indent-level))))

 (defn refresh-content!
   [^TextEditorPane text-area state]
-  (let [old-text (.getText text-area)
-        lines (:lines state)
-        new-text (str/join \newline lines)
-        tags (ts/str->tags new-text)
-        [lines cursor-position] (add-indent-if-necessary lines new-text tags state)
+  (let [lines (:lines state)
+        [start-pos end-pos] (:cursor-position state)
         new-text (str/join \newline lines)]
-    (.replaceRange text-area new-text 0 (count old-text))
-    (.setCaretPosition text-area cursor-position)
+    (if (:should-indent? state)
+      (add-indent! text-area lines new-text (ts/str->tags new-text) state)
+      (do
+        (.setText text-area new-text)
+        (set-cursor-position! text-area start-pos end-pos)))
     state))

 (defn init-parinfer!
@@ -332,7 +351,7 @@
     (let [old-text (.getText text-area)]
       ; use paren mode to preprocess the code
       (when preprocess?
-        (->> (assoc (get-parinfer-state text-area true) :cursor-position 0)
+        (->> (get-parinfer-state text-area true)
              (refresh-content! text-area)
              (mwm/update-edit-history! edit-history)))
       (.discardAllEdits text-area)
@@ -347,7 +366,7 @@
               (contains? #{KeyEvent/VK_DOWN KeyEvent/VK_UP
                            KeyEvent/VK_RIGHT KeyEvent/VK_LEFT}
                          (.getKeyCode e))
-              (mwm/update-cursor-position! edit-history (.getCaretPosition text-area))
+              (mwm/update-cursor-position! edit-history (get-cursor-position text-area))

               (not (or (contains? #{KeyEvent/VK_SHIFT KeyEvent/VK_CONTROL
                                     KeyEvent/VK_ALT KeyEvent/VK_META}
@@ -369,7 +388,7 @@
           (mouseExited [this e] nil)
           (mousePressed [this e] nil)
           (mouseReleased [this e]
-            (mwm/update-cursor-position! edit-history (.getCaretPosition text-area))))))
+            (mwm/update-cursor-position! edit-history (get-cursor-position text-area))))))
     (reset! edit-history nil))
   text-area)


Made test server more robust. Handles exceptions

--- src/test/clojure/me/moocar/logbackgelf/servers.clj
+++ src/test/clojure/me/moocar/logbackgelf/servers.clj
@@ -119,10 +119,16 @@
                 {:keys [length offset data]} packet]
             (if (chunked? packet)
               (let [[chunks full-packet] (process-chunk chunks (dechunk packet))]
-                (when full-packet
-                  (>!! msg-ch (packet->json full-packet)))
+                (try
+                  (when full-packet
+                    (>!! msg-ch (packet->json full-packet)))
+                  (catch Throwable t
+                    (.printStackTrace t)))
                 (recur chunks))
-              (do (>!! msg-ch (packet->json packet))
+              (do (try
+                    (>!! msg-ch (packet->json packet))
+                    (catch Throwable t
+                      (.printStackTrace t)))
                   (recur chunks)))))))))

 (defn new-datagram-socket-reader


lein-release plugin: preparing 1.1.0 release

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (def tk-version "1.0.0")
 (def ks-version "1.0.0")

-(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.1.0-SNAPSHOT"
+(defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.1.0"
   :description "A jetty9-based webserver implementation for use with the puppetlabs/trapperkeeper service framework."
   ;; Abort when version ranges or version conflicts are detected in
   ;; dependencies. Also supports :warn to simply emit warnings.


version bumps

version bumps

--- project.clj
+++ project.clj
@@ -3,29 +3,33 @@
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
-                 [org.clojure/clojurescript "0.0-3308"]
+  :dependencies [;; Core
+                 [org.clojure/clojure "1.7.0"]
+                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
+                 [org.clojure/tools.namespace "0.2.10"]
+                 [org.clojure/clojurescript "1.7.48"]
                  [org.clojure/core.match "0.3.0-alpha4"]
-                 [org.clojure/tools.namespace "0.2.9"]
+
+                 ;; Utils
+                 [com.stuartsierra/component "0.2.3"]
                  [org.clojure/data.xml "0.0.8"]
+                 [clj-time "0.8.0"]

-                 [com.stuartsierra/component "0.2.2"]
+                 ;; Web UI
+                 [com.taoensso/sente "1.5.0"]
+                 [com.taoensso/timbre "3.4.0"]

-                 [com.taoensso/sente "1.3.0"]
-                 [compojure "1.2.0"]
-                 [http-kit "2.1.18"]
-
+                 [http-kit "2.1.19"]
+
+                 [ring                      "1.3.2"]
+                 [ring/ring-defaults        "0.1.5"]
+
+                 [compojure "1.3.4"]
+
                  [reagent "0.5.0"]
-                 [clj-time "0.8.0"]
-
-                 [ring/ring-defaults "0.1.3"]
-
-
+
                  ; Code cleaness tools
-                 [repetition-hunter "1.0.0"]
-
-                 ]
+                 [repetition-hunter "1.0.0"]]

   :plugins [[lein-cljsbuild "1.0.6"]
             [lein-hiera "0.9.0"]


PLD: bump version for vector tiles

PLD: bump version for vector tiles

--- project.clj
+++ project.clj
@@ -3,7 +3,7 @@
       [path]
       (str "resources/public/js/lib/" path))

-(defproject onaio/hatti "0.3.2-SNAPSHOT"
+(defproject onaio/hatti "0.3.2"
   :description "A cljs dataview from your friends at Ona.io"
   :license "Apache 2, see LICENSE"
   :url "https://github.com/onaio/hatti"


using [ancient-clj "0.1.7"].

using [ancient-clj "0.1.7"].

--- project.clj
+++ project.clj
@@ -2,7 +2,7 @@
   :description "Check your Projects for outdated Dependencies."
   :url "https://github.com/xsc/lein-ancient"
   :dependencies [[rewrite-clj "0.3.5"]
-                 [ancient-clj "0.1.6"]]
+                 [ancient-clj "0.1.7"]]
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :profiles {:dev {:dependencies [[midje "1.6.0"]]


Increase lib version to pull in soup.

Increase lib version to pull in soup.

--- project.clj
+++ project.clj
@@ -24,7 +24,7 @@
     [org.clojure/tools.namespace "0.3.0-alpha4" :exclusions [org.clojure/tools.reader]]

     ;; Library for OC projects https://github.com/open-company/open-company-lib
-    [open-company/lib "0.16.3"]
+    [open-company/lib "0.16.4"]
     ;; In addition to common functions, brings in the following common dependencies used by this project:
     ;; Component - Component Lifecycle https://github.com/stuartsierra/component
     ;; Schema - Data validation https://github.com/Prismatic/schema
@@ -34,6 +34,7 @@
     ;; Cheshire - JSON encoding / decoding https://github.com/dakrone/cheshire
     ;; clj-time - Date and time lib https://github.com/clj-time/clj-time
     ;; Environ - Get environment settings from different sources https://github.com/weavejester/environ
+    ;; soup - Clojure wrapper for jsoup HTML parser https://github.com/mfornos/clojure-soup
   ]

   ;; All profile plugins


Bump to snapshot

Bump to snapshot

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (let [dev-deps '[[speclj "2.7.2"]
                  [classlojure "0.6.6"]]]

-  (defproject reply "0.4.2"
+  (defproject reply "0.4.3-SNAPSHOT"
     :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
     :dependencies [[org.clojure/clojure "1.6.0"]
                    [jline "2.14.6"]


Updating imagej version (#30)

Updating imagej version (#30)

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject funimage "0.1.93"
+(defproject funimage "0.1.94-SNAPSHOT"
   :description "Functional Image Processing with ImageJ/FIJI"
   :url "https://github.com/funimage/funimage"
   :license {:name "Apache v2.0"
@@ -9,10 +9,10 @@
                  [org.clojure/data.zip "0.1.1"]

                  ; Java libs
-                 [net.imglib2/imglib2-roi "0.4.4"]
-                 [net.imglib2/imglib2-ij "2.0.0-beta-35"]
-                 [net.imagej/imagej "2.0.0-rc-55" :exclusions [com.github.jnr/jffi com.github.jnr/jnr-x86asm]]
-                 [ome/bioformats_package "5.2.4"]
+                 [net.imglib2/imglib2-roi "0.4.5"]
+                 [net.imglib2/imglib2-ij "2.0.0-beta-36"]
+                 [net.imagej/imagej "2.0.0-rc-58" :exclusions [com.github.jnr/jffi com.github.jnr/jnr-x86asm]]
+                 [ome/bioformats_package "5.3.3"]

                  ;[sc.fiji/Auto_Threshold "1.16.0"]
                  ]


0.2.0 release

0.2.0 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.mdrogalis/onyx "0.2.0-SNAPSHOT"
+(defproject com.mdrogalis/onyx "0.2.0"
   :description "Distributed data processing"
   :url "https://github.com/MichaelDrogalis/onyx"
   :license {:name "Eclipse Public License"


Update dependencies.

Update dependencies.

--- project.clj
+++ project.clj
@@ -25,7 +25,7 @@
                  [ola-clojure "0.1.1"]
                  [selmer "0.9.1"]
                  [com.evocomputing/colors "1.0.3"]
-                 [environ "1.0.0"]
+                 [environ "1.0.1"]
                  [camel-snake-kebab "0.3.2"]
                  [com.taoensso/timbre "4.1.1"]
                  [com.taoensso/tower "3.0.2"]
@@ -62,7 +62,7 @@
              :uberjar {:env {:production true}
                        :aot :all}}
   :plugins [[codox "0.8.13"]
-            [lein-environ "1.0.0"]
+            [lein-environ "1.0.1"]
             [lein-ancient "0.6.7"]]

   :codox {:src-dir-uri "http://github.com/brunchboy/afterglow/blob/master/"


Adding test commit to test ci

Adding test commit to test ci

--- project.clj
+++ project.clj
@@ -6,7 +6,7 @@
                  [ring/ring-jetty-adapter "1.2.2"]
                  [org.clojure/test.check "0.5.7"]
                  [org.clojure/data.xml "0.0.7"]]
-
+;test commit message for ci
   :profiles
   {:dev {:dependencies [[org.clojure/tools.namespace "0.2.4"]
                         [org.clojars.gjahad/debug-repl "0.3.3"]]


deps update: datomic 0.9.4724

deps update: datomic 0.9.4724

--- project.clj
+++ project.clj
@@ -13,7 +13,7 @@
                  [com.cemerick/friend "0.2.0"]
                  [clj-time "0.6.0"]
                  [com.taoensso/timbre "3.1.6"]
-                 [com.datomic/datomic-free "0.9.4707"]
+                 [com.datomic/datomic-free "0.9.4724"]
                  [org.clojure/core.match "0.2.1"]
                  ;; CLJS
                  [org.clojure/clojurescript "0.0-2173"]


Version 0.20.0-SNAPSHOT

Version 0.20.0-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject io.sarnowski/swagger1st "0.19.0"
+(defproject io.sarnowski/swagger1st "0.20.0-SNAPSHOT"
   :description "A ring handler that does routing based on a swagger definition."
   :url "https://github.com/sarnowski/swagger1st"


Version 0.1.2-SNAPSHOT

Version 0.1.2-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject breeze-quiescent "0.1.1"
+(defproject breeze-quiescent "0.1.2-SNAPSHOT"
   :description "A minimal, functional ClojureScript wrapper for ReactJS"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}


Version 1.0.2-SNAPSHOT

Version 1.0.2-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject dda/dda-user-crate "1.0.1"
+(defproject dda/dda-user-crate "1.0.2-SNAPSHOT"
   :description "A crate to handle users"
   :url "https://www.domaindrivenarchitecture.org"
   :license {:name "Apache License, Version 2.0"