Fix up fork toggle and use better naming

--- frontend/components/add_projects.cljs
+++ frontend/components/add_projects.cljs
@@ -14,7 +14,7 @@
             [goog.string :as gstring]
             [goog.string.format])
   (:require-macros [cljs.core.async.macros :as am :refer [go go-loop alt!]]
-                   [frontend.utils :refer [html]]))
+                   [frontend.utils :refer [html defrender]]))

 (defn missing-scopes-notice [current-scopes missing-scopes]
   [:div
@@ -26,7 +26,7 @@
                      (string/join "and " missing-scopes)
                      (if (< 1 (count missing-scopes)) "scope" "scopes"))]]])

-(defn side-item [org settings owner]
+(defn organization [org settings owner]
   (let [login (:login org)
         type (if (:org org) :org :user)]
     [:div.organization {:class (when (= {:login login :type type} (get-in settings [:add-projects :selected-org])) "active")}
@@ -36,14 +36,15 @@
         [:img {:src (gh-utils/make-avatar-url org :size 50)
                :height 50}]]]
       [:div.other-stuff
-       [:div.orgname
+       [:div.orgname
         [:a {:on-click #(raise! owner [:selected-add-projects-org {:login login :type type}])} login]
          [:small.github-url.pull-right
                  [:a {:href (str "https://github.com/" login), :target "_blank"}
                   [:i.fa.fa-github-alt ""]]]]]]]))

-(defn org-sidebar [data owner]
+(defn organization-listing [data owner]
   (reify
+    om/IDisplayName (display-name [_] "Organization Listing")
     om/IDidMount
     (did-mount [_]
       (utils/tooltip "#collaborators-tooltip-hack" {:placement "right"}))
@@ -58,14 +59,14 @@
              [:div.instruction "Choose a GitHub account that you are a member of or have access to."]]
             [:div.organizations
              [:h4 "Your accounts"]
-             (map (fn [org] (side-item org settings owner))
+             (map (fn [org] (organization org settings owner))
                    (:organizations user))
-             (map (fn [org] (side-item org settings owner))
+             (map (fn [org] (organization org settings owner))
                    (filter (fn [org] (= (:login user) (:login org)))
                            (:collaborators user)))
               [:div
                [:h4 "Users & organizations who have made pull requests to your repos"]
-               (map (fn [org] (side-item org settings owner))
+               (map (fn [org] (organization org settings owner))
                     (remove (fn [org] (= (:login user) (:login org)))
                             (:collaborators user)))]]])))))

@@ -79,6 +80,7 @@

 (defn repo-item [data owner]
   (reify
+    om/IDisplayName (display-name [_] "repo-item")
     om/IDidMount
     (did-mount [_]
       (utils/tooltip (str "#view-project-tooltip-" (-> data :repo repo-model/id (string/replace #"[^\w]" "")))))
@@ -162,89 +164,83 @@
      {:data-dismiss "modal", :aria-hidden "true"}
      "Got it"]]])

-(defn repo-filter [settings owner]
-  (reify
-    om/IRender
-    (render [_]
-      (let [repo-filter-string (get-in settings [:add-projects :repo-filter-string])]
-        (html
-         [:div.repo-filter
-          ; [:i.fa.fa-search]
-          [:input.unobtrusive-search
-           {:placeholder "Filter repos..."
-            :type "search"
-            :value repo-filter-string
-            :on-change #(utils/edit-input owner [:settings :add-projects :repo-filter-string] %)}]
-          [:div.checkbox.pull-right.fork-filter
-           [:label
-            [:input {:type "checkbox"
-                     :name "Show forks"
-                     :on-change #(utils/edit-input owner [:settings :add-projects :show-forks] %)}]
-            "Show forks"]]])))))
-
-(defn main [data owner]
-  (reify
-    om/IRender
-    (render [_]
-      (let [user (:current-user data)
-            settings (:settings data)
-            repos (:repos data)
-            repo-filter-string (get-in settings [:add-projects :repo-filter-string])
-            show-forks (get-in settings [:add-projects :show-forks])]
-        (html
-         [:div.proj-wrapper
-          (if-not (get-in settings [:add-projects :selected-org :login])
-            repos-explanation
-            (if-not (seq repos)
-              [:div.loading-spinner common/spinner]
-              [:div
-               (om/build repo-filter settings)
-               [:ul.proj-list
-                (let [filtered-repos (sort-by :name (filter (fn [repo]
-                                               (and
-                                                 (not (:fork repo))
-                                                 (-> repo
-                                                   :name
-                                                   (.toLowerCase)
-                                                   (.indexOf (.toLowerCase repo-filter-string))
-                                                   (not= -1))))
-                                             repos))]
-                  (map (fn [repo] (om/build repo-item {:repo repo
-                                                       :settings settings}))
-                       filtered-repos))]]))
-          invite-modal])))))
-
-(defn add-projects [data owner]
-  (reify
-    om/IRender
-    (render [_]
-      (let [user (:current-user data)
-            settings (:settings data)
-            repo-key (gstring/format "%s.%s"
-                                     (get-in settings [:add-projects :selected-org :login])
-                                     (get-in settings [:add-projects :selected-org :type]))
-            repos (get-in user [:repos repo-key])]
-        (html
-         [:div#add-projects
-          [:header.main-head
-           [:div.head-user
-            [:h1 "Start Building Your Projects"]]]
-          [:div#follow-contents
-           (when (seq (user-model/missing-scopes user))
-             (missing-scopes-notice (:github_oauth_scopes user) (user-model/missing-scopes user)))
-           [:h2 "Welcome!"]
-           [:h3 "You're about to set up a new project in CircleCI."]
-           [:p "CircleCI helps you ship better code, faster. To kick things off, you'll need to pick some projects to build:"]
-           [:hr]
-           [:div.org-listing
-            (om/build org-sidebar {:user user
-                                   :settings settings})]
-           [:hr]
-           [:div.project-listing
-            [:div.overview
-             [:span.big-number "2"]
-             [:div.instruction "Choose a repo, and we'll watch the repository for activity in GitHub such as pushes and pull requests. We'll kick off the first build immediately, and a new build will be initiated each time someone pushes commits."]]
-            (om/build main {:user user
-                            :repos repos
-                            :settings settings})]
-           ]])))))
+(defrender repo-filter [settings owner]
+  (let [repo-filter-string (get-in settings [:add-projects :repo-filter-string])]
+    (html
+     [:div.repo-filter
+      ; [:i.fa.fa-search]
+      [:input.unobtrusive-search
+       {:placeholder "Filter repos..."
+        :type "search"
+        :value repo-filter-string
+        :on-change #(utils/edit-input owner [:settings :add-projects :repo-filter-string] %)}]
+      [:div.checkbox.pull-right.fork-filter
+       [:label
+        [:input {:type "checkbox"
+                 :name "Show forks"
+                 :on-change #(utils/toggle-input owner [:settings :add-projects :show-forks] %)}]
+        "Show forks"]]])))
+
+(defrender main [data owner]
+  (let [user (:current-user data)
+        settings (:settings data)
+        repos (:repos data)
+        repo-filter-string (get-in settings [:add-projects :repo-filter-string])
+        show-forks (true? (get-in settings [:add-projects :show-forks]))]
+    (html
+     [:div.proj-wrapper
+      (if-not (get-in settings [:add-projects :selected-org :login])
+        repos-explanation
+        (if-not (seq repos)
+          [:div.loading-spinner common/spinner]
+          [:div
+           (om/build repo-filter settings)
+           [:ul.proj-list
+            (let [filtered-repos (sort-by :name (filter (fn [repo]
+                                           (inspect (and
+                                             (if show-forks
+                                               true
+                                               (not (:fork repo)))
+                                             (-> repo
+                                               :name
+                                               (.toLowerCase)
+                                               (.indexOf (.toLowerCase repo-filter-string))
+                                               (not= -1)))))
+                                         repos))]
+              (map (fn [repo] (om/build repo-item {:repo repo
+                                                   :settings settings}))
+                   filtered-repos))]]))
+      invite-modal])))
+
+(defrender add-projects [data owner]
+  (let [user (:current-user data)
+        settings (:settings data)
+        repo-key (gstring/format "%s.%s"
+                                 (get-in settings [:add-projects :selected-org :login])
+                                 (get-in settings [:add-projects :selected-org :type]))
+        repos (get-in user [:repos repo-key])]
+    (html
+     [:div#add-projects
+      [:header.main-head
+       [:div.head-user
+        [:h1 "Start Building Your Projects"]]]
+      [:div#follow-contents
+       (when (seq (user-model/missing-scopes user))
+         (missing-scopes-notice (:github_oauth_scopes user) (user-model/missing-scopes user)))
+       [:h2 "Welcome!"]
+       [:h3 "You're about to set up a new project in CircleCI."]
+       [:p "CircleCI helps you ship better code, faster. To kick things off, you'll need to pick some projects to build:"]
+       [:hr]
+       [:div.org-listing
+        (om/build organization-listing {:user user
+                                        :settings settings})]
+       [:hr]
+       [:div.project-listing
+        [:div.overview
+         [:span.big-number "2"]
+         [:div.instruction "Choose a repo, and we'll watch the repository for activity in GitHub such as pushes and pull requests. We'll kick off the first build immediately, and a new build will be initiated each time someone pushes commits."]]
+        (om/build main {:user user
+                        :repos repos
+                        :settings settings})]
+           ]])))
+


Can update category id

Can update category id

--- src/swanson/models/db.clj
+++ src/swanson/models/db.clj
@@ -1,5 +1,5 @@
 (ns swanson.models.db
-  (:require [clojure.java.jdbc :as sql]
+  (:require [clojure.java.jdbc :as jdbc]
              [swanson.utils :refer [date-converter]])
   (:import [java.security MessageDigest]
            [javax.xml.bind DatatypeConverter]))
@@ -10,10 +10,10 @@
          :password "admin"})

 (defmacro with-db [f & body]
-  `(sql/with-connection ~db (~f ~@body)))
+  `(jdbc/with-connection ~db (~f ~@body)))

 (defn create-users-table []
-  (with-db sql/create-table
+  (with-db jdbc/create-table
       :users
       [:id "serial primary key"]
       [:fname "varchar(100) NOT NULL"]
@@ -22,7 +22,7 @@
       [:encrypted_password "varchar(100)"]))

 (defn create-transactions-table []
-  (with-db sql/create-table
+  (with-db jdbc/create-table
       :transactions
       [:id "serial primary key"]
       [:amount "float NOT NULL"]
@@ -31,44 +31,44 @@
       [:description "varchar(512) NOT NULL"]))

 (defn create-categories-table []
-  (with-db sql/create-table
+  (with-db jdbc/create-table
       :categories
       [:id "serial primary key"]
       [:name "varchar(512) NOT NULL"]))

 (defn get-user
   [email]
-  (with-db sql/with-query-results
+  (with-db jdbc/with-query-results
     res ["SELECT * FROM users WHERE email = ?" email] (first res)))

 (defn create-user
   [fname lname email encrypted-pass]
-  (with-db sql/insert-values
+  (with-db jdbc/insert-values
       :users
       [:fname :lname :email :encrypted_password]
       [fname lname email encrypted-pass]))

 (defn get-category
   [name]
-  (with-db sql/with-query-results
+  (with-db jdbc/with-query-results
       res ["SELECT * FROM categories WHERE name = ?" name] (first res)))

 (defn create-category
   [category]
-  (with-db sql/insert-values
+  (with-db jdbc/insert-values
       :categories
       [:name]
       [category]))

 (defn get-transaction
   [id]
-  (with-db sql/with-query-results
+  (with-db jdbc/with-query-results
       res ["SELECT * FROM transactions WHERE id = ?" id] (first res)))

 (defn create-transaction
   [{:keys [amount date description]}]
   (let [converted-date (date-converter date)]
-    (with-db sql/insert-values
+    (with-db jdbc/insert-values
       :transactions
       [:amount :date :category_id :description]
       [amount converted-date 1 description])))
@@ -92,14 +92,22 @@
   ORDER BY Week")

 (defn get-transactions-by-week []
-  (with-db sql/with-query-results rows [week-grouping-query]
+  (with-db jdbc/with-query-results rows [week-grouping-query]
       (doall rows)))

 (defn for-category
   [category-id]
-  (with-db sql/with-query-results
+  (with-db jdbc/with-query-results
     rows
     ["SELECT id, date, amount, category_id, description
      FROM transactions
      WHERE category_id = ?
      ORDER BY date DESC" category-id] (doall rows)))
+
+(defn update-category-id
+  "Update category id"
+  [id new-category-id]
+  (with-db jdbc/update-values
+    :transactions
+    ["id=?" id]
+    {:category_id new-category-id}))


cluster-unique template resources

cluster-unique template resources

--- src/terraboot/cluster.clj
+++ src/terraboot/cluster.clj
@@ -257,22 +257,22 @@
                                          })})

-             (resource "template_file" "master-user-data"
-                       {:template (mesos-master-user-data)
-                        :vars {:aws-region region
-                               :cluster-name cluster-name
-                               :cluster-id cluster-identifier
-                               :server-group (cluster-unique "MasterServerGroup")
-                               :master-role (cluster-id-of "aws_iam_role" "master-role")
-                               :slave-role (cluster-id-of "aws_iam_role" "slave-role")
-                               :aws-access-key (cluster-id-of "aws_iam_access_key" "host-key")
-                               :aws-secret-access-key (cluster-output-of "aws_iam_access_key" "host-key" "secret")
-                               :exhibitor-s3-bucket (cluster-unique "exhibitor-s3-bucket")
-                               :internal-lb-dns (cluster-output-of "aws_elb" "InternalMasterLoadBalancer" "dns_name")
-                               :fallback-dns (vpc/fallback-dns vpc/vpc-cidr-block)
-                               :number-of-masters min-number-of-masters}
-                        :lifecycle { :create_before_destroy true }
-                        })
+             (cluster-resource "template_file" "master-user-data"
+                               {:template (mesos-master-user-data)
+                                :vars {:aws-region region
+                                       :cluster-name cluster-name
+                                       :cluster-id cluster-identifier
+                                       :server-group (cluster-unique "MasterServerGroup")
+                                       :master-role (cluster-id-of "aws_iam_role" "master-role")
+                                       :slave-role (cluster-id-of "aws_iam_role" "slave-role")
+                                       :aws-access-key (cluster-id-of "aws_iam_access_key" "host-key")
+                                       :aws-secret-access-key (cluster-output-of "aws_iam_access_key" "host-key" "secret")
+                                       :exhibitor-s3-bucket (cluster-unique "exhibitor-s3-bucket")
+                                       :internal-lb-dns (cluster-output-of "aws_elb" "InternalMasterLoadBalancer" "dns_name")
+                                       :fallback-dns (vpc/fallback-dns vpc/vpc-cidr-block)
+                                       :number-of-masters min-number-of-masters}
+                                :lifecycle { :create_before_destroy true }
+                                })

              (asg "MasterServerGroup"
                   cluster-unique
@@ -284,7 +284,7 @@
                    :tags {:Key "role"
                           :PropagateAtLaunch "true"
                           :Value "mesos-master"}
-                   :user_data (output-of "template_file" "master-user-data" "rendered")
+                   :user_data (cluster-output-of "template_file" "master-user-data" "rendered")
                    :max_size max-number-of-masters
                    :min_size min-number-of-masters
                    :health_check_type "EC2"
@@ -319,21 +319,21 @@
                                                      "master-security-group"])
                           }]})

-             (resource "template_file" "public-slave-user-data"
-                       {:template (mesos-public-slave-user-data)
-                        :vars {:aws-region region
-                               :cluster-name cluster-name
-                               :cluster-id cluster-identifier
-                               :server-group (cluster-unique "PublicSlaveServerGroup")
-                               :master-role (cluster-id-of "aws_iam_role" "master-role")
-                               :slave-role (cluster-id-of "aws_iam_role" "slave-role")
-                               :aws-access-key (cluster-id-of "aws_iam_access_key" "host-key")
-                               :aws-secret-access-key (cluster-output-of "aws_iam_access_key" "host-key" "secret")
-                               :exhibitor-s3-bucket (cluster-unique "exhibitor-s3-bucket")
-                               :internal-lb-dns (cluster-output-of "aws_elb" "InternalMasterLoadBalancer" "dns_name")
-                               :fallback-dns (vpc/fallback-dns vpc/vpc-cidr-block)
-                               :number-of-masters min-number-of-masters}
-                        :lifecycle { :create_before_destroy true }})
+             (cluster-resource "template_file" "public-slave-user-data"
+                               {:template (mesos-public-slave-user-data)
+                                :vars {:aws-region region
+                                       :cluster-name cluster-name
+                                       :cluster-id cluster-identifier
+                                       :server-group (cluster-unique "PublicSlaveServerGroup")
+                                       :master-role (cluster-id-of "aws_iam_role" "master-role")
+                                       :slave-role (cluster-id-of "aws_iam_role" "slave-role")
+                                       :aws-access-key (cluster-id-of "aws_iam_access_key" "host-key")
+                                       :aws-secret-access-key (cluster-output-of "aws_iam_access_key" "host-key" "secret")
+                                       :exhibitor-s3-bucket (cluster-unique "exhibitor-s3-bucket")
+                                       :internal-lb-dns (cluster-output-of "aws_elb" "InternalMasterLoadBalancer" "dns_name")
+                                       :fallback-dns (vpc/fallback-dns vpc/vpc-cidr-block)
+                                       :number-of-masters min-number-of-masters}
+                                :lifecycle { :create_before_destroy true }})

              (asg "PublicSlaveServerGroup"
                   cluster-unique
@@ -345,7 +345,7 @@
                    :tags {:Key "role"
                           :PropagateAtLaunch "true"
                           :Value "mesos-slave"}
-                   :user_data (output-of "template_file" "public-slave-user-data" "rendered")
+                   :user_data (cluster-output-of "template_file" "public-slave-user-data" "rendered")
                    ;;:root_block_device {:volume_size 20}
                    :max_size max-number-of-public-slaves
                    :min_size min-number-of-public-slaves
@@ -362,22 +362,22 @@
                           :subnets public-subnets
                           :sgs (mapv cluster-unique ["public-slave-security-group"])}]})

-             (resource "template_file" "slave-user-data"
-                       {:template (mesos-slave-user-data)
-                        :vars {:aws-region region
-                               :cluster-name cluster-name
-                               :cluster-id cluster-identifier
-                               :server-group (cluster-unique "SlaveServerGroup")
-                               :master-role (cluster-id-of "aws_iam_role" "master-role")
-                               :slave-role (cluster-id-of "aws_iam_role" "slave-role")
-                               :aws-access-key (cluster-id-of "aws_iam_access_key" "host-key")
-                               :aws-secret-access-key (cluster-output-of "aws_iam_access_key" "host-key" "secret")
-                               :exhibitor-s3-bucket (cluster-unique "exhibitor-s3-bucket")
-                               :internal-lb-dns (cluster-output-of "aws_elb" "InternalMasterLoadBalancer" "dns_name")
-                               :fallback-dns (vpc/fallback-dns vpc/vpc-cidr-block)
-                               :number-of-masters min-number-of-masters}
-                        :lifecycle { :create_before_destroy true }
-                        })
+             (cluster-resource "template_file" "slave-user-data"
+                               {:template (mesos-slave-user-data)
+                                :vars {:aws-region region
+                                       :cluster-name cluster-name
+                                       :cluster-id cluster-identifier
+                                       :server-group (cluster-unique "SlaveServerGroup")
+                                       :master-role (cluster-id-of "aws_iam_role" "master-role")
+                                       :slave-role (cluster-id-of "aws_iam_role" "slave-role")
+                                       :aws-access-key (cluster-id-of "aws_iam_access_key" "host-key")
+                                       :aws-secret-access-key (cluster-output-of "aws_iam_access_key" "host-key" "secret")
+                                       :exhibitor-s3-bucket (cluster-unique "exhibitor-s3-bucket")
+                                       :internal-lb-dns (cluster-output-of "aws_elb" "InternalMasterLoadBalancer" "dns_name")
+                                       :fallback-dns (vpc/fallback-dns vpc/vpc-cidr-block)
+                                       :number-of-masters min-number-of-masters}
+                                :lifecycle { :create_before_destroy true }
+                                })

              (asg "SlaveServerGroup"
                   cluster-unique
@@ -388,7 +388,7 @@
                    :tags {:Key "role"
                           :PropagateAtLaunch "true"
                           :Value "mesos-slave"}
-                   :user_data  (output-of "template_file" "slave-user-data" "rendered")
+                   :user_data  (cluster-output-of "template_file" "slave-user-data" "rendered")
                    ;;:root_block_device {:volume_size 20}
                    :max_size max-number-of-slaves
                    :min_size min-number-of-slaves


Remove debug messages.

Remove debug messages.

--- src/uxbox/data/pages.cljs
+++ src/uxbox/data/pages.cljs
@@ -102,7 +102,6 @@
 (defrecord SyncPage [id]
   rs/WatchEvent
   (-apply-watch [this state s]
-    (println "SyncPage")
     (letfn [(on-success [{page :payload}]
               (->PageSynced page))
             (on-failure [e]
@@ -122,7 +121,6 @@
 (defrecord UpdatePage [id]
   rs/WatchEvent
   (-apply-watch [this state s]
-    (println "UpdatePage")
     (let [page (get-in state [:pages-by-id id])]
       (if (:history page)
         (rx/empty)


Remove useless parsing multiple tags when only one is expected.

--- src/uxbox/util/emails.clj
+++ src/uxbox/util/emails.clj
@@ -14,7 +14,7 @@
 (def ^:private grammar
   (str "message = part*"
        "part = begin header body end; "
-       "header = tag* eol; "
+       "header = tag eol; "
        "tag = space keyword; "
        "body = line*; "
        "begin = #'--\\s+begin\\s+'; "


A pithy comment.

A pithy comment.

--- src/midje/midje_forms/recognizing.clj
+++ src/midje/midje_forms/recognizing.clj
@@ -93,6 +93,9 @@
   (and (list? thing)
        (mockable-function-symbol? (first thing))))

+
+;; It's annoying that these have to be here, instead of
+;; dissecting, but I can't do circular references.
 (defn fake-form-funcall [fake-form]
   (second fake-form))


Logs the compute cluster name instead of entire object in safe-kill-task (#1375)

--- scheduler/src/cook/compute_cluster.clj
+++ scheduler/src/cook/compute_cluster.clj
@@ -63,20 +63,21 @@

 (defn safe-kill-task
   "A safe version of kill task that never throws. This reduces the risk that errors in one compute cluster propagate and cause problems in another compute cluster."
-  [compute-cluster task-id]
+  [{:keys [name] :as compute-cluster} task-id]
   (try
     (kill-task compute-cluster task-id)
     (catch Throwable t
-      (log/error t "In compute cluster" compute-cluster "error killing task" task-id))))
+      (log/error t "In compute cluster" name ", error killing task" task-id))))

-(defn kill-task-if-possible [compute-cluster task-id]
+(defn kill-task-if-possible
   "If compute cluster is nil, print a warning instead of killing the task. There are cases, in particular,
   lingering tasks, stragglers, or cancelled tasks where the task might outlive the compute cluster it was
   member of. When this occurs, the looked up compute cluster is null and trying to kill via it would cause an NPE,
   when in reality, it's relatively innocuous. So, we have this wrapper to use in those circumstances."
+  [compute-cluster task-id]
   (if compute-cluster
     (safe-kill-task compute-cluster task-id)
-    (log/warn "Unable to kill task " task-id " because compute-cluster is nil")))
+    (log/warn "Unable to kill task" task-id "because compute-cluster is nil")))

 ; Internal method
 (defn write-compute-cluster


Implement offerRescinded callback

Implement offerRescinded callback

--- scheduler/src/cook/mesos/scheduler.clj
+++ scheduler/src/cook/mesos/scheduler.clj
@@ -35,7 +35,8 @@
             [chime :refer [chime-at]]
             [cook.mesos.heartbeat :as heartbeat]
             [cook.mesos.share :as share]
-            [swiss.arrows :refer :all])
+            [swiss.arrows :refer :all]
+            [clojure.core.cache :as cache])
   (import java.util.concurrent.TimeUnit))

 (defn now
@@ -100,6 +101,14 @@
                {:instance (str (count (:job/instance job-ent)))})
              "UTF-8")
      executor-key executor-value}))
+
+(defn rescind-offer!
+  [rescinded-offer-id-cache offer-id]
+  (log/info "Rescinding offer" offer-id)
+  (swap! rescinded-offer-id-cache (fn [c]
+                                    (if (cache/has? c offer-id)
+                                      (cache/hit c offer-id)
+                                      (cache/miss c offer-id offer-id)))))

 (timers/deftimer [cook-mesos scheduler handle-status-update-duration])
 (meters/defmeter [cook-mesos scheduler tasks-killed-in-status-update])
@@ -917,7 +926,7 @@

 (defn start-offer-matcher!
   "Create a thread to repeatedly pull from matcher-chan and have the offer matched."
-  [conn pending-jobs-atom matcher-chan]
+  [conn pending-jobs-atom matcher-chan rescinded-offer-id-cache]
   (async/thread
     (log/debug "offer matcher started")
     (try
@@ -925,9 +934,12 @@
         (log/debug "Preparing to pull offer (offer-matcher)")
         (let [offer (async/<!! matcher-chan)
               fid (:fid offer)
+              offer-ids (:ids offer)
               driver (:driver offer)]
           (log/debug "(offer-matcher) Offer taken " offer)
-          (handle-resource-offer! conn driver fid pending-jobs-atom offer))
+          (if-let [invalid-offer-id (some #(cache/lookup @rescinded-offer-id-cache %) offer-ids)]
+            (log/info "Received rescinded offer" invalid-offer-id "in offer matcher")
+            (handle-resource-offer! conn driver fid pending-jobs-atom offer)))
         (log/debug "(offer matcher) Handled resource offer")
         (recur))
       (catch Exception e
@@ -939,14 +951,17 @@
 (defn create-datomic-scheduler
   [conn set-framework-id pending-jobs-atom heartbeat-ch offer-incubate-time-ms task-constraints]
   (let [fid (atom nil)
+        ;; Mesos can potentially rescind thousands of offers
+        rescinded-offer-id-cache (-> {}
+                                     (cache/fifo-cache-factory :threshold 10240)
+                                     atom)
         offer-chan (async/chan 100)
         offer-ready-chan (async/chan 100)
         matcher-chan (async/chan) ; Don't want to buffer offers to the matcher chan. Only want when ready
         view-incubating-offers (start-offer-incubator! offer-chan offer-ready-chan offer-incubate-time-ms)
         view-mature-offers (start-offer-prioritizer! offer-ready-chan matcher-chan)
-        _ (start-offer-matcher! conn pending-jobs-atom matcher-chan)
-        _ (start-jobs-prioritizer! conn pending-jobs-atom task-constraints)
-        ]
+        _ (start-offer-matcher! conn pending-jobs-atom matcher-chan rescinded-offer-id-cache)
+        _ (start-jobs-prioritizer! conn pending-jobs-atom task-constraints)]
     {:scheduler
      (mesos/scheduler
       (registered [driver framework-id master-info]
@@ -968,7 +983,8 @@
                         (catch Exception e
                           (log/error e "Reconciliation error")))))
       ;; Ignore this--we can just wait for new offers
-      (offerRescinded [driver offer-id])
+      (offerRescinded [driver offer-id]
+                      (rescind-offer! rescinded-offer-id-cache offer-id))
       (frameworkMessage [driver executor-id slave-id data]
                         (heartbeat/notify-heartbeat heartbeat-ch executor-id slave-id data))
       (disconnected [driver]
@@ -982,11 +998,11 @@
       (resourceOffers [driver offers]
                       (case
                           (async/alt!!
-                           [[offer-chan [offers driver @fid]]] (log/debug "Passed " (count offers) " to incubator")
+                           [[offer-chan [offers driver @fid]]] (log/debug "Passed" (count offers) "to incubator")
                            :default :back-pressure
                            :priority true)
                         :back-pressure (do
-                                         (log/warn "Back pressure on offer-incubator. Declining " (count offers) "offers")
+                                         (log/warn "Back pressure on offer-incubator. Declining" (count offers) "offers")
                                          (meters/mark! offer-back-pressure)
                                          (decline-offers driver (map :id offers)))
                         nil))


Move the scrabble exercise under a namespace.

Related: PR #8.

--- scrabble-score/scrabble_score_test.clj
+++ scrabble-score/scrabble_score_test.clj
@@ -2,16 +2,16 @@
 (load-file "scrabble.clj")

 (deftest lower-case-letter
-  (is (= 1 (score-letter "a"))))
+  (is (= 1 (scrabble/score-letter "a"))))
 (deftest upper-case-letter
-  (is (= 1 (score-letter "A"))))
+  (is (= 1 (scrabble/score-letter "A"))))
 (deftest two-letter-word
-  (is (= 2 (score-word "at"))))
+  (is (= 2 (scrabble/score-word "at"))))
 (deftest bigger-word-1
-  (is (= 6 (score-word "street"))))
+  (is (= 6 (scrabble/score-word "street"))))
 (deftest bigger-word-2
-  (is (= 22 (score-word "quirky"))))
+  (is (= 22 (scrabble/score-word "quirky"))))
 (deftest all-upper-case-word
-  (is (= 20 (score-word "MULTIBILLIONAIRE"))))
+  (is (= 20 (scrabble/score-word "MULTIBILLIONAIRE"))))

 (run-tests)


adjusted query order

adjusted query order

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/irefweb/temp/binary.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/temp/irefweb/temp/binary.clj
@@ -23,29 +23,6 @@
    (_/edge_field obo/IAO_0000219 ["X" "en"])   ;; "X" signifies binary interaction
    (_/interaction_record obo/BFO_0000051 _/edge_field)  ;; bfo/has_part

-   ;; get the unique interaction identifier
-   (_/interaction_record obo/BFO_0000051 _/interaction_checksum_field) ;; bfo/has_part
-   (_/interaction_checksum_field kiao/hasTemplate iaoirefweb/IRefWebInteraction_checksumInteractionDataField1)
-   (_/interaction_checksum_field obo/IAO_0000219 ?/unique_interaction_id) ;; iao/denotes
-
-   ;; get the interaction type name and ID
-   (_/interaction_record obo/BFO_0000051 _/interaction_type_record) ;; bfo/has_part
-   (_/interaction_type_record kiao/hasTemplate iaoirefweb/IRefWebInteractionTypeSchema1)
- ;;  (?/interaction_type_record obo/BFO_0000051 ?/int_type_name_field) ;; bfo/has_part
- ;;  (?/int_type_name_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeNameDataField1)
- ;;  (?/int_type_name_field obo/IAO_0000219 ?/int_type_name) ;; iao/denotes
-   (_/interaction_type_record obo/BFO_0000051 _/int_type_id_field) ;; bfo/has_part
-   (_/int_type_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeIdDataField1)
-   (_/int_type_id_field obo/IAO_0000219 _/int_type_id_ice) ;; iao/denotes
-   (_/int_type_id_ice obo/IAO_0000219 ?/int_type_id) ;; iao/denotes
-
-   ;; get the detection method
-   (_/interaction_record obo/BFO_0000051 _/interaction_detection_method_record) ;; bfo/has_part
-   (_/interaction_detection_method_record kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethodSchema1)
-   (_/interaction_detection_method_record obo/BFO_0000051 _/detection_method_id_field) ;; bfo/has_part
-   (_/detection_method_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethod_detectionMethodIdDataField1)
-   (_/detection_method_id_field obo/IAO_0000219 ?/detection_method_id) ;; iao/denotes
-
    ;; there is a "super" record in IRefWeb that contains references
    ;; to the interaction record and interactor record(s)
    (_/super_record obo/BFO_0000051 _/interaction_record) ;; bfo/has_part
@@ -69,6 +46,29 @@
    (_/id_field2 obo/IAO_0000219 _/id2) ;; iao/denotes
    (_/id2 obo/IAO_0000219 ?/protein2)) ;; iao/denotes

+  ;; get the unique interaction identifier
+   (_/interaction_record obo/BFO_0000051 _/interaction_checksum_field) ;; bfo/has_part
+   (_/interaction_checksum_field kiao/hasTemplate iaoirefweb/IRefWebInteraction_checksumInteractionDataField1)
+   (_/interaction_checksum_field obo/IAO_0000219 ?/unique_interaction_id) ;; iao/denotes
+
+   ;; get the interaction type name and ID
+   (_/interaction_record obo/BFO_0000051 _/interaction_type_record) ;; bfo/has_part
+   (_/interaction_type_record kiao/hasTemplate iaoirefweb/IRefWebInteractionTypeSchema1)
+ ;;  (?/interaction_type_record obo/BFO_0000051 ?/int_type_name_field) ;; bfo/has_part
+ ;;  (?/int_type_name_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeNameDataField1)
+ ;;  (?/int_type_name_field obo/IAO_0000219 ?/int_type_name) ;; iao/denotes
+   (_/interaction_type_record obo/BFO_0000051 _/int_type_id_field) ;; bfo/has_part
+   (_/int_type_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionType_interactionTypeIdDataField1)
+   (_/int_type_id_field obo/IAO_0000219 _/int_type_id_ice) ;; iao/denotes
+   (_/int_type_id_ice obo/IAO_0000219 ?/int_type_id) ;; iao/denotes
+
+   ;; get the detection method
+   (_/interaction_record obo/BFO_0000051 _/interaction_detection_method_record) ;; bfo/has_part
+   (_/interaction_detection_method_record kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethodSchema1)
+   (_/interaction_detection_method_record obo/BFO_0000051 _/detection_method_id_field) ;; bfo/has_part
+   (_/detection_method_id_field kiao/hasTemplate iaoirefweb/IRefWebInteractionDetectionMethod_detectionMethodIdDataField1)
+   (_/detection_method_id_field obo/IAO_0000219 ?/detection_method_id) ;; iao/denotes
+
   ;; we take advantage of the fact that IRefWeb has
   ;; created a unique id for the interaction. This will allow us to reproducibly create
   ;; a hash for the interaction that can be matched across records.


Fixes virtual product test.

Fixes virtual product test.

I should have (reset), (run-all-tests)'ed when I merely C-c C-k, C-c M-,'ed.

--- system-int-test/test/cmr/system_int_test/bootstrap/virtual_products_test.clj
+++ system-int-test/test/cmr/system_int_test/bootstrap/virtual_products_test.clj
@@ -1,4 +1,4 @@
-(ns cmr.system-int-test.bootstrap.virtual-product-bootstrap-test
+(ns cmr.system-int-test.bootstrap.virtual-products-test
   (:require [clojure.test :refer :all]
             [cmr.system-int-test.data2.collection :as dc]
             [cmr.system-int-test.data2.core :as d]


account for zooming when we drag text

account for zooming when we drag text

--- src-cljs/frontend/controllers/controls.cljs
+++ src-cljs/frontend/controllers/controls.cljs
@@ -349,9 +349,12 @@
                                              (cond-> (and (= tool :text)
                                                           (get-in state [:mouse :down]))
                                                ((fn [s]
-                                                  (-> s
-                                                    (update-in [:layer/start-x] + (:x delta))
-                                                    (update-in [:layer/start-y] + (:y delta))))))))
+                                                  (let [zoom (get-in state [:camera :zf])]
+                                                    (-> s
+                                                      (update-in [:layer/start-x] + (* (/ 1 zoom)
+                                                                                (:x delta)))
+                                                      (update-in [:layer/start-y] + (* (/ 1 zoom)
+                                                                                (:y delta))))))))))
         (update-in [:drawing :layers 0]
                    (fn [layer]
                      (merge


Make contrib a dev dependency for session tests.

--- ring-core/project.clj
+++ ring-core/project.clj
@@ -2,8 +2,8 @@
   :description "Ring core libraries."
   :url "http://github.com/mmcgrana/ring"
   :dependencies [[org.clojure/clojure "1.2.0"]
-                 [org.clojure/clojure-contrib "1.2.0"]
                  [commons-codec "1.4"]
                  [commons-io "1.4"]
                  [commons-fileupload "1.2.1"]
-                 [javax.servlet/servlet-api "2.5"]])
+                 [javax.servlet/servlet-api "2.5"]]
+  :dev-dependencies [[org.clojure/clojure-contrib "1.2.0"]])


fix setting tag description

fix setting tag description

--- src/braid/client/state/handler/impl.cljs
+++ src/braid/client/state/handler/impl.cljs
@@ -140,7 +140,7 @@
   (helpers/subscribe-to-tag state tag-id))

 (defmethod handler :set-tag-description [state [_ {:keys [tag-id description local-only?]}]]
-  (when local-only?
+  (when-not local-only?
     (sync/chsk-send!
       [:braid.server/set-tag-description {:tag-id tag-id :description description}]))
   (helpers/set-tag-description state tag-id description))


adding android Environment log entries to get available disks, also needs to get from activity the current working directory in order to check the disk cache size

--- src/clojure/my/company/superapp/main.clj
+++ src/clojure/my/company/superapp/main.clj
@@ -35,6 +35,7 @@
              com.vincentbrison.openlibraries.android.dualcache.Builder
              com.vincentbrison.openlibraries.android.dualcache.CacheSerializer
              com.vincentbrison.openlibraries.android.dualcache.JsonSerializer
+             android.os.Environment
              )
     )

@@ -344,7 +345,7 @@
     ;; caching tests
     (def info (Runtime/getRuntime))
     (log/i "free memory in the device:" (.freeMemory info) "with max memory of:" (.maxMemory info) "and total memory:" (.totalMemory info))
-
+    (Environment$getExternalStorageState
     ;; needs to add to intent main activity the "EXTRA_ID_CACHE, AND SIZES"
     (def main-intent (.getIntent (*a)))
     ;; (def mCacheId (.getStringExtra main-intent "EXTRA_ID_CACHE"))


Blur projects buttons on click

Blur projects buttons on click

--- src/clojure/staircase/views/projects.clj
+++ src/clojure/staircase/views/projects.clj
@@ -51,6 +51,7 @@
   [:ul.breadcrumb.list-inline.mymine.clearfix
    [:button.btn.btn-default.pull-right
     {:ng-click "appView.editing = !appView.editing"
+     :blur-on "click"
      :ng-class "{active: appView.editing}"}
     [:i.fa.fa-2x.fa-edit]]
    [:li [:a {:ng-click "appView.goToRoot()"} "Home"]]
@@ -115,6 +116,7 @@
      [:button.btn.btn-default.pushleft
       {:ng-class "{active: appView.showExplorer}"
        :ng-disabled "!appView.allProjects.length"
+       :blur-on "click"
        :ng-click "appView.showExplorer = !appView.showExplorer"}
       [:i.fa.fa-plus]
       " "


fix munged non-original (text) -LRB- etc

--- src/clojure/zensols/nlparse/stanford.clj
+++ src/clojure/zensols/nlparse/stanford.clj
@@ -308,11 +308,22 @@
                                mentions)})))
        doall))

+(defn- anon-mention-map
+  "Create a mention map from an annotation.  We clobber the `:text` entry since
+  by default it uses the non-original annotation.  This non-original annotation
+  will substitute things like parenthesis with `-LRB-` and `-RRB-`."
+  [top-anon anon]
+  (->> anon
+       char-range-
+       (apply subs (text- top-anon))
+       (hash-map :text)
+       (merge (anon-word-map anon))))
+
 (defn- anon-map [anon]
   (log/debugf "tokens: %s" (tokens- anon))
   {:text (text- anon)
-   :mentions (map anon-word-map (mentions- anon))
-   :tok-re-mentions (map anon-word-map (tok-re-mentions- anon))
+   :mentions (map #(anon-mention-map anon %) (mentions- anon))
+   :tok-re-mentions (map #(anon-mention-map anon %) (tok-re-mentions- anon))
    :coref (coref-tree-to-map anon)
    :sents (map (fn [anon]
                  {:text (text- anon)


Add more examples

Add more examples

--- src/clojure_walkthrough/jocj/ch03_04.clj
+++ src/clojure_walkthrough/jocj/ch03_04.clj
@@ -12,7 +12,6 @@
   (
    ;; do something here with RABBITMQ-CONNECTION
    ))
-

 ;; Special variables

@@ -35,9 +34,9 @@
 (print-the-var "A:") ;; will print "A: 10" in the REPL

 (binding [*eval-me* 20] ;; the first binding
-  (print-the-var "B:")
+  (print-the-var "B:")
   (binding [*eval-me* 30] ;; the 2nd binding
-    (print-the-var "C:"))
+    (print-the-var "C:"))
   (print-the-var "D:"))

 ;; Result:
@@ -50,3 +49,79 @@

 ;; Result:
 ;; E: 10
+
+;; 3.5 - A high-order function for aspect-oriented logging
+(defn ^:dynamic twice [x]
+  (println "original function")
+  (* 2 x))
+
+(defn call-twice [y]
+  (twice y))
+
+(defn with-log [function-to-call log-statement]
+  (fn [& args]
+    (println log-statement)
+    (apply function-to-call args)))
+
+(call-twice 10) ;; the REPL print "original function" and return 20
+
+(binding [twice (with-log twice "Calling the twice function")]
+  (call-twice 20)) ;; 40
+;; Console:
+;; Calling the twice function
+;; original function
+
+(call-twice 30) ;; 60
+;; Console:
+;; original function
+
+;; Laziness and Special Variables
+(def ^:dynamic *factor* 10)
+
+(defn multiply [x]
+  (* x *factor*))
+
+(map multiply [1 2 3 4 5]) ;; (10 20 30 40 50)
+
+;; If we use binding call
+(binding [*factor* 20]
+  (map multiply [1 2 3 4 5])) ;; (10 20 30 40 50)
+;; Call to map returns lazy sequence
+
+;; To make this work we need to force non-lazy realization
+(binding [*factor* 20]
+  (doall (map multiply [1 2 3 4 5]))) ;; (20 40 60 80 100)
+
+;; 3.4.2: The let form revisited
+
+(let [x 10
+      y 20]
+  [x y]) ;; [10 20]
+
+;; defined function locally inside lexical scope of let form
+(defn upcased-name [names]
+  (let [up-case (fn [name] (.toUpperCase name))]
+    (map up-case names)))
+
+(upcased-name ["foo" "bar" "baz"]) ;; ("FOO" "BAR" "BAZ")
+
+;; Difference between let and binding forms
+(def ^:dynamic *factor* 10)
+(binding [*factor* 20]
+  (println *factor*)
+  (doall (map multiply [1 2 3 4 5]))) ;; (20 40 60 80 100)
+
+;; using the let form
+(let [*factor* 20]
+  (println *factor*)
+  (doall (map multiply [1 2 3 4 5]))) ;; (10 20 30 40 50)
+;; print 20 five time and has no effect on the dynamic scope
+
+;; 3.4.3 - Lexical closures
+(defn create-scaler [scale]
+  (fn [x]
+    (* x scale)))
+
+(def percent-scaler (create-scaler 100))
+
+(percent-scaler 0.59) ; 59.0


Shortened a few lines.

Shortened a few lines.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -1,6 +1,3 @@
-;; gorilla-repl.fileformat = 1
-
-;; @@
 (ns clojush.pushgp.genetic-operators
   (:use [clojush util random individual globals interpreter translate pushstate]
         clojush.instructions.tag
@@ -38,7 +35,8 @@
         new-tag-num (mod (round (perturb-with-gaussian-noise
                                   uniform-mutation-tag-gaussian-standard-deviation tag-num))
                          @global-tag-limit)
-        new-instr (symbol (apply str (interpose  "_" (concat (butlast tagparts) (list (str new-tag-num))))))]
+        new-instr (symbol (apply str (interpose "_" (concat (butlast tagparts)
+                                                            (list (str new-tag-num))))))]
     (assoc instr-map :instruction new-instr)))

 (defn uniform-mutation
@@ -64,7 +62,8 @@
         instruction-mutator (fn [token]
                               (assoc token
                                      :instruction
-                                     (:instruction (first (random-plush-genome 1 atom-generators argmap)))))
+                                     (:instruction
+                                       (first (random-plush-genome 1 atom-generators argmap)))))
         constant-mutator (fn [token]
                            (let [const (:instruction token)]
                              (if (tag-instruction? const)
@@ -281,7 +280,8 @@
                           (let [closes (get instr-map :close 0)]
                             (assoc instr-map :close
                               (if (< (lrand) uniform-close-mutation-rate)
-                                (if (< (lrand) close-increment-rate) ;Rate at which to increase closes instead of decrease
+                                (if (< (lrand) close-increment-rate)
+                                  ;Rate at which to increase closes instead of decrease
                                   (inc closes)
                                   (if (<= closes 0)
                                     0
@@ -370,7 +370,8 @@
                              (<= iteration-budget 0)) ;; looping too long
                        result-genome ;; Return
                        (if (< (lrand) alternation-rate)
-                         (recur (max 0 (+' i (Math/round (*' alignment-deviation (gaussian-noise-factor)))))
+                         (recur (max 0 (+' i (Math/round (*' alignment-deviation
+                                                             (gaussian-noise-factor)))))
                                 (not use-s1)
                                 result-genome
                                 (dec iteration-budget))
@@ -605,7 +606,8 @@
         parent1-genome (:genome parent1)
         parent2-genome (:genome parent2)
         child-genome (if (< (lrand) construct-clone-ratio)
-                       (produce-child-genome-by-autoconstruction parent1-genome parent2-genome false argmap)
+                       (produce-child-genome-by-autoconstruction
+                         parent1-genome parent2-genome false argmap)
                        parent1-genome)
         child-errors (if autoconstructive-improve-or-diversify
                        (do
@@ -633,5 +635,3 @@
            :is-random-replacement
            (if use-child false true)
       )))
-
-;; @@


Call destroy! when close button clicked

Call destroy! when close button clicked

--- src/zaffre/glterminal.clj
+++ src/zaffre/glterminal.clj
@@ -1353,6 +1353,7 @@
                     (doseq [id (flatten [[fbo-texture] glyph-textures fg-textures bg-textures])]
                       (GL11/glDeleteTextures (int id))))
                   (GLFW/glfwDestroyWindow window)
+                  (zat/destroy! terminal)
                 (log/info "Exiting"))
               (do
                 (when-not (= @last-video-mode @window-size)


use s/valid? and simpler wrapper in spec instead of s/conform

--- src/validation_benchmark/lib/spec.clj
+++ src/validation_benchmark/lib/spec.clj
@@ -30,60 +30,58 @@

 (defn atomic-keyword [v]
-  (s/conform keyword?  v))
+  (s/valid? keyword?  v))

 (defn atomic-number [v]
-  (s/conform number? v))
+  (s/valid? number? v))

 (defn nil-allowed-bool [v]
-  (s/conform ::nilable-saiyan? v))
+  (s/valid? ::nilable-saiyan? v))

 (defn nil-allowed-number [v]
-  (s/conform ::nilable-number v))
+  (s/valid? ::nilable-number v))

 (defn nil-allowed-string [v]
-  (s/conform ::nilable-string v))
+  (s/valid? ::nilable-string v))

 (defn person-map [v]
-  (s/conform ::person v))
+  (s/valid? ::person v))

 (defn person-record [v]
-  (s/conform ::typed-person
+  (s/valid? ::typed-person
              v))

 (defn primes [v]
-  (s/conform prime? v))
+  (s/valid? prime? v))

 (defn range-check [v]
-  (s/conform ::range v))
+  (s/valid? ::range v))

 (defn set-of-keywords [v]
-  (s/conform ::keyword-set v))
+  (s/valid? ::keyword-set v))

 (defn three-tuple [v]
-  (s/conform ::three-tuple v))
+  (s/valid? ::three-tuple v))

 (defn vector-of-two-elements [v]
-  (s/conform ::vector-of-two-elements v))
+  (s/valid? ::vector-of-two-elements v))

 (defn vector-of-variable-length [v]
-  (s/conform vector? v))
+  (s/valid? vector? v))

 (defn wrapper [f valid?]
   (fn [v]
-    (= (not= (f v)
-             :clojure.spec/invalid)
-       valid?)))
+    (= (f v) valid?)))


Update test to create expected image if it doesn't already exist.

--- test/clj/quil/snippet.clj
+++ test/clj/quil/snippet.clj
@@ -163,12 +163,15 @@
                           (remove #(:skip-image-diff? %))
                           (doall))]
         (doseq [{:keys [name index]} elements]
+          (etaoin/go driver (str "http://localhost:3000/test.html#" index))
+          (etaoin/refresh driver)
           (let [n          (str (tu/path-to-snippet-snapshots "cljs") name "-expected.png")
+                f          (io/file (str "dev-resources/" n))
+                _          (when-not (.exists f)
+                             (etaoin/screenshot-element driver {:tag :canvas} (.getAbsolutePath f)))
                 expected   (.getAbsolutePath (io/file (io/resource n)))
                 actual     (replace-suffix expected "actual")
                 difference (replace-suffix expected "difference")]
-            (etaoin/go driver (str "http://localhost:3000/test.html#" index))
-            (etaoin/refresh driver)
             (etaoin/screenshot-element driver {:tag :canvas} actual)
             (let [result (compare-images expected actual difference)]
               (when (number? result)


Bumps version to 1.35.1

Bumps version to 1.35.1

--- 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.35.0"
+(defproject cook "1.35.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"]


Lazy conversion of sequences in hybrid->clojure

--- pigpen-cascading/src/main/clojure/pigpen/cascading/runtime.clj
+++ pigpen-cascading/src/main/clojure/pigpen/cascading/runtime.clj
@@ -58,7 +58,7 @@
   (-> value (OperationUtil/getBytes) thaw))

 (defmethod hybrid->clojure ISeq [^ISeq value]
-  (mapv hybrid->clojure value))
+  (map hybrid->clojure value))

 ;; ******* Serialization ********
 (defn ^:private cs-freeze [value]


simplify example wordcount filter

simplify example wordcount filter

--- test/marceline/topology/wordcount.clj
+++ test/marceline/topology/wordcount.clj
@@ -43,9 +43,7 @@
 (t/deffilter
   filter-null
   [tuple]
-  (if (nil? (t/first tuple))
-    false
-    true))
+  (not (nil? (t/first tuple))))

 (defn build-topology [spout drpc]
   (let [word-state-factory (MemoryMapState$Factory.)


Remove wildcards from word form

Remove wildcards from word form

--- src/cljs/cglossa/search_inputs/cwb/impl/extended.cljs
+++ src/cljs/cglossa/search_inputs/cwb/impl/extended.cljs
@@ -35,6 +35,9 @@
     (case name
       ("word" "lemma" "phon")
       (cond-> (assoc term :word val)
+      (cond-> (assoc term :word (-> val
+                                    (str/replace #"^(?:\.\+)?(.+?)" "$1")
+                                    (str/replace #"(.+?)(?:\.\+)?$" "$1")))
               (= name "lemma") (assoc :lemma? true)
               (= name "phon") (assoc :phon? true)
               (re-find #"\.\+$" val) (assoc :start? true)


rhomboiding

rhomboiding

--- src/tailrecursion/boot/middleware/pom.clj
+++ src/tailrecursion/boot/middleware/pom.clj
@@ -12,7 +12,9 @@

 (defn ^Model set-repositories! [^Model model repositories]
   (dotoseq model [repo repositories]
-    (.addRepository (doto (Repository.) (.setUrl repo)))))
+    (.addRepository
+     (doto (Repository.)
+       (.setUrl repo)))))

 (defn extract-ids [sym]
   (let [[group artifact] ((juxt namespace name) sym)]
@@ -22,13 +24,16 @@
   (dotoseq model
     [[project version & {:keys [exclusions]}] dependencies
      :let [[group artifact] (extract-ids project)]]
-    (.addDependency (doto (Dependency.)
-                      (.setGroupId group)
-                      (.setArtifactId artifact)
-                      (.setVersion version)
-                      (.setExclusions
-                       (for [e exclusions :let [[group artifact] (extract-ids e)]]
-                         (doto (Exclusion.) (.setGroupId group) (.setArtifactId artifact))))))))
+    (.addDependency
+     (doto (Dependency.)
+       (.setGroupId group)
+       (.setArtifactId artifact)
+       (.setVersion version)
+       (.setExclusions
+        (for [e exclusions :let [[group artifact] (extract-ids e)]]
+          (doto (Exclusion.)
+            (.setGroupId group)
+            (.setArtifactId artifact))))))))

 (defn ^Model build-model [boot pom]
   (let [{:keys [repositories dependencies directories]} boot


fix instrumentation ordering

fix instrumentation ordering

--- src-cljs/frontend/instrumentation.cljs
+++ src-cljs/frontend/instrumentation.cljs
@@ -179,17 +179,22 @@
                        (dom/tr nil
                          (dom/td nil display-name)
                          (dom/td #js {:className "number" } render-count)
-                         (dom/td #js {:className "number" } (when mount-count (gstring/format "%2d" mount-count)))
-                         (dom/td #js {:className "number" } last-mount-ms)
-                         (dom/td #js {:className "number" } (when last-render-ms (gstring/format "%2d" last-render-ms)))
-                         (dom/td #js {:className "number" } average-mount-ms)
-                         (dom/td #js {:className "number" } (when average-render-ms (gstring/format "%2d" average-render-ms)))
-                         (dom/td #js {:className "number" } max-mount-ms)
-                         (dom/td #js {:className "number" } (when max-render-ms (gstring/format "%2d" max-render-ms)))
-                         (dom/td #js {:className "number" } min-mount-ms)
-                         (dom/td #js {:className "number" } (when min-render-ms (gstring/format "%2d" min-render-ms)))
-                         (dom/td #js {:className "number" } mount-std-dev)
-                         (dom/td #js {:className "number" } (when render-std-dev (gstring/format "%2d" render-std-dev))) )))
+                         (dom/td #js {:className "number" } (when mount-count (gstring/format "%4d" mount-count)))
+
+                         (dom/td #js {:className "number" } last-render-ms)
+                         (dom/td #js {:className "number" } (when last-mount-ms (gstring/format "%3d" last-mount-ms)))
+
+                         (dom/td #js {:className "number" } average-render-ms)
+                         (dom/td #js {:className "number" } (when average-mount-ms (gstring/format "%3d" average-mount-ms)))
+
+                         (dom/td #js {:className "number" } max-render-ms)
+                         (dom/td #js {:className "number" } (when max-mount-ms (gstring/format "%3d" max-mount-ms)))
+
+                         (dom/td #js {:className "number" } min-render-ms)
+                         (dom/td #js {:className "number" } (when min-mount-ms (gstring/format "%3d" min-mount-ms)))
+
+                         (dom/td #js {:className "number" } render-std-dev)
+                         (dom/td #js {:className "number" } (when mount-std-dev (gstring/format "%3d" mount-std-dev))))))
               (dom/tfoot nil
                 (dom/tr nil
                   (dom/td #js {:className "instrumentation-info" :colSpan "13"}


Clear out finished TODO's

Clear out finished TODO's

--- src/tutorial/untangled_tutorial/B_UI.cljs
+++ src/tutorial/untangled_tutorial/B_UI.cljs
@@ -5,11 +5,6 @@
             [om.dom :as dom]
             cljsjs.d3
             [devcards.core :as dc :refer-macros [defcard defcard-doc]]))
-
-; TODO: Split D3 out to advanced UI
-; TODO: Add "using React from Untangled" to advanced UI. Use victory
-; M###-Advanced-UI  with inc of 10 for naming
-; TODO: Make our links to the "next section" auto-scroll back to top

 (defui Widget
   Object