Camelia, the Perl 6 bug

IRC log for #mojo, 2012-11-14

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

All times shown according to UTC.

Time Nick Message
01:04 laouji joined #mojo
01:18 Mike-PerlRecruiter_ joined #mojo
01:37 xaka joined #mojo
01:38 dwierenga joined #mojo
01:46 hlin joined #mojo
01:49 d4rkie joined #mojo
02:15 vel joined #mojo
02:53 Adura joined #mojo
03:25 jayallen_ joined #mojo
03:31 noganex joined #mojo
03:49 Foxcool joined #mojo
05:20 tempire urg
05:21 tempire might be about that time again
05:21 * tempire jobs
05:27 egopro joined #mojo
05:36 rem_lex| joined #mojo
05:40 Vandal joined #mojo
05:48 Polarn_ joined #mojo
05:54 Polarn joined #mojo
06:15 batman joined #mojo
06:15 ver joined #mojo
06:16 Polarn joined #mojo
06:39 batman joined #mojo
06:50 dpetrov_ joined #mojo
06:50 spleenjack joined #mojo
07:09 AmeliePoulain joined #mojo
07:12 ladnaV joined #mojo
07:16 yakudza joined #mojo
07:18 mire__ joined #mojo
07:19 Molaf joined #mojo
07:29 davido joined #mojo
07:57 chesti joined #mojo
07:58 batman joined #mojo
07:58 chesti hi
07:59 chesti batman: are you alive?
07:59 batman chesti: yeah
07:59 chesti about our yesterday talk
08:00 chesti doing the app i based on http://blogs.perl.org/users/joel_berger/20​12/10/a-simple-mojoliciousdbi-example.html
08:00 chesti and i had problem with disconnecting
08:00 chesti i changed 1 thing today
08:01 chesti helper db => sub {$dbh;};
08:01 chesti into:
08:01 chesti helper db => sub { return $dbh;};
08:01 chesti and now it reconects...
08:02 batman chesti: it should not matter
08:02 batman return or no return
08:03 chesti but it matters
08:03 batman no.
08:03 chesti when i have no return
08:03 batman there must be something else
08:03 chesti and i do kill process in mysql
08:03 chesti when i do F5 to reload page i get empty page in first case
08:04 chesti in second one new process comes out
08:04 batman chesti: anyway... i would't use that code. do something like this instead:
08:04 batman helper db => sub { $_[0]->stash->{dbh} ||= DBI->connect(@DBH_ARGS) };
08:04 batman oops @DBI_ARGS
08:06 dod joined #mojo
08:06 chesti i thought about iserting there something like if ($dbh->ping()) {$_0->stash->{dbh}} else {DBI->connect(@DBH_ARGS)}
08:06 chesti ahhh...
08:07 chesti batman: http://pastebin.com/BH12VWKE
08:07 chesti what do you thing about going that way?
08:08 chesti to use conectivity check like that one?
08:10 batman chesti: i'm writing some code for you now... wait a sec
08:10 batman https://gist.github.com/4070937
08:10 batman no idea if it compiles though
08:11 batman *refresh*
08:11 batman i had a bug in the Usage
08:15 chesti ehhh i tell you bullshit, i tricked myself in both cases it fails :/
08:15 chesti case clear
08:15 batman i know :)
08:15 batman but that's fine
08:16 chesti i study that code you pasted
08:16 chesti tx
08:17 batman i also added transactions now. refresh to see the new code
08:19 batman so my code sucks compared to DBIx::Class. just to be absolutely clear about that :)
08:19 batman fixed a bug in txn_do() now
08:20 chesti i see it,,,
08:21 chesti yes but as i said it won`t work for me by the dependences... :(
08:22 chesti btw you`re from Norway i see
08:23 batman please let me know how the code works for you. i would like if the gist actually works :)
08:23 batman yup. i'm from norway...
08:24 chesti never been there but i know that`s beautiful but a bit cold :)
08:24 chesti i`m from Poland and now i have 1 celsius degree ;)
08:24 batman *need to work* *brb*
08:25 chesti batman: sure, i`ll give you feedback about that code
08:27 dod joined #mojo
08:30 egopro joined #mojo
08:31 dod joined #mojo
08:48 xaka joined #mojo
08:48 * sri yawns
08:50 memowe \o/
09:00 rem_lex joined #mojo
09:05 cosmincx joined #mojo
09:09 dotan joined #mojo
09:20 chesti joined #mojo
09:25 fhelmber_ joined #mojo
09:25 nic I've never understood why you'd want your DBI layer to pretend the DB can do nested transactions
09:28 nic chesti: batman isn't connected right now, but you'll see his gist doesn't handle/disable auto-reconnect
09:35 chesti hi nic :)
09:36 nic hi
09:37 chesti i`m not sure if i undersand, "his gist doesn't handle/disable auto-reconnect"
09:37 chesti i thought that line 16 does that
09:37 chesti ?
09:40 chesti hmmm ok
09:40 chesti it create new connection if there is no previous one, but in my case there is one handler already
09:44 nic chesti: are you using transactions now?
09:45 Britzel joined #mojo
09:46 chesti no
09:46 batman joined #mojo
09:46 nic good
09:46 nic so my advice from yesterday stands
09:46 chesti there is no need i only fetch data
09:46 kwa joined #mojo
09:46 nic yep.  So ignore txn_do from the gist
09:47 nic and enable auto-reconnect in lines 2..10
09:48 chesti ok
09:48 chesti tx :)
09:48 chesti this auto-reconnect will work as goog as checking $dbh->ping() ?
09:49 nic better
09:49 nic ->ping() can get misleading results
09:49 chesti when?
09:49 nic but you can only use auto-reconnect if you don't ever use transactions
09:54 nic Personally, I don't recommend auto-reconnect -- I always use a db connector and request a new connection for each chunk of code
09:55 chesti yes but this is just good enough for me
09:55 nic for example, if you set any interactive options like utf8, it'll quietly forget them next time it auto reconnects
09:55 chesti but i`m aware of that what you pionting
09:55 nic it's a v similar argument as to why we don't have commandline hypnotoad options
09:56 chesti i didn`t use hpnotoad yet
09:57 chesti just using morbo while developing my app
09:57 nic sounds good
09:59 coff joined #mojo
10:22 Adura joined #mojo
10:22 jayallen_ joined #mojo
10:22 dvinciguerra joined #mojo
10:23 D4RK-PH0ENiX joined #mojo
10:23 Grrrr joined #mojo
10:23 spleenjack joined #mojo
10:23 mattp_ joined #mojo
10:24 edenc joined #mojo
10:24 tholen42 joined #mojo
10:24 laouji joined #mojo
10:25 sri joined #mojo
10:29 mire joined #mojo
10:29 drift_ joined #mojo
10:30 Vandal joined #mojo
10:31 drift joined #mojo
10:34 Vandal joined #mojo
10:44 batman chesti: does dbh_do work?
10:54 cstamas hi
10:55 cstamas Mojo::Useragent; how do I check if a req is succeeded or not?
10:56 cstamas maybe I overlooked sth, but it is not obvious for me
10:57 cstamas never mind, found it
11:05 memowe cstamas: from the synopsis:
11:05 memowe if (my $res = $tx->success) { say $res->body }
11:05 cstamas memowe: ok, got it
11:05 cstamas thx
11:06 cstamas memowe: you know it is a kind of "when you asked the question you found the answer at once" :)
11:07 chesti batman: no time to test it yet
11:07 batman chesti: ok
11:08 memowe cstamas: yeah. :)
11:08 cstamas memowe: I do not however get this one:
11:08 cstamas say $code ? "$code response: $err" : "Connection error: $err";
11:09 cstamas memowe: what is $code in this context?
11:17 mikegrb joined #mojo
11:27 chesti joined #mojo
11:40 d4rkie joined #mojo
11:45 dbr joined #mojo
11:48 cosmincx joined #mojo
11:58 yakudza how can I pass multiple parameters to block in mojolicious template
12:01 yakudza % my $daytop = begin
12:01 yakudza % my ($id, $uid, $ip, $country) = @_;
12:02 yakudza and then $daytop->($qew, $qasd, $xzc, $cn);
12:02 yakudza not working
12:12 Foxcool joined #mojo
13:17 Mike-PerlRecruiter_ joined #mojo
13:21 spleenjack1 joined #mojo
13:29 ladnaV joined #mojo
13:30 chesti joined #mojo
13:32 memowe joined #mojo
13:44 nic cstamas: http response code (404, 301, 200, etc)
13:48 sh4 joined #mojo
13:48 cstamas nic: and it is 0 if could not connect if I got that right
13:52 mattastrophe joined #mojo
14:04 Vandal joined #mojo
14:05 jayallen joined #mojo
14:25 ladnaV joined #mojo
14:45 memowe joined #mojo
14:48 mire joined #mojo
14:52 Vandal joined #mojo
14:57 ladnaV joined #mojo
14:57 * tempire enjoys the 26c weather here in florida
15:05 marty joined #mojo
15:09 chesti joined #mojo
15:10 chesti joined #mojo
15:14 dod joined #mojo
15:15 dod joined #mojo
15:36 dod joined #mojo
15:39 * sri hopes tempire will survive florida
15:40 sri tv has taught me there are only old people and serial killers in florida
15:40 sri oh, and alligators
15:40 jayallen joined #mojo
15:44 knshaum joined #mojo
15:47 kongelaks Can somebody please explain to me how I can simulate the parsing/building of a multipart response with Transfer-Encoding: chunked?
15:48 marty joined #mojo
15:49 kongelaks I've tried copying a multipart test from t/mojo/response.t and changing the content-length header to transfer-encoding... doesn't work
15:51 kongelaks I've also tried recording some of my own responses and I cannot get them to work. However, when I'm using the user-agent against a server that provides multipart responses, I get back a multipart response without the last part
15:54 sri i'm sure there's an example for how to do chunked in the documentation
15:55 sri http://mojolicio.us/perldoc/Mojolicious/G​uides/Rendering#Chunked_transfer_encoding
15:56 sri that's advanced stuff though, so be careful
15:59 kongelaks sri: thanks. let me clarify that I'm only really interested in Mojo::UserAgent and the ability to build a test case that parses a multipart response with transfer-encoding chunked
16:00 kongelaks i'm trying to investigate a potential bug
16:00 sri that kind of test case would usually be on a different layer
16:00 sri like t/mojo/response.t
16:01 sri since Mojo::UserAgent doesn't really know or care how the response looks like
16:01 kongelaks yeah, i've taken a test case from that file and tried to modify it to use transfer-encoding: chunked, but cannot seem to get it
16:05 sri there is no chunked+multipart test yet?
16:05 sri that's unusual
16:08 kongelaks i can't seem to find one in mojo/t/response.t
16:11 bobkare joined #mojo
16:13 good_news_everyone joined #mojo
16:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/rtOd5g
16:13 good_news_everyone mojo/master 20691c9 Sebastian Riedel: added chunked multipart response test
16:13 good_news_everyone left #mojo
16:13 sri kongelaks: there you go :)
16:14 kongelaks sri: thanks. I'll be back here when I figure out this issue I'm having
16:18 sri kongelaks: the gzip code is still pretty new, perhaps it has something to do with that
16:21 dabudabu joined #mojo
16:35 alester joined #mojo
16:55 pravus joined #mojo
16:56 pravus I have a question about exceptions.  If I catch a Mojo::Exception object, is it acceptable to alter ->message() while keeping raw_message() intact so that I have both a 'nice' message and the original stack dump?
16:57 sri raw_message is deprecated and will disappear
16:58 yakudza joined #mojo
16:58 sri in fact, it's nothing more than an alias for message in the latest release
16:59 pravus Hrm.  I wonder who I might do what I want to do, then.
16:59 pravus how*
17:01 xaka joined #mojo
17:02 bluescreen joined #mojo
17:03 bluescreen_ joined #mojo
17:04 mire joined #mojo
17:06 labrown joined #mojo
17:15 pravus sri: Thanks for the info.
17:15 pravus left #mojo
17:15 bluescreen__ joined #mojo
17:21 inokenty joined #mojo
17:32 * sri wonders when chunked multipart actually happens
17:33 sri since you need to know the multipart boundary in advance, it's rather pointless for dynamic content
17:42 kongelaks sri: i'm requesting images from a web service and they come back in a multipart response
17:43 sri only good reason i can think of is gzip compression
17:43 sri like... they have the finished multipart response, and it goes through a reverse proxy that dynamically compresses it, which would then require chunked
17:44 batman joined #mojo
17:46 kongelaks it may be related to the spec that this server is attempting to adhere to
17:47 kongelaks if i request all images associated with an object (or multiple objects), they support individual image errors instead of parts
17:47 kongelaks err, they're actually XML errors and they come in their own part
17:48 kongelaks i'm thinking that the implementors of the service assume that they may encounter errors accessing certain images on their side
17:48 sri still, that can all be done with a Content-Length
17:49 sri you can only generate a boundary once you know all content
17:50 sri or you gamble with a random boundary and things break randomly
17:50 kongelaks i didn't know that... i thought it could be arbitrary
17:50 kongelaks heh, i'm betting they use a random boundary
17:50 sri what if the boundary string appears in one of the images or error messages? :)
17:51 kongelaks that wouldn't be the worst of the problems when dealing with these services
17:52 sri anyway, let me know if you manage to turn it into a test case, i like these kinds of bugs :)
17:53 kongelaks is there a way to create a raw http log file other than using MOJO_USERAGENT_DEBUG ?
17:53 sri there's a low level api on the connection
17:53 kongelaks k, i'll check it out
17:54 mire joined #mojo
17:54 sri https://github.com/kraih/mojo/blo​b/master/t/mojo/user_agent.t#L315
17:54 sri it's a build your own introspection layer api
17:55 kongelaks cool
18:02 davido joined #mojo
18:03 davido I didn't realize that Mojolicious was #2 rank in the metacpan.org "++" (favorite distributions) list: http://mapofcpan.org/#/sig​hts/favorites-leaderboard  Congrats!
18:03 sri \o/
18:04 sri of course the number of people participating is still way too low to be meaningful
18:06 davido Low, but they've got it right in many cases.  The leaderboard does a pretty good job of representing the "best of".
18:07 davido Sometimes I think there should be a "Boost" for Perl.
18:08 davido Not separate from CPAN, but somehow distinguishable from the rest thereof.
18:09 sri oooh, json pointer and json patch are now in working group last call, so almost an rfc \o/
18:13 xaka what the diff between pointer and path?
18:15 sri pointer has a real spec and addresses single values in the json structure
18:39 gryphon joined #mojo
19:33 mars joined #mojo
20:06 dabudabu joined #mojo
20:07 mire_ joined #mojo
20:14 perlite_ joined #mojo
21:16 dpetrov_ joined #mojo
21:28 dabudabu joined #mojo
21:28 mars joined #mojo
21:28 gryphon joined #mojo
21:28 batman joined #mojo
21:28 inokenty joined #mojo
21:28 bluescreen joined #mojo
21:28 alester joined #mojo
21:28 marty joined #mojo
21:28 knshaum joined #mojo
21:28 jayallen joined #mojo
21:28 Mike-PerlRecruiter_ joined #mojo
21:28 dbr joined #mojo
21:28 d4rkie joined #mojo
21:28 mikegrb joined #mojo
21:28 drift joined #mojo
21:28 sri joined #mojo
21:28 kwa joined #mojo
21:28 Britzel joined #mojo
21:28 rem_lex joined #mojo
21:28 noganex joined #mojo
21:28 dwierenga joined #mojo
21:28 jzawodn joined #mojo
21:28 baton8 joined #mojo
21:28 duncanthrax_work joined #mojo
21:28 Kulag joined #mojo
21:28 mtths joined #mojo
21:28 kongelaks joined #mojo
21:28 jberger joined #mojo
21:28 arthas joined #mojo
21:28 robinsmidsrod joined #mojo
21:28 nic joined #mojo
21:28 kvorg joined #mojo
21:28 jwang joined #mojo
21:28 njlg joined #mojo
21:28 dross joined #mojo
21:28 Caelum joined #mojo
21:28 crab joined #mojo
21:28 trone joined #mojo
21:28 SmokeMachine joined #mojo
21:28 janus joined #mojo
21:28 migo joined #mojo
21:28 charsbar__ joined #mojo
21:28 zivester joined #mojo
21:28 tempire joined #mojo
21:28 bc547 joined #mojo
21:28 JiYu joined #mojo
21:28 romel joined #mojo
21:28 rafl joined #mojo
21:28 ZadYree joined #mojo
21:28 omega joined #mojo
21:28 diegok joined #mojo
21:28 mike_ joined #mojo
21:28 rwstauner joined #mojo
21:28 andrefs joined #mojo
21:28 chansen joined #mojo
21:28 avenj joined #mojo
21:28 rhaen joined #mojo
21:28 tomi-ru joined #mojo
21:28 ashleydev joined #mojo
21:28 allison joined #mojo
21:28 HtbaaPi joined #mojo
21:28 kmx joined #mojo
21:28 tokuhirom joined #mojo
21:28 bjoernfan joined #mojo
21:28 Mikey joined #mojo
21:28 xxtjaxx_ joined #mojo
21:28 patspam joined #mojo
21:28 gabiruh joined #mojo
21:28 jmmills joined #mojo
22:04 lukep joined #mojo
22:20 xaka joined #mojo
22:47 yakudza joined #mojo
22:56 jzawodn joined #mojo
23:46 davido joined #mojo
23:47 Averna joined #mojo

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