I hereby claim:
- I am stevenproctor on github.
- I am proctor (https://keybase.io/proctor) on keybase.
- I have a public key ASCZGt0FkO-yXpUni3yA2DBA0myAtm3oN2L5ycZRWZLiMwo
To claim this, I am signing this object:
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>loopback</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>ProgramArguments</key> | |
<array> |
-module(index). | |
-export([get_file_contents/1, | |
show_file_contents/1, | |
main/1]). | |
% Used to read a file into a list of lines. | |
% Example files available in: | |
% gettysburg-address.txt (short) | |
% dickens-christmas.txt (long) |
I hereby claim:
To claim this, I am signing this object:
onlyFiles :: Path -> Array Path | |
onlyFiles file = onlyFiles' file [] | |
where | |
onlyFiles' file files | isDirectory file = do | |
child <- ls file | |
onlyFiles' child files | |
onlyFiles' file files = file : files | |
safeMin :: Maybe Path -> Maybe Path -> Maybe Path |
def do_fizzbuzz(n) | |
fizz = ['', '', 'fizz'].cycle.lazy | |
buzz = ['', '', '', '', 'buzz'].cycle.lazy | |
fizzbuzz = fizz.zip buzz | |
puts (1..n). | |
zip(fizzbuzz.map(&:join)). | |
map {|number, translation| if translation.empty? then number else translation end}. | |
join("\n") | |
end |
Running from stevenproctor/language-comparison-client-elixir, with changes in pull request 4 on barrettclark/language-comparison-client-elixir against a local copy of barrettclark/language-comparison-server which is using basic Rack and Webrick on Ruby 2.1.5.
running a sinle request took 2756 microseconds
running 100 baseline tasks took 1047 microseconds
running 100 tasks took 215851 microseconds
running 100 in a map took 266523 microseconds
Erlang :gen_tcp.connect/3
‘s first argument(Address
) is either an :inet.ip_address()
which is a tuple of octets or an :inet.hostname()
which is a char_list. Write a function format_host
that takes a string a returns a valid format for :gen_tcp.connect
format_host("192.168.0.1") #=> {192, 168, 0, 1}
format_host("www.example.com") #=> 'www.example.com'
How about using interop with Erlang to handle a solved problem for you, and take advantage of :inet.parse_strict_address. This solution would also handle IPv6 addresses as well. ;)
Request URL:http://www.functionalgeekery.com/feed/podcast/ | |
Request Method:GET | |
Status Code:304 Not Modified | |
Request Headersview source | |
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 | |
Accept-Encoding:gzip,deflate,sdch | |
Accept-Language:en-US,en;q=0.8 | |
Cache-Control:max-age=0 | |
Connection:keep-alive | |
Cookie:__qca=P0-1012572507-1385437517515; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_921aee34bd7b058d3ecda34b629881d8=functionalgeekery%7C1389066714%7C6adbb45f03652e72b43ef1aaa86a5478; wp-settings-1=editor%3Dhtml%26libraryContent%3Dbrowse%26wplink%3D1; wp-settings-time-1=1388894905 |