Camelia, the Perl 6 bug

IRC log for #mojo, 2011-03-23

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:30 xris left #mojo
00:46 diegok sri: I think the docs examples for the new UA are wrong --> http://pastebin.com/tHcnKHT3
00:48 GitHub131 joined #mojo
00:48 GitHub131 mojo: master Sebastian Riedel * 1019a6a (1 files in 1 dirs): fixed typos - http://bit.ly/i7KHWZ
00:48 GitHub131 left #mojo
00:48 sri diegok: thanks, fixed
00:49 diegok sri: what should I do to get several things async?
00:49 sri ?
00:50 diegok I mean, when should I call IOLoop->stop
00:50 sri when you're done of course
00:51 diegok right, so I should count on a global?
00:51 sri whatever works best for you, the daemon for example uses signals
00:53 tempire_ joined #mojo
00:53 diegok sri: ok, understand. It was the same with the old client? (if so, I had a wrong example on my pm talk) :-(
00:53 tempire left #mojo
00:55 sri most people got the old clients async mode wrong, that's exactly why it had to change ;p
00:55 sri i'm happy you got the new async mode at first sight :D
00:56 diegok so, I was among the ones that got wrong the old client? :-(
00:57 sri i doubt anyone understood it really
00:57 sri not even me :S
00:58 sri way too much magic, ->async doing different things depending on context....
00:59 diegok so, this was wrong: http://pastebin.com/DrHc76Y2 ?
00:59 diegok (that the example I'm trying to translate to the new ua)
01:00 sri nope, that was a sync/async hybrid thingy we don't support anymore
01:00 sri it was ok for client though
01:00 diegok sri: ok, I think I fully understand :-)
01:00 sri but technically sync
01:01 sri there is a cookbook recipe you might like
01:01 diegok thank you (one more time).
01:01 diegok ok, I'll check cookbook now :)
01:02 sri your example was actually one of the few good things about the old api, but not very useful, since you couldn't add more requests dynamically
01:02 sri http://mojolicio.us/perldoc?Mojolic​ious/Guides/Cookbook#Non2DBlocking
01:03 diegok I did the slides on the day after 1.0, gave the talk for barcelona.pm and then just code without the need for async client. But I will do the same talk for madrid.pm tomorrow :)
01:03 sri oh
01:03 sri let me know if i can help somehow
01:04 diegok sri: well, I'm trying to make everything coherent for the changes since 1.0, client to ua is the most significative I think.
01:05 diegok that plus adding some more stuff I didn't understand at that moment about routes and changing city and dates :)
01:06 sri i guess it's mostly s/client/us/
01:06 sri grrr
01:06 sri *ua
01:06 diegok :)
01:06 diegok right
01:06 sri i just keep typing "us"
01:06 diegok well... it "our" client :-p
01:07 diegok ^it's
01:07 sri i made that typo a gazillion times when i compiled the pod for the useragent
01:07 diegok yes, I saw that typo on the pod
01:08 sri oh right, we talked about that before :)
01:08 diegok right :)
01:12 diegok oh!, I'll add command line :)
01:17 sri good idea, everybody loves that one
01:18 diegok yes, I had some very similar examples using "perl -Mojo" :)
01:20 diegok and pple at barcelona.pm really liked those.
01:42 stephen left #mojo
01:47 perlrocks Twitter: "Mojolicious API Reference - GitHub http://htn.to/4mxkVL" (ja) --jamadam http://twitter.com/jamadam​/status/50373100096856065
02:04 ispy_ joined #mojo
02:10 vel joined #mojo
04:56 Foxcool joined #mojo
05:04 Drossel joined #mojo
05:04 Kulag left #mojo
05:09 Kulag joined #mojo
05:10 Drossel left #mojo
05:22 jwang joined #mojo
05:23 Foxcool_ joined #mojo
05:25 Foxcool left #mojo
06:06 giwi joined #mojo
06:15 Kulag left #mojo
06:17 Kulag joined #mojo
06:25 arpadszasz joined #mojo
06:27 Kulag left #mojo
06:28 Kulag joined #mojo
06:30 arpadszasz left #mojo
06:31 arpadszasz joined #mojo
06:37 Foxcool_ left #mojo
06:38 koban` joined #mojo
06:47 kaare joined #mojo
06:48 Foxcool_ joined #mojo
07:10 Christian joined #mojo
07:10 Christian morning
07:17 cosmincx joined #mojo
07:33 koban` left #mojo
07:36 koban` joined #mojo
07:57 esskar joined #mojo
08:01 breaker313 joined #mojo
08:02 vel left #mojo
08:19 fhelmber_ joined #mojo
08:32 Kulag left #mojo
08:35 Kulag joined #mojo
08:39 Drossel joined #mojo
08:39 Kulag left #mojo
08:45 diegok morning ;-)
09:27 Foxcool_ left #mojo
09:29 * crab ponders running Mojolicious-y applications from crontab
09:39 Foxcool_ joined #mojo
09:41 abra left #mojo
09:53 abra joined #mojo
10:26 arthas joined #mojo
10:34 spleenjack joined #mojo
10:41 ver joined #mojo
10:54 ver left #mojo
10:54 AmeliePoulain joined #mojo
10:56 koban` left #mojo
11:29 sri good morning fellow ninjas
11:30 moritz not morning here anymore, websocketrobot
11:30 moritz lunch time, in fact
11:30 moritz &
11:40 crab it's late afternoon here, but it's always lunch time.
11:58 ispy_ left #mojo
12:05 Foxcool_ left #mojo
12:13 crab ah. so $ua->get($blah)->res->dom->blahblah->text breaks horribly if ua can't connect.
12:13 crab so what's the robust way to write it? $res = $ua->get($blah)->res; $res = $res->dom if $res; $res = $res->at(...) if $res; $res = $res->text if $res;?
12:14 crab oh, i can do everything up to the text.
12:15 sri see synopsis examples
12:17 Foxcool_ joined #mojo
12:31 crab thanks.
12:46 koban` joined #mojo
12:58 Foxcool_ left #mojo
13:19 ispy_ joined #mojo
13:26 ispy_ left #mojo
13:28 breaker313 left #mojo
13:28 omega https://gist.github.com/7dbab8cbfff3451d8e3d
13:29 omega I end up with a not a CODE reference error?
13:32 giwi left #mojo
13:49 giwi joined #mojo
13:54 vti_mob joined #mojo
13:55 vti_mob left #mojo
13:58 koban` can't believe my eyes! ^)
14:00 sri oh there's a neat new css3 pseudo class
14:01 sri :any(p, div)
14:02 giwi left #mojo
14:11 crab koban: what happened?
14:11 purl We don't know what happened, so tell everyone nothing happened.
14:16 koban` left #mojo
14:16 koban` joined #mojo
14:29 koban` сrab: i thought vti came back
14:30 cosmincx left #mojo
14:32 vti_mob joined #mojo
14:32 vti_mob left #mojo
14:39 cosmincx joined #mojo
14:42 perlrocks Twitter: "When people tell you not to try parsing #html with a regex, this is why. :) http://t.co/kyQEWb4 #perl" --kraih http://twitter.com/kraih/status/50564291975319553
14:44 moritz when people tell you not to parse HTML with regexes, it's also because of bugs like those fixed in 51489ada9ab9d18ae014f5d49d52ef784e810197 :-)
14:47 esskar left #mojo
14:53 giwi joined #mojo
14:56 kaare left #mojo
15:05 perlrocks Twitter: "Ole Ole WAF discarded leaving only the template engine, mojolicious crossover to. Innovation goes so comparatively Sakurai." (ja) --jamadam http://twitter.com/jamadam​/status/50572648106823680
15:07 su-bzero How to set parameters manually?
15:07 moritz su-bzero: what is the simplest thing that could possibly work?
15:07 purl it has been said that the simplest thing that could possibly work is _fine_ when it's being done in a particular application. Less good when it's being done in something as frameworky as Moose. Then you have to do the Rightest Thing that will keep working in novel situations.
15:08 su-bzero moritz: Wheel. ;)
15:08 su-bzero $self->param(z => 1) works, but not $self->param(z => 1, y => 2);
15:08 moritz then you know what to do, no?
15:09 su-bzero Yes.
15:09 su-bzero Just need to set parameters manually.
15:16 duff joined #mojo
15:17 duff I'm having some issues with Template Toolkit in Mojo, http://friendpaste.com/7izrX4MKgyTaRIGvsqA0Qi. Unicode seems to be getting buggered somehow...
15:17 arpadszasz left #mojo
15:17 su-bzero moritz: I just try to use template where param('foo'), param('bar'),.. So I need to set params manually.
15:20 su-bzero So I've found a solution: foreach my $key (%{$member}) {$self->req->param($key => $member->{$key});}
15:20 su-bzero ;))
15:21 Foxcool joined #mojo
15:27 Foxcool left #mojo
15:33 Christian cu all
15:34 Christian left #mojo
15:35 kaare joined #mojo
15:38 omega what does Mojo::DOM decode   into? I parse a chunk of html, extract a sub-node, rewrite some links, and use innner_xml, and it turns into something strange
15:43 sri omega: https://github.com/kraih/mojo/b​lob/master/lib/Mojo/Util.pm#L26
15:44 omega sri: ok, thanks
15:45 omega what encoding is returned from inner_xml?
15:49 omega nm
15:51 koban` left #mojo
16:16 AmeliePoulain left #mojo
16:17 Alias left #mojo
16:33 xris joined #mojo
16:48 cosmincx left #mojo
16:54 giwi left #mojo
17:08 fhelmber_ left #mojo
17:14 Drossel left #mojo
17:14 Kulag joined #mojo
17:46 gizzlon joined #mojo
17:50 snearch joined #mojo
17:55 stephen joined #mojo
18:09 sri anyone got a clever oneliner for an xor cipher?
18:10 crab perl -le 'print "hi there sri"^"one time pad"'
18:10 sri ;p
18:10 crab sorry, could not resist.
18:10 sri a little more clever, 32bit key and arbitrary length message
18:11 sri need it for websocket client to server masking
18:13 dekimsey left #mojo
18:18 GitHub122 joined #mojo
18:18 GitHub122 mojo: master Sebastian Riedel * 5849475 (1 files in 1 dirs): pod cleanup - http://bit.ly/gJgQMM
18:18 GitHub122 left #mojo
18:18 crab you're supposed to split the input into 32-bit blocks and xor it against a single key?
18:19 sri yes
18:19 crab that sounds... very much not a good idea, crypto-wise. but i don't know what it's for, so maybe it isn't bad.
18:19 sri it is not for crypto purposes
18:19 sri just masking the data
18:19 dekimsey joined #mojo
18:19 sri to prevent cross protocol attacks
18:22 crab what padding to use for the last block, if it's too small?
18:23 sri part of the key again i think
18:24 sri Octet i of the masked-data is the XOR of octet i of the clear text frame with octet i modulo 4 of the masking-key:
18:24 sri j              = i MOD 4
18:24 sri masked-octet-i = clear-text-octet-i XOR octet-j-of-masking-key
18:26 sri that's basically the whole description
18:26 sri everything else just says the key has to be 32bit and random
18:29 crab perl -le '$key="abcd";$input="aabaa​bedacbedebca";$input.=$key unless length($input)%4==0;$key=unpack "N",$key;print pack "N*", map({$_^$key} unpack "N*", $input)'
18:29 crab oh, octet i modulo 4.
18:29 crab well, same idea.
18:31 Akron joined #mojo
18:31 crab oh i parsed "octet i modulo 4" wrong.
18:32 crab so no padding needed. fine. moment.
18:33 sri oh you mean padding for the message
18:34 sri right, that would be counterproductive
18:35 sri input and output need to be equal
18:35 arpadszasz joined #mojo
18:47 crab perl -le '$input="abcddcbabdaccdabef";$key="​abcd";$n=length($input);substr($key x=1+$n/4,$n)="";print $input^$key'
18:48 crab that just repeats the key until it's the same length as the input, then xors.
18:49 snearch left #mojo
18:51 crab must sleep.
18:51 purl Sleep is for the weak.
18:51 sri !
18:51 sri crab++
18:51 sri hmm, building a key first is not so nice memory usage wise
18:52 sri a websocket message can theoretically be huge
18:52 sri max payload length is a 64bit value
19:00 spleenjack left #mojo
19:23 perlrocks Twitter: "The #Mojolicious #OpenBSD errata scraper now grabs the last two releases - http://t.co/p0N2EDi - but Mojo::DOM::Collection needs ->reverse" --AFreshOne http://twitter.com/AFreshOn​e/status/50638753043185664
19:30 arpadszasz left #mojo
19:35 Akron left #mojo
19:42 perlrocks Twitter: "Nau Mojolicious Tsuyoshi Tsutomu" (ja) --brain_apple http://twitter.com/brain_app​le/status/50643723675115520
19:47 perlrocks Twitter: "Nice introduction to Mojolicious by Diego Kuperman, Madrid PerlMongers are on fire!! :)" --aescuderoz http://twitter.com/aescuder​oz/status/50644783353442304
19:48 sri diegok++
19:51 arthas left #mojo
20:21 sherr left #mojo
20:24 sherr joined #mojo
20:29 vel joined #mojo
20:44 Akron joined #mojo
20:51 arpadszasz joined #mojo
20:51 sri oh, Community is really not bad for a comedy series
21:49 vel left #mojo
21:53 ok22_ joined #mojo
21:58 ok22 left #mojo
22:11 baton8 left #mojo
22:14 marcus joined #mojo
22:14 marcus yay, internet in new apartment \o/
22:15 marcus Also, roomba in new apartment.
22:15 sigue left #mojo
22:17 kaare left #mojo
22:24 marcus I mentioned Mojolicious as a server with web socket support in my html5 talk today
22:24 marcus wanted to do a live demo, but the irc example seems to not work with current mojo
22:52 sri marcus: current master?
22:52 purl i think current master is better.
22:53 marcus sri: no, I wasn't able to get it to run with any recent versions
22:53 marcus I tried various tags
22:53 sri draft-76 support is working fine in the cpan version
22:54 sri or has the irc demo just not been updated in a very long time?
22:54 marcus so it seems
22:54 marcus http://dev.xantus.org/ is down too
22:54 sri ah ok
22:54 sri websockets are pretty much completely broken in master btw
22:55 sri have to wait a bit now for browsers to catch up
22:56 marcus I figured
22:56 marcus I actually used that as my excuse for no live web sockets demo
22:57 sri can't wait for ietf-07
22:57 sri that one is supposed to be final
22:57 marcus sweet
22:57 sri and so far it looks like just a few minor tweaks on ietf-06
23:00 sri looks like most websocket examples use stuff that was deprecated a year ago
23:01 sri xantus doesn't seem to have much time for perl hacking atm :/
23:02 marcus it's a bit annoying
23:02 marcus most examples of mojo out there are broken
23:02 marcus leaves a bad impression
23:02 marcus vti's stuff too
23:04 sri not much we can do about it though
23:04 marcus could fix them and send pull requests
23:05 sri quite sure we've had a few people do that already
23:05 marcus xantus' stuff or vti's?
23:06 sri think a few people went through the examples
23:06 sri (in the wiki)
23:06 marcus anyways, have to go to bed now.  will maybe spend some time on this later, but right now, moving is taking up my capasity
23:06 marcus nite
23:06 sri nn
23:07 sigue joined #mojo
23:10 Akron_ joined #mojo
23:13 Akron_ left #mojo
23:17 arpadszasz left #mojo
23:48 Akron left #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary