   "Turn an integer into a key suitable for fetching from mongodb."
   [id]
   keyword str int)
+
+(defn trim-code [code]
+  (when code (.trim code)))
 
 (defn code-length [code]
   (count (remove #(Character/isWhitespace %)

    (catch Throwable t {:message (.getMessage t), :url *url*
                        :num-tests-passed 0})))

(defn static-run-code [id raw-code]
  (let [{:keys [message url num-tests-passed]}
        (binding [*url* (str *url* "#prob-desc")]
          (run-code id raw-code))]
    (session/flash-put! :failing-test num-tests-passed)
    (flash-msg message url)))


specified id.

Return a map, {:message, :url, :num-tests-passed}."
  [id code]
  (try
    (let [{:keys [tests restricted] :as problem} (get-problem id)
          sb-tester (get-tester restricted)
          user-forms (s/join " " (map pr-str (read-string-safely code)))
          results (if (empty? user-forms)
