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
# Original blog post about Rubinius performance on the alioth mandelbrot benchmark: | |
# http://rfc2616.wordpress.com/2010/10/16/rubinius-vs-the-benchmark-from-hell/ | |
# | |
# Problems with assumptions in the blog post: | |
# * The C <-> Ruby comparison is apples to oranges because the Ruby code | |
# is written to use blocks rather than loops. That imposes the overhead | |
# of additional execution contexts per pixel. | |
# * The output is written a byte at a time, which requires a fairly deep | |
# chain of methods before the byte is handed off to the OS. | |
# * The work is done in the script body. Unless the implementation has |
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
(defn validates-credentials [username password] | |
(let [uc (count username) | |
pc (count password)] | |
(match [username uc password pc] | |
[(:or nil "") _ _ _] {:error "No username given" :field "name"} | |
[_ _ (:or nil "") _] {:error "No password given" :field "pass"} | |
[_ (_ :guard #(< % 3)) _ _] {:error "Username less than 3 characters" :field "pass"} | |
[_ _ _ (_ :guard #(< % 4))] {:error "Password less than 4 characters" :field "pass"} | |
[#"^([a-z0-9-_]+)$" _ _ _] {:error "Username contains invalid characters" :field "name"} | |
:else true))) |
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
ffmpeg -i in.mkv -f srt -i in.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt out.mkv |