Camelia, the Perl 6 bug

IRC log for #mojo, 2013-06-15

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

All times shown according to UTC.

Time Nick Message
00:12 mire_ joined #mojo
00:18 dotan joined #mojo
01:45 tempire https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak​-ash3/1017071_10151632701939235_1290924587_n.jpg
01:45 tempire Whatever the last discussion was
01:45 tempire I won it.
01:55 sri :o
02:04 asarch joined #mojo
02:06 KindOne joined #mojo
02:56 KindTwo joined #mojo
03:24 KindOne joined #mojo
03:34 KindTwo joined #mojo
03:46 delias joined #mojo
03:52 KindTwo joined #mojo
03:56 KindOne joined #mojo
03:56 preflex_ joined #mojo
05:50 Britzel_ joined #mojo
05:51 mrphilov joined #mojo
05:55 d4rkie joined #mojo
06:00 abstract joined #mojo
06:09 sinkovsky joined #mojo
06:27 KindOne joined #mojo
06:30 Mike-PerlRecruiter_ joined #mojo
06:45 sinkovsky joined #mojo
07:13 delias joined #mojo
07:17 delias joined #mojo
07:21 delias joined #mojo
07:49 sinkovsky joined #mojo
07:54 Vandal joined #mojo
08:03 * nic jiffles to the right
08:05 abstract_ joined #mojo
08:08 jzawodn joined #mojo
08:18 KindTwo joined #mojo
08:22 KindOne joined #mojo
08:23 denisboyun_ joined #mojo
08:27 denisboyun___ joined #mojo
08:40 denisboyun_ joined #mojo
08:57 basiliscos1 joined #mojo
09:08 KindTwo joined #mojo
09:19 KindTwo joined #mojo
09:20 sinkovsky joined #mojo
09:21 KindOne joined #mojo
09:26 rihegher joined #mojo
09:27 berov joined #mojo
10:20 sinkovsky joined #mojo
10:36 rihegher left #mojo
10:41 kitt_vl joined #mojo
10:49 D4RK-PH0ENiX joined #mojo
11:15 sinkovsky joined #mojo
11:44 mrphilov joined #mojo
12:07 al joined #mojo
12:15 sinkovsky joined #mojo
12:45 asarch joined #mojo
13:07 mire__ joined #mojo
13:09 d4rkie joined #mojo
13:15 mire_ joined #mojo
13:15 sinkovsky joined #mojo
13:24 rem_lex| joined #mojo
14:15 sinkovsky joined #mojo
14:27 mrphilov joined #mojo
14:54 crab are Mojo::Util functions considered internal?
15:16 sinkovsky joined #mojo
15:26 preflex_ joined #mojo
15:53 sh4 joined #mojo
16:07 basiliscos joined #mojo
16:16 sinkovsky joined #mojo
16:22 bpmedley Greetings, sometimes I have the desire to save a request's state and run it from the command-line.  Either in the debugger or just running a simulated request repeatedly.  I wrote Mojolicious::Plugin::SaveRequest to help with this: http://metacpan.org/release/BPMEDLEY​/Mojolicious-Plugin-SaveRequest-0.04.  It creates scripts like this: https://gist.github.com/brianmed/5788624.  Comments?
16:22 Ultali joined #mojo
16:23 * Ulti is really enjoying the Heroku deploy command
16:23 Ulti thanks tempire
16:25 dod joined #mojo
16:33 dod joined #mojo
16:37 D4RK-PH0ENiX joined #mojo
16:48 basiliscos joined #mojo
16:57 berov1 joined #mojo
17:00 rem_lex|pivo joined #mojo
17:01 mire_ joined #mojo
17:02 rem_lex joined #mojo
17:09 mire__ joined #mojo
17:12 drift joined #mojo
17:14 btyler joined #mojo
17:16 sinkovsky joined #mojo
17:34 abstract joined #mojo
17:35 abstract joined #mojo
17:38 basiliscos joined #mojo
17:47 denisboyun joined #mojo
17:48 gryphon joined #mojo
17:48 basiliscos joined #mojo
17:53 denisboyun joined #mojo
18:01 basiliscos joined #mojo
18:02 Gedge joined #mojo
18:03 KindOne joined #mojo
18:10 d4rkie joined #mojo
18:21 Gedge joined #mojo
18:32 Mike-PerlRecruiter_ joined #mojo
18:32 sinkovsky joined #mojo
18:35 sh4 joined #mojo
18:36 sergeysinkovsky joined #mojo
18:46 cstamas hi
18:46 cstamas can mojo::json do some kind of pretty printing?
18:47 cstamas i would display it for the user (engineer) editing it
18:47 cstamas (i would let the user open a json structure and make changes to it)
18:52 marcus Hello world
18:54 jberger cstamas, Mojo::JSON does not do pretty printing
19:06 senthil joined #mojo
19:16 sri TIL about unspace in perl6 :o http://perlmonks.org/?node_id=1035391
19:29 jberger TIL `use Module 1` calls Module->VERSION(1) if &Module::VERSION exists
19:30 jberger (where 1 is a version number)
19:30 jberger I didn't know version importing was hackable
19:32 jberger the default handler dies if the version requested cannot be met, but this would allow for dying when the version requested is too low
19:33 jberger use MyModule 2; # die 'sorry this is MyModule version 3 which is not compatible with MyModule version 2'
19:33 sri it doesn't have to check if VERSION exists, there's UNIVERSAL::VERSION
19:35 jberger sri: yeah, I phrased that incorrectly
19:38 jberger I think we both learned while reading chromatic's post though right?
19:38 sri :)
19:38 jberger I was looking at the source for strictures
19:47 Kulag joined #mojo
19:56 bpmedley Greetings, sometimes I have the desire to save a request's state and run it from the command-line.  Either in the debugger or just running a simulated request repeatedly.  I wrote Mojolicious::Plugin::SaveRequest to help with this: http://metacpan.org/release/BPMEDLEY​/Mojolicious-Plugin-SaveRequest-0.04.  It creates scripts like this: https://gist.github.com/brianmed/5788624.  Comments?
20:00 trone joined #mojo
20:05 basic6 joined #mojo
20:09 senthil joined #mojo
20:12 senthil joined #mojo
20:23 nic sri: You might already know, but in the Cookbook, Backend Web Services, the Twitter example no longer works
20:23 nic (due to Twitter policy)
20:26 bluescreen joined #mojo
20:29 sri damn
20:31 rem_lex|pivo joined #mojo
20:50 rem_lex| joined #mojo
21:01 nic If that example can be saved (by using a different service) it would be nice to add ->render_later
21:02 nic jberger: Did you say that you were maintaining all the examples as executable scripts?
21:03 nic I'm just wondering if any others need modernisalising
21:04 jberger nic: ?
21:04 jberger that's a worthy goal, but I don't think its me
21:05 nic maybe you just mentioned it as an aim or idea
21:09 nic ah, I see Joel suggested using openlibrary.org, so maybe now's the time
21:11 avenj plu: stumbled across your github-meets-cpan.com -- very cool!
21:28 cstamas jberger: i realized that pretty printing (formatting only) is possible with javascript
21:35 rem_lex|pivo joined #mojo
21:38 good_news_everyone joined #mojo
21:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/WXCQnw
21:38 good_news_everyone mojo/master 78f1e0b Sebastian Riedel: replaced Twitter with MetaCPAN in examples
21:38 good_news_everyone left #mojo
21:38 sri that should be more reliable
21:39 sri i suppose reddit is also not such a reliable example
21:43 xaka joined #mojo
21:45 pavelpat joined #mojo
21:45 pavelpat Hello all!
21:45 pavelpat How to flush data from controller?
21:46 preaction or, how do you send partial response while waiting for the rest of the response to complete?
21:48 pavelpat i have slow operations in controller, and want sendstatus of operations to user
21:49 pavelpat like.. page is loading and user see: (1 generating data), after some time (1..., 2 sorting data)
21:52 good_news_everyone joined #mojo
21:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/x0JTJA
21:52 good_news_everyone mojo/master ac9b0b2 Sebastian Riedel: more reliable examples for Mojo::UserAgent
21:52 good_news_everyone left #mojo
21:52 sri i liked twitter as an example... too bad the api is going down the drain
21:53 preaction pavelpat, http://mojolicio.us/perldoc/Mojolicious/G​uides/Rendering#Chunked_transfer_encoding <- it looks like this is what you want, or at least one way of doing what you want
21:53 Patterner joined #mojo
21:54 preaction jberger, why isn't galileo on this page? https://github.com/kraih/moj​o/wiki/Example-applications
21:58 nic http://mojolicio.us/perldoc/Mojo::IOLoop#delay
21:58 nic "my $delay" appears twice
21:58 nic sri: Is that because they're separate examples?
21:59 good_news_everyone joined #mojo
21:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/g5xj0w
21:59 good_news_everyone mojo/master e2aaff2 Sebastian Riedel: more detailed streaming recipes
21:59 good_news_everyone left #mojo
21:59 nic The BOOM example is really nice and clear by itself, but needs the $delay->wait line
21:59 nic that tiny example makes a hell of a lot instantly understandable
22:02 good_news_everyone joined #mojo
22:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/DTKi9g
22:02 good_news_everyone mojo/master e28d1fe Sebastian Riedel: more consistent delay examples
22:02 good_news_everyone left #mojo
22:02 nic What also helped me was guessing why it broke if the ->begin was moved outside the loop
22:02 nic It's a great example
22:03 sri pavelpat: what preaction said
22:03 sri nic: agree
22:07 arthas joined #mojo
22:24 sinkovsky joined #mojo
22:41 bluescreen_ joined #mojo
22:44 good_news_everyone joined #mojo
22:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/pOcN-Q
22:44 good_news_everyone mojo/master 0391693 Sebastian Riedel: fixed typo in streaming recipe
22:44 good_news_everyone left #mojo
23:09 kwak joined #mojo
23:11 kwak Ah, work me is still connected. :) What's the suggested way to trap errors nowadays? I've read the mojo groups where they suggested overriding render_exception, but that doesn't seem to work.
23:19 kwak This is driving me nuts. Thought it would be simple to refactor my code so errors raised in my DBIx::Class resultset methods could be trapped and handled pretty easily. I'm missing something, but don't know what. :)
23:27 sri you might be mixing up exception handling with flow control
23:27 sri render_exception is a measure of last resort, not a way to handle exceptions gracefully
23:28 * sri has no clue if  or how something like that would be possible
23:30 kwak sri: hmm, I think you mentioned the same thing when I was adding authentication to my controllers.
23:32 Liam`` joined #mojo
23:32 kwak I have to pass a reference to a mojolicious object to my resultsets to handle things 'gracefully', but I didn't like the idea of passing the object as they should be independent.
23:33 sri i vaguely remember that render_exception hacks were possible somewhen around 2.0 or so... but we got rid of that... it was a horrible mess
23:33 sri if that's what you found in google groups
23:34 kwak I've separated my tests so that I test the model directly, and through Test::Mojo, and I liked that separation.
23:34 kwak Yeah, that's what I found.
23:34 kwak Other people are suggesting the sledgehammer approach of using a hook.
23:38 kwak Can't quite see how I can approach this from another angle. I'm already having to trap exceptions in the DBIC methods for things like missing fields. dieing seems like the most logical approach in this instance.
23:38 kwak I'll at least stop trying to get the render_exception hack to work. :)
23:44 kwak "Default exception handling with "render_exception" in Mojolicious::Controller is the first hook in the chain" - 'Default exception handling' kind of implies that there are other ways of handling exceptions?
23:47 kwak sri: I know you mostly have no opinion on the smaller matters, but how would you handle exceptions in something like DBIC. Say, where you didn't check the uniqueness of a uniquely indexed row? Or a plugin that raises its own exception class? :/
23:52 marty_ joined #mojo
23:54 kwak Hmm, it's generally for when I'm doing DBIC actions. So I think I will write a plugin which adds something like dbic_eval and traps and handles exceptions specific to dbic.
23:54 tba kwak: if you know you'll be running queries you expect to fail, why not try/catch or eval them?
23:56 kwak tba: I perform queries all over the place. The controller would then become lots of little try/catches.
23:56 tba kwak: shouldn't the queries be inside a model, not in the controller?
23:57 kwak I was hoping to factor it out so any specific exceptions could be caught and handled gracefully.
23:57 tba caught where? if you don't catch them in your controller, where would you want to catch them?
23:58 kwak tba: Yip, and they are. I've added an add method to DBIC resultsets. So I call $self->db->resultset('Greeting')->add({ ... });
23:59 kwak Well, caught in something like what was posted in the mojo groups (render_exception).
23:59 tba what are you trying to acheive though?

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