Camelia, the Perl 6 bug

IRC log for #mojo, 2012-11-20

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

All times shown according to UTC.

Time Nick Message
00:19 sinkovsky joined #mojo
00:41 kitt_vl joined #mojo
00:56 mire__ joined #mojo
01:02 sri don't do this, putting multiple changes into a single pull requests lowers the chance of it getting merged to pretty much zero https://github.com/kraih/mojo/pull/414
01:07 good_news_everyone joined #mojo
01:07 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OmQQpw
01:07 good_news_everyone mojo/master 5661a84 Sebastian Riedel: better range tests
01:07 good_news_everyone left #mojo
01:10 hlin joined #mojo
01:17 Mike-PerlRecruiter_ joined #mojo
01:20 laouji joined #mojo
02:12 good_news_everyone joined #mojo
02:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/MAR-1w
02:12 good_news_everyone mojo/master 6c03571 Sebastian Riedel: fixed keep alive bug in Mojo::Server::Daemon
02:12 good_news_everyone left #mojo
02:12 memowe_ joined #mojo
02:33 d4rkie joined #mojo
02:33 good_news_everyone joined #mojo
02:33 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/MJD8TA
02:33 good_news_everyone mojo/master 68d81d6 Sebastian Riedel: more range tests
02:33 good_news_everyone left #mojo
02:47 michaelfung joined #mojo
02:54 xaka joined #mojo
02:57 michaelfung left #mojo
02:57 michaelfung joined #mojo
02:58 atz joined #mojo
03:02 michaelfung joined #mojo
03:02 * atz greets all
03:03 heytrav joined #mojo
03:03 michaelfung Morning!
03:04 atz i'm curious what the proper mojo way is to enable gzip encoding on a streaming (HTTP) response... any ideas?
03:05 sri we only do gzip decoding automatically
03:05 atz yeah, that's what i'm seeing
03:06 sri i mean, there is nothing to turn on
03:06 atz right, gzip happens for free via the data => template => render pattern
03:08 atz but that is a single string-to-string transformation.  encoding a streaming response would require a different implementation.
03:08 sri we provide none
03:09 atz that's cool, i'll probably setup a nginx proxy to provide it in the short term...
03:10 michaelfung Quick question about a sample code in the doc about hooks:
03:10 michaelfung $self->res->headers->cache_control('max-age=3600, must-revalidate')
03:10 michaelfung if $self->res->code;
03:10 sri please do not paste into the channel
03:11 michaelfung Sorry!
03:11 michaelfung Why $self->res->code indicates static content?
03:12 atz michaelfung: without a proper code, the response is unfinished, malformed, etc.
03:13 heytrav joined #mojo
03:13 michaelfung atz: but why it is used to distinguish static content? I cannot find that in the module doc.
03:15 atz not really sure
03:16 atz this example uses other means: http://toroid.org/ams/etc/m​ojolicious-static-resources
03:17 michaelfung My bad, now I see. I overlooked the "after_static_dispatch => sub {" line. Please ignore my stupid question.
03:18 crab it's not a stupid question
03:18 heytrav_ joined #mojo
03:18 crab note that the after_static_dispatch hook ALWAYS fires, and the self->res->code check is not always sufficient.
03:19 crab that mojolicious-static-resources thing explains what to do.
03:19 crab (i.e. don't imagine that after_static_dispatch is called only when the dispatch is static)
03:19 sri crab: when is it not sufficient?
03:21 crab read the article :-)
03:22 noganex joined #mojo
03:22 crab but it's not "not sufficient" in the way you're thinking.
03:22 crab i.e. that's not what i meant.
03:22 sri ah, ok
03:22 crab just that there are other things to consider also.
03:23 sri was starting to wonder why you've not fixed the bug yet if there was one :)
03:32 michaelfung strange, with http://pastebin.com/smmBFPGY, $self->render_static('default.html') does not output 'max-age=3600, must-revalidate', any idea?
03:34 michaelfung Now, remove the condition "if $self->res->code", it gives 'max-age=3600, must-revalidate'.
03:35 crab render_static is not a response from the static dispatcher
03:36 crab so the response code hasn't been generated when the after_static_dispatch hook is called
03:36 crab did you actually read my article, or are you just trying things randomly?
03:37 michaelfung I am studying mojo, and have reached the hook part, so I learn by trying out the code in the doc.
03:38 crab ok.
03:39 Miked joined #mojo
03:40 michaelfung crab: it think it is normal for a newbie to think render_static will trigger the after_static_dispatch hook.
03:41 michaelfung crab: and actually it did. But the condition res->code is not met.
03:41 sri http://mojolicio.us/perldoc/Mojolicious#hook "Emitted in reverse order after the static dispatcher determined if a static file should be served and before the router starts its work."
03:42 sri why would you think something that runs after the router would trigger it?
03:43 michaelfung sri: frankly, I don't understand the sentence: "Emitted in reverse order after the static dispatcher determined if a static file should be served and before the router starts its work."
03:44 michaelfung sri: it would be great if there was a flow diagram.
03:48 sri then that's the real issue
03:48 sri you're welcome to draw one and add it to the wiki :)
03:49 michaelfung I think I'll do it if I finalized to use mojo my project. :)
03:51 sri michaelfung: you've not built anything with mojolicious yet?
03:52 michaelfung sri: not yet, still studying. I come from php + MySQL.
03:52 sri hmmm...that's not good, hooks are supposed to be a rather advanced feature you learn later on
03:52 sri mostly used in plugins, not apps
03:53 michaelfung sri: thanks for your hint!
03:53 sri perhaps a complete hook redesign should be added to the 4.0 todo list
04:19 atz related question: can mojo provide compression on websocket responses?
04:20 good_news_everyone joined #mojo
04:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/eFz3gA
04:20 good_news_everyone mojo/master 6804499 Sebastian Riedel: do not allow range requests for empty files
04:20 good_news_everyone left #mojo
04:21 atz websocket+gzip currently in IETF draft: http://tools.ietf.org/html/draft-tyo​shino-hybi-permessage-compression-00
04:22 sri i know, draft for months
04:23 atz yeah, was supposed to have produced some progress by now... haven't seen any though
04:24 sri at this point i'm not really interested anymore, it would just be nice to finally be able to use websockets in real apps
04:27 good_news_everyone joined #mojo
04:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ECxdKw
04:27 good_news_everyone mojo/master d1f476b Sebastian Riedel: test tweaks
04:27 good_news_everyone left #mojo
04:28 Britzel_ How do I set multiple cookies? One with secure flag on, the other off.
04:29 Foxcool joined #mojo
04:38 jayallen joined #mojo
05:08 good_news_everyone joined #mojo
05:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/T_y9-A
05:08 good_news_everyone mojo/master 77c38c0 Sebastian Riedel: better range handling (closes #414)
05:08 good_news_everyone left #mojo
05:24 ver joined #mojo
05:31 sri crab: perhaps all that messing around with $res->code should be replaced with something better
05:32 sri we already have $c->stash->{'mojo.static'}
05:32 sri some kind of public test for it might be a good solution
05:32 * sri just doesn't want to add more methods to Mojolicious::Controller
05:34 Vandal joined #mojo
05:34 sri maybe a default helper... can't think of a name though :S
05:34 sri is_static seems like an odd name for a helper
06:01 jayallen joined #mojo
06:17 Britzel_ 'is_rendered' maybe?
06:25 marcus joined #mojo
06:38 Molaf joined #mojo
06:44 spleenjack joined #mojo
06:47 dpetrov_ joined #mojo
07:33 sunson joined #mojo
07:35 sunson can #mojo be used to find Mojolicious freelancers?
07:35 sunson or is there a more relevant place on the interwires?
07:35 andrefs joined #mojo
07:38 dod joined #mojo
07:39 andrefs joined #mojo
07:42 dpetrov_ I dont see any problem why not... but probably the maintainers or people that are more active in the channel should share their opinion
07:42 dpetrov_ sunson: you can check probably also at odesk?
07:46 andrefs joined #mojo
07:52 yakudza joined #mojo
07:57 egopro joined #mojo
08:02 andrefs joined #mojo
08:18 batman joined #mojo
08:23 andrefs joined #mojo
08:35 andrefs joined #mojo
08:36 marcus sunson: I also recommend posting on jobs.perl.org
08:36 marcus but asking here can't hurt imo.
08:37 marcus sunson: we provide consulting services on Molicious btw ;) http://nordaaker.com/
08:43 andrefs joined #mojo
09:08 fhelmber_ joined #mojo
09:15 cosmincx joined #mojo
09:21 sunson marcus: thanks!
09:23 * marcus really shouldn't be ircing before morning coffee - http://www.urbandictionary.c​om/define.php?term=molicious
09:24 sunson Looking for a kick ass free lancer who can help build an elegant, stateless, simple MVP. It starts with this: https://www.elance.com/j/mojolicious-web-ser​vice-control-amazon-ec2-instances/35348058/
09:35 sunson thanks, marcus. Posted on perl jobs board too - http://jobs.perl.org/job/16728
09:35 marcus sunson: 404
09:36 sunson marcus: well, yeah, by the time google picks up from the irc-logs-of-this-channel it will not be a 404 ;)
09:41 nicomen win 24
09:45 Britzel joined #mojo
09:46 cosmincx joined #mojo
10:29 dotan joined #mojo
10:31 * nic resolves
10:41 dod joined #mojo
10:41 egopro joined #mojo
10:48 andrefs joined #mojo
11:04 mire__ joined #mojo
11:31 dod joined #mojo
12:28 kitt_vl joined #mojo
12:30 sunson joined #mojo
12:52 Antisoche joined #mojo
13:00 good_news_everyone joined #mojo
13:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/A5qRiw
13:00 good_news_everyone mojo/master 4aa1082 Sebastian Riedel: better range support
13:00 good_news_everyone left #mojo
13:15 Mike-PerlRecruiter_ joined #mojo
13:18 wmarcus joined #mojo
13:18 wmarcus joined #mojo
13:19 wmarcus joined #mojo
13:32 ObseLeTe joined #mojo
13:46 inokenty joined #mojo
13:54 mire__ joined #mojo
13:57 ObseLeTe joined #mojo
13:58 ObseLeTe joined #mojo
14:03 wmarcus joined #mojo
14:04 wmarcus joined #mojo
14:10 bluescreen joined #mojo
14:20 mattastrophe joined #mojo
14:23 ladnaV joined #mojo
14:40 mattastrophe joined #mojo
14:55 memowe O HAI :)
14:56 sri o/
14:58 d4rkie joined #mojo
15:26 Vandal joined #mojo
15:29 augensalat Uploads seem to be stored completely in memory, when app is run under plackup. Is that an intended behaviour? Is it documented somewhere?
15:40 augensalat in case somebody wants to try: http://pastebin.com/hGAqCnVN
15:45 augensalat this one does not require Devel::Size: http://pastebin.com/HsYigLDg
15:46 lammel2 joined #mojo
15:47 marcus augensalat: there should be a size restriction that makes it write to disk.
15:51 augensalat No, under plackup $c->req->{buffer} is not drained until the whole file is uploaded, because $c->req->{state} eq 'cgi'.
15:51 augensalat https://metacpan.org/source/SRI/Mojol​icious-3.58/lib/Mojo/Message.pm#L220
16:03 marcus augensalat: joy
16:06 mire__ joined #mojo
16:06 marty joined #mojo
16:09 augensalat marcus: There you go
16:16 good_news_everyone joined #mojo
16:16 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Vw5JZw
16:16 good_news_everyone mojo/master 0fd8176 Sebastian Riedel: a few more CGI tests
16:16 good_news_everyone left #mojo
16:16 * sri calls bullshit
16:18 marcus sri: damn you, ruining a good discussion with facts!
16:19 good_news_everyone joined #mojo
16:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/l1fLPg
16:19 good_news_everyone mojo/master 208dd89 Sebastian Riedel: another CGI test
16:19 good_news_everyone left #mojo
16:29 * sri is listening to the firefly soundtrack o/
16:32 tempire no free lancers here.  only regular lances.
16:32 tempire http://img2.timeinc.net/people/i/20​08/gallery/dwts2/lance_bass300.jpg
16:45 cosmincx joined #mojo
16:49 SmokeMachine joined #mojo
16:53 sri i can confirm however that there's a CGI leak
17:02 Vandal joined #mojo
17:05 xaka joined #mojo
17:12 good_news_everyone joined #mojo
17:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Q3p-Rg
17:12 good_news_everyone mojo/master 6c84566 Sebastian Riedel: fixed memory leak in Mojo::Message::Request
17:12 good_news_everyone left #mojo
17:12 sri that should fix it
17:13 dod joined #mojo
17:13 rem_lex|pivo joined #mojo
17:13 sri i guess this one deserves a quick bugfix release, if anyone feels like releasing :)
17:14 rem_lex joined #mojo
17:18 rem_lex| joined #mojo
17:23 sinkovsky joined #mojo
17:23 batman joined #mojo
17:30 dod joined #mojo
17:31 good_news_everyone joined #mojo
17:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/J1nPNw
17:31 good_news_everyone mojo/master 6313575 Sebastian Riedel: small optimizations
17:31 good_news_everyone left #mojo
17:34 labrown joined #mojo
18:14 jnbek^dt joined #mojo
18:19 vel joined #mojo
18:43 sh4 joined #mojo
19:19 marty joined #mojo
19:24 sinkovsky joined #mojo
19:31 marty joined #mojo
19:33 memowe_ joined #mojo
19:46 drift joined #mojo
19:48 sri hmm, looks like i have to release :S
19:53 augensalat Now that the upload bug has been fix, I would like to put my actual question:
19:53 augensalat How to I store a big upload, when the destination is not in the filesystem? That means move_to() is not applicable.
19:53 augensalat And slurp() puts everything back into RAM.
19:55 memowe joined #mojo
19:56 augensalat I also noticed get_chunk(), which is not very elegant to use and does seek() on each call.
19:57 drift joined #mojo
20:07 augensalat So how about a method in Mojo::Asset::(File|Memory), that takes a callback code reference, which is called chunk by chunk?
20:07 augensalat I.e. http://pastebin.com/PyJDDcek
20:12 sinkovsky joined #mojo
20:16 sergeysinkovsky joined #mojo
20:18 sh4|2 joined #mojo
20:26 Adura joined #mojo
20:33 lukep joined #mojo
20:34 perlite joined #mojo
20:48 bluescreen joined #mojo
20:53 rem_lex joined #mojo
21:08 Averna joined #mojo
21:17 xaka joined #mojo
21:28 bobkare joined #mojo
21:41 sinkovsky joined #mojo
21:50 _xaka_ joined #mojo
21:53 SmokeMachine joined #mojo
21:57 rem_lex joined #mojo
22:24 dabudabu joined #mojo
22:27 omani joined #mojo
22:28 omani hi I'm new to mojo
22:28 omani even to perl :)
22:30 omani but I already built my first hello world website from scratch
22:32 niczero joined #mojo
22:33 niczero that is great news omani
22:37 sri \o/
22:40 xaka joined #mojo
22:40 sinkovsky joined #mojo
22:44 bluescreen joined #mojo
22:46 xaka joined #mojo
22:48 njlg joined #mojo
22:48 omani # /bar
22:48 omani get '/bar' => sub {
22:48 omani my $self = shift;
22:48 omani $self->render(text => 'Hi!')
22:48 omani sorry
22:49 omani what's the "=> 'bar';" for at the end?
22:49 omani http://pastebin.ca/2253582
22:50 omani I already render in "$self->render(text..." so why passing to a template? is it a template I pass on with "=> 'bar'"?
22:54 bluescreen joined #mojo
22:59 sinkovsky joined #mojo
23:02 jzawodn joined #mojo
23:11 marcus omani: it's the action name.
23:11 marcus omani: if you didn't render anything it would use it for the template name, and you can use it for uri_for to link to the action.
23:29 omani ok I need to read through http://mojolicio.us/perldoc​/Mojolicious/Guides/Routing to understand this
23:31 marcus omani: good idea!
23:40 omani ok
23:40 omani so the controller is just a namespace
23:40 omani a package
23:41 omani and the action is just a method in this package
23:41 omani ?
23:42 omani $r->route('/welcome')->to(controller => 'foo', action => 'welcome'); would tell me, that there is a package called MyApp::Foo and a method within that namespace named "welcome"?
23:48 drift joined #mojo
23:53 omani but what is   $r->route('/welcome')->to('foo#welcome', namespace => 'MyApp::Foo');  then?
23:54 sri MyApp::Foo::Foo
23:57 omani ok so both can be used
23:58 omani which is the recommended way?

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