Camelia, the Perl 6 bug

IRC log for #mojo, 2013-03-01

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

All times shown according to UTC.

Time Nick Message
00:13 Gedge_ joined #mojo
00:30 shmuel joined #mojo
00:40 KindOne joined #mojo
01:12 freman *sigh* this date time change thing is still hurting me
01:14 ka2u joined #mojo
01:17 egopro joined #mojo
01:22 hlin joined #mojo
01:41 Caelum Kovensky: yah
01:41 Caelum Kovensky: it does a shitload of mysql queries
01:43 d4rkie joined #mojo
01:44 d4rkie joined #mojo
01:48 mattastrophe joined #mojo
02:22 egopro joined #mojo
02:33 Caelum how do I get the server url
02:42 Caelum $c->req->url->base should work
02:53 anewkirk ?
02:53 anewkirk do you mean the host name?
02:55 anewkirk $c->req->url is a https://metacpan.org/module/Mojo::URL
03:01 duncanthrax joined #mojo
03:05 gryphon joined #mojo
03:36 Gedge joined #mojo
03:46 good_news_everyone joined #mojo
03:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/shHsoA
03:46 good_news_everyone mojo/master 1db1d85 Sebastian Riedel: do not include MYMETA files in tarballs
03:46 good_news_everyone left #mojo
04:34 mauke_ joined #mojo
04:35 preflex_ joined #mojo
05:03 jberger joined #mojo
05:09 ka2u joined #mojo
05:16 jberger o/
05:16 jberger why get rid of format detection? what's wrong with it?
05:17 ka2u joined #mojo
05:18 jberger well we can discuss tomorrow, I just caught up after giving the talk
05:18 jberger it went well, people seem interested
05:19 jberger I wish there were more people there, but Chicago.pm is still getting its feet under it again
05:19 jberger nite all
05:19 jberger o/
05:20 anewkirk format detection?
05:32 ka2u_ joined #mojo
05:36 Achilles14 joined #mojo
06:16 tempire what would be the reasoning for getting rid of it?
06:16 * tempire is so happy to have a stable bouncer again
06:27 Britzel_ joined #mojo
06:36 spleenjack joined #mojo
06:46 Caelum $c->req->url seems to not have the server address and stuff
06:46 Caelum how do I get that
06:46 omega $c->uri_for('/') ?
06:46 omega ohh, sorry
06:47 omega wrong channel :P
06:47 Caelum hehe
06:50 Caelum $c->req->url->host returns undef :/
06:51 Caelum I'm using plack+mod_perl2
06:57 hrupp
06:57 Molaf_ joined #mojo
07:00 hrupp joined #mojo
07:04 hlin joined #mojo
07:06 Caelum alnewkirk: this is what I ended up doing: http://gist.github.com/5062956
07:06 Mike-PerlRecruiter_ joined #mojo
07:08 Caelum whatever gets the code to work
07:17 jzawodn joined #mojo
07:24 Vandal joined #mojo
07:28 n0n joined #mojo
07:28 mattastrophe joined #mojo
07:36 dpetrov_ joined #mojo
07:56 basiliscos joined #mojo
08:01 mugenken joined #mojo
08:09 yakudza joined #mojo
08:11 dod joined #mojo
08:15 ver joined #mojo
08:17 ObseLeTe joined #mojo
08:20 jamesw joined #mojo
08:35 daxim joined #mojo
08:35 dod joined #mojo
08:38 fhelmber_ joined #mojo
08:43 suy joined #mojo
08:44 ObseLeTe joined #mojo
08:45 ObseLeTe joined #mojo
08:58 ObseLeTe joined #mojo
08:59 jontaylor joined #mojo
09:02 mugenken joined #mojo
09:08 D4RK-PH0ENiX joined #mojo
09:13 kongelaks joined #mojo
09:22 egopro joined #mojo
09:42 maxhq joined #mojo
09:46 ka2u joined #mojo
10:04 d4rkie joined #mojo
10:22 jpn joined #mojo
10:33 egopro joined #mojo
10:35 kitt_vl joined #mojo
10:36 dod1 joined #mojo
10:38 Britzel joined #mojo
10:41 HtbaaPi_ joined #mojo
10:57 MarvinDoe joined #mojo
10:58 MarvinDoe hi guys I'm using mojolicious taghelper plugin, which is awesome
10:58 MarvinDoe it auto-selects fields provided by user
10:59 MarvinDoe so i don't need to do if() { ... checked="checked" }
10:59 MarvinDoe i was told that $self->param() is responsible for that.
11:00 ObseLeTe joined #mojo
11:00 toebu joined #mojo
11:00 MarvinDoe how to make taghelper auto-select something, but it's given by other valiable than  param?
11:01 MarvinDoe i can't $self->param('name') = 'Marvin';
11:04 arthas joined #mojo
11:05 jontaylor joined #mojo
11:05 ObseLeTe joined #mojo
11:07 jontaylor joined #mojo
11:19 tm joined #mojo
11:21 MarvinDoe so correct syntax is $self->param('name' => 'Marvin');
11:21 MarvinDoe cool
11:23 andrefs joined #mojo
11:58 SmokeMachine joined #mojo
12:32 dod joined #mojo
12:48 ObseLeTe joined #mojo
12:52 ObseLeTe joined #mojo
13:15 basiliscos joined #mojo
13:41 ladnaV joined #mojo
13:52 sh4 joined #mojo
13:59 egopro joined #mojo
14:12 egopro joined #mojo
14:14 gryphon joined #mojo
14:27 bluescreen joined #mojo
14:32 mattastrophe joined #mojo
14:37 mugenken_ joined #mojo
14:43 egopro joined #mojo
14:43 egopro joined #mojo
14:48 btyler joined #mojo
15:01 basic6 joined #mojo
15:02 basic6 joined #mojo
15:54 egopro joined #mojo
15:56 good_news_everyone joined #mojo
15:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/yexpQA
15:56 good_news_everyone mojo/master 4daf3ae Sebastian Riedel: documentation tweaks
15:56 good_news_everyone left #mojo
16:12 Mikey i married mojo and Backbone in an unschitzophrenic way.
16:13 Mikey and yes, i want a cookie.
16:14 * tm puts cookie box on the table
16:14 tm enjoy, thank you
16:26 sri shotgun wedding?
16:27 Mikey it was really ugly at first, half my team "loves javascript"
16:27 Mikey and i had never heard of backbone
16:28 Mikey and i mean i like javascript as well as the rest of us, most of my hatred stemming from interactions with it on the server side in the late 90s as part of netscape enterprise server
16:28 Mikey anyway, i know we needed to organize our JS, as it was just a bunch of jquery crap tucked into template fragments
16:29 Mikey i found a way to let them have their cake and eat it too while still having mojo run the show
16:29 Mikey as well as allowing us to build a require.js bundle and such when MOJO_MODE=production
16:29 * Mikey eats his cookies.
16:30 Mikey thinking about doing a blog post about it
16:30 ulf joined #mojo
16:34 sri tempire: so, you're happy with how format detection works currently?
16:35 sri jberger, tempire: the format detection thing has a long history, originally it was impossible to disable it, format => 0 is a recent addition (3.0 or so) http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Formats
16:37 sri is it good that for a route "get '/foo';" the renderer would try to render "foo.html.*" for GET /foo and "foo.txt.*" for GET /foo.txt?
16:39 inokenty joined #mojo
16:40 sri wouldn't it make more sense to require a format placeholder?
16:40 sri like "get '/foo.:format';"
16:41 crab i agree that it would make sense to require a format placeholder.
16:41 sri unless you set format => 0, format detection is currently always implicit
16:41 baton8 joined #mojo
16:41 crab i was very happy when format => 0 was added, and i could disable it for some special cases.
16:42 crab but not sure about foo.:format, what about plain foo?
16:42 sri of course "get '/foo.:format'" has problems too, now we need a way to make the dot optional
16:42 sri crab: yes :)
16:44 sri the rails option would be to get rid of how we handle optional placeholders currently and replace them with () in the route
16:44 sri get '/foo(.:format)';
16:44 crab i wouldn't object to something like that in _principle_, but i am not sure such a dramatic change is really called for
16:45 crab i mean, if we're looking at backwards-incompatible changes, making format => 0 the default would be much less intrusive and easier to adjust to.
16:46 crab i don't think /foo(.:format) is intrinsically superior, i.e. it wouldn't have any other benefits that would make it worth incurring the big change
16:50 sri /foo/(bar.:format) would work too
16:50 sri the downside is multiple optional placeholders get messy
16:50 crab yeah
16:51 sri /(:controller(/:action(.:format)))
16:51 crab i'm not really seeing much demand for major changes here
16:51 sri guess i agree
16:52 sri crab: so you would like to see format => 0 become the default and format => 1 added to enable format detection again?
16:54 crab yep.
16:54 crab but i could also live with the status quo if i had to.
16:54 sri tempire, jberger, marcus: CAN HAZ OPINIONS?!
16:54 sri crab: ok
16:56 phillipadsmith what are the downsides to having the format => 1 as the default?
16:58 sri breakage of course, the effects on content negotiation need to be explained in documentation, many examples need to be updated, and we need to redesign a lot of tests
16:59 crab phillip and smith: you mean => 0, 1 is the default right now
16:59 * sri assumed he meant s/to/of/
16:59 phillipadsmith crab: no, I was asking what the downsides are with leaving it as it is
17:00 sri what i mentioned above, it's implicit magic some folks might not be aware of
17:01 sri your route matches more than you might expect
17:01 sri get '/foo' => sub { shift->render('some_template') };
17:02 phillipadsmith there's a lot of magic in Mojolicious, IMHO, so a little bit more doesn't seem like a stretch to me. I've appreciated having the format stored in the stash without having to think about it on more than one occasion, FWIW.
17:02 sri this will try "some_template.html.ep" for GET /foo and "some_template.txt.ep" for GET /foo.txt
17:02 sri this magic is exposed to the outside world though
17:02 crab there's not "a lot of magic" in mojolicious!
17:02 phillipadsmith heh
17:02 crab it's all very polite and sensible.
17:02 phillipadsmith magic in the good sense of the term
17:07 lucs Um, the Rendering Guide mentions "Perl characters can be rendered with the "text" [...]", but looking at the accompanying example, does it actually mean Unicode or UTF-8 or something rather than "Perl characters"?
17:07 sri characters vs bytes
17:08 lucs Oh.
17:09 lucs (I guess it could be clearer -- I was wondering what a "Perl character" is.)
17:10 sri we are not going to explain how unicode works in perl
17:10 crab you know, like larry
17:10 crab or tchrist
17:10 sri haha
17:12 sri should it be just characters instead of Perl characters?
17:12 crab maybe it should be "Characters (as opposed to bytes) can be rendered with ..."?
17:12 chansen sri: yeah, would be more clear IMO
17:13 lucs What crab said sounds good to me.
17:13 sri i think it says characters to bytes already
17:13 xaka joined #mojo
17:14 crab let me read what it says in full
17:14 chansen You could probably change the "Raw bytes" to "bytes", what's the difference?
17:15 crab 'Unicode text can be rendered with the "text" stash value, the given string will be automatically encoded to bytes"?
17:15 lucs I think "characters vs bytes" needs to be the focus.
17:15 chansen I then to use the terms "octet string" and "character string" when I need to make a distinction between them
17:15 * chansen s/then/tend/
17:17 good_news_everyone joined #mojo
17:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/WmS6Tw
17:17 good_news_everyone mojo/master 0c63d4e Sebastian Riedel: characters vs bytes documentation tweaks
17:17 good_news_everyone left #mojo
17:18 lucs sri: Thanks.
17:18 crab looks good.
17:19 * sri thinks perl6 calls it Str vs Buf
17:29 lucs Still in the Rendering Guide, about Partial rendering, would it be correct (and if so, for me it would be clearer) to rephrase to "Sometimes you might want to access the rendered result <without actually outputing it>, ..."?
17:31 sri outputting is not correct
17:31 lucs Perhaps, but do you see what I mean?
17:33 dvinciguerra joined #mojo
17:33 lucs In naive terms, I'm thinking "If I use -partial, I can render into a variable, but it won't go on the page.".
17:34 lucs s/-//
17:34 yakudza joined #mojo
17:35 ka2u joined #mojo
17:38 crab what does it say?
17:38 lucs Sometimes you might want to access the rendered result, for example to generate emails, this can be done using the "partial" stash value.
17:40 crab and you want it to say something like 'If you specify the "partial" stash value, the rendered result is returned as a string. This can sometimes be useful, for example to generate emails'?
17:40 crab (i don't like that wording yet, but is it what you mean?)
17:40 lucs What I was wondering about was more like "Will it go on the page too?"
17:41 crab well, the answer is that it won't.
17:41 crab but i'm not sure how to explain that succintly.
17:42 sri "but it won't go on the page" is very very bad
17:42 lucs crab: Yeah, after a few minutes of thinking, it appears that that's what "partial" is all about.
17:42 sri partials are used to include templates into other templates
17:42 sri it's actually their primary use
17:43 sri be careful not to make it more confusing!
17:44 crab sri: i'm certainly not going to say "won't go on the page"
17:44 crab i'm not going to change anything if i can't make it clearly better.
17:45 * sri just wants to make sure the bigger picture is clear
17:45 lucs I'm not sure what the solution is, but I'm just pointing out that the current phrasing had me wondering as to what exactly would happen.
17:46 moltar joined #mojo
17:46 lucs It's now clear enough in my mind to keep on reading, but I'm pointing it out for future naive readers like me :)
17:49 lucs (My notes read: "Use 'partial' to do no more than capture the rendering to a variable.".)
17:54 mattastrophe joined #mojo
18:00 xaka joined #mojo
18:31 lucs Lighten a bit, in the Rendering Guide, in the 'Rendering "exception" and "not_found" pages'section: reads better as "[...] the Mojolicious::Controller methods "render_exception" and "render_not_found" can be used [...]".
18:33 lucs (Actually, that sentence -- the original -- has a weird structure that can be improved.)
18:33 phillipadsmith Thoughts on this: getting the error 'Can't locate object method "html" via package "Mojo::DOM"' while trying to print the title for a resource that reports to be 'text/html; charset=utf-8' … if I use Perl -Mojo to get the title, it works fine.
18:35 labrown joined #mojo
18:36 sh4 joined #mojo
18:36 lucs (Just adding "and" may fix it:  "[...] great help, and the Mojolicious::Controller methods [...]".)
18:37 phillipadsmith the response content has a <!DOCTYPE html> and a <title>, so I'm a bit confused as to what's happening
18:44 ladnaV I'm getting "panic: Infinite recursion in SWASHNEW for 'XIdStart'" and can't understand why. What can I do to debug it?
18:56 good_news_everyone joined #mojo
18:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ymkmjQ
18:56 good_news_everyone mojo/master 97adf41 Sebastian Riedel: more documentation tweaks
18:56 good_news_everyone left #mojo
18:57 sri lucs: i guess it does sound a bit awkward
19:07 Mike-PerlRecruiter_ joined #mojo
19:09 ObseLeTe joined #mojo
19:09 ObseLeTe joined #mojo
19:30 mattastrophe joined #mojo
19:37 yakudza joined #mojo
19:38 d4rkie joined #mojo
19:39 Akron joined #mojo
19:55 btyler joined #mojo
20:11 Akron Just my opinion: I like the current format rule. if format => 0 is used frequently, maybe something perlish like '/:foo.txt$' could be introduced. However - I use it pretty rarely.
20:13 mattastrophe joined #mojo
20:13 asarch joined #mojo
20:16 sri Akron: noted
20:21 sh4|2 joined #mojo
20:27 mattastrophe joined #mojo
20:41 bpmedley_ joined #mojo
20:47 mattastrophe joined #mojo
20:50 sri jberger, tempire, marcus, crab: another thing to discuss for 4.0 is the Mojo::Path situation
20:50 sri do we want to make it parse lazy (like Mojo::Parameters) or keep it the way it is
20:52 sri adding a charset attribute helped a lot with generating all kinds of edge cases that were previously normalized away, but is that good enough?
20:52 anaio joined #mojo
20:52 sri the Mojo::Parameters situation is of course a little different, since a query string might not be parsable
20:54 sri i guess the question is if normalizing stuff away in Mojo::Path by default is good
20:54 rem_lex|pivo joined #mojo
20:55 sri perl -Mojo -E 'say Mojo::URL->new("http://localhost/foo%2fbar")'
20:55 sri an example
20:55 anaio Caelum, can you paste that again please
20:55 sri it gets more complicated with charsets
20:56 sri perl -Mojo -E 'say Mojo::URL->new("http://localhost")->tap(sub { $_->path->parts([qw(foo/bar)]) })'
20:56 sri this is the current way to bypass normalization
20:58 anewkirk I'm trying out the new outlook.com, importing all my google mail over, all I see so far is old Mojolicious mailing list messages {-_-}
20:59 anewkirk ... must be thousands
20:59 sri 4526 to be precise
21:01 ulf joined #mojo
21:04 anewkirk I'm trying to figure out all the scenarios people might take to submit arrays
21:23 Caelum anewkirk: you mean my stupid hack to get the server url, https://gist.github.com/rkitover/5062956
21:27 perlite joined #mojo
21:31 Caelum anewkirk: are my gists not visible?
21:31 anewkirk Caelum, yes, I see it now
21:34 Caelum what else is not visible, are the cpan modules I upload also not visible?
21:34 Caelum it's not enough that the fucking pigs break all my libraries?
21:36 anewkirk Caelum, I'm not sure I understand why you need that plugin?
21:37 Caelum anewkirk: because helpful people fuck up all the modules I use, and in this case $c->req->url->host returns undef
21:37 Caelum I also need to figure out why my headers object was disappearing mid-request
21:38 Caelum I got around that by cloning it
21:39 anewkirk hrrmmm
21:40 Caelum and my perl is segfaulting like all the fucking time
21:41 mattastrophe joined #mojo
21:44 anewkirk thats what happens when you build porn sites with perl
21:44 anewkirk :}
21:46 Caelum heh
21:49 ObseLeTe joined #mojo
22:05 Caelum speaking of which, I'm still not getting a warning from DBI that I should be getting
22:28 btyler joined #mojo
22:29 mattastrophe joined #mojo
22:32 BeDa joined #mojo
23:00 btyler joined #mojo
23:00 jberger_at_work joined #mojo
23:00 dPetrov_ joined #mojo
23:00 jberger_at_work o/
23:00 jberger_at_work I've been less than available today
23:01 * jberger_at_work catches up on backlog
23:01 jberger_at_work as far as the format detection, I have no real problem with it
23:01 jberger_at_work I can imagine requiring using respond_to explicitly, would seem to make sense
23:02 Caelum oh, so if you're using respond_to you're not effected, that's what I'm doing, awesome
23:04 jberger_at_work Caelum: I can't promise that, but it might be where I start my thinking
23:04 jberger_at_work it seems like begin required to establish how to handle the different request explicitly would be the reason to move away from having it be handled automagically
23:05 jberger_at_work not sure I have an opinion on Mojo::Path
23:09 jberger_at_work considering your one liner:
23:09 jberger_at_work perl -Mojo -E 'say Mojo::URL->new("http://localhost/foo%2fbar")'
23:10 jberger_at_work it should behave however it would when typing that into a browser or clicking on a link with that as the target
23:11 jberger_at_work hmmmm
23:11 jberger_at_work or perhaps I see what you are saying
23:11 jberger_at_work should that match /:foo/:bar or /:foo
23:11 jberger_at_work is that the question
23:12 * jberger_at_work ponders that one
23:19 * jberger_at_work will pop back on in a bit
23:19 jberger_at_work left #mojo
23:35 sri jberger: %2f is just one case, there is also charsets
23:35 sri perl -Mojo -E 'say Mojo::URL->new("http://localhost.com/foobär")'
23:35 sri vs
23:35 sri perl -Mojo -E 'say Mojo::URL->new("http://localhost.com/foobär")->tap(sub { $_->path->charset("Latin-1") })'
23:36 sri browsers decide that based on context
23:37 sri we couldn't really do that anymore, and would have to require % encoding for all input values
23:38 sri here's a better example for normalization
23:38 sri perl -Mojo -E 'say Mojo::URL->new("http://localhost.com/foo%E4r")'
23:39 sri well, it's complicated :)
23:40 sri the big question is what *exactly* the right behavior would be
23:41 sri specs won't help us much here, browser behavior is different, there is an w3c api spec in the works, but most people hate and ignore it
23:43 sri jberger, Caelum: a format detection change would almost certainly affect respond_to and break the current file extension based detection
23:44 sri you would have to enable it with format => 1 before using respond_to, or respond_to would be limited to Accept header and format parameter
23:45 sri that's the documentation problem i mentioned earlier :) a new special case that needs to be explained
23:46 sri hmmm... the more i think about changing Mojo::Path, the more i dislike the idea... at least until we know exactly what we want
23:48 mattastrophe joined #mojo
23:58 sri btw. Mojo::Path works pretty well on the server side, the open design questions are more about its use in Mojo::UserAgent
23:59 sri and there it is mostly about bringing it in line with Mojo::Parameters
23:59 jberger I think it should behave the same on both sides, if for no other reason than it makes sense that it should

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