Camelia, the Perl 6 bug

IRC log for #mojo, 2012-08-20

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

All times shown according to UTC.

Time Nick Message
01:00 xaka joined #mojo
01:01 laouji joined #mojo
01:03 scott joined #mojo
01:07 davido joined #mojo
01:18 garu sri: awesome! one quick question: is there a reason you did my ($self, $level) = (shift, shift)? I always thought @_ was faster
01:34 zhutingting joined #mojo
01:43 yko joined #mojo
01:47 zhutingting joined #mojo
01:58 d4rkie joined #mojo
02:09 arpadszasz joined #mojo
02:13 jeen joined #mojo
02:43 Averna joined #mojo
02:46 Averna1 joined #mojo
02:49 noganex_ joined #mojo
02:50 asarch joined #mojo
02:53 asarch joined #mojo
03:34 bird joined #mojo
03:35 arpadszasz joined #mojo
04:04 l3l1p joined #mojo
05:04 laouji joined #mojo
05:28 newbie joined #mojo
05:37 davido_ joined #mojo
06:00 davido_ joined #mojo
06:07 batman_ joined #mojo
06:22 dbr joined #mojo
06:24 tempire joined #mojo
06:28 maettu joined #mojo
06:55 yko joined #mojo
07:03 Vandal joined #mojo
07:07 taryk joined #mojo
07:11 batman_ joined #mojo
07:37 d4rkie joined #mojo
07:39 jeen joined #mojo
07:44 pau4o joined #mojo
07:54 vvv joined #mojo
07:57 vvv hello all
07:57 purl It's a crazy world, but hello to you too!
07:57 vvv haha .. damn'
07:57 vvv hello purl
07:58 maettu joined #mojo
07:58 vvv I think my morbo server is restarting every time I reach a mounted plugin route .. any idea why ?
08:03 maettu1 joined #mojo
08:09 davido_ joined #mojo
08:19 Psyche^ joined #mojo
08:20 jontaylor joined #mojo
08:27 fhelmber_ joined #mojo
08:34 baton8 joined #mojo
09:05 judofyr joined #mojo
09:10 sri garu: i need the level
09:15 sri passing along all lines as @_ should be faster than copying them to some array, but i guess it doesn't really matter
09:16 vvv hi, i want to initialize one var by getting the result of a function .. but i guess it isn't possible, isn't it ?
09:19 vvv well, not directly as a var of the controller in fact .. i should initialize it in some function
09:21 Foxcool joined #mojo
09:39 vvv my bad .. i got an error in my function .. i love perl for being so flexible
09:41 good_news_everyone joined #mojo
09:41 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xdreUQ
09:41 good_news_everyone [mojo/master] small optimizations - Sebastian Riedel
09:41 good_news_everyone left #mojo
09:42 marcus a dino ate my baby.
09:42 vvv haha
09:43 vvv i forgot about your baby !
10:00 maettu joined #mojo
10:02 sri "Please don't eat me! I have a wife and kids. Eat them!"
10:02 sri if there are no complaints, i think we'll have a release later today
10:03 judofyr joined #mojo
10:09 ilyuhan joined #mojo
10:10 ilyuhan Hello, how to get a reference to a PSGI app for the given Mojolicious(::Lite) app?
10:32 crab i haven't done a release for a while. i'll do this one.
10:37 marcus sounds good to me
10:37 * marcus is using a mac without ssd. it's horrible :(
10:44 maettu joined #mojo
10:54 jeen joined #mojo
10:59 Htbaa joined #mojo
11:03 good_news_everyone joined #mojo
11:03 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/T8e-zQ
11:03 good_news_everyone [mojo/master] fixed get command to allow ":" character in header values (closes #373) - Sebastian Riedel
11:03 good_news_everyone left #mojo
11:03 sri crab: we are not ready yet
11:06 sri crab: give it an hour, if there are no more commits i think we are good to go
11:08 sri lots of new features this time, event sequentialization should definitely be mentioned in the tweet :)
11:08 judofyr sequentialization ?
11:08 sri steps
11:09 sri guess i would announce it as new features for untangling callback spaghetti :)
11:11 crab sri: yes, i know. i was just saying i'll do it, whenever it's to be done.
11:12 sri crab++
11:15 Lucas1 joined #mojo
11:35 marcus purl: jerk it!
11:35 purl marcus: When you get irrational, I get stiff
11:37 crab purl is back? oh god why
11:43 marcus because we love her long time.
11:43 marcus :)
11:44 Lucas1 joined #mojo
11:51 * sri loves purl
12:00 jeen joined #mojo
12:07 arthas joined #mojo
12:13 sri crab: i guess the hour os over ;)
12:36 marcus btw, has there become more eval lately?
12:36 marcus stuff like "Subroutine on_parallol redefined at (eval 1753) line 2" is hard to grok.
12:39 good_news_everyone joined #mojo
12:39 good_news_everyone [mojo] amenonsen pushed 1 new commit to master: http://git.io/yfFb6Q
12:39 good_news_everyone [mojo/master] Bump VERSION after release - Abhijit Menon-Sen
12:39 good_news_everyone left #mojo
12:41 sri marcus: not that i'm aware of, if anything there should be less eval
12:42 marcus the root of all eval
12:45 spleenjack joined #mojo
12:55 jamesw joined #mojo
12:56 maettu joined #mojo
12:57 good_news_everyone joined #mojo
12:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/bpFcaA
12:57 good_news_everyone [mojo/master] use more JSON Pointers in examples - Sebastian Riedel
12:57 good_news_everyone left #mojo
13:04 sri marcus: the mojolicious bundle is finally in TM2!
13:04 sri \o/
13:04 atrodo joined #mojo
13:10 sri crab: you need to update your gravatar! https://metacpan.org/release/AMS/Mojolicious-3.32
13:10 * sri cracks the whip
13:11 marcus sri: yes, I noticed :) 6 months hard work paid of.
13:13 marcus sri: actually, that looks a lot like crab.
13:14 sri WHY NOT ZOIDBERG?
13:14 purl (V) (;,,;) (V)
13:14 marcus I was thinking that too :)
13:14 marcus http://i.qkme.me/352azq.jpg
13:15 sri -.-
13:15 marcus http://furry.1d4.us/_images/1c985bfa81e9eea​f4151435c55a0154f/26379%20-%20claws-crab-cr​eepy-crustacean-doctor_zoidberg-futurama-ma​le-nightmare_fuel-realistic-solo-starfish-t​entacles-unknown_artist-what-zoidberg.jpg
13:17 metys joined #mojo
13:17 maettu joined #mojo
13:24 arthas joined #mojo
13:25 crab i don't know how to do all this gravatar stuff.
13:26 metys how can I add custom namespace for Command(s) in my application? I know, I need to push my ns like: push @{ $c->namespace }, '...', but when I do this in script/myapp (...I replace "Mojolicious::Commands->start;" with "my $c = Mojolicious::Commands; push @{ $c->namespaces }, '...'; $c->start"), I don't see MyApp::Command(s) on list of available/callable commands? :-/
13:26 crab i asked an artist friend of mine to draw me a nice crab, but i didn't like the result.
13:26 sri 1) create account at http://en.gravatar.com 2) ??? 3) Profit!
13:27 andrefs joined #mojo
13:27 sri metys: do it in your app, you shouldn't touch the start script
13:30 maettu joined #mojo
13:35 metys sri: works, thx a lot
13:38 sri oh, another candidate for a Mojo::Base method... Mojo::Base->clone
13:39 sri could look like sub clone { Storable::dclone(shift) }
13:40 sri it might make some of our current clone methods obsolete
13:42 judofyr what about a shallow clone too?
13:43 sri right... i guess deep clone by default is a bit awkward... hmm
13:44 sri especially since most of our objects contain more objects
13:44 judofyr I guess you could have "our @CLONABLE = qw(foo bar)"
13:44 sri it would only work for trivial classes like Mojo::ByteStream
13:44 judofyr or something
13:45 sri not very elegant
13:45 sri guess it's like Mojo::Base->perl, fun in theory, but in practice not very useful
13:45 judofyr agree
13:45 judofyr what did ->perl do?
13:45 sri Data::Dumper the object
13:46 sri in perl6 you can $foo.perl every object and it will show you its perl data structure
13:47 sri here https://github.com/kraih/mojo/commit/d2​6a9d81d932a122eae33b0d01a201041355a231
13:47 sri it existed for a very short time
13:49 sri it's fun when it works, but you always have to think about if your data structure is actually an object and if it inherits from Mojo::Base...
13:50 metys but you always have to think about if your data structure is actually an object and if it inherits from Mojo::Base...
13:50 sri works a lot better in perl6 where everything is an object
13:50 metys sorry... mouse + irssi doesn't work well together ;-)
13:59 maettu joined #mojo
14:02 gryphon joined #mojo
14:11 judofyr_ joined #mojo
14:12 andrefs joined #mojo
14:13 arthas joined #mojo
14:17 fhelmber_ joined #mojo
14:25 l3l1p joined #mojo
14:27 maettu joined #mojo
14:31 marcus repeating what sri says for fun and profit :)
14:32 inokenty joined #mojo
14:32 judofyr_ sri: well, ->tap has the same problems
14:34 sri judofyr: not really, you don't ->tap() random data structures and objects
14:34 judofyr I could tap random objects; not strings/arrays though
14:34 sri while it is extremely common to do so with Data::Dumper
14:34 judofyr or, could want to tap*
14:34 judofyr but it's even worse with Data::Dumper
14:34 judofyr (I agree that)
14:35 vel joined #mojo
14:44 sri hope some autobox implementation makes it into Perl 5.18, so we can have it all :) https://metacpan.org/module/autobox
14:44 mikegrb that would be nice
14:45 mikegrb I had missed autodie's inclusion in 5.10.1 until recently
14:45 mikegrb still haven't gotten into the habit of using it regularly
14:46 sri problem with autodie is that it's so damn slow
14:46 mikegrb then again I still have to target 5.8 in a lot of my stuff :/
14:46 mikegrb yeah but my use case would be the 'throw away' quick scripts for doing random things
14:46 mikegrb making them even quicker to write
14:46 sri when i activate autodie in Mojo::Base the tests take twice as long
14:47 d4rkie joined #mojo
14:51 al what's the recommended way to deploy mojolicious with apache?
14:52 marcus al: PSGI
14:52 marcus or mod_proxy
14:52 purl mod_proxy is nice
14:53 inokenty al: https://github.com/kraih/m​ojo/wiki/Apache-deployment
14:53 al marcus, thanks. i saw mentioning of PSGI but i'm not sure what i need on the apache side
14:53 marcus http://mojolicio.us/perldoc/Mojolici​ous/Guides/Cookbook#Apachemod_proxy / http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#PSGIPlack
14:55 marcus al: http://search.cpan.org/~miyagawa/Plac​k-0.9959/lib/Plack/Handler/Apache2.pm is one way to deploy a plack app, if you prefer that.
14:55 marcus personally I like fastcgi - http://search.cpan.org/~miyagawa/Plac​k-0.9959/lib/Plack/Handler/Apache2.pm
14:55 al i'd much prefer (f(ast)?)cgi(d), too, but for some reason can't get it to work
14:56 al looks like my Mojo::Commands script always outputs the "usage" section to the apache/cgi daemon and only then follows up with the actual rendered page
14:57 marcus al: That second link was supposed to be http://search.cpan.org/~miyagawa/Pla​ck-0.9959/lib/Plack/Handler/FCGI.pm - fcgi driver for plack.
14:57 al marcus, the last url was the same as the one before
14:58 al ah, thanks
14:58 marcus yes, I just noticed.
15:00 al the current behavior with auto-detection is rather weird... i get the "Page not found... yet!" template from mojolicious with a 404 status code and right below that the 200 OK response headers along with the actual rendered page
15:00 sri what current behavior?
15:00 purl i guess current behavior is a workaround for invinite loops caused by exception handlers throwing exceptions.
15:00 al doesn't seem to matter which one of mod_cgi, mod_fcgid or mod_fastcgi i'm using
15:01 al sri, on the server i'm currently trying to deploy on
15:01 sri what auto-detection behavior is weird?
15:02 sri we have no fastcgi support in core at all, so i have no clue what you're talking about
15:03 al it seems debian has Mojo::Server::FastCGI packaged and sneaked that in
15:03 sri that is not maintained by us, and i believe still broken
15:04 al yea, uninstalled it now
15:19 al ok, there's something wrong with my app, probably the startup() method - http://hastebin.com/hesakuhola
15:19 al although standalone it's running just fine
15:20 Lucas1 joined #mojo
15:24 vel joined #mojo
15:30 Antisoche joined #mojo
15:44 newbie joined #mojo
15:47 labrown joined #mojo
16:04 maettu joined #mojo
16:16 dbr joined #mojo
16:17 batman_ joined #mojo
16:21 batman i think i've asked about this earlier, but how do you develop in st2 and run unittests?
16:21 vel joined #mojo
16:21 batman do you do that in a separate window?
16:26 al ah, dammit.. there was an "$app->start;" in my App.pm
16:26 al removed it, cgi works like a charm
16:30 espent joined #mojo
16:31 Leandr joined #mojo
16:32 bjoernfan joined #mojo
16:36 o_o joined #mojo
16:39 maettu left #mojo
16:56 njlg batman: I think sri et al use a seperate terminal window instead of the build system.
16:57 * sri doesn't even use ST2 anymore
16:57 njlg =(
16:57 * njlg weeps
16:58 batman ok
16:58 sri perltidy not working if a file contains unicode chars is a dealbreaker for me
16:59 njlg the perltidy plugin? hmm...
16:59 sri it seems to be an ST2 bug
16:59 batman perltidy is a dealbreaker :P
17:11 Lucas1 joined #mojo
18:00 mercutioviz joined #mojo
18:00 mercutioviz left #mojo
18:05 ilyuhan left #mojo
18:11 stephan48 joined #mojo
18:13 batman is there an example on how to use steps() in a controller? should i simply do $self->stash->{d} = $delay = Mojo::IOLoop->delay; to make sure it doesn't go out of scope?
18:13 sri see my last tweet
18:13 batman ok
18:13 batman thanks
18:14 mire joined #mojo
18:14 sri it doesn't go out of scope as long as there are still callbacks active it generated, it's rather neat that way
18:15 batman that is awesome!
18:21 batman but that example is for non-blocking apps? i still need to to ->wait if i'm running under psgi or something?
18:21 sri i suppose
18:22 sri you can always ->wait unless Mojo::IOLoop->is_running to make it portable
18:22 batman yup
18:22 batman i'm running under uwsgi @dotcloud
18:23 sri but for those realtime web features i don't particularly care about psgi, only causes headaches ;p
18:23 batman yeah, but what are my options?
18:23 sri pretty sure you can run the mojo daemon as a dotcloud worker
18:24 sri similar to how heroku does it
18:24 batman hm... wonder how that would work
18:24 batman need to look into that
18:24 sri long term all those req/res model abstraction layers like psgi/rack/wsgi are dead anyway
18:25 batman how come?
18:25 sri we'll all just be using custom web servers behind some cool routing layer
18:25 sri new end-to-end protocols
18:25 batman hm... ok
18:26 sri like websockets
18:26 fhelmber_ joined #mojo
18:26 batman right
18:26 sri node.js is setting the trend mostly
18:27 sri i love custom servers because their behavior is so predictable, it's just the raw protocol, nothing dumbed down to the lowest common denominator :)
18:28 sri if you do anything beyond plain req/res you're in for a world of hurt with psgi/rack/wsgi
18:29 sri even long polling is not portable with them
18:29 sri and that has been around for ages
18:29 batman i see
18:29 batman *brb*
18:30 sri http://docs.dotcloud.com/services/perl-worker/
18:31 sri there, it even says run your own custom server
18:35 fibo joined #mojo
18:38 batman cool
18:38 batman thanks
18:41 batman but don't i need to do render_later; either?
18:45 jeen joined #mojo
18:50 sri why does everybody ask that questio? -.-
18:50 sri n
18:51 batman maybe it's because i think i used to do so...
18:52 batman i'm starting to remember ->begin; now :)
18:57 good_news_everyone joined #mojo
18:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/9bgDUg
18:57 good_news_everyone [mojo/master] better render_later description - Sebastian Riedel
18:57 good_news_everyone left #mojo
18:57 sri that should make it more clear
18:57 batman so if there's no template, then it is not required?
18:57 sri yes
18:58 batman ok. then i need render_later i my cases
19:07 newbie calling render_later you can make your logs cleaner otherwise you'll see a lot of errors like "template not found", etc.
19:16 davido batman: If you get a dotCloud "worker" service set up acting as its own webserver and figure out how to make it horizontally scale with similar reliability to the standard Perl service let me know and I'll add it to my dotCloud discussion at LA PerlMongers on the 29th.
19:17 davido I haven't done it.  But I suspect that it
19:17 batman i won't  do horizontal scaling
19:17 davido Ok.  :) That's my only concern with using a worker service.
19:18 davido I think you would lose all of dC's load balancing and automatic failover.  I could be wrong though, and would like to know more about it.
19:19 batman i see
19:19 batman have you tweeted them?
19:19 davido I'll just send a message to one of their developers whom I've gotten acquainted with.
19:19 batman ok
19:23 davido done.  We'll see what comes of it.
19:35 sri davido: i'm almost certain you do not lose load balancing benefits
19:36 sri both heroku and dotcloud have a smart routing layer that can forward incoming connections to an infinite number of worker processes
19:36 sri think haproxy on steroids
19:46 jeen joined #mojo
19:53 davido joined #mojo
19:55 davido sri: Cool!
19:56 osprey_ joined #mojo
19:57 davido Hmm... ( http://stackoverflow.com/questions/12044003/r​edirect-the-request-from-before-dispatch-hook ) Why isn't he just using a bridge and eliminating the "before_dispatch" manipulation?
19:58 sri he's cross posting to the mailing list too, no answer from me then...
20:13 Britzel_ joined #mojo
20:13 nich0s joined #mojo
20:14 o_o joined #mojo
20:20 xaka joined #mojo
20:43 osprey_ hi
20:43 purl hola, osprey_.
20:44 osprey_ offtop, but can I import EXPORT_TAGS from module via Module::Load?
20:45 osprey_ or other ways to check perl module exists w/o crash
20:45 osprey_ load foo, ':all' <- fail
20:46 jeen joined #mojo
20:50 batman osprey_: but if it can't be loaded then the imported symbols won't exists and it will fail...
20:51 batman eval "require $module; 1" and print "yay! $module exists!";
20:52 batman ^ that only checks for modules on disk iirc
20:52 osprey_ yes, I want to eval first
20:52 batman i don't think you can get what you want.
20:52 batman but i'm just guessing what you want know, since i don't understand what you really wnat
20:53 batman *want
20:53 * batman needs to get some food
20:54 osprey_ but perldoc Module::Load say that I can do like this load CGI, ':standard'
20:55 osprey_ I steel can access to some array of my module via @Foo::someArr and build tags after loading
20:55 zpmorgan joined #mojo
20:57 batman weird
20:58 batman what is the error?
20:58 purl the error is KABOOM!
21:04 zpmorgan howdies, #mojo
21:04 zpmorgan is the filename recoverable from a file upload form?
21:06 batman zpmorgan: https://metacpan.org/module/Mojo::Upload#1
21:11 zpmorgan thanks, batman
21:44 rem_lex|pivo joined #mojo
21:47 jeen joined #mojo
21:50 batman Note that the first argument passed to the callback will be ignored <--- why?!
21:50 batman reading about begin()
21:51 sri to chop off the invocant of course
21:51 batman like $ua ?
21:51 sri yes
21:52 batman it breaks marcus' OAuth2 plugin
21:52 batman since it only returns the $token to callback
21:52 sri that is marcus problem :)
21:53 batman :(
21:53 sri i believe all callbacks in core get an invocant as first argument
21:53 batman it makes sense
21:54 sri anyway, if you have one without just work around it
21:54 sri my $cb = $delay->begin; ->whatever(sub { $cb->(undef, @_) })
21:54 batman on_success => sub { $delay->begin->(undef, @_) }
21:54 batman yeah
21:54 batman :)
21:55 sri no, you have to begin before the closure
21:55 batman to prevent memory leak?
21:55 sri to prevent it from not working
21:55 batman ok
21:57 perlite_ joined #mojo
22:08 lukep joined #mojo
22:32 Antisoche Hello - starting using Mojo and I'm a bit lost. How can I dump the entire stash from within my .ep file?
22:47 jeen joined #mojo
22:48 davido %= dumper stash
22:52 Antisoche davido: Thanks. I see what I was doing, kinda. I was using '%' instead of '%=' with the 'dumper', but I was also using "print" to try to generate HTML output.
22:52 * Antisoche has too many paradigms fighting in his head
22:53 davido It gets easier.  Just have to let go a little. ;)
22:57 sri the easiest way is % die;
22:57 sri ;p
23:09 ryozi joined #mojo
23:13 bluescreen joined #mojo
23:14 bluescreen hey I've a quick question. I'm trying to implement authentication via "bridges" basically I want some resources to be authenticated while others not. So I was able to do it but when auth fails returns a 404 error. Is there any way to return a proper 403 from within bridges?
23:22 xaka bluescreen: it depends on what you've coded, share few lines with us
23:23 bluescreen_ joined #mojo
23:27 bluescreen_ xaka, sure.
23:29 bluescreen_ my $r = $self->bridge->to(cb => sub { return 1 if int(rand()*10) < 6; $self->render(text=> "you're not allowed", status => 403); return; } )->get('/protected_resource')->to(cb => sub { ... });
23:30 bluescreen_ the int(rand()*10) < 6 it's just for the purpose of testing
23:30 bluescreen_ i'd like to get a 403 when the authentication fails
23:34 SmokeMachine joined #mojo
23:38 xaka bluescreen: your $self is wrong inside subroutine, you need to initiate it from passed arguments like my $self = shift()
23:38 xaka bluescreen: http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
23:39 bluescreen well yeah
23:39 bluescreen that's ok
23:39 bluescreen but still if "return undef" it will give 404 back to the customer
23:39 bluescreen by the way i forgot to copy the "my $self = shift;"
23:40 xaka do you see the text that you've passed to render?
23:41 bluescreen nop... I see mojo's default 404 page
23:41 bluescreen with all different routes
23:42 bluescreen and if int(rand()*100) is actually less than 6 i see the content generated by the resource's cb
23:48 jeen joined #mojo
23:56 bluescreen xaka, this is the actual code https://gist.github.com/3409425
23:57 bluescreen and I want to return 403 whenever auth fails
23:58 sri bluescreen: xaka actually already told you what's wrong
23:59 bluescreen what?
23:59 sri replace that one $self with shift and it works
23:59 bluescreen that's not the problem look at the gist i've just pasted
23:59 sri that is the problem
23:59 sri in the gist
23:59 xaka cb => sub { my $self = shift; ... }

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