<commit_before>(ns foreclojure.users
  (:use foreclojure.utils
        somnium.congomongo
        compojure.core
        [hiccup.page-helpers :only (link-to)])) 

(defn get-users []
  (let [users (from-mongo
               (fetch :users
                      :only [:user :solved :contributor]))
        sortfn  (comp count :solved)]
    (reverse (sort-by sortfn users))))

(def-page users-page []
  [:div
   [:span.contributor "*"] " "
   (link-to "https://github.com/dbyrne/4clojure" "4clojure contributor")]
  [:br]
  [:table#user-table.my-table
   [:thead
    [:tr
     [:th  "Username"]
     [:th "Problems Solved"]]]
   (map-indexed #(vec [:tr (row-class %1)
                       [:td
                        (when (:contributor %2)
                          [:span.contributor "* "])
                        (:user %2)]
                       [:td {:class "centered"} (count (:solved %2))]])
                (get-users))])
<commit_msg>Display rank<commit_after>(ns foreclojure.users
  (:use foreclojure.utils
        somnium.congomongo
        compojure.core
        [hiccup.page-helpers :only (link-to)]))

(defn get-users []
  (let [users (from-mongo
               (fetch :users
                      :only [:user :solved :contributor]))
        sortfn  (comp count :solved)]
    (reverse (sort-by sortfn users))))

(def-page users-page []
  [:div
   [:span.contributor "*"] " "
   (link-to "https://github.com/dbyrne/4clojure" "4clojure contributor")]
  [:br]
  [:table#user-table.my-table
   [:thead
    [:tr
     [:th "Rank"]
     [:th "Username"]
     [:th "Problems Solved"]]]
   (map-indexed #(vec [:tr (row-class %1)
                       [:td (inc %1)]
                       [:td
                        (when (:contributor %2)
                          [:span.contributor "* "])
                        (:user %2)]
                       [:td {:class "centered"} (count (:solved %2))]])
                (get-users))])

{'fraction_non_alphanumeric': 0.16640906749098403, 'fraction_numerical': 0.006697578567748583, 'mean_word_length': 1.6712517193947731, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7026650', 'n_tokens_mistral': 681, 'n_tokens_neox': 624, 'n_words': 134}