Add WormBase signing key identity.

Add WormBase signing key identity.

--- lein/.lein/profiles.clj
+++ lein/.lein/profiles.clj
@@ -13,14 +13,10 @@
                        [me.raynes/fs "1.4.6"]
                        [clj-stacktrace "0.2.8"]
                        [acyclic/squiggly-clojure "0.1.5"]
-                       ^:replace [org.clojure/tools.nrepl "0.2.12"]
-                       ;; Consider using typed? [org.clojure/core.typed "0.3.22"]
-                       ]
-        }
-
+                       ^:replace [org.clojure/tools.nrepl "0.2.12"]]}
+ :signing {:gpg-key "matthew.russell@wormbase.org"}
  ;; VisualVM profiling opts
  :jvm-opts ["-Dcom.sun.management.jmxremote"
             "-Dcom.sun.management.jmxremote.ssl=false"
             "-Dcom.sun.management.jmxremote.authenticate=false"
             "-Dcom.sun.management.jmxremote.port=43210"]}
-


Give the "Step 4.3" prompt for corp a negative priority so all other abilities show above it in prompt queue.

--- src/clj/game/core-runs.clj
+++ src/clj/game/core-runs.clj
@@ -419,7 +419,8 @@
                      (fn [args-corp]
                        (clear-wait-prompt state :runner)
                        (show-prompt state :runner nil "The run is now successful" ["Continue"]
-                                    (fn [args-runner] (successful-run-trigger state :runner))))))
+                                    (fn [args-runner] (successful-run-trigger state :runner))))
+                     {:priority -1}))
     (successful-run-trigger state side)))

 (defn corp-phase-43


cleanup code and documentation

cleanup code and documentation

--- src/clj/lesezeichen/db.clj
+++ src/clj/lesezeichen/db.clj
@@ -17,8 +17,7 @@
     (d/create-database uri)
     (d/connect uri)))

-
-(def conn (d/connect (str db-uri-base "/bookmarks")))
+(def conn (d/connect (str db-uri-base "/lesezeichen")))

 (defn init-schema [path]
@@ -76,13 +75,17 @@
      (d/q query db url email))))

-(defn add-bookmark [{:keys [url title email] :as bookmark}]
+(defn add-bookmark
+  "Transact bookmark and return the resulting datom"
+  [{:keys [url title email] :as bookmark}]
   (do
     (transact-bookmark bookmark)
     (get-bookmark bookmark)))

-(defn get-user-bookmarks [email]
+(defn get-user-bookmarks
+  "Find user's bookmarks"
+  [email]
   (let [query '[:find ?url ?title ?tx
                 :in $ ?email
                 :where
@@ -100,7 +103,9 @@
      (d/q query db email))))

-(defn get-all-bookmarks []
+(defn get-all-bookmarks
+  "Retrieve all bookmarks"
+  []
   (map
    #(zipmap [:url :title :user] %)
    (d/q '[:find ?url ?title ?email
@@ -111,7 +116,10 @@
           [?uid :user/email ?email]]
         (d/db conn))))

-(defn get-all-users []
+
+(defn get-all-users
+  "Retrieve all users"
+  []
   (map
    first
    (d/q '[:find ?email
@@ -122,9 +130,10 @@

 (comment

-  (d/create-database (str db-uri-base "/bookmarks"))
+  ;; only once for test purposes
+  (d/create-database (str db-uri-base "/lesezeichen"))

-  (d/delete-database (str db-uri-base "/bookmarks"))
+  (d/delete-database (str db-uri-base "/lesezeichen"))

   (init-schema "schema.edn")

@@ -132,23 +141,24 @@

   (add-user {:email "adam@topiq.es"})

+  (do
+   (add-bookmark {:url "https://topiq.es" :title "TOPIQ" :email "eve@topiq.es"})
+   (add-bookmark {:url "https://google.com" :title "the kraken" :email "eve@topiq.es"})
+   (add-bookmark {:url "https://sup.com" :title "the void 2" :email "adam@topiq.es"})
+   (add-bookmark {:url "http://boo.far" :title "foobar" :email "eve@topiq.es"})
+   (add-bookmark {:url "http://boo.far" :title "foobar" :email "adam@topiq.es"}))
+  ;; -------
+
+
+  ;; some queries
   (-> (get-user-bookmarks "eve@topiq.es")
-      first
-      :ts)
+      aprint)

   (let [users (get-all-users)]
     (->> users
          (map get-user-bookmarks)
-         (zipmap users)))
+         (zipmap users)
+         aprint))

-  (add-bookmark {:url "https://topiq.es" :title "TOPIQ" :email "eve@topiq.es"})
-
-  (add-bookmark {:url "https://google.com" :title "the kraken" :email "eve@topiq.es"})
-
-  (add-bookmark {:url "https://sup.com" :title "the void 2" :email "adam@topiq.es"})
-
-  (add-bookmark {:url "http://boo.far" :title "foobar" :email "eve@topiq.es"})
-
-  (add-bookmark {:url "http://boo.far" :title "foobar" :email "adam@topiq.es"})

   )


Rename view app param to view-ctx

Rename view app param to view-ctx

--- src/clj/zetawar/views.cljs
+++ src/clj/zetawar/views.cljs
@@ -23,7 +23,7 @@
        [(* q 32) (* r 26)]
        [(+ 16 (* q 32)) (+ 26 (* (- r 1) 26))]))))

-(defn tile-border [{:keys [conn] :as app} q r]
+(defn tile-border [{:as view-ctx :keys [conn]} q r]
   (let [[x y] (offset->pixel q r)]
     [:g {:id (str "border-" q "," r)}
      (cond
@@ -52,7 +52,7 @@
         (get-in [:unit/type :unit-type/image])
         (string/replace "COLOR" color-name))))

-(defn board-unit [{:keys [conn dispatch] :as app} q r]
+(defn board-unit [{:as view-ctx :keys [conn dispatch]} q r]
   (when-let [unit @(subs/unit-at conn q r)]
     (let [[x y] (offset->pixel q r)
           image (unit-image unit)]
@@ -69,7 +69,7 @@
                 :width 32 :height 34
                 :xlink-href (str "/images/game/health/" (:unit/count unit) ".png")}]])))

-(defn tile-mask [{:keys [conn] :as app} q r]
+(defn tile-mask [{:as view-ctx :keys [conn]} q r]
   (let [[x y] (offset->pixel q r)
         show (or
               ;; No unit selected and tile contains current unit with no actions
@@ -96,42 +96,42 @@
         (get-in [:terrain/type :terrain-type/image])
         (string/replace "COLOR" color-name))))

-(defn terrain-tile [{:keys [conn] :as app} terrain q r]
+(defn terrain-tile [view-ctx terrain q r]
   (let [[x y] (offset->pixel q r)
         image (terrain-image terrain)]
     [:image {:x x :y y
              :width 32 :height 34
              :xlink-href (str "/images/game/" image)}]))

-(defn tile [{:keys [conn dispatch] :as app} terrain]
+(defn tile [{:as view-ctx :keys [dispatch]} terrain]
   (let [{:keys [terrain/q terrain/r]} terrain]
     ^{:key (str q "," r)}
     [:g {:on-click #(dispatch [::events.ui/select-hex q r])}
-     [terrain-tile app terrain q r]
-     [tile-border app q r]
-     [board-unit app q r]
-     [tile-mask app q r]]))
-
-(defn tiles [{:keys [conn] :as app}]
+     [terrain-tile view-ctx terrain q r]
+     [tile-border view-ctx q r]
+     [board-unit view-ctx q r]
+     [tile-mask view-ctx q r]]))
+
+(defn tiles [view-ctx]
   (into [:g]
-        (for [terrain @(subs/terrains conn)]
-          [tile app terrain])))
+        (for [terrain @(subs/terrains view-ctx)]
+          [tile view-ctx terrain])))

 ;; TODO: computer board size based on map size
-(defn board [app]
+(defn board [view-ctx]
   [:svg#board {:width 500 :height 500}
-   [tiles app]])
-
-(defn faction-credits [{:keys [conn] :as app}]
-  (let [{:keys [faction/credits]} @(subs/current-faction conn)
-        {:keys [map/credits-per-base]} @(subs/game-map conn)
-        income @(subs/current-income conn)]
+   [tiles view-ctx]])
+
+(defn faction-credits [view-ctx]
+  (let [{:keys [faction/credits]} @(subs/current-faction view-ctx)
+        {:keys [map/credits-per-base]} @(subs/game-map view-ctx)
+        income @(subs/current-income view-ctx)]
     [:p#faction-credits
      [:strong (str credits " Credits")]
      [:span.text-muted.pull-right (str "+" income)
       [:span.hidden-md "/turn"]]]))

-(defn copy-url-link [{:keys [conn dispatch] :as app}]
+(defn copy-url-link [view-ctx]
   (let [clipboard (atom nil)
         text-fn (fn [] js/window.location)]
     (r/create-class
@@ -147,7 +147,7 @@
         [:a {:href "#" :on-click #(.preventDefault %)}
          "Copy Link"])})))

-(defn faction-status [{:keys [conn dispatch] :as app}]
+(defn faction-status [{:as view-ctx :keys [conn dispatch]}]
   (let [{:keys [game/round]} @(subs/game conn)
         base-count @(subs/current-base-count conn)]
     [:div#faction-status
@@ -155,7 +155,7 @@
      [:a {:href "#" :on-click #(dispatch [::events.ui/end-turn])}
       "End Turn?"]
      " · "
-     [copy-url-link app]
+     [copy-url-link view-ctx]
      [:div.pull-right
       [:a {:href "#"
            :on-click (fn [e]
@@ -165,7 +165,7 @@
       " · "
       (str "Round " round)]]))

-(defn faction-actions [{:keys [conn dispatch] :as app}]
+(defn faction-actions [{:as view-ctx :keys [conn dispatch]}]
   ;; TODO: replace query with something from subs ns
   (let [[round current-color] (-> @(posh/q '[:find ?round ?current-color
                                              :where
@@ -224,7 +224,7 @@
         [:a {:href "https://www.kickstarter.com/projects/311016908/zetawar/posts/1608417"} "here"]
         "."])]))

-(defn faction-list [{:keys [conn dispatch] :as app}]
+(defn faction-list [{:as view-ctx :keys [conn dispatch]}]
   (into [:ul.list-group]
         (for [faction @(subs/factions conn)]
           (let [faction-eid (e faction)
@@ -253,7 +253,7 @@
                 :title "Configure faction"}]]]))))

 ;; TODO: cleanup unit-picker
-(defn unit-picker [{:keys [conn dispatch] :as app}]
+(defn unit-picker [{:as view-ctx :keys [conn dispatch]}]
   (let [unit-types @(subs/available-unit-types conn)
         cur-faction @(subs/current-faction conn)
         color (name (:faction/color cur-faction))
@@ -287,7 +287,7 @@
       [:button.btn.btn-default {:on-click hide-picker}
        "Cancel"]]]))

-(defn faction-settings [{:keys [conn dispatch] :as app}]
+(defn faction-settings [{:as views-ctx :keys [conn dispatch]}]
   (with-let [faction (subs/faction-to-configure conn)
              selected-player-type (r/atom nil)
              hide-settings #(do
@@ -326,7 +326,7 @@
           "Cancel"]]]]]]))

 ;; TODO: move default-scenario-id to data ns?
-(defn new-game-settings [{:keys [conn dispatch] :as app}]
+(defn new-game-settings [{:as view-ctx :keys [conn dispatch]}]
   (with-let [default-scenario-id :sterlings-aruba-multiplayer
              selected-scenario-id (r/atom default-scenario-id)
              hide-settings #(do
@@ -362,11 +362,11 @@

 ;; TODO: turn entire game interface into it's own component

-(defn app-root [{:keys [conn dispatch] :as app}]
+(defn app-root [{:as view-ctx :keys [conn dispatch]}]
   [:div
-   [new-game-settings app]
-   [faction-settings app]
-   [unit-picker app]
+   [new-game-settings view-ctx]
+   [faction-settings view-ctx]
+   [unit-picker view-ctx]
    ;; TODO: break win dialog out into it's own component
    ;; TODO: add continue + start new game buttons
    [:> js/ReactBootstrap.Modal {:show @(subs/show-win-message? conn)
@@ -388,10 +388,10 @@
     (kickstarter-alert)
     [:div.row
      [:div.col-md-2
-      [faction-credits app]
-      [faction-list app]
-      [faction-actions app]]
+      [faction-credits view-ctx]
+      [faction-list view-ctx]
+      [faction-actions view-ctx]]
      [:div.col-md-10
-      [faction-status app]
-      [board app]]]]
+      [faction-status view-ctx]
+      [board view-ctx]]]]
    (footer)])


decrease memory comsumption for reading whole sequence

--- src/cljam/fasta/reader.clj
+++ src/cljam/fasta/reader.clj
@@ -93,16 +93,29 @@
                      (map? s) (cons s (lazy-seq (read-fn* rdr name))))))]
     (read-fn rdr nil)))

+(def ^:private newline-character (char 10))
+(def ^:private return-character (char 13))
+
+(defn- newline*?
+  [c]
+  (or (= c newline-character)
+      (= c return-character)))
+
+(def newline? (memoize newline*?))
+
 (defn- read-sequence-with-offset
   [rdr offset-start offset-end]
   (let [len (- offset-end offset-start)
         ba (byte-array len)
-        r (.reader rdr)]
+        r (.reader rdr)
+        buf (StringBuffer. len)]
     (.seek r offset-start)
     (.read r ba 0 len)
-    (cstr/upper-case
-       (cstr/replace (cstr/join "" (map char (seq ba)))
-                     #"(\n|\r)" ""))))
+    (doseq [b ^byte ba]
+      (let [c (char ^byte b)]
+        (when-not (newline? c)
+          (.append buf (Character/toUpperCase c)))))
+    (.toString buf)))

 (defn read-whole-sequence
   [^FASTAReader rdr name]


Add User Page

Add User Page

--- src/cljs/ladders/core.cljs
+++ src/cljs/ladders/core.cljs
@@ -26,13 +26,24 @@
    (map-indexed ranking-row rankings)])

 (defn home-page []
-  [:div [:h2 "Current Rankings"]
-        [:h3 "Week 1"]
+  [:div
+   [:div "Home | " [:a {:href "/users"} "Users"]]
+   [:h2 "Current Rankings"]
+   [:h3 "Week 1"]
    [rankings-component rankings]])

-(defn about-page []
-  [:div [:h2 "About ladders"]
-   [:div [:a {:href "/"} "go to the home page"]]])
+(defn add-user-page []
+  [:div
+   [:div [:a {:href "/"} "Home"] " | Users"]
+   [:h2 "Player Information"]
+   [:form
+    [:fieldset {:class "form-group"}
+     [:label "Username"]
+     [:input {:type "text" :class "form-control"}]]
+    [:fieldset {:class "form-group"}
+     [:label "Name"]
+     [:input {:type "text" :class "form-control"}]]
+    [:button {:type "submit" :class "btn btn-primary pull-right"} "Add User"]]])

 (defn current-page []
   [:div [(session/get :current-page)]])
@@ -44,8 +55,8 @@
 (secretary/defroute "/" []
   (session/put! :current-page #'home-page))

-(secretary/defroute "/about" []
-  (session/put! :current-page #'about-page))
+(secretary/defroute "/users" []
+  (session/put! :current-page #'add-user-page))

 ;; -------------------------
 ;; Initialize app


Json friendly property names

Json friendly property names

--- src/clojars/routes/api.clj
+++ src/clojars/routes/api.clj
@@ -18,10 +18,11 @@
       [group-id artifact-id]
       (let [stats (stats/all)]
         (some-> (db/find-jar group-id artifact-id)
-                (assoc :recent-versions (db/recent-versions group-id artifact-id)
-                       :total-downloads (stats/download-count stats group-id artifact-id))
-                (update-in [:recent-versions] (fn [versions]
-                                                (map #(assoc % :downloads (stats/download-count stats group-id artifact-id (:version %)))
+                (assoc :recent_versions (db/recent-versions group-id artifact-id)
+                       :downloads (stats/download-count stats group-id artifact-id))
+                (update-in [:recent_versions] (fn [versions]
+                                                (map (fn [version]
+                                                       (assoc version :downloads (stats/download-count stats group-id artifact-id (:version version))))
                                                      versions)))
                 (json/generate-string))))
     (ANY "*" _


`do` it fools

`do` it fools

--- src/clojure/flambo/api.clj
+++ src/clojure/flambo/api.clj
@@ -67,7 +67,7 @@
 (defmacro iterator-fn
   [& body]
   (let [[args & impl] body]
-    `(fn ~args (~'flambo.api/iterator ~@impl))))
+    `(fn ~args (~'flambo.api/iterator (do ~@impl)))))

 (defn spark-context
   "Creates a spark context that loads settings from given configuration object


Simplify semver-type test with are

Simplify semver-type test with are

--- test/github_changelog/semver_test.clj
+++ test/github_changelog/semver_test.clj
@@ -26,8 +26,12 @@
     (is (not (semver/newer? low high)))))

 (deftest semver-type
-  (is (= (semver/get-type v-major) :major))
-  (is (= (semver/get-type v-minor) :minor))
-  (is (= (semver/get-type v-patch) :patch))
-  (is (= (semver/get-type v-pre-release) :pre-release))
-  (is (= (semver/get-type v-build) :build)))
+  (are [type version] (= type (semver/get-type version))
+                      :major v-major
+                      :minor v-minor
+                      :patch v-patch
+                      :pre-release v-pre-release
+                      :build v-build))
+
+
+


fix test count for karma (#459)

fix test count for karma (#459)

--- src/main/shadow/test/karma.cljs
+++ src/main/shadow/test/karma.cljs
@@ -102,10 +102,11 @@

 (defn start []
   ;; (js/console.log "test env" @st/tests-ref)
-  (js/__karma__.info #js {:total (env/get-test-count)})

   (-> (env/get-test-data)
       (env/reset-test-data!))
+
+  (js/__karma__.info #js {:total (env/get-test-count)})

   (let [env (ct/empty-env ::karma)]
     (st/run-all-tests env)))


add missing reference

add missing reference

--- src/metabase/models/hydrate.clj
+++ src/metabase/models/hydrate.clj
@@ -1,6 +1,7 @@
 (ns metabase.models.hydrate
   (:require [clojure.data.json :as json]
-            [clojure.walk :as walk]))
+            [clojure.walk :as walk]
+            [metabase.db :refer [sel]]))

 (declare hydrate
          hydrate-one


update port for dashboard if unavailable

--- src/main/clojure/edu/umass/cs/runner/dashboard/Dashboard.clj
+++ src/main/clojure/edu/umass/cs/runner/dashboard/Dashboard.clj
@@ -16,7 +16,7 @@

 (def runner-args (atom nil))
 (def record-data (atom nil))
-(def PORT 9000)
+(def PORT (atom 9000))

 (defn get-content-type-for-request
   [uri]
@@ -70,9 +70,15 @@
   [^Namespace ns ^Record record]
   (reset! runner-args ns)
   (reset! record-data record)
-  (ring.adapter.jetty/run-jetty
-    handler
-    {:port PORT :join? false})
+  (try
+    (let [dashboardServer (ring.adapter.jetty/run-jetty
+                            handler
+                            {:port @PORT :join? false})]
+      (println (str "Dashboard server running at http://localhost:" @PORT "/dashboard/Dashboard.html"))
+      dashboardServer)
+    (catch java.net.BindException e
+      (swap! PORT (inc @PORT))
+      (run ns record)))
   )

 (defn -run


Implement «up-down-arrows» in terms of «up-arrows» and «down-arrows»

Seems cleaner this way (and is also a bit parallel, hooray!)

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -340,21 +340,7 @@
 (defn up-down-arrows
   "Returns up-down-arrow relation of ctx."
   [ctx]
-  (let [objs   (objects ctx),
-        atts   (attributes ctx),
-        inz    (incidence ctx),
-        oprime (map-by-fn #(object-derivation ctx #{%}) objs),
-        aprime (map-by-fn #(attribute-derivation ctx #{%}) atts)]
-    (set-of [g m]
-            [g objs
-             m atts
-             :when (and (not (inz [g m]))
-                        (forall [h objs]
-                          (or (inz [h m])
-                              (not (proper-subset? (oprime g) (oprime h)))))
-                        (forall [n atts]
-                          (or (inz [g n])
-                              (not (proper-subset? (aprime m) (aprime n))))))])))
+  (apply intersection (pvalues (up-arrows ctx) (down-arrows ctx))))

 (defn reduce-objects
   "Object reduction for ctx."


Small typo in docstring fixed

Small typo in docstring fixed

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

--- src/conexp/fca/contexts.clj
+++ src/conexp/fca/contexts.clj
@@ -435,7 +435,7 @@
 (defn context-subposition
   "Returns context subposition of ctx-1 and ctx-2, that is
   \\[
-     \frac{(G_1,M_1,I_1)}{(G_2,M_1,I_2)} := (G_1\\cup G_2,M_1,I_1\\cup I_2).
+     \\frac{(G_1,M_1,I_1)}{(G_2,M_1,I_2)} := (G_1\\cup G_2,M_1,I_1\\cup I_2).
   \\]"
   [ctx-1 ctx-2]
   (if (not= (attributes ctx-1) (attributes ctx-2))


Don't show tables before data exists

Don't show tables before data exists

--- mtg-pairings-server/src/cljs/mtg_pairings_server/components/tournament.cljs
+++ mtg-pairings-server/src/cljs/mtg_pairings_server/components/tournament.cljs
@@ -138,28 +138,29 @@
   (let [data (subscribe [::subs/sorted-pairings id round])
         sort-key (subscribe [::subs/pairings-sort])]
     (fn pairings-render [id round]
-      [:table.pairings-table
-       {:class (when (= @sort-key :team1_name) :player-sorted)}
-       [:thead
-        [:tr
-         [sortable-header {:class        :table
-                           :column       :table_number
-                           :sort-key     @sort-key
-                           :dispatch-key ::events/sort-pairings}
-          "Pöytä"]
-         [sortable-header {:class        :players
-                           :column       :team1_name
-                           :sort-key     @sort-key
-                           :dispatch-key ::events/sort-pairings}
-          ^{:key "player-1-heading"} [:span.hidden-mobile "Pelaaja 1"]
-          ^{:key "players-heading"} [:span.hidden-desktop "Pelaajat"]]
-         [:th.players2.hidden-mobile "Pelaaja 2"]
-         [:th.points "Pist."]
-         [:th.result "Tulos"]]]
-       [:tbody
-        (for [pairing @data]
-          ^{:key [(:team1_name pairing)]}
-          [pairing-row pairing])]])))
+      (when (seq @data)
+        [:table.pairings-table
+         {:class (when (= @sort-key :team1_name) :player-sorted)}
+         [:thead
+          [:tr
+           [sortable-header {:class        :table
+                             :column       :table_number
+                             :sort-key     @sort-key
+                             :dispatch-key ::events/sort-pairings}
+            "Pöytä"]
+           [sortable-header {:class        :players
+                             :column       :team1_name
+                             :sort-key     @sort-key
+                             :dispatch-key ::events/sort-pairings}
+            ^{:key "player-1-heading"} [:span.hidden-mobile "Pelaaja 1"]
+            ^{:key "players-heading"} [:span.hidden-desktop "Pelaajat"]]
+           [:th.players2.hidden-mobile "Pelaaja 2"]
+           [:th.points "Pist."]
+           [:th.result "Tulos"]]]
+         [:tbody
+          (for [pairing @data]
+            ^{:key [(:team1_name pairing)]}
+            [pairing-row pairing])]]))))

 (defn percentage [n]
   (gstring/format "%.3f" (* 100 n)))
@@ -174,19 +175,20 @@
    [:td.pgw (percentage (:ogw standing))]])

 (defn standing-table [data]
-  [:table.standings-table
-   [:thead
-    [:tr
-     [:th.rank]
-     [:th.players "Pelaaja"]
-     [:th.points "Pist."]
-     [:th.omw "OMW"]
-     [:th.ogw "PGW"]
-     [:th.pgw "OGW"]]]
-   [:tbody
-    (for [standing data]
-      ^{:key (:team_name standing)}
-      [standing-row standing])]])
+  (when (seq data)
+    [:table.standings-table
+     [:thead
+      [:tr
+       [:th.rank]
+       [:th.players "Pelaaja"]
+       [:th.points "Pist."]
+       [:th.omw "OMW"]
+       [:th.ogw "PGW"]
+       [:th.pgw "OGW"]]]
+     [:tbody
+      (for [standing data]
+        ^{:key (:team_name standing)}
+        [standing-row standing])]]))

 (defn standings [id round]
   (let [data (subscribe [::subs/standings id round])]
@@ -203,24 +205,25 @@
   (let [data (subscribe [::subs/sorted-pods id round])
         sort-key (subscribe [::subs/pods-sort])]
     (fn pods-render [id round]
-      [:table.pods-table
-       [:thead
-        [:tr
-         [sortable-header {:class        :pod
-                           :column       :pod
-                           :sort-key     @sort-key
-                           :dispatch-key ::events/sort-pods}
-          "Pöytä"]
-         [:th.seat "Paikka"]
-         [sortable-header {:class        :player
-                           :column       :team_name
-                           :sort-key     @sort-key
-                           :dispatch-key ::events/sort-pods}
-          "Pelaaja"]]]
-       [:tbody
-        (for [seat @data]
-          ^{:key [(:team_name seat)]}
-          [pod-row seat])]])))
+      (when (seq @data)
+        [:table.pods-table
+         [:thead
+          [:tr
+           [sortable-header {:class        :pod
+                             :column       :pod
+                             :sort-key     @sort-key
+                             :dispatch-key ::events/sort-pods}
+            "Pöytä"]
+           [:th.seat "Paikka"]
+           [sortable-header {:class        :player
+                             :column       :team_name
+                             :sort-key     @sort-key
+                             :dispatch-key ::events/sort-pods}
+            "Pelaaja"]]]
+         [:tbody
+          (for [seat @data]
+            ^{:key [(:team_name seat)]}
+            [pod-row seat])]]))))

 (defn seating-row [seat]
   [:tr
@@ -231,23 +234,24 @@
   (let [data (subscribe [::subs/sorted-seatings id round])
         sort-key (subscribe [::subs/seatings-sort])]
     (fn seatings-render [id round]
-      [:table.seatings-table
-       [:thead
-        [:tr
-         [sortable-header {:class        :table
-                           :column       :table_number
-                           :sort-key     @sort-key
-                           :dispatch-key ::events/sort-seatings}
-          "Pöytä"]
-         [sortable-header {:class        :player
-                           :column       :name
-                           :sort-key     @sort-key
-                           :dispatch-key ::events/sort-seatings}
-          "Pelaaja"]]]
-       [:tbody
-        (for [seat @data]
-          ^{:key [(:name seat)]}
-          [seating-row seat])]])))
+      (when (seq @data)
+        [:table.seatings-table
+         [:thead
+          [:tr
+           [sortable-header {:class        :table
+                             :column       :table_number
+                             :sort-key     @sort-key
+                             :dispatch-key ::events/sort-seatings}
+            "Pöytä"]
+           [sortable-header {:class        :player
+                             :column       :name
+                             :sort-key     @sort-key
+                             :dispatch-key ::events/sort-seatings}
+            "Pelaaja"]]]
+         [:tbody
+          (for [seat @data]
+            ^{:key [(:name seat)]}
+            [seating-row seat])]]))))

 (defn bracket-match [match]
   [:div.bracket-match


(#21372) Remove unused require for ring.adapter.jetty in ssl.clj

Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>

--- src/com/puppetlabs/ssl.clj
+++ src/com/puppetlabs/ssl.clj
@@ -3,7 +3,6 @@
            (java.security.cert X509Certificate)
            (org.bouncycastle.openssl PEMReader PEMWriter)
            (org.bouncycastle.jce.provider BouncyCastleProvider))
-  (:require [ring.adapter.jetty :as jetty])
   (:use [clojure.tools.logging :as log]
         [clojure.java.io :only (reader writer)]))


Build all working platforms

Build all working platforms

Man this is slow...

--- src/docker_clojure/core.clj
+++ src/docker_clojure/core.clj
@@ -146,10 +146,21 @@
         {:keys [dockerfile build-dir]}
         (generate-dockerfile! installer-hashes variant)

-        ;; TODO: Build for all appropriate platforms instead of just linux/amd64.
-        ;;       alpine won't build for arm64.
-        build-cmd ["docker" "buildx" "build" "--no-cache" "--platform"
-                   "linux/amd64" "--load" "-t" image-tag "-f" dockerfile "."]]
+        ;; alpine won't build for arm64.
+        ;; boot crashes under qemu (i.e. non-host arch) but does anyone even
+        ;; use boot anymore?
+        platform-arg (cond
+                       (str/includes? image-tag "alpine")
+                       "--platform=linux/amd64"
+
+                       (str/includes? image-tag "boot")
+                       nil ; default to host arch
+
+                       :else
+                       "--platform=linux/amd64,linux/arm64")
+        build-cmd (remove nil? ["docker" "buildx" "build" "--no-cache"
+                                platform-arg "--output=type=tar,dest=images.tar"
+                                "-t" image-tag "-f" dockerfile "."])]
     (apply println "Running" build-cmd)
     (let [{:keys [out err exit]}
           (with-sh-dir build-dir (apply sh build-cmd))]


util/context.clj: added AWS credentials

util/context.clj: added AWS credentials

--- src/org/altlaw/util/context.clj
+++ src/org/altlaw/util/context.clj
@@ -37,3 +37,9 @@
   "Solr home directory for running Solr instances."
   []
   (java.io.File. (str (altlaw-home) "/var/solr")))
+
+(defn aws-access-key-id []
+  (get-property "org.altlaw.aws.access.key.id"))
+
+(defn aws-secret-access-key []
+  (get-property "org.altlaw.aws.secret.access.key"))


RS & ML | 121 | Add integration test for delete-account flow from a confirmation email

--- test/stonecutter/integration/kerodon/email_confirmations.clj
+++ test/stonecutter/integration/kerodon/email_confirmations.clj
@@ -105,3 +105,28 @@
            (kc/selector-exists [ks/profile-flash-message])

            (teardown-test-directory)))
+
+(facts "A user can follow the delete-account flow from a confirmation email"
+       (-> (k/session test-app)
+
+           (setup-test-directory)
+
+           (steps/register "confirmation-test-3@email.com" "valid-password")
+           (k/visit "/profile")
+           (k/follow ks/sign-out-link)
+           (kc/check-and-follow-redirect "just signed out")
+
+           (k/visit (routes/path :show-confirmation-delete
+                                 :confirmation-id (get-in (parse-test-email) [:body :confirmation-id])))
+           (kc/page-uri-is (routes/path :show-confirmation-delete
+                                        :confirmation-id (get-in (parse-test-email) [:body :confirmation-id])))
+           (kc/response-status-is 200)
+           (kc/selector-exists [ks/delete-account-page-body])
+           (kc/check-and-press ks/delete-account-button)
+
+           (kc/check-and-follow-redirect)
+           (kc/page-uri-is "/profile-deleted")
+           (kc/response-status-is 200)
+           (kc/selector-exists [ks/profile-deleted-page-body])
+
+           (teardown-test-directory)))


Include ezbake git sha in ezbake manifest

--- src/puppetlabs/ezbake/stage.clj
+++ src/puppetlabs/ezbake/stage.clj
@@ -29,7 +29,8 @@
                                   (str/join " " args)
                                   "\n\nOutput:"
                                   (:out result)
-                                  (:err result)))))))
+                                  (:err result)))))
+    result))

 (defn staging-dir-git-cmd
   [& args]
@@ -62,6 +63,14 @@
   (let [iter (fs/iterate-dir dir)]
     (mapcat files-from-dir-iter iter)))

+(defn get-ezbake-sha
+  "Get the commit SHA of the current ezbake working copy, plus an asterisk if the
+  working tree is dirty."
+  []
+  (let [sha     (str/trim (:out (exec "git" "rev-parse" "HEAD")))
+        dirty?  (not= "" (str/trim (:out (exec "git" "diff" "--shortstat"))))]
+    (str sha (if dirty? "*" ""))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; General Staging Helper functions

@@ -103,9 +112,11 @@
     (format "
 This package was built by the Puppet Labs packaging system.

+EZBake version: %s
 Release package: %s/%s (%s)
 Bundled packages: %s
 "
+            (get-ezbake-sha)
             (:group lein-project)
             (:name lein-project)
             (:version lein-project)


Replace use of ref with atom in job manager

--- src/engulf/job_manager.clj
+++ src/engulf/job_manager.clj
@@ -15,7 +15,7 @@

 (def emitter (lc/channel* :permanent? true :grounded? true))

-(def current-job (ref nil))
+(def current-job (atom nil))

 (defn job
   "Creates a new job map"
@@ -55,9 +55,8 @@
   [formula-name title notes params]
   (let [j (job formula-name title notes params)]
     (insert database/jobs (values j))
-    (dosync
-     (ref-set current-job j)
-     j)))
+    (reset! current-job j)
+    j))

 (defn stop-job
   "Marks the currently running job as stopped"
@@ -65,7 +64,7 @@
   (ctrl/stop-job)
   (when-let [job (dosync
                   (when-let [job @current-job]
-                    (ref-set current-job nil)
+                    (reset! current-job nil)
                     job))]
     (update database/jobs
             (set-fields {:ended-at (System/currentTimeMillis)})


Dschungel okay now, formula was not complete!! (Paper on mpa has the flaw too)

--- src/examples/logelei_2.clj
+++ src/examples/logelei_2.clj
@@ -32,19 +32,29 @@

 ; Welches Tier macht welches Geräusch?

+(def tiere '(fiedertiger, beutelaffen, tentakelläufer, ohrhörner, rüsselratten, nagekühe))
+(def geraeusche '(surren miauen kratzen zischen pfeifen oinken))
+
 (defn ein-geraeusch
   [tier]
-  (oneof (map #(combine-syms tier %)
-              '(surren miauen kratzen zischen pfeifen oinken))))
+  (oneof (map #(combine-syms tier %) geraeusche)))

 (defn tiere-ein-geraeusch []
-  (apply list 'and (map ein-geraeusch
-                        '(fiedertiger, beutelaffen, tentakelläufer,
-                          ohrhörner, rüsselratten, nagekühe))))
+  (apply list 'and (map ein-geraeusch tiere)))
+
+(defn ein-tier
+  [geraeusch]
+  (oneof (map #(combine-syms % geraeusch) tiere)))
+
+(ein-tier 'zischen)

+(defn geraeusche-ein-tier []
+  (apply list 'and (map ein-tier geraeusche)))
+
 (def fml
   (list 'and
         (tiere-ein-geraeusch)
+        (geraeusche-ein-tier)
         '(impl fiedertiger-surren  beutelaffen-miauen)
         '(impl fiedertiger-miauen  tentakelläufer-zischen)
         '(impl fiedertiger-kratzen beutelaffen-oinken)
@@ -63,16 +73,54 @@
         '(impl beutelaffen-oinken  ohrhörner-surren)
         ))

+
+
 (def solution
   (let [tseit (transform-tseitin fml)
         result (-> (tseit :tseitin-formula) generate-dimacs-clauses sat-solve)]
     (retransform-tseitin result tseit)))

+solution
+
 (filter literal? solution)
-; eigenartiges Ergebnis

 ; Ergebnis kontrollieren:

-(def evals ['beutelaffen-kratzen false 'fiedertiger-pfeifen false 'fiedertiger-surren false 'fiedertiger-zischen true 'nagekühe-kratzen false 'nagekühe-miauen false 'nagekühe-oinken false 'nagekühe-pfeifen false 'nagekühe-surren false 'nagekühe-zischen true 'ohrhörner-kratzen true 'beutelaffen-miauen false 'ohrhörner-miauen false 'ohrhörner-oinken false 'ohrhörner-pfeifen false 'ohrhörner-surren false 'ohrhörner-zischen false 'rüsselratten-kratzen true 'rüsselratten-miauen false 'rüsselratten-oinken false 'rüsselratten-pfeifen false 'rüsselratten-surren false 'beutelaffen-oinken false 'rüsselratten-zischen false 'tentakelläufer-kratzen true 'tentakelläufer-miauen false 'tentakelläufer-oinken false 'tentakelläufer-pfeifen false 'tentakelläufer-surren false 'tentakelläufer-zischen false 'beutelaffen-pfeifen false 'beutelaffen-surren true 'beutelaffen-zischen false 'fiedertiger-kratzen false 'fiedertiger-miauen false 'fiedertiger-oinken false])
+(def evals ['beutelaffen-kratzen false
+            'beutelaffen-pfeifen false
+            'beutelaffen-surren false
+            'beutelaffen-zischen true
+            'beutelaffen-miauen false
+            'beutelaffen-oinken false
+            'nagekühe-kratzen false
+            'nagekühe-miauen false
+            'nagekühe-oinken true
+            'nagekühe-pfeifen false
+            'nagekühe-surren false
+            'nagekühe-zischen false
+            'ohrhörner-kratzen false
+            'ohrhörner-miauen false
+            'ohrhörner-oinken false
+            'ohrhörner-pfeifen false
+            'ohrhörner-surren true
+            'ohrhörner-zischen false
+            'rüsselratten-kratzen false
+            'rüsselratten-miauen true
+            'rüsselratten-oinken false
+            'rüsselratten-pfeifen false
+            'rüsselratten-surren false
+            'rüsselratten-zischen false
+            'tentakelläufer-kratzen true
+            'tentakelläufer-miauen false
+            'tentakelläufer-oinken false
+            'tentakelläufer-pfeifen false
+            'tentakelläufer-surren false
+            'tentakelläufer-zischen false
+            'fiedertiger-pfeifen true
+            'fiedertiger-surren false
+            'fiedertiger-zischen false
+            'fiedertiger-kratzen false
+            'fiedertiger-miauen false
+            'fiedertiger-oinken false])
 (eval-formula fml evals)
 ; true


fixed mistake in last commit

fixed mistake in last commit

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -156,11 +156,11 @@
                                                       (.emit g/socket
                                                              "chat-message"
                                                              message)
-                                                      (dommy/set-value! (sel1 :#chat-input) "")))))
+                                                      (dommy/set-value! (sel1 :#chat-input) ""))))))
       (dommy/listen! (sel1 :#chat-input) :keydown (om/get-state owner :enter-key-handler)))
     om/IWillUnmount
     (will-unmount [_]
-      (dommy/unlisten! (sel1 :#chat-input) :keydown (om/get-state owner :enter-key-handler)))
+      (dommy/unlisten! (sel1 :#chat-input) :k:ydown (om/get-state owner :enter-key-handler)))
     om/IRender
     (render [_]
       (dom/textarea #js {:id "chat-input"} nil))))


use different name for navigator.validation

--- src/gangway/validation.clj
+++ src/gangway/validation.clj
@@ -1,7 +1,7 @@
 (ns gangway.validation
   (:require [clojure.data.json :as json]
             [hatch]
-            [navigator.validation :as navigator]))
+            [navigator.validation :as nav-val]))

 (defn construct-data
   "Constructs a namespaced map out of an incoming json message"
@@ -17,12 +17,12 @@

 (def validation-dispatch
   {:assert
-   {:task           navigator/task-in
-    :comp           navigator/comp-in
-    :comp-tag       navigator/comp-tag-in
-    :perf-asmt      navigator/perf-asmt-in
-    :user2comp      navigator/user2comp-in
-    :user2perf-asmt navigator/user2perf-asmt-in}})
+   {:task           nav-val/task-in
+    :comp           nav-val/comp-in
+    :comp-tag       nav-val/comp-tag-in
+    :perf-asmt      nav-val/perf-asmt-in
+    :user2comp      nav-val/user2comp-in
+    :user2perf-asmt nav-val/user2perf-asmt-in}})

 ;;TODO: Not sure if this fn is needed
 (defn valid-json?


Serialize Float and Double

Serialize Float and Double

--- src/grafter/rdf/sesame.clj
+++ src/grafter/rdf/sesame.clj
@@ -43,6 +43,14 @@
     (NumericLiteralImpl. this))

   java.math.BigInteger
+  (->sesame-rdf-type [this]
+    (NumericLiteralImpl. this))
+
+  java.lang.Float
+  (->sesame-rdf-type [this]
+    (NumericLiteralImpl. this))
+
+  java.lang.Double
   (->sesame-rdf-type [this]
     (NumericLiteralImpl. this))


corrected sample for deserializer changes

--- src/hsec/source/sensor.clj
+++ src/hsec/source/sensor.clj
@@ -2,7 +2,7 @@
                         [hsec.source.mcp23017 :as mcp23017]
                         [hsec.source.gpio :as gpio]
                         [hsec.source.deserialize :as d]
-                        [Clojure.core.async :as a]
+                        [clojure.core.async :as a]
                         ))

 (comment ;; calling mcp23017 functions
@@ -11,16 +11,19 @@
   (def bus (mcp23017/setup-chip "/dev/i2c-1" 0x20))

   ;; get current PIR state
-  (:GP2 (d/deserialize-gpio-integer
-        (get-in (mcp23017/get-registers bus :gpio) [:a])))
+  (:GP2 (d/deserialize-register
+         (get-in (mcp23017/get-registers bus :gpio) [:a])
+         d/bit-to-logic-level))

   ;; are interrupts pending?
-  (d/deserialize-interrupt-integer (get-in
-                                    (mcp23017/get-registers bus :intf) [:a]))
+  (:GP2(d/deserialize-register
+        (get-in (mcp23017/get-registers bus :intf) [:a])
+        d/bit-to-interrupt-state))

   ;; get PIR activity at interrupt
-  (:GP2 (d/deserialize-gpio-integer (get-in
-                                     (mcp23017/get-registers bus :intcap) [:a])))
+  (:GP2 (d/deserialize-register
+         (get-in (mcp23017/get-registers bus :intcap) [:a])
+         d/bit-to-logic-level))

   (mcp23017/shutdown-chip bus))

@@ -38,7 +41,7 @@
                 (println event)
                 (println (-> (mcp23017/get-registers bus :gpio)
                              (:a)
-                             (d/deserialize-gpio-integer)
+                             (d/deserialize-register d/bit-to-logic-level)
                              (:GP2)))
                 (recur))))))


Fix Binary Read Function.

Fix Binary Read Function.

--- src/konserve/filestore.clj
+++ src/konserve/filestore.clj
@@ -251,46 +251,46 @@
                                :key       key
                                :exception e}))))))

-
-(defn- read-binary-old [f res-ch folder fn key locked-cb]
-    (try
-          (let [ac (AsynchronousFileChannel/open (.getPath (FileSystems/getDefault)
-                                                           (str folder "/B_" fn)
-                                                           (into-array String []))
-                                                 (into-array StandardOpenOption
-                                                             [StandardOpenOption/READ]))
-                bb (ByteBuffer/allocate (.size ac))]
-            (.read ac
-                   bb
-                   0
-                   nil
-                   (proxy [CompletionHandler] []
-                     (completed [res att]
-                       (let [bais (ByteArrayInputStream. (.array bb))]
-                         (try
-                           (locked-cb {:input-stream bais
-                                       :size (.length f)
-                                       :file f})
-                           (catch Exception e
-                             (ex-info "Could not read key."
-                                      {:type :read-error
-                                       :key key
-                                       :exception e}))
-                           (finally
-                             (close! res-ch)
-                             (.close ac)))))
-                     (failed [t att]
-                       (put! res-ch (ex-info "Could not read key."
-                                             {:type :read-error
-                                              :key key
-                                              :exception t}))
-                       (close! res-ch)
-                       (.close ac)))))
-          (catch Exception e
-            (put! res-ch (ex-info "Could not read key."
-                               {:type :read-error
-                                :key key
-                                :exception e})))))
+(defn- read-binary-old [f folder fn key copy-fn]
+  (let [res-ch-old (chan)]
+    (try
+      (let [ac (AsynchronousFileChannel/open (.getPath (FileSystems/getDefault)
+                                                       (str folder "/B_" fn)
+                                                       (into-array String []))
+                                             (into-array StandardOpenOption
+                                                         [StandardOpenOption/READ]))
+            bb (ByteBuffer/allocate (.size ac))]
+        (.read ac
+               bb
+               0
+               nil
+               (proxy [CompletionHandler] []
+                 (completed [res att]
+                   (let [bais (ByteArrayInputStream. (.array bb))]
+                     (try
+                       (copy-fn {:input-stream bais
+                                 :size (.length f)
+                                 :file f})
+                       (catch Exception e
+                         (ex-info "Could not read key."
+                                  {:type :read-error
+                                   :key key
+                                   :exception e}))
+                       (finally
+                         (close! res-ch-old)
+                         (.close ac)))))
+                 (failed [t att]
+                   (put! res-ch-old (ex-info "Could not read key."
+                                         {:type :read-error
+                                          :key key
+                                          :exception t}))
+                   (close! res-ch-old)
+                   (.close ac)))))
+      (catch Exception e
+        (put! res-ch-old (ex-info "Could not read key."
+                              {:type :read-error
+                               :key key
+                               :exception e}))))))

 (defn- write-binary
   "Helper Function for Binary Write"
@@ -318,6 +318,34 @@
                   :exception e}))
       (finally
         (.close fos)))))
+
+(defn- write-binary-old
+  "Helper Function for Binary Write"
+  [folder fn key input config]
+  (let [f        (io/file (str folder "/data/" fn))
+        new-file (io/file (str folder "/data/" fn ".new"))
+        fos      (FileOutputStream. new-file)
+        dos      (DataOutputStream. fos)
+        fd       (.getFD fos)]
+    (try
+      (io/copy input dos)
+      (.flush dos)
+      (when (:fsync config)
+        (.sync fd))
+      (.close fos) ;; required for windows
+      (Files/move (.toPath new-file) (.toPath f)
+                  (into-array [StandardCopyOption/ATOMIC_MOVE]))
+      (when (:fsync config)
+        (sync-folder folder))
+      (catch Exception e
+        (.delete new-file)
+        (ex-info "Could not write key."
+                 {:type      :write-error
+                  :key       key
+                  :exception e}))
+      (finally
+        (.close fos)))))
+

 (defrecord FileSystemStore [folder serializer read-handlers write-handlers locks config
                             stale-binaries?]
@@ -360,20 +388,22 @@

   PBinaryAsyncKeyValueStore
   (-bget [this key locked-cb]
-    (let [fn     (str (uuid key))
-          f      (io/file (str folder "/data/" fn))
-          res-ch (chan)]
+    (let [fn (str (uuid key))
+          f         (io/file (str folder "/data/" fn))
+          res-ch    (chan)]
       ;; migrate old schema
-      (when (and stale-binaries? (.exists (io/file (str folder "/B_" fn))))
-        (read-binary-old f res-ch folder fn key #(-bassoc this key (:input-stream %)))
-        (.delete (io/file (str folder "/B_" fn)))
-        (when (:fsync config)
-          (sync-folder folder)))
-      (go (read-binary f res-ch folder fn key locked-cb))))
+      (if (and stale-binaries? (.exists (io/file (str folder "/B_" fn))))
+        (async/thread
+          (do
+            (read-binary-old (io/file (str folder "/B_" fn)) folder fn key #(write-binary folder fn key (:input-stream %) config))
+            (write-edn-key serializer write-handlers read-handlers (str folder "/meta/") fn {:key key :format :binary} config)
+            (delete-entry (str "/B_" fn) folder config)
+            (read-binary f res-ch folder fn key locked-cb)))
+        (go (read-binary f res-ch folder fn key locked-cb)))))

   (-bassoc [this key input]
-    (let [file-name    (uuid key)
-          key-folder   (str folder "/meta/")]
+    (let [file-name  (uuid key)
+          key-folder (str folder "/meta/")]
       (async/thread
         (do (write-edn-key serializer write-handlers read-handlers key-folder file-name {:key key :format :binary} config)
             (write-binary folder (str file-name) key input config))))))


Adds a :path-info key to war servlet requests

--- src/leiningen/ring/war.clj
+++ src/leiningen/ring/war.clj
@@ -91,6 +91,13 @@
   (compile/eval-in-project project
     `(do (clojure.core/compile '~namespace) nil)))

+(defn generate-handler [project handler-sym]
+  (if (get-in project [:ring :servlet-path-info?] true)
+    `(fn [request#]
+       (let [path-info# (.getPathInfo (:servlet-request request#))]
+         (~handler-sym (assoc request# :path-info path-info#))))
+    handler-sym))
+
 (defn compile-servlet [project]
   (let [handler-sym (get-in project [:ring :handler])
         handler-ns  (symbol (namespace handler-sym))
@@ -99,7 +106,8 @@
       `(do (ns ~servlet-ns
              (:require ring.util.servlet ~handler-ns)
              (:gen-class :extends javax.servlet.http.HttpServlet))
-           (ring.util.servlet/defservice ~handler-sym)))))
+           (ring.util.servlet/defservice
+             ~(generate-handler project handler-sym))))))

 (defn create-war [project file-path]
   (-> (FileOutputStream. file-path)


any 2XX response will be considered valid e.g. nytimes and 204s

--- src/link_checker/check.clj
+++ src/link_checker/check.clj
@@ -13,6 +13,10 @@
   (haml/html
    (clostache/render-resource template repo-map)))

+(defn- successful-status?
+  [status]
+  (and (integer? status) (> 300 status 199)))
+
 (defn- send-final-message
   "Sends a results event containing total row and message event summarizing checked links."
   [send-to time links]
@@ -20,12 +24,12 @@
    "message"
    (if (zero? (count links))
      "No links found. Check your link and selector."
-     (let [invalid-links (count (remove #(= "200" (:status %)) links))]
-       (format "%s. It took %ss to fetch %s links."
+     (let [invalid-links (count (remove #(successful-status? (:status %)) links))]
+       (format "%s It took %ss to fetch %s links."
                (case invalid-links
                  0 "All links are valid!"
-                 1 "1 link did not return a 200."
-                 (str invalid-links " links did not return a 200."))
+                 1 "1 link did not return a 2XX response."
+                 (str invalid-links " links did not return a 2XX response."))
               time
               (count links))))))

@@ -50,12 +54,12 @@
                       head
                       (client-get url)))
                   (catch Exception err {:error err}))
-        status (if (:error resp) (str "Request failed: " (:error resp)) (str (:status resp)))]
+        status (if (:error resp) (str "Request failed: " (:error resp)) (:status resp))]
     {:url url
      :shortened-url (shorten-to url 80)
      :status status
-     :shortened-status (shorten-to status 40)
-     :tr-class (if (= 200 (:status resp)) "success"
+     :shortened-status (shorten-to (str status) 40)
+     :tr-class (if (successful-status? (:status resp)) "success"
                    (if (:error resp) "failure" "no-success"))
      :response resp
      :thread-id (.. Thread currentThread getId)}) )


add cljs.js/*eval-fn*

add cljs.js/*eval-fn*

--- src/main/cljs/cljs/js.cljs
+++ src/main/cljs/cljs/js.cljs
@@ -26,6 +26,15 @@
   *load-fn*
   (fn [name cb]
     (throw (js/Error. "No *load-fn* set"))))
+
+(defonce
+  ^{:doc "Each runtime environment provides various ways to eval JavaScript
+  source. Whatever function *eval-fn* is bound to will be passed source to eval
+  (a string). The result of eval will be passed back immediately to the caller."
+    :dynamic true}
+  *eval-fn*
+  (fn [source]
+    (throw (js/Error. "No *eval-fn* set"))))

 (defn empty-env []
   (env/default-compiler-env))


Use optional :custom-parser-mappings.

Use optional :custom-parser-mappings.

Used to define additional extensions exisitng parsers can use.

--- src/incise/parsers/core.clj
+++ src/incise/parsers/core.clj
@@ -1,5 +1,6 @@
 (ns incise.parsers.core
   (:require [incise.parsers.helpers :refer [extension]]
+            [incise.config :as conf]
             [taoensso.timbre :refer [info]])
   (:import [java.io File]))

@@ -36,7 +37,10 @@
   "Do all the work, parse the file and output it to the proper location."
   [^File handle]
   {:pre [(instance? File handle)]}
-  (let [ext (extension handle)]
-    (when (contains? @parsers ext)
+  (when-let [mappings (conf/get :custom-parser-mappings)]
+    (register-mappings mappings))
+  (let [ext (extension handle)
+        current-parsers @parsers]
+    (when (contains? current-parsers ext)
       (info "Parsing" (.getPath handle))
-      ((@parsers ext) handle))))
+      (info "Wrote" (.getPath ((current-parsers ext) handle))))))


Add Github ribbon.

Add Github ribbon.

--- src/leipzig_live/views.cljs
+++ src/leipzig_live/views.cljs
@@ -60,4 +60,9 @@
     [:div
      [:div {:class "graph"} [graph handle! state-atom]]
      [:div {:class "controls"} button]
-     [:div {:class (if error "error" "")} [editor handle! state]]]))
+     [:div {:class (if error "error" "")} [editor handle! state]]
+     [:a {:href "https://github.com/ctford/leipzig-live"}
+      [:img {:style {:position "absolute" :top 0 :right 0 :border 0}
+             :src "https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67"
+             :alt "Fork me on GitHub"
+             :data-canonical-src "https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"}]]]))


no message

no message

--- mtg-pairings-wer/src/mtg_pairings/core.clj
+++ mtg-pairings-wer/src/mtg_pairings/core.clj
@@ -50,12 +50,13 @@
                :border ""
                :north tournament-listbox
                :south (button :text "OK" :listen [:action (fn [event] (-> tournament-selector hide!)
-                                                            (text! tournament-label (selection tournament-listbox)  ) )]))))
+                                                            (text! tournament-label (first (selection tournament-listbox)))
+                                                            (set-tournament-tracking! (second (selection tournament-listbox)) true   ))]))))

 (defn select-tournament [event]
   (if @watcher
     (do (config! tournament-listbox :model (for [tournaments (get-tournaments)]
-                                             (str (:name tournaments) ", id: " (:id tournaments)) ))
+                                             [(:name tournaments)  (:id tournaments)]) )
           (-> tournament-selector pack! show! ))
     (-> (dialog :content "No database opened") pack! show!)))


tidy up table construction

tidy up table construction


Fix Firefox Content-Security-Policy warnings [ci skip]

--- src/metabase/middleware.clj
+++ src/metabase/middleware.clj
@@ -191,11 +191,9 @@
                                                                     "https://www.google-analytics.com" ; Safari requires the protocol
                                                                     "https://*.googleapis.com"
                                                                     "*.gstatic.com"
-                                                                    "js.intercomcdn.com"
-                                                                    "*.intercom.io"
                                                                     (when config/is-dev?
                                                                       "localhost:8080")]
-                                                      :frame-src   ["'self'"
+                                                      :child-src   ["'self'"
                                                                     "https://accounts.google.com"] ; TODO - double check that we actually need this for Google Auth
                                                       :style-src   ["'unsafe-inline'"
                                                                     "'self'"
@@ -206,11 +204,9 @@
                                                                     (when config/is-dev?
                                                                       "localhost:8080")]
                                                       :img-src     ["*"
-                                                                    "self data:"]
+                                                                    "'self' data:"]
                                                       :connect-src ["'self'"
                                                                     "metabase.us10.list-manage.com"
-                                                                    "*.intercom.io"
-                                                                    "wss://*.intercom.io" ; allow websockets as well
                                                                     (when config/is-dev?
                                                                       "localhost:8080 ws://localhost:8080")]}]
                                           (format "%s %s; " (name k) (apply str (interpose " " vs)))))})


figure out where the jar is running

figure out where the jar is running

--- src/metabase/util/stats.clj
+++ src/metabase/util/stats.clj
@@ -2,7 +2,6 @@
   "Functions which summarize the usage of an instance"
   (:require [clojure.tools.logging :as log]
             [clj-http.client :as client]
-            [environ.core :as environ]
             (metabase [config :as config]
                       [db :as db])
             [metabase.public-settings :as settings]
@@ -116,9 +115,9 @@
   "Figure out what we're running under"
   []
   (cond
-    (not (nil? (environ :database-url))) :heroku
-    (not (nil? (environ :rds-hostname))) :elastic-beanstalk
-    (not (= (environ :mb-client) :osx)) :osx
+    (= (config/config-str :mb-client) :osx) :osx
+    (not (nil? (config/config-str :rds-hostname))) :elastic-beanstalk
+    (not (nil? (config/config-str :database-url))) :heroku ;; Putting this last as 'database-url' seems least specific
     :default "unknown")

   )
@@ -126,7 +125,7 @@
   "Figure out global info aboutt his instance"
   []
   {:version               (config/mb-version-info :tag)
-   :running_on            "unknown" ;; HOW DO I GET THIS? beanstalk vs heroku vs mac vs 'unknown'
+   :running_on            (where-am-i-running?)
    :application_database  (config/config-str :mb-db-type)
    :check_for_updates     (setting/get :check-for-updates)
    :site_name             (not= settings/site-name "Metabase")


Add append operation to matrix ns.

Add append operation to matrix ns.


Don't read from exhausted inputs.

Don't read from exhausted inputs.

--- src/onyx/peer/transform.clj
+++ src/onyx/peer/transform.clj
@@ -35,24 +35,26 @@
       (extensions/close-resource queue consumer)))

 (defn read-batch [queue consumers task-map]
-  (let [reader-chs (map (fn [_] (chan (:onyx/batch-size task-map))) (vals consumers))
-        reader-threads (doall (map (fn [ch [input consumer]]
-                                     (reader-thread queue ch input consumer))
-                                   reader-chs consumers))
-        read-f #(first (alts!! reader-chs))
-        segments (doall (take-segments read-f (:onyx/batch-size task-map)))]
+  (if-not (empty? consumers)
+    (let [reader-chs (map (fn [_] (chan (:onyx/batch-size task-map))) (vals consumers))
+          reader-threads (doall (map (fn [ch [input consumer]]
+                                       (reader-thread queue ch input consumer))
+                                     reader-chs consumers))
+          read-f #(first (alts!! reader-chs))
+          segments (doall (take-segments read-f (:onyx/batch-size task-map)))]

     ;;; Ack each of the segments. Closing a consumer with unacked tasks will send
     ;;; all the tasks back onto the queue.
-    (doseq [segment segments]
-      (extensions/ack-message queue (:message segment)))
+      (doseq [segment segments]
+        (extensions/ack-message queue (:message segment)))

     ;;; Close each consumer. If any consumers are left open with unacked messages,
     ;;; the next round of reading will skip the messages that the consumers are hanging
     ;;; onto - hence breaking the sequential reads for task that require it.
-    (doseq [consumer (vals consumers)]
-      (extensions/close-resource queue consumer))
-    segments))
+      (doseq [consumer (vals consumers)]
+        (extensions/close-resource queue consumer))
+      segments)
+    []))

 (defn decompress-segment [queue message]
   (extensions/read-message queue message))
@@ -87,8 +89,10 @@
 (defn read-batch-shim
   [{:keys [onyx.core/queue onyx.core/session onyx.core/ingress-queues
            onyx.core/catalog onyx.core/task-map] :as event}]
-  (let [consumer-f (partial extensions/create-consumer queue session)
-        consumers (reduce-kv (fn [all k v] (assoc all k (consumer-f v))) {} ingress-queues)
+  (let [learned (keys (:learned-sentinel @(:onyx.core/pipeline-state event)))
+        consumer-f (partial extensions/create-consumer queue session)
+        uncached (into {} (remove (fn [[t _]] (some #{t} learned)) ingress-queues))
+        consumers (reduce-kv (fn [all k v] (assoc all k (consumer-f v))) {} uncached)
         batch (read-batch queue consumers task-map)]
     (merge event {:onyx.core/batch batch :onyx.core/consumers consumers})))


Remove unused fn.

Remove unused fn.

--- src/onyx/plugin/datomic.clj
+++ src/onyx/plugin/datomic.clj
@@ -148,11 +148,6 @@
 (defn inject-read-log-resources
   [{:keys [onyx.core/task-map] :as event} lifecycle]
   {})
-
-(defn get-starting-offset! [task-map start-tx]
-  (if (:checkpoint/force-reset? task-map)
-    {:largest (or start-tx -1) :status :incomplete}
-    {:largest (or start-tx -1) :status :incomplete}))

 (defn tx-range [conn start-tx batch-size]
   (let [log (d/log conn)]


Disallow short circuit for current test

Disallow short circuit for current test

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -90,6 +90,7 @@
                      :onyx/id id
                      :onyx.messaging/bind-addr (slurp "http://169.254.169.254/latest/meta-data/local-ipv4")
                      :onyx.messaging/peer-ports (vec (range 40000 40200))
+                     :onyx.messaging/allow-short-circuit? false
                      ;:onyx.messaging/peer-link-gc-interval 99999999
                      ;:onyx.messaging.aeron/embedded-driver? false
                      :onyx.peer/join-failure-back-off 500


Reduce subscriber count back down to 2

Reduce subscriber count back down to 2

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -90,7 +90,7 @@
                      :onyx/id id
                      :onyx.messaging/bind-addr (slurp "http://169.254.169.254/latest/meta-data/local-ipv4")
                      :onyx.messaging/peer-ports (vec (range 40000 40200))
-                     :onyx.messaging.aeron/subscriber-count 4
+                     :onyx.messaging.aeron/subscriber-count 2
                      :onyx.peer/join-failure-back-off 500
                      :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
                      :onyx.messaging/impl (keyword messaging)}


Reassoc new segment.

Reassoc new segment.

--- src/onyx/peer/function.clj
+++ src/onyx/peer/function.clj
@@ -28,15 +28,18 @@
     :leaves
     (mapv
      (fn [leaf]
-       (let [msg (if (and (operation/exception? (:segment leaf))
+       (let [msg (if (and (operation/exception? (:message leaf))
                           (:post-transformation (:routes leaf)))
                    (operation/apply-fn
                     (operation/kw->fn (:post-transformation (:routes leaf)))
-                    [event] (:segment leaf))
-                   (:segment leaf))]
-         (assoc leaf :hash-group (reduce (fn [groups t]
-                                           (assoc groups t (group-message msg catalog t)))
-                                         {} next-tasks))))
+                    [event] (:message leaf))
+                   (:message leaf))]
+         (assoc leaf
+           :hash-group
+           (reduce (fn [groups t]
+                     (assoc groups t (group-message msg catalog t)))
+                   {} next-tasks)
+           :message msg)))
      (:leaves result))))

 (defmethod l-ext/start-lifecycle? :function


Adding event docs.

Adding event docs.

--- src/overtone/core/event.clj
+++ src/overtone/core/event.clj
@@ -6,24 +6,40 @@
 (defonce thread-pool (Executors/newFixedThreadPool NUM-THREADS))
 (defonce event-handlers* (ref {}))

-(defn on [event-type handler]
+(defn on
+  "Runs handler whenever events of type event-type are fired.  The handler can
+  optionally except a single event argument, which is a map containing the
+  :event-type property and any other properties specified when it was fired.
+
+  (on ::booted #(do-stuff))
+  (on ::midi-note-down (fn [event] (funky-bass (:note event))))"
+  [event-type handler]
   (dosync
     (let [handlers (get @event-handlers* event-type [])]
       (alter event-handlers* assoc event-type (conj handlers handler)))))

-(defn remove-handler [event-type handler]
+(defn remove-handler
+  "Remove an event handler previously registered to handle events of event-type."
+  [event-type handler]
   (dosync
     (let [handlers (get @event-handlers* event-type [])]
       (alter event-handlers* assoc event-type (filter #(not (= handler %)) handlers)))))

-(defn clear-handlers [event-type]
+(defn clear-handlers
+  "Remove all handlers for events of type event-type."
+  [event-type]
   (dosync (alter event-handlers* dissoc event-type)))

 (defn- handle-event [event]
-  (doseq [handler (get @event-handlers* (:event event) [])]
+  (doseq [handler (get @event-handlers* (:event-type event) [])]
     (if (zero? (arg-count handler))
       (handler)
       (handler event))))

-(defn event [event-type & args]
-  (.execute thread-pool #(handle-event (apply hash-map :event event-type args))))
+(defn event
+  "Fire an event of type event-type with any number of additional properties.
+
+  (event ::my-event)
+  (event ::filter-sweep-done :instrument :phat-bass)"
+  [event-type & args]
+  (.execute thread-pool #(handle-event (apply hash-map :event-type event-type args))))


Fix rerun read delay

Fix rerun read delay

The rerun read and the initial read had become interchangeable, so both
were using the initial read. They did the same thing, except the rerun
read was on a delay. This delays a read after a rerun no matter what it
is, and then uses the same cond branch to implement the read.

--- src-cljs/frontend/send.cljs
+++ src-cljs/frontend/send.cljs
@@ -128,37 +128,6 @@
 (defn- retry-run-expression?
   [expression]
   (= 'run/retry (first expression)))
-
-(defn- reread-project-runs-ast? [{:keys [key children]}]
-  (and (= :circleci/organization key)
-       (= 1 (count children))
-       (= :organization/project (:key (first children)))
-       (= [{:project/workflow-runs [:run/id
-                                    :run/name
-                                    :run/status
-                                    :run/started-at
-                                    :run/stopped-at
-                                    {:run/trigger-info [:trigger-info/vcs-revision
-                                                        :trigger-info/subject
-                                                        :trigger-info/body
-                                                        :trigger-info/branch
-                                                        {:trigger-info/pull-requests [:pull-request/url]}]}
-                                    {:run/project [:project/name
-                                                   {:project/organization [:organization/name
-                                                                           :organization/vcs-type]}]}]}]
-          (:query (first children)))))
-
-(defn- reread-project-runs [ast merge-fn query]
-  (js/setTimeout #(let [{:keys [connection/offset connection/limit]}
-                        (:params (expr-ast/get-in ast [:organization/project :routed-page]))]
-                    (merge-workflow-runs {:organization/vcs-type (-> ast :params :organization/vcs-type)
-                                          :organization/name (-> ast :params :organization/name)
-                                          :project/name (-> ast :children first :params :project/name)}
-                                         offset
-                                         limit
-                                         merge-fn
-                                         query))
-                 ms-until-retried-run-retrieved))

 (defn- org-runs-ast?
   "returns true if the ast is for an expression rendering the org workflows page"
@@ -334,196 +303,200 @@
 ;; pattern-matching against a few expected cases to decide which APIs to hit. A
 ;; more rigorous implementation will come later.
 (defmethod send* :remote [[_ query] cb]
-  (doseq [expr query]
-    (let [[expr cb] (de-alias-expression expr cb)
-          ast (om-parser/expr->ast expr)]
-      (cond
-        (branch-crumb-ast? ast) (get-branch-name cb ast query)
-        (branch-runs-ast? ast) (get-branch-runs cb ast query)
-        (retry-run-expression? expr) (send-retry-run ast cb query)
-        (= {:app/current-user [{:user/organizations [:organization/name :organization/vcs-type :organization/avatar-url]}]}
-           expr)
-        (let [ch (callback-api-chan
-                  #(let [orgs (for [api-org %]
-                                {:organization/name (:login api-org)
-                                 :organization/vcs-type (:vcs_type api-org)
-                                 :organization/avatar-url (:avatar_url api-org)})]
-                     (cb {:app/current-user {:user/organizations (vec orgs)}} query)))]
-          (api/get-orgs ch :include-user? true))
-
-        (and (= :circleci/organization (:key ast))
-             (= '[:organization/vcs-type
-                  :organization/name
-                  :organization/avatar-url
-                  :organization/current-user-is-admin?]
-                (:query ast)))
-        (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
-          (api/get-orgs
-           (callback-api-chan
-            #(let [selected-org (first (filter (fn [{:keys [vcs_type login]}]
-                                                 (and (= vcs_type vcs-type)
-                                                      (= login name)))
-                                               %))
-
-                   avatar-url (:avatar_url selected-org)
-                   admin (:admin selected-org)]
-               (cb {:circleci/organization {:organization/name name
+  (if (retry-run-expression? (first query))
+    ;; If we're rerunning, give the rerun mutation a chance to take effect on
+    ;; the backend before continuing with any reads.
+    (do
+      (send-retry-run (om-parser/expr->ast (first query)) cb query)
+      (js/setTimeout #(send* [:remote (rest query)] cb)
+                     ms-until-retried-run-retrieved))
+    (doseq [expr query]
+      (let [[expr cb] (de-alias-expression expr cb)
+            ast (om-parser/expr->ast expr)]
+        (cond
+          (branch-crumb-ast? ast) (get-branch-name cb ast query)
+          (branch-runs-ast? ast) (get-branch-runs cb ast query)
+          (= {:app/current-user [{:user/organizations [:organization/name :organization/vcs-type :organization/avatar-url]}]}
+             expr)
+          (let [ch (callback-api-chan
+                    #(let [orgs (for [api-org %]
+                                  {:organization/name (:login api-org)
+                                   :organization/vcs-type (:vcs_type api-org)
+                                   :organization/avatar-url (:avatar_url api-org)})]
+                       (cb {:app/current-user {:user/organizations (vec orgs)}} query)))]
+            (api/get-orgs ch :include-user? true))
+
+          (and (= :circleci/organization (:key ast))
+               (= '[:organization/vcs-type
+                    :organization/name
+                    :organization/avatar-url
+                    :organization/current-user-is-admin?]
+                  (:query ast)))
+          (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
+            (api/get-orgs
+             (callback-api-chan
+              #(let [selected-org (first (filter (fn [{:keys [vcs_type login]}]
+                                                   (and (= vcs_type vcs-type)
+                                                        (= login name)))
+                                                 %))
+
+                     avatar-url (:avatar_url selected-org)
+                     admin (:admin selected-org)]
+                 (cb {:circleci/organization {:organization/name name
+                                              :organization/vcs-type vcs-type
+                                              :organization/avatar-url avatar-url
+                                              :organization/current-user-is-admin? admin}} query)))
+             :include-user? true))
+
+          ;; :route/projects
+          (and (= :circleci/organization (:key ast))
+               (= '[:organization/vcs-type
+                    :organization/name
+                    {:organization/projects [:project/follower-count
+                                             :project/vcs-url
+                                             :project/name
+                                             :project/parallelism
+                                             :project/oss?]}
+                    {:organization/plan [*]}]
+                  (:query ast)))
+          (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
+            (api/get-org-settings
+             name vcs-type
+             (callback-api-chan
+              #(let [projects (for [p (:projects %)]
+                                {:project/vcs-url (:vcs_url p)
+                                 :project/name (vcs-url/repo-name (:vcs_url p))
+                                 :project/parallelism (:parallel p)
+                                 ;; Sometimes the backend returns a map of feature_flags,
+                                 ;; and sometimes it returns :oss directly on the project.
+                                 :project/oss? (or (:oss p)
+                                                   (get-in p [:feature_flags :oss]))
+                                 :project/follower-count (count (:followers p))})]
+                 (cb {:circleci/organization {:organization/name name
+                                              :organization/vcs-type vcs-type
+                                              :organization/projects (vec projects)}} query))))
+            (api/get-org-plan
+             name vcs-type
+             (callback-api-chan
+              #(cb {:circleci/organization {:organization/name name
                                             :organization/vcs-type vcs-type
-                                            :organization/avatar-url avatar-url
-                                            :organization/current-user-is-admin? admin}} query)))
-           :include-user? true))
-
-        ;; :route/projects
-        (and (= :circleci/organization (:key ast))
-             (= '[:organization/vcs-type
-                  :organization/name
-                  {:organization/projects [:project/follower-count
-                                           :project/vcs-url
-                                           :project/name
-                                           :project/parallelism
-                                           :project/oss?]}
-                  {:organization/plan [*]}]
-                (:query ast)))
-        (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
-          (api/get-org-settings
-           name vcs-type
-           (callback-api-chan
-            #(let [projects (for [p (:projects %)]
-                              {:project/vcs-url (:vcs_url p)
-                               :project/name (vcs-url/repo-name (:vcs_url p))
-                               :project/parallelism (:parallel p)
-                               ;; Sometimes the backend returns a map of feature_flags,
-                               ;; and sometimes it returns :oss directly on the project.
-                               :project/oss? (or (:oss p)
-                                                 (get-in p [:feature_flags :oss]))
-                               :project/follower-count (count (:followers p))})]
-               (cb {:circleci/organization {:organization/name name
-                                            :organization/vcs-type vcs-type
-                                            :organization/projects (vec projects)}} query))))
-          (api/get-org-plan
-           name vcs-type
-           (callback-api-chan
-            #(cb {:circleci/organization {:organization/name name
-                                          :organization/vcs-type vcs-type
-                                          :organization/plan %}}
-                 query))))
-
-        ;; Also :route/projects (but a separate expression for analytics, which
-        ;; doesn't actually need to hit the server)
-        (and (= :circleci/organization (:key ast))
-             (= '[:organization/name] (:query ast)))
-        (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
-          (cb {:circleci/organization {:organization/name name}} query))
-
-        ;; :route/workflow
-        (project-runs-ast? ast)
-        (let [{:keys [connection/offset connection/limit]}
-              (:params (expr-ast/get-in ast [:organization/project :routed-page]))]
-          (merge-workflow-runs {:organization/vcs-type (-> ast :params :organization/vcs-type)
-                                :organization/name (-> ast :params :organization/name)
-                                :project/name (-> ast :children first :params :project/name)}
-                               offset
-                               limit
-                               cb
-                               query))
-
-        (reread-project-runs-ast? ast) (reread-project-runs ast cb query)
-
-        ;; :route/run
-        (let [{:keys [key children]} ast]
-          (and (= :circleci/run key)
-               (= 1 (count children))
-               (= :run/job (:key (first children)))
-               (= [:job/build :job/name]
-                  (:query (first children)))))
-        (let [job-ast (first (:children ast))
-              job-name (:job/name (:params job-ast))]
+                                            :organization/plan %}}
+                   query))))
+
+          ;; Also :route/projects (but a separate expression for analytics, which
+          ;; doesn't actually need to hit the server)
+          (and (= :circleci/organization (:key ast))
+               (= '[:organization/name] (:query ast)))
+          (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
+            (cb {:circleci/organization {:organization/name name}} query))
+
+          ;; :route/workflow
+          (project-runs-ast? ast)
+          (let [{:keys [connection/offset connection/limit]}
+                (:params (expr-ast/get-in ast [:organization/project :routed-page]))]
+            (merge-workflow-runs {:organization/vcs-type (-> ast :params :organization/vcs-type)
+                                  :organization/name (-> ast :params :organization/name)
+                                  :project/name (-> ast :children first :params :project/name)}
+                                 offset
+                                 limit
+                                 cb
+                                 query))
+
+          ;; :route/run
+          (let [{:keys [key children]} ast]
+            (and (= :circleci/run key)
+                 (= 1 (count children))
+                 (= :run/job (:key (first children)))
+                 (= [:job/build :job/name]
+                    (:query (first children)))))
+          (let [job-ast (first (:children ast))
+                job-name (:job/name (:params job-ast))]
+            (api/get-workflow-status
+             (callback-api-chan
+              (fn [response]
+                (cb {:circleci/run {:run/job (->> response
+                                                  adapt-to-run
+                                                  :run/jobs
+                                                  (filter #(= job-name (:job/name %)))
+                                                  first)}}
+                    query)))
+             (:run/id (:params ast))))
+          ;; Also :route/workflow (but a separate expression for breadcrumbs, which
+          ;; doesn't actually need to hit the server)
+          (and (= :circleci/organization (:key ast))
+               (= '[:organization/vcs-type :organization/name] (:query ast)))
+          (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
+            (cb {:circleci/organization {:organization/vcs-type vcs-type
+                                         :organization/name name}}
+                query))
+
+          ;; Also :route/workflow (but *another( expression for breadcrumbs, which
+          ;; doesn't actually need to hit the server)
+          (project-crumb-ast? ast) (get-project-name cb ast query)
+
+          ;; :route/run crumbs
+          (run-page-crumbs-ast? ast) (get-run-page-crumbs cb ast query)
+
+          ;; :route/run RunRow
+          (let [{:keys [key query]} ast]
+            (and (= :circleci/run key)
+                 (= [:run/id
+                     :run/name
+                     :run/status
+                     :run/started-at
+                     :run/stopped-at
+                     {:run/trigger-info [:trigger-info/vcs-revision
+                                         :trigger-info/subject
+                                         :trigger-info/body
+                                         :trigger-info/branch
+                                         {:trigger-info/pull-requests [:pull-request/url]}]}
+                     {:run/project [:project/name
+                                    {:project/organization [:organization/name
+                                                            :organization/vcs-type]}]}]
+                    query)))
           (api/get-workflow-status
            (callback-api-chan
             (fn [response]
-              (cb {:circleci/run {:run/job (->> response
-                                                adapt-to-run
-                                                :run/jobs
-                                                (filter #(= job-name (:job/name %)))
-                                                first)}}
+              (cb {:circleci/run (-> (adapt-to-run response)
+                                     (dissoc :run/jobs))}
                   query)))
-           (:run/id (:params ast))))
-        ;; Also :route/workflow (but a separate expression for breadcrumbs, which
-        ;; doesn't actually need to hit the server)
-        (and (= :circleci/organization (:key ast))
-             (= '[:organization/vcs-type :organization/name] (:query ast)))
-        (let [{:keys [organization/vcs-type organization/name]} (:params ast)]
-          (cb {:circleci/organization {:organization/vcs-type vcs-type
-                                       :organization/name name}}
-              query))
-
-        ;; Also :route/workflow (but *another( expression for breadcrumbs, which
-        ;; doesn't actually need to hit the server)
-        (project-crumb-ast? ast) (get-project-name cb ast query)
-
-        ;; :route/run crumbs
-        (run-page-crumbs-ast? ast) (get-run-page-crumbs cb ast query)
-
-        ;; :route/run RunRow
-        (let [{:keys [key query]} ast]
-          (and (= :circleci/run key)
-               (= [:run/id
-                   :run/name
-                   :run/status
-                   :run/started-at
-                   :run/stopped-at
-                   {:run/trigger-info [:trigger-info/vcs-revision
-                                       :trigger-info/subject
-                                       :trigger-info/body
-                                       :trigger-info/branch
-                                       {:trigger-info/pull-requests [:pull-request/url]}]}
-                   {:run/project [:project/name
-                                  {:project/organization [:organization/name
-                                                          :organization/vcs-type]}]}]
-                  query)))
-        (api/get-workflow-status
-         (callback-api-chan
-          (fn [response]
-            (cb {:circleci/run (-> (adapt-to-run response)
-                                   (dissoc :run/jobs))}
-                query)))
-         (:run/id (:params ast)))
-        (let [{:keys [key query]} ast]
-          (and (= :circleci/run key)
-               (= '[({:jobs-for-jobs [:job/id
-                                      :job/status
-                                      :job/started-at
-                                      :job/stopped-at
-                                      :job/name
-                                      {:job/run [:run/id]}]}
-                     {:< :run/jobs})
-                    ({:jobs-for-first [:job/id
-                                       :job/build
-                                       :job/name]}
-                     {:< :run/jobs})]
-                  query)))
-        (api/get-workflow-status
-         (callback-api-chan
-          (fn [response]
-            (let [run (adapt-to-run response)
-                  run-with-aliases (-> run
-                                       (dissoc :run/jobs)
-                                       (assoc :jobs-for-jobs (mapv #(select-keys % [:job/id
-                                                                                :job/status
-                                                                                :job/started-at
-                                                                                :job/stopped-at
-                                                                                :job/name
-                                                                                :job/run])
-                                                                   (:run/jobs run))
-                                              :jobs-for-first (mapv #(select-keys % [:job/id
-                                                                                :job/build
-                                                                                :job/name])
-                                                                    (:run/jobs run))))]
-              (cb {:circleci/run run-with-aliases} query))))
-         (:run/id (:params ast)))
-
-        ;; :route/org-workflows
-        (org-runs-ast? ast) (get-org-runs ast cb query)))))
+           (:run/id (:params ast)))
+          (let [{:keys [key query]} ast]
+            (and (= :circleci/run key)
+                 (= '[({:jobs-for-jobs [:job/id
+                                        :job/status
+                                        :job/started-at
+                                        :job/stopped-at
+                                        :job/name
+                                        {:job/run [:run/id]}]}
+                       {:< :run/jobs})
+                      ({:jobs-for-first [:job/id
+                                         :job/build
+                                         :job/name]}
+                       {:< :run/jobs})]
+                    query)))
+          (api/get-workflow-status
+           (callback-api-chan
+            (fn [response]
+              (let [run (adapt-to-run response)
+                    run-with-aliases (-> run
+                                         (dissoc :run/jobs)
+                                         (assoc :jobs-for-jobs (mapv #(select-keys % [:job/id
+                                                                                :job/status
+                                                                                :job/started-at
+                                                                                :job/stopped-at
+                                                                                :job/name
+                                                                                :job/run])
+                                                                     (:run/jobs run))
+                                                :jobs-for-first (mapv #(select-keys % [:job/id
+                                                                                :job/build
+                                                                                :job/name])
+                                                                      (:run/jobs run))))]
+                (cb {:circleci/run run-with-aliases} query))))
+           (:run/id (:params ast)))
+
+          ;; :route/org-workflows
+          (org-runs-ast? ast) (get-org-runs ast cb query))))))

 (defn send [remotes cb]
   (doseq [remote-entry remotes]


Rm old comments

Rm old comments

--- src-cljs/frontend/send.cljs
+++ src-cljs/frontend/send.cljs
@@ -275,9 +275,6 @@

    :organization/projects
    (fn [{:keys [organization/vcs-type organization/name] :as env} ast]
-     ;; Unlike most of the api functions, api/get-org-settings takes the channel
-     ;; as its last argument, so we use `partial` to make a function which takes
-     ;; it first, as `api-promise-fn` requires.)
      (-> (((get-in env [:apis :get-org-settings]) name vcs-type))
          (p/then
           (fn [response]
@@ -294,10 +291,6 @@

    :organization/plan
    (fn [{:keys [organization/vcs-type organization/name] :as env} ast]
-     ;; Unlike most of the api functions, api/get-org-settings takes the channel
-     ;; as its last argument, so we use `partial` to make a function which takes
-     ;; it first, as `api-promise-fn` requires.
-     ;;
      ;; Also: note that we do no processing/massaging of this data. The plan
      ;; data is currently used in it's old-api form rather than using new
      ;; namespaced, universal keys. This is debt.
@@ -322,9 +315,6 @@
    #{:job/build
      :job/required-jobs}
    (fn [{:keys [run/id job/name] :as env} ast]
-     ;; Unlike most of the api functions, api/get-org-settings takes the channel
-     ;; as its last argument, so we use `partial` to make a function which takes
-     ;; it first, as `api-promise-fn` requires.
      (-> ((get-in env [:apis :get-workflow-status]) id)
          (p/then
           (fn [response]


pomodoro style\!

pomodoro style\!

--- src-cljs/main/pomodoro.cljs
+++ src-cljs/main/pomodoro.cljs
@@ -105,6 +105,10 @@
 (defn set-time! [time]
   (set-state! (time-map time)))

+(defn next-time [time]
+  (if (= (:twenty-five presets) time)
+    (:five presets)
+    (:twenty-five presets)))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Timer logic
 (def ^:constant time-speed 1e3)
@@ -125,7 +129,7 @@
            (fn [k r os ns]
              (when (and (get-state :on?) (apply expired? (get-state :stime :etime)))
                (play-sound)
-               (set-state! :on? false))))
+               (set-state! (default-state (next-time (get-state :time)))))))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Generic Views


[Fix #124] Recognize mvn and gradle projects

--- src/refactor_nrepl/core.clj
+++ src/refactor_nrepl/core.clj
@@ -40,7 +40,7 @@
          start (if (fs/directory? path-or-file-in-project)
                  path-or-file-in-project
                  (fs/parent path-or-file-in-project))
-         names-at-root #{"project.clj" "build.boot"}
+         names-at-root #{"project.clj" "build.boot" "build.gradle" "pom.xml"}
          known-root-file? (fn [f] (some (fn [known-root-name]
                                           (.endsWith (.getCanonicalPath f)
                                                      known-root-name))


faster keywordized response in http-request-async (#1522)

--- waiter/src/waiter/util/http_utils.clj
+++ waiter/src/waiter/util/http_utils.clj
@@ -18,7 +18,6 @@
             [clojure.data.json :as json]
             [clojure.string :as str]
             [clojure.tools.logging :as log]
-            [clojure.walk :as walk]
             [plumbing.core :as pc]
             [qbits.jet.client.http :as http]
             [slingshot.slingshot :as ss]
@@ -104,7 +103,7 @@
               parsed-body (try
                             (cond-> response-body
                               (not-empty response-body)
-                              (-> json/read-str walk/keywordize-keys))
+                              (json/read-str :key-fn keyword))
                             (catch Exception _
                               response-body))
               response (assoc response :body parsed-body)]