This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
$('.tabs').click(function(evt){ | |
evt.preventDefault(); | |
$('.tabtargets').hide(); | |
var clicked = $(evt.currentTarget); | |
var toShow = clicked.attr('data-target'); | |
$(toShow).show(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List | |
t :: [Double] -> [[Char]] | |
t f = | |
let | |
perms = permutations f | |
opers = [("+", (+)), ("-", (-)), ("*", (*)), ("/" ,(/))] | |
in | |
["(((" ++ (show $ truncate a) ++ n1 ++ (show $ truncate b) ++ ")" ++ n2 ++ (show $ truncate c) ++ ")" ++ n3 ++ (show $ truncate d) ++ ")" | | |
[a ,b ,c ,d ] <- perms, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest complex-params-to-str | |
; other clauses. | |
(is (= "d=b%20c" (params-to-str {"d" "b c"}))) | |
(is (= "d=b%20%26%20c" (params-to-str {"d" "b & c"})))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declare merge-peak-with-first) | |
(defn concatenate-similar-peaks-xf [] | |
(fn [xf] | |
(let [prev (volatile! ::none)] | |
(fn | |
([] (xf)) | |
([result] (xf result)) | |
([result input] | |
(let [prior @prev] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :time | :pace | :speed | | |
|----------+-------+------------| | |
| 02:30:00 | 3:33 | 16.88 km/h | | |
| 02:30:30 | 3:34 | 16.82 km/h | | |
| 02:31:12 | 3:35 | 16.74 km/h | | |
| 02:31:54 | 3:36 | 16.67 km/h | | |
| 02:32:37 | 3:37 | 16.59 km/h | | |
| 02:33:19 | 3:38 | 16.51 km/h | | |
| 02:34:01 | 3:39 | 16.44 km/h | | |
| 02:34:43 | 3:40 | 16.36 km/h | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 02:48:47 | 4:00 min/km | 15.0 km/h | | |
| 02:49:29 | 4:01 min/km | 14.9 km/h | | |
| 02:50:11 | 4:02 min/km | 14.9 km/h | | |
| 02:50:54 | 4:03 min/km | 14.8 km/h | | |
| 02:51:36 | 4:04 min/km | 14.8 km/h | | |
| 02:52:18 | 4:05 min/km | 14.7 km/h | | |
| 02:53:00 | 4:06 min/km | 14.6 km/h | | |
| 02:53:42 | 4:07 min/km | 14.6 km/h | | |
| 02:54:25 | 4:08 min/km | 14.5 km/h | | |
| 02:55:07 | 4:09 min/km | 14.5 km/h | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :time | :pace | :speed | | |
|----------+-------------+-----------| | |
| 01:20:00 | 3:47 min/km | 15.8 km/h | | |
| 01:20:11 | 3:48 min/km | 15.8 km/h | | |
| 01:20:32 | 3:49 min/km | 15.7 km/h | | |
| 01:20:53 | 3:50 min/km | 15.6 km/h | | |
| 01:21:14 | 3:51 min/km | 15.6 km/h | | |
| 01:21:35 | 3:52 min/km | 15.5 km/h | | |
| 01:21:56 | 3:53 min/km | 15.4 km/h | | |
| 01:22:17 | 3:54 min/km | 15.4 km/h | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns user | |
(:require [clojure.string :refer [lower-case includes? trim]])) | |
(defn parse-line | |
"Returns the name of the message, or nil if it can't be found" | |
[l] | |
(->> l | |
trim | |
(re-find #"\[.{19}\].(.[A-Za-z\ \-]+):") | |
second)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns user | |
(:require [clojure.string :as string])) | |
(defn ⁵ | |
"Returns n to the fifth power. | |
Note we use the UTF-character of superscript-5 as function name, because we can. ;-)" | |
[n] | |
(let [sq (* n n)] | |
(* sq sq n))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(future | |
(try | |
(println "inside future body") | |
(assert false) ;; | |
(catch Exception e | |
(println "error" (.getMessage e))))) ;; no error printed | |
(try ;; not in a future, but just normal | |
(println "inside future body") |
OlderNewer