Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-lwp-gsoc, 2014-06-02

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:28 FROGGS_ joined #perl6-lwp-gsoc
06:34 sergot morning o/
06:52 FROGGS joined #perl6-lwp-gsoc
06:53 FROGGS o/
06:56 sergot FROGGS: o/
07:23 sergot I want to write a gsoc post today :)
07:23 sergot about HTTP Cookies and DateTime::Parse
07:23 sergot and HTTP::Message, changed LWP name
07:24 FROGGS yeah
07:24 sergot aaaaand. our plans :)
07:24 FROGGS and my plan is to review more modules, and write everything down in the issues
07:24 FROGGS (and I'll also blog about it of course)
07:25 sergot That's our plan:
07:25 sergot * Week #3 - #4 2 - 15 June
07:25 sergot Write solid HTTP::Request and HTTP::Response modules with tests.
07:25 sergot Write solid LWP::Simple module with tests.
07:25 sergot Write lwp-request, lwp-dump, lwp-download.
07:25 FROGGS that will be awesome
07:25 sergot We should change LWP to HTTP here as well.
07:26 FROGGS because I got grey hair yesterday when I hacked a simple http client for fetch cpan.org/MIRRORED.BY
07:26 FROGGS see https://github.com/tadzik/panda/commit/ece2c62b1d5ab0f4c268bdd523c5fec823d4caa8
07:27 FROGGS very very hacky
07:28 sergot hmm, interesting
07:29 FROGGS I mean, I am not sure if I want to pull in HTTP::UserAgent as a dependency for panda, but also I think that is the only way to make it reliable
07:49 sergot Ok :)
11:56 sergot 13:54 < timotimo> if someone sets a cookie that has a not-nice character in its data, your format goes kablooey, no?
11:56 sergot good point
12:04 FROGGS do you need to escape something perhaps?
12:05 sergot I'm not sure. I must check if cookies can contain ; or =
12:06 sergot Can I use gsoc logo on my blog without permission?
12:06 FROGGS I guess so
12:07 FROGGS can you make it a link to the gsoc website?
12:09 sergot it's not so easy. :)
12:09 sergot I can add an addnotation under this post.
12:10 sergot annotation *
12:10 FROGGS well, nvm then, just put the pic there
12:10 sergot ok :)
12:11 FROGGS https://code.google.com/p/google-summer-of-code/wiki/GsocLogos
12:11 FROGGS "You are, for example, welcome to put it up on your website or use it on a flyer advertising your organization's participation in the program."
12:12 sergot \o/
12:12 sergot thanks FROGGS++
13:59 dalek http-message: 04f7e21 | sergot++ | t/01-basic.t:
13:59 dalek http-message: test added
13:59 dalek http-message: review: https://github.com/sergot/http-message/commit/04f7e21163
14:01 dalek http-message: 80c9f0a | sergot++ | lib/HTTP/Message.pm6:
14:01 dalek http-message: Date contains : - fixed
14:01 dalek http-message: review: https://github.com/sergot/http-message/commit/80c9f0ab5b
14:04 dalek http-headers: 738d213 | sergot++ | t/01-basic.t:
14:04 dalek http-headers: test added
14:04 dalek http-headers: review: https://github.com/sergot/http-headers/commit/738d21331e
14:05 dalek http-message: 2dee6a0 | sergot++ | t/01-basic.t:
14:05 dalek http-message: test fixed
14:05 dalek http-message: review: https://github.com/sergot/http-message/commit/2dee6a05ee
14:09 dalek http-message: 454371e | sergot++ | lib/HTTP/Message.pm6:
14:09 dalek http-message: parse() fixed
14:09 dalek http-message:
14:09 dalek http-message: now it handles multiple values too
14:09 dalek http-message: review: https://github.com/sergot/http-message/commit/454371ec3f
14:09 sergot some bugs fixed :)
14:09 sergot actually... one :)
14:11 sergot hmm, two.
16:10 FROGGS joined #perl6-lwp-gsoc
16:40 sergot FROGGS: some bugs have been fixed today. :)
16:40 sergot FROGGS: could you give address of your blog?
16:40 sergot give me*
16:43 FROGGS usev5.wordpress.com
17:02 sergot nice, I like it, thank you! :)
17:23 dalek http-message: 32fd79e | sergot++ | lib/HTTP/Message.pm6:
17:23 dalek http-message: some comments added
17:23 dalek http-message: review: https://github.com/sergot/http-message/commit/32fd79e79f
17:24 FROGGS ERROR: Permission to sergot/http-message.git denied to FROGGS.
17:24 FROGGS :o(
17:24 dalek http-message: 795bf0b | sergot++ | lib/HTTP/Message.pm6:
17:24 dalek http-message: we dont need this if-statement
17:24 dalek http-message:
17:24 dalek http-message: FROGGS++
17:24 dalek http-message: review: https://github.com/sergot/http-message/commit/795bf0be9b
17:25 FROGGS sergot: can you check that I have push rights?
17:25 sergot Oh, you don't. giving
17:25 sergot FROGGS: added
17:25 FROGGS thanks
17:26 dalek http-message: bc36cc6 | (Tobias Leich)++ | t/01-basic.t:
17:26 dalek http-message: add failing test
17:26 dalek http-message: review: https://github.com/sergot/http-message/commit/bc36cc61b5
17:26 FROGGS *g*
17:26 FROGGS that is what you get in return :P
17:26 sergot ooohhh, haha :)
17:27 sergot I like this example :)
17:27 FROGGS this made me suspicious: https://github.com/sergot/http-message/blob/master/lib/HTTP/Message.pm6#L49
17:27 FROGGS but perhaps it is not that, I dunno
17:28 sergot I've just gave you commit bit to all of the gsoc repos.
17:29 * sergot is debugging
17:31 sergot Something is wrong with the Content-Type
17:32 sergot And some others. Thanks FROGGS
17:32 sergot :)
17:32 FROGGS also in HTTP::Message.parse: you are also looping over the lines of the message body... if this looks like \w+:... will it result in a header field?
17:33 sergot I guess so, good point.
17:34 FROGGS that would only happen when you have windows newlines in the message body, but still...
17:38 sergot The first bug is that \w doesn't include '-
17:38 sergot '-'
17:41 sergot FROGGS: if not $line ~~ /^[\w '-'?]+\:/ # is it a good regexp?
17:41 sergot I don't like it :D
17:43 FROGGS is that better?  /^ <[\w-]>+ ':' /
17:45 sergot what does <> mean here?
17:45 sergot yes, this is better
17:46 FROGGS <[ ... ]> is a character class
17:46 FROGGS like [ ... ] in Perl 5
17:46 sergot oooh, right, thanks :)
17:46 FROGGS but [ ... ] in P6 is just a non-capturing group
17:46 sergot Ok :)
17:48 dalek http-message: 75d956d | sergot++ | lib/HTTP/Message.pm6:
17:48 dalek http-message: regexp changed, passes tests now
17:48 dalek http-message: review: https://github.com/sergot/http-message/commit/75d956d6d5
17:48 sergot Still I should do something with the content.
17:52 sergot We probably can get rid of this regexp at all.
17:55 FROGGS perhaps it makes sense to write a grammar for the message structure
17:55 FROGGS then you don't have to check regexes, split texts and push things to a hash...
17:56 FROGGS you'd just walk the match object, or, create the proper action class that gives you everything correctly
17:57 FROGGS grammar HTTP::Message::Grammar { token TOP { <header> "\r\n\r\n" <body> } token header { <header-line>+ % "\r\n" }; token headerline {}; token body { .* } }
17:58 FROGGS but, the chunked transfer encoding is still tricky
18:01 sergot I like this solution
18:03 sergot what does mean the '%' there?
18:07 sergot what's the difference between .grep( *.sth ) and .grep({ .sth })?
18:07 [Coke] timtoady just answered that in the few days on #perl6
18:08 [Coke] I had tried (* ~~ something) and was surprised that the ~~ was treating the * as a whatever and not as 'whatever the individual element was')
18:09 [Coke] http://irclog.perlgeek.de/perl6/2014-05-30#i_8797038
18:09 sergot [Coke]: thanks!
18:11 [Coke] I'm glad I could be confused slightly ahead of you! ;)
18:12 sergot while my $a = @a.shift {} won't work in p6, am I right?
18:14 [Coke] Failure.new(exception => X::AdHoc.new(payload => "Element shifted from empty list"))
18:15 [Coke] if you're not mutating @a while looping, I'd do:
18:15 [Coke] for @a -> $a { }
18:21 FROGGS sergot: the % is 'something divided by something'
18:21 FROGGS just look at the character :o)
18:21 FROGGS so, <field>+ % <comma> would be a nice way to parse a CSV
18:44 sergot thanks!
18:44 dalek http-message: 48a53f8 | sergot++ | lib/HTTP/Message.pm6:
18:44 dalek http-message: we dont need regexp at all
18:44 dalek http-message: review: https://github.com/sergot/http-message/commit/48a53f8221
18:44 sergot What do you think about this?
18:44 sergot it stops when \r\n between headers and content reached
18:50 FROGGS what does: $.content = @lines.grep({ $_ }).join; ?
18:50 [Coke] while 1 == loop
19:07 sergot FROGGS: joins every non empty line ("\r" == empty)
19:07 sergot or.. wait
19:08 sergot yes
19:08 FROGGS sergot: does that mean that empty lines in the content get lost?
19:09 sergot yes
19:09 FROGGS which is not very good, is it? :o)
19:10 sergot Empty line means end of the http message, doesn't it?
19:10 FROGGS hmmm, is that so...
19:10 FROGGS guess I should test that
19:10 [Coke] I think that's true for the header.
19:12 sergot I can also pop the last line (which is empty for sure)
19:13 dalek http-message: d311b5c | sergot++ | lib/HTTP/Message.pm6:
19:13 dalek http-message: loop instead of while 1
19:13 dalek http-message: review: https://github.com/sergot/http-message/commit/d311b5c19f
19:13 sergot nevertheless I think we should use grammar for this.
19:13 sergot It's more 6ish
19:14 FROGGS and probably faster
19:14 sergot I'll do this tomorrow.
19:14 sergot I have to leave soon.
19:15 FROGGS yeah, me too
19:16 sergot So, there is one more important think in http::message - encoding and decoding.
19:17 sergot What I want to do this week, I want to "connect" HTTP::{Response,Request} with HTTP::Cookies as well.
19:19 sergot so, good night! o/
19:32 FROGGS good night!

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary