Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-05

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

All times shown according to UTC.

Time Nick Message
00:11 Molaf__ joined #mojo
00:23 gatlin joined #mojo
01:08 hlin joined #mojo
01:17 basic61 joined #mojo
01:55 ryozi joined #mojo
02:08 marty I have not watched TV in years (decades) but I'm thinking about doing some on-demand viewing.   Any suggestion on a good sci-fi series to watch?
02:09 buu marty: stargate sg1, firefly..
02:09 buu Do they have to be current?
02:09 marty I've heard a lot about Buffy, sounds to weird to me. :0
02:09 marty No, old is fine
02:09 buu Buffy is great if you're a teenager
02:09 marty ya, I like the idea os stargate and I saw the movie
02:09 marty os=of
02:09 buu SG1 has like, 12 seasons, it will take you a while
02:10 marty ahhhh, that's what I am looking for.
02:10 buu Babylon 5?
02:10 buu DS9?
02:10 buu Jericho
02:11 marty What's your favorite?
02:11 buu Stargate, then babylon5
02:11 * marty is creating a spreadsheet.  :)
02:11 buu Firefly was decent but got canelled super early
02:11 marty Ok.   I put those at the top.   :0
02:11 buu marty: Arrow is pretty enjoyable if you want more comic book stuff
02:12 marty Hmmm, never heard of Arrow
02:12 buu It's uh, new tv series based on Green Arrow
02:12 duncanthrax joined #mojo
02:12 marty Thanks, buu.  I appreciate the help
02:12 buu I can't help with mojo but I sure can recommend tv
02:13 marty That makes two of us.  \o/
02:13 buu Farscape was supposed to be good
02:14 buu Oh yeah, the new doctor who is pretty solid
02:15 marty A new doctor who? kewl,I did'nt know.  I like the old one.
02:15 buu They resumed making it in like, 2004 or so?
02:15 buu And if you want something completely insane: lexx
02:16 * marty is googling lexx
02:18 buu Dresden Files and Blood Ties were pretty enjoyable if you don't mind some urban fantasy
02:24 marty I think I have about two years of popcorn time now.   :)
02:24 buu Yay popcorn
02:41 wepy joined #mojo
02:41 wepy hi
02:42 wepy what's the best way to make a link to something i want to work like /get/<some_number_here> ?
02:43 wepy the docs talk about doing things like get '/get/:id' => sub {} but.. how do I do that?
02:43 wepy also, how would i use link_to to make that happen?
02:44 wepy i'm tempted to do <% ... form a string... %> <%= link_to $string ..begin %>...
02:44 wepy but it seems wrong
02:50 wepy fek.
02:52 mattastrophe joined #mojo
03:22 noganex joined #mojo
04:09 mattastrophe joined #mojo
04:30 d4rkie joined #mojo
04:36 xaka joined #mojo
04:38 _xaka_ joined #mojo
07:07 Miked joined #mojo
07:31 Vandal joined #mojo
07:42 wircus if you like it, you gotta whip it! W
07:42 wircus Whip it real good!
08:18 heytrav joined #mojo
08:18 tempire Somethin' went wrong, so I whipped it.
08:25 ObseLeTe joined #mojo
08:26 sri marty: oh my, there is so much scifi for you to catch up!
08:31 sri firefly, futurama, farscape, battlestar galactica, doctor who, stargate sg1, stargate atlantis, stargate universe, star trek enterprise, terminator scc, v
08:32 sri and that's assuming you've seen the old star trek series and babylon 5
08:33 sri buu: how could you forget bsg!
08:34 tempire bsg is depressing
09:26 suy joined #mojo
09:30 dod joined #mojo
09:32 wircus \m/
09:35 dod joined #mojo
10:42 kitt_vl joined #mojo
11:10 ObseLeTe joined #mojo
11:12 sri \o\
11:12 sri /o/
11:12 sri tempire: it is not!
11:12 b2b joined #mojo
11:13 * b2b waves a casual hi
11:13 sri o/
11:14 b2b i had to jump in because no one mentioned Star Wars - Clone Wars
11:16 sri this is not the channel you're looking for
11:17 * sri gesticulates wildly
11:26 sri guess you have to be a jedi or something for that to work :(
11:26 ObseLeTe joined #mojo
11:49 * b2b feels a mild whoosh hours later - keep practicing Padawan SRI
12:00 mire_ joined #mojo
12:04 basic6 joined #mojo
12:41 Molaf_ joined #mojo
13:21 ObseLeTe joined #mojo
13:27 ladnaV joined #mojo
14:00 Vandal joined #mojo
14:33 Miked joined #mojo
14:57 asarch joined #mojo
15:04 ObseLeTe joined #mojo
15:15 Britzel_ joined #mojo
15:22 jbnewman joined #mojo
15:42 ObseLeTe joined #mojo
15:51 f joined #mojo
15:59 jberger I was surprised that it took that long to mention battlestar, great series!
16:00 jberger and if sri is gesticulating wildly, its because he has watched "The West Wing" and so should you
16:14 sri firefly and bsg were prolly my favorites
16:23 moody_bear joined #mojo
16:29 sri marty: forgot fringe and dark angel
16:30 * marty wakes up
16:30 sri marty: you should have given us a year to start with :)
16:31 marty Thanks, sri and all.   I appreciate all the feedback.   gunna do some previews of each and see what grabs me.  :)
16:31 marty I stopped watching TV around 90
16:31 sri :O
16:31 marty Network TV.  I still watched movies.
16:31 sri then you've not even seen babylon 5
16:31 marty cant deal with commercials
16:31 marty Nope
16:31 sri well... that changes everything!
16:32 marty I've seen the original star Trek and A little of the one with Patrick stewart
16:32 sri then you missed 3 star trek shows
16:32 basic6 i want to get the client's ip address from within an object (selfwritten class) which is instantiated in my app class. apparently i could get it from a controller method using something like $self->tx->remote_addr where self is the controller object
16:32 basic6 but self is my app object
16:32 sri ds9 and voyager are a must, enterprise not so much
16:33 * marty is adding ds9 and voyager to the list.
16:34 sri marty: you have to watch firefly, battlestar galactica, futurama, babylon 5, farscape, deep space 9, voyager and doctor who imo, rest is optional :)
16:36 sri oh my, you even missed x-files
16:37 marty wow,  that's quite list, sri.   :)    I think I should be able to have nighttime entertainment for some time.
16:38 sri a few years at least ;p
16:38 marty imo, the best thing to ever happen to network TV is on demand viewing without commercials.  It's actually quite enjoyable now.  :)
16:38 sri they stopped making good scifi the last few years though :(
16:39 marty what?  You seem to be forgetting Crocktopuss, the syfy classic.  :)
16:40 sri or piranhaconda!
16:40 marty classics in their own time
16:40 asarch joined #mojo
16:41 sri and sharktopus of course
16:41 marty Ahghh, sharktopus.  That's what I meant to say.   It's awesomeness got me all flustered.
16:44 ObseLeTe joined #mojo
17:08 dod joined #mojo
17:26 Foxcool joined #mojo
17:28 xaka joined #mojo
17:37 buu BSG seemed grim and depessing when I watched it =[
17:37 buu or depressing
17:45 vervain It was shadowy and quite the opposite of light-hearted but I wouldn't go as far as depressing myself.
17:45 vervain I really liked it, and have in fact watched it through three times.
17:46 vervain Star Trek Enterprise was the outlier for me.  When it first came out I didn't get through more than a few episodes, but I tried again a couple of years ago and loved it.
17:49 xaka joined #mojo
18:01 wircus hmmmm
18:01 wircus I really enjoyed BSG.
18:01 * sri likes scifi where the robots win :/
18:02 sri the soundtrack is pretty epic too http://www.youtube.com/watch?v=XQowmzzdRr8
18:06 b2b wow, that soundtrack is really nice. somehow, i never got into BSG. methinks i think i will reconsider
18:06 * wircus just booked a night at Hotel in Amsterdam for 17. january. Tiny boys-trip. o/
18:13 Vandal it's all very naive, boring and cliche shows, except firefly and futurama
18:15 buu ... what
18:19 Vandal yep
18:20 * sri sets Vandal on fire
18:21 Vandal truth hater!!!!
18:21 vervain Vandal must find life very hard.
18:21 Vandal O_o
18:21 Vandal why?
18:22 * sri misses firefly and babylon 5 the most
18:22 buu Andromeda!
18:22 buu I knew there was another one
18:22 sri boooo!
18:22 sri hercules in space!
18:23 buu Which is *awesome*
18:24 buu At the risk of taking this channel back on topic, I'm doing $self->plugin( tt_renderer ... ); in my App.pm, can I access this variable to temporarily change an option I'm passing to it?
18:24 sri well... if you want to go there... then there's also shows like smallville
18:25 buu Or more accurately, I'm using TT's wrapper argument and want to ignore it for a specific page
18:27 * buu prods sri
18:27 * sri prods buu back
18:28 rem_lex|pivo joined #mojo
18:29 buu No idea about accessing the plugin?
18:29 sri not a clue
18:38 buu Ok, I'll do it the hard way
18:45 buu sri: In the 'post processing content' page it uses this function: self->res->content->asset->slurp; is that the correct way to get the data that had previously been rendered by the handler?
18:45 tempire firefly always wins.
18:46 tempire ds9 is the best star trek
18:46 tempire but only after sisko shaves his head.
18:46 tempire that's when you know everything's about to go crazy.
18:46 sri buu: that depends on what the handler does, as you can see in the example there are many special cases
18:46 * tempire bewares the shaved head
18:48 buu sri: Right but the example is just returning if most of those special cases have happened right? I'm just trying to capture the output from a handler so I can post-process it, assuming it's not a file or a stream or whatever.
18:48 sri so what's the question exactly? that's what the example does
18:49 sri i've added that example so there would be no questions
18:50 sri do you want to know if there's an easier way to do post-processing?
18:50 * sri is a little confused
18:50 buu My question was basically that content->asset seemed like an odd way to access rendered content and I wanted to double check if that did what I thought it did
18:50 buu But it sounds like it is
18:50 buu So you've cleared my question
18:51 sri there are other shorter ways, but they would encourage you to ignore all the special cases
18:52 buu So uh, this is the best way to do it so I can handle the special cases?
18:52 sri that example is the official way to do it
18:53 buu ok.
18:53 sri if you want something nicer you're welcome to make a proposal
18:53 sri i've tried starting a discussion about it in the past, but nobody seemed interested
18:53 buu I'm fine with it, I just wanted to double check. I'm not used to thinking of an in-memory rendered template as an asset.
18:54 sri don't put too much meaning into it, "asset" was a pretty arbitrary choice
18:56 sri could just as well be called Mojo::Buffer
18:56 buu Heh, ok.
18:56 wircus Buffer the vampire slayer
18:57 sri i think it was called something silly like Mojo::File before :)
18:57 ObseLeTe joined #mojo
18:59 ObseLeTe joined #mojo
18:59 sri buu: you could just as well type $self->res->body, but you have the asset object from the previous checks anyway, so slurp is more efficient
19:01 sri if we wanted to make post-processing a simple task imo it would have to happen inside the renderer
19:02 buu That seems like it makes sense. My current problem is trying to get access to the $tt object create by tt_renderer
19:02 buu Which doesn't seem possible =[
19:03 sri i think my old proposal was app->renderer->filter(html => sub {...});
19:03 buu Maybe I should just be doing something lesss illy.
19:03 * sri has never used the tt renderer
19:04 sri perhaps even app->renderer->filter(sub { my ($renderer, $content, $format) = @_; ... });
19:05 sri maybe with $c mixed in, so you can do stuff like $self->render(gzip => 1);
19:06 sri app->renderer->filter(sub { my ($renderer, $c, $content_ref, $format) = @_; return unless delete $c->stash->{gzip}; ... });
19:33 sivoais joined #mojo
19:42 inokenty Is there a way to get app name in running app?
19:43 wircus inokenty: what are you looking for, exactly?
19:44 xaka i dont remember you name your app when it's started
19:44 inokenty wircus: $ENV{MOJO_APP}
19:46 wircus inokenty: if $ENV{MOJO_APP} is set, it's available in your app as well? The config plugin uses it for example.
19:47 sri don't ever depend on information from env vars
19:48 sri MOJO_APP is actually a candidate for removal
19:49 inokenty wircus: in startup action its okay, but after dispatch a route $ENV{MOJO_APP} is empty
19:49 davehorner joined #mojo
19:49 wircus Do not meddle in the affairs of env variables, for they are subtle and quick to anger?
19:49 inokenty sri: So I have to put app name to $app->defaults(app_name => 'name'); ?
19:49 sri what is an app name?
19:51 inokenty Main package name where I have 'startup' function
19:51 sri blessed($app)?
19:52 sri why the hell would you mess with fragile env vars?
19:53 inokenty sri: Thanks, it works!
19:53 sri :)
19:54 inokenty (just never used 'blessed' before)
19:54 sri ref($app) should work too
19:55 inokenty true )
20:02 good_news_everyone joined #mojo
20:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/MvIaVA
20:02 good_news_everyone mojo/master 3b7848d Sebastian Riedel: improved name detection in Mojolicious::Plugin::Config
20:02 good_news_everyone left #mojo
20:03 sri it's not even very useful
20:07 d4rkie joined #mojo
20:24 wircus sri^^ looks better. less magic.
20:27 good_news_everyone joined #mojo
20:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/rrnZQw
20:27 good_news_everyone mojo/master 2779ed6 Sebastian Riedel: deprecated Mojolicious::Commands->start in favor of Mojolicious::Commands->start_app
20:27 good_news_everyone left #mojo
20:27 sri bye bye MOJO_APP! \o/
20:29 sri MOJO_EXE is still a bit magical though
20:29 b2b nooooo
20:30 b2b well, i still have my config file, so RIP MOJO_APP
20:30 sri nothing should break
20:31 sri that stuff has surprisingly solid unit tests
20:31 sri hmmm
20:31 sri MOJO_EXE could be replaced with an attribute i suppose
20:31 sri like $app->executable
20:31 b2b thats good to know. thank goodness my app doesnt really depend on it.
20:32 b2b sorry sri, cant help with windows
20:32 wircus sri: what about all the generated scripts?
20:32 wircus sri: like script/foo
20:32 wircus they all call Mojolicious::Commands->start;
20:32 sri that has nothing to do with windows :D
20:33 sri wircus: we stopped doing that like a year ago
20:33 sri since then it's all start_app
20:33 * b2b feels a light bulb go ON over his head. Ah!
20:34 wircus sri: I have an app that was started in august that has it.
20:34 sri update your scripts then ;p
20:34 sri it's even less code afterwards
20:36 sri hmmmm, don't think we can get rid of MOJO_EXE though
20:37 wircus sri: I just worry it's a bit soon to deprecate it. Will affect end users (sysadmins) who have no idea how to fix this.
20:37 sri lite apps embedded in classes have special requirements....hmmm
20:38 sri wircus: i don't see how we could ever deprecate it then
20:38 sri if you're worried about warnings
20:39 wircus well, the next step after deprecating it is obviously removing it in the next major release :)
20:39 sri any deprecation will result in warnings admins can't fix though
20:39 wircus at which point we would get errors.
20:40 sri what makes this deprecation different than the $routes->namespace deprecation?
20:41 wircus sri: only that it affects code the developer didn't write.
20:41 sri you're thinking in catalyst terms
20:42 wircus how so?
20:42 sri our scripts are tiny and completely controlled by the developer
20:42 sri we explain how they work in the growing guide
20:42 sri it's no big blob or code nobody ever touches
20:42 wircus well, I've never needed to touch it :)
20:43 sri BUT YOU CAN! :)
20:43 wircus since it's so tiny.
20:43 wircus I suppose so
20:43 sri if it's really a problem i'm sure we can extend the deprecation period
20:43 wircus that would probably help
20:44 sri it has basically been deprecated silently for a year now ;)
20:44 sri no mention in documentation or generated code
20:46 sri wircus: actually, i highly recommend fresh scripts
20:46 sri the ones from a year ago contained a lot of garbage we don't need anymore
20:46 wircus Date:   Sun Jun 17 22:30:27 2012 +0200
20:46 wircus that's the import date of web_irc
20:46 sri they are much more tiny now
20:46 wircus I've updated my script for that project now. I've got several others that should be updated tho :)
20:48 wircus but yeah, the new script is much nicer.
20:48 wircus I actually think we did something similar for catalyst at some point as well.
20:48 sri a result of the FindBin hack
20:54 good_news_everyone joined #mojo
20:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ukF76Q
20:54 good_news_everyone mojo/master d6e4c19 Sebastian Riedel: better comment for generated scripts
20:54 good_news_everyone left #mojo
21:18 sri http://pastie.org/5628075 # here's a basic patch for renderer filters
21:18 sri thoughts?
21:21 sri in this form they would basically just be callbacks that run over the output of the renderer and get similar arguments to handlers
21:23 good_news_everyone joined #mojo
21:23 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/h39lAQ
21:23 good_news_everyone mojo/master c292e76 Sebastian Riedel: small optimization
21:23 good_news_everyone left #mojo
21:24 sri app->renderer->add_filter(sub { my ($renderer, $c, $output, $format) = @_; $$output = reverse $$output });
21:24 sri that would be a filter
21:24 sri scope could be adjusted with a $format check or $c->stash->{whatever} values
21:25 sri $self->render('foo/bar', reverse => 1)
21:30 basic6 what's the syntax for route groups in full (non-lite) mojolicious apps?
21:35 sri hmmmm, it could also be an after_render hook i guess
21:36 sri hook after_render => sub { my ($self, $output, $format) = @_; return unless $self->stash->{reverse}; $$output = reverse $$output };
21:37 vervain basic6: Look into nested routes and bridges in the routing guide.
21:37 inokenty basic6: http://blog.kraih.com/mojoli​cious-hack-of-the-day-groups
21:39 basic6 inokenty that code doesn't work in a non-lite app (string found where operator expected...), maybe it has to be modified but i don't know how
21:40 basic6 vervain thanks i'll check it out
21:41 inokenty basic6: You don't have to use it in non-lite app
21:43 inokenty basic6: use bridges and nested routes
21:43 sri hmm
21:44 sri http://pastie.org/5628173 # this would be a pretty simple solution
21:44 sri marcus, tempire, crab: thoughts?
21:46 basic6 inokenty thanks, that does the job
21:47 tempire I like the idea of renderer filters
21:47 Miked joined #mojo
21:48 tempire though
21:50 tempire I wonder if it's too much hidden magic, since it looks like a stash var
21:51 sri well, layout/extends and friends are also just stash vars
21:51 sri but yea, i guess it could be tricky if you pick too generic terms
21:51 sri on the other hand, there are no alternatives
21:55 tempire oh nevermind
21:55 tempire the reverse is arbitrary in the hook
21:55 * sri nods
21:55 tempire That's just fine
21:55 tempire +1 after_render
21:56 sri i wonder if the hook should be in Mojolicious::Controller->render of Mojolicious::Renderer->render
21:56 sri hmmm
21:57 sri hehe, cute, the documentation still refers to Mojo renderer
21:57 sri i guess that part has not been altered since 0.x :)
21:58 jbnewman joined #mojo
21:59 sri hmm, kind of would feel better if the hook was in Mojolicious::Controller, but i guess it's only a matter of time until we have hooks all over the place... Mojolicious::Routes comes to mind
22:02 tempire hook all the things
22:05 good_news_everyone joined #mojo
22:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/vSIbNg
22:05 good_news_everyone mojo/master 81479c3 Sebastian Riedel: documentation tweaks
22:05 good_news_everyone left #mojo
22:06 tempire is there a reason we differentiate between hooks and events?
22:06 sri yea
22:07 sri events happen in one object and hooks are central for multiple objects
22:07 sri it's just terminology
22:07 sri internally it's all the same
22:08 tempire seems like that might be something that would get people comfort with events
22:08 sri hooks can be emitted from anywhere in the framework, while events get emitted from the object that defines them
22:08 sri that sounds better
22:08 sri tempire: "that"?
22:09 tempire over time referring to hooks as app-level events
22:16 jnbek joined #mojo
22:18 good_news_everyone joined #mojo
22:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/9T1fRA
22:18 good_news_everyone mojo/master d43d095 Sebastian Riedel: more documentation tweaks
22:18 good_news_everyone left #mojo
22:19 sri hmm
22:19 sri one problem though
22:19 sri it's easy to cause deep recursion in a filter
22:19 sri if you call ->render again
22:19 sri we had the same problem with the before_render hook a year ago
22:21 sri i guess it's less of a problem for filters
22:21 sri especially if we encourage stuff like return unless delete $self->stash->{reverse}
22:26 tempire crab: you might want to remove your old mojolicious cpan dists.  they show up in search results.
22:42 sri oh noes
22:42 sri huge flaw in my design :(
22:43 sri we can't differentiate between full and partial templates in after_render
22:44 sri abort abort abort!
22:44 xaka i like the name "asynchronous pipeline" instead of hook. it's less confusing and better known for what current hooks are doing (http://blog.jcoglan.com/2010/08/09/evented-p​rogramming-patterns-asynchronous-pipelines/)
22:46 sri no filters for now
22:47 tempire xaka: asynchronous pipeline only makes sense to people who read those sort of blogs
22:47 tempire and hackernews
22:49 xaka tempire: actually if you google it, you'll find a lot of info, even wikipedia has the page for that. hook is confusing because you're not expecting it to provide "next" callback. it's like event, but has different name. imho
22:56 sri if you want to start term lawyering you better start with interceptor and chain of responsibility pattern
23:08 basic6 the docs say that setting the session cookie expiration to 0 may have security implications - which are those?
23:38 davehorner joined #mojo
23:41 vervain basic6: Basically the same reason your online banking sessions timeout after a while.
23:46 basic6 vervain is that because it increases the risk of session hijacking (which would be limited to one hour by default)?
23:47 jzawodn joined #mojo
23:47 vervain I don't really see it as session hijacking, just that you may not want just any given browser session to last forever.  e.g. what it the user was actually using a library computer and didn't log off.
23:48 basic6 in that case, the browser is never closed and therefore the next user is still in the old session...
23:49 basic6 makes sense

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