Camelia, the Perl 6 bug

IRC log for #mojo, 2012-09-10

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

All times shown according to UTC.

Time Nick Message
00:56 * tempire considers moving to the jellybean colorscheme
00:57 scott joined #mojo
01:14 bluescreen joined #mojo
01:31 sri augensalat: that bug report is pretty terrible
01:32 sri no test case, no links to spec sections, no scenatio to replicate the problem
01:32 sri https://github.com/kraih/mojo/issues/379
01:45 sri tempire: that blue is horrible :o
01:46 tempire you speak madness.  I'm going to start moving more toward that color blue in the theme.
01:46 sri /o\
01:46 tempire maybe our monitors show something different.  can't imagine anything thinking it's bad
01:52 sri tempire: i meant your screenshot on twitter
01:52 sri the autocomplete and bottom bar don't mix with the theme
01:53 tempire Ah, well that's true.  It's the first step.
01:53 tempire I'm in love with the powerline bar, though.
01:57 sri tempire: do you understand issue 379?
01:58 * tempire looks
01:59 tempire no.  but I don't know anything about charsets.
01:59 d4rkie joined #mojo
02:17 abra joined #mojo
02:32 sri i have a vague idea of what might be wrong
02:34 sri interesting
02:34 sri the fix is also a huge performance improvement
02:34 purl okay, sri.
02:35 sri in the 100+ rps range
02:35 tempire \o/
02:37 good_news_everyone joined #mojo
02:37 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6SYwsA
02:37 good_news_everyone [mojo/master] fixed support for query parameters in Mojolicious::Plugin::Charset (closes #379) - Sebastian Riedel
02:37 good_news_everyone left #mojo
02:38 sri i'm not sure how correct this is though
02:39 sri augensalat: if you want this to go get into a release you will have to do some research i'm afraid
02:40 sri s/go//
02:41 sri specifically, i want confirmation for different browsers that they really use the current page charset for query parameters, even if it differs from the browser default
02:42 sri otherwise this will get removed again
02:48 sri https://github.com/kraih/mojo/i​ssues/379#issuecomment-8412507
02:48 sri commented also on the issue
02:55 noganex_ joined #mojo
02:57 sri perl -Mojo -E 'use utf8; plugin Charset => {charset => "Shift_JIS"}; get "/" => {inline => q{<%= form_for "/foo" => begin %><%= submit_button "や った", name => "yatta" %><%= end %>}}; get "/foo" => {inline => q{<%= param "yatta" %>}}; app->start' daemon
02:57 sri here's a oneliner testcase
02:58 sri just run it in your browser
02:58 sri umm, open it in your browser
02:58 sri of course you need a utf-8 terminal
03:18 laouji joined #mojo
03:30 throughnothing can i set the port with hypnotoad from the command line?
03:33 crab no
03:33 throughnothing hmm is there a reason for that :)
03:33 throughnothing --listen support like morbo would be nice
03:33 sri never gonna happen, because zero downtime restarts
03:34 throughnothing sri: how does the port affect that?
03:34 sri sorry, too busy to explain
03:35 throughnothing sri: ok, np
03:35 throughnothing I understand that if you run it twice in a row with different ports it could be an issue, but that could be detected, and an error given etc.
03:35 throughnothing or warning at least
03:36 throughnothing and running it again with the same port could give the same result as currently, or running it with no port at all could default to whatever port/listen the currently running one is using
03:36 throughnothing just a thought, I may still be missing some other complication
03:36 throughnothing and if all that fails, Having the documentation explain that this is why you cannot set the port would be pretty helpful, IMO at least :)
03:38 throughnothing 'port' is glaringly absent from the Hypnotoad pod
03:38 sri you should study the code before making proposals ;)
03:38 throughnothing sri: fair enough! :P
03:43 Foxcool joined #mojo
03:53 sri i still need people to try the oneliner above btw!
03:53 sri (with the latest version from github)
04:33 jamadam joined #mojo
04:38 jamadam tried the oneliner on IE6, IE7, IE8, IE9, Firefox15.0.1, Chrom 21, Safari 5.1.5
04:42 jamadam it looks working fine. I also checked what was wrong on v3.31 with firefox
04:57 sri jamadam: thanks!
05:10 arthas joined #mojo
05:23 tempire jamadam+++
05:28 Vandal joined #mojo
06:17 good_news_everyone joined #mojo
06:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/llKo6A
06:17 good_news_everyone [mojo/master] test tweaks - Sebastian Riedel
06:17 good_news_everyone left #mojo
06:44 * sri likes fun
06:45 sri perl -Mojo -MFun -E 'get "/" => fun ($self) { $self->render(text => "hello!") }; app->start' get /
06:46 nour joined #mojo
06:46 jamadam joined #mojo
06:46 mikegrb sri nice find
06:46 mikegrb wonder how I missed that in the rss
06:47 sri doy wrote it as a proof of concept, really like the minimalism
06:47 sri god i hope the p5p discussion goes somewhere
06:48 sri http://www.xray.mpe.mpg.de/mailing-lis​ts/perl5-porters/2012-09/msg00068.html # in case you're not folling me on twitter
06:48 sri *+ow
06:49 sri there are even patches now
06:49 sri with *a lot* of luck we may have sub ($self) {...} in 5.18
06:50 mikegrb yeah, saw mention of that
06:51 mikegrb I got way behind and declared surrender on p5p last night
06:53 nour how do i access the current template name/path from a template
06:53 nour none of $template and stash->{template} and template() work
06:53 sri don't think you can
06:54 nour sucks
06:54 nour k
06:54 sri make a proposal
06:54 nour use case -- kind of useful for consistent file schemes
06:55 nour i.e. in controller, turn on flag $stash->{toolbar} = 1
06:55 nour if thats on in view, then my ( $partial ) = $template =~ s/whatever/toolbar/; $self->render( $partial, 1 );
06:55 nour something like that
06:56 nour though that perl is wrong
06:56 crab nour: can you explain what you want to do without the code?
06:58 nour if i have an action 'main/list' and a template 'main/list', i want to be able to automatically determine a partial component based on a similar name, e.g. 'partial/toolbar/main/list'
06:59 nour rather than setting that specific string in the stash, so that if i change my action name i need to change the filenames of the coupled components
06:59 nour helps keep things consistent in my head and tone down the chaos
06:59 crab why not store it in main/toolbar and just include toolbar?
07:00 nour because the toolbar is coupled with the action
07:00 nour make sense? different actions would have different toolbar buttons and such
07:00 nour but i'm rendering the toolbar from the layout, not from the template
07:01 nour because its tied to the global fixed header
07:03 crab i see.
07:04 nour or here's another use case -- sometimes an action/template has a coupled css/js component
07:05 nour perhaps we toggle $stash->{coupled}->{css} = 1 in action and then from template we use the template name/path to derive where the css component lives and <link rel="stylesheet" href="<%= $over_there %>"
07:06 crab nour: have you seen the "template inheritance" section in ::Guides::Rendering?
07:06 crab i'm not (necessarily) arguing strongly against having the current template name available through a helper. i haven't thought about that yet.
07:07 crab but certainly there are other ways to handle it. i do have lots of actions that require specific css/js to be included in the layout, and i do it by "declaring" my specific requirements in the template itself, using a custom helper.
07:08 sri wouldn't the current template name in the layout be the name of the layout?
07:08 nour hmm thanks crab
07:08 nour that might be a better implementation
07:09 crab sri: yes, there would have to be some concept of the "active" template or some such. that's why i'm suggesting alternatives, to see if it can be done without adding more complexity.
07:09 * sri nods
07:11 ghandi joined #mojo
07:11 crab hm. how does the template name in e.g. 'include "x/foo"' get resolved to a path?
07:12 crab it's always from the root of any directories in Renderer->paths, right?
07:12 crab irrespective of the path of the template that's executing the include?
07:26 jamadam joined #mojo
07:43 cosmincx joined #mojo
07:51 rem_lex|pivo joined #mojo
07:59 scott left #mojo
08:05 fhelmber_ joined #mojo
08:13 ghandi joined #mojo
08:34 fhelmber_ joined #mojo
08:48 mire_ joined #mojo
09:14 sri http://robfig.github.com/revel/ # hot compile is a cool feature
09:30 pau4o joined #mojo
09:36 crab "Write simple blocking code without guilt."
09:36 Netfeed is there some way to make "hooks" in templates? for example, if i have pagnation, then i'd like to have <link/>-tags in my <head/> and so on
09:37 crab look at the template inheritance section in the rendering guide. write your own declarative helper if you like.
09:38 crab sri: where did "flash" come from? rails?
09:39 Netfeed oh, nifty, thanks
09:40 sri crab: ye
09:40 sri i added it to catalyst before though
09:45 crab sri: can you think of any nice readable way to have pjax-friendly rendering? i.e. either render the template embedded in a full layout or just as an html snippet, without an if/else in every action?
09:46 basic6 joined #mojo
09:46 crab i control both server and client, so any suitably clean approach (to minimise maintenance burden) is ok.
09:47 Netfeed never really got pjax to work for me, can't get the same nice feel as they have on github
09:47 basic6 How do I route a request to a template, via its controller function?
09:47 marcus good morning, fellow h00mans.
09:47 crab basic6: what do you mean?
09:47 crab netfeed: why not? what was wrong?
09:48 basic6 $r->route('/test')->to("Controller#test"); There's a funciton Controller::test that sets some variables which are used in the template templates/Controller/test.html.ep
09:48 crab i'm interested in pjax mostly because it removes all the problems with caching js/css resources etc.
09:48 Netfeed i don't know, it just seemed like the page rendered the same way as it always done
09:48 noganex joined #mojo
09:48 basic6 $r->route('/test')->to("Controller#test"); <- This will call Controller::test(), but it ignores the template file.
09:49 Netfeed might be that i just failed at it, but i've tried it in both mojo and in sinatra with the same failure
09:49 Netfeed basic6: you call $self->render in your template
09:49 Netfeed s/template/controller/
09:50 sri crab: factor the if/else out into a helper?
09:51 crab you can call "$self->render" at the end, but you shouldn't need to (isn't it the default thing to do when your template name can be derived from the controller/action?)
09:52 crab sri: and put "layout => 'x'" in the call to render() rather than in the template itself?
09:52 sri ye
09:52 Netfeed shouldn't his template be located in templates/controller/test.html.ep in that case?
09:53 crab hmm, that wouldn't play nice with a lot of my templates.
09:53 crab netfeed: oh, i didn't pay attention to the controller vs. Controller thing. yes, you're right.
09:53 sri pjax is really trivial in general, just disable layouts if it's a pjax call, done
09:54 crab disable layouts?
09:54 sri just don't set a layout
09:55 crab well, then the declaration of which template wants which layout has to move from the template to the code, see what i mean?
09:55 crab if you have only one layout, it's easy. but i do have multiple layouts in this app, so it becomes a bit more troublesome.
09:55 sri make a custom layout helper then
09:56 sri one that is context aware
09:56 daxim joined #mojo
09:56 sri done!
09:56 crab that sounds sensible. thanks.
09:56 sri \o/
09:57 basic6 Ok $self->render works, I must have had something else wrong the last time I checked...
09:58 crab all it woul;d need to do is set or not set $stash->{layout}, right?
09:59 sri correct
09:59 sri just name it pjax_layout and reuse the normal layout helper ;)
10:01 crab sounds good.
10:01 crab i think i'll do it and write a blog post or so that mentions pjax and mojolicious
10:02 crab heh, if you google for mojolicious pjax, you get a bunch of japanese pages.
10:06 sri crab++
10:08 crab crab hasn't done anything (yet)
10:09 crab netfeed: btw, isn't the whole point of pjax that it should render the same way?
10:31 Netfeed crab: i mean good old regular get and not some fancy ajax
10:33 crab i can't tell if you're being serious
10:34 crab pjax's "fancy ajax" is just to include an X-PJAX header in a "good old regular get" request.
10:34 crab so that on the server you can see if X-PJAX is set and return only part of the page.
10:35 Netfeed yeah i know, and i never got the smoth page change to work, the whole page was reloaded each time
10:36 crab hm. well, no point my speculating why that might have been.
10:36 Netfeed it's easy
10:36 Netfeed i failed :)
10:38 crab Netfail: ok. :-)
10:38 Lucas1 joined #mojo
10:40 Netfeed aye
10:44 sri the railscast about pjax is pretty good http://railscasts.com/epis​odes/294-playing-with-pjax
10:45 sri tempire: maybe a fun topic for a mojocast too ;)
10:48 nour wats a bjax
10:53 * sri is still surprised by the performance gain from the charset bugfix
10:56 sri there may still be some low hanging fruits
10:57 sri i bet there is more stuff we could only parse on demand
11:14 good_news_everyone joined #mojo
11:14 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5t7uWA
11:14 good_news_everyone [mojo/master] small optimizations - Sebastian Riedel
11:14 good_news_everyone left #mojo
11:26 pingup3rl joined #mojo
11:33 marcus async BJ?
11:48 sri if anyone wants, feel free to upload a new release (just bugfixes, no announcement necessary)
11:52 DaniBunny joined #mojo
11:54 crab i'll do it.
11:58 good_news_everyone joined #mojo
11:58 good_news_everyone [mojo] amenonsen pushed 1 new commit to master: http://git.io/F5HGOA
11:58 good_news_everyone [mojo/master] Bump VERSION after release - Abhijit Menon-Sen
11:58 good_news_everyone left #mojo
12:12 AmeliePoulain joined #mojo
12:14 AmeliePoulain joined #mojo
12:18 mire_ joined #mojo
12:52 spleenjack joined #mojo
13:07 nour i think i hate coding
13:21 DaniBunny hahaha
13:22 DaniBunny i do hate corporate coding
13:26 bluescreen joined #mojo
13:30 azawawi joined #mojo
13:31 azawawi hi, are there any Mojo plugins for minifying JS / CSS resources
13:31 azawawi and Prettifying stuff also...
13:32 jnap joined #mojo
13:35 Lucas1 joined #mojo
13:55 inokenty1 joined #mojo
13:56 andrefs joined #mojo
13:59 basic6 How do I set a route to be text/plain? $self->routes->route('/test​')->to("Controller#test"); will use the template file "test.html.ep" and send "text/html" as http header
14:01 inokenty1 ->to('controller#test', format => 'txt');
14:03 gryphon joined #mojo
14:04 gryphon joined #mojo
14:04 espent joined #mojo
14:06 jamadam joined #mojo
14:08 basic6 Thanks
14:09 azawawi So are there any Mojo plugins for minifying JS / CSS resources  :)
14:18 Ulti has anyone heard of a mojolicious plugin for wrapping the github API?
14:33 azawawi github is down btw
14:33 vervain Wow.. they have unicorns and rainbows too :-)
14:34 sri no raptors though
14:39 knshaum joined #mojo
14:59 crab azawawi: not that i know of
15:05 spleenjack1 joined #mojo
15:05 d4rkie joined #mojo
15:15 augensalat sri: Just hooked back onto my IRC bouncer, so I didn't get your replies here. Sorry for the bad bug report and thanks for the super-fast fix. ;-)
15:20 augensalat Anyway - my actual problem is, that I am looking for a way to disable parameter decoding completely. When I look into Mojo::Parameters::params(), it seems that decoding is only done, if the charset attribute is defined. The thing is: I'm not able to set that attribute to undef.
15:25 sri augensalat: what's the use case for no decoding?
15:26 sri it seems completely illogical to me
15:27 sri there is no such thing as no charset after all
15:27 augensalat A Webservice API, that handles filenames from external filesystems. Files can be stored on that FS using any protocol, so I don't have any information, which was the encoding for the filenames.
15:27 sri that's irrelevant
15:28 augensalat What do you mean?
15:28 sri if you don't know the charset you're screwed anyway
15:28 augensalat no, filenames pass through the webservice as bytestreams#
15:30 augensalat hen I simply don't touch the encoding, I can be sure not to break anything.
15:30 augensalat s/^hen/when/
15:32 augensalat OIOW: If I make false assumptions on filenames (everything is UTF-8) I will sooner or later break people's files.
15:34 augensalat I'm not asking for disabling Mojo's default behaviour of decoding input. I just want an option to disable it.
15:35 sri i suppose you can do $self->req->url->query->charset(undef) but i'm not sure that has unit tests (therefore might break in the future)
15:39 augensalat Works. Would you accept such a test for the distribution?
15:41 augensalat and is there a similar trick for POST/PUT?
15:42 sri $self->req->body_params->charset(undef) maybe
15:43 good_news_everyone joined #mojo
15:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZOmIMQ
15:43 good_news_everyone [mojo/master] added tests for parameters without charset - Sebastian Riedel
15:43 good_news_everyone left #mojo
15:43 sri i've added a test case, but i'm not sure if this really should be a feature
15:44 sri remember, it's not a feature if it's not in a cpan release! i'll need some time to think about it
15:44 augensalat hmm, yeah, it's a test for a hack...
15:45 sri marcus, crab, tempire: you think about it too!
15:45 augensalat plugin Charset => { charset => undef }
15:45 augensalat would be great
15:45 sri not really
15:46 sri that affects all layers
15:46 sri the renderer would stop working
15:48 sri there is pretty much no chance i would go further than allowing charsets to be disabled manually ;)
15:52 espent joined #mojo
15:52 jzawodn joined #mojo
15:53 sri i have a bad feeling about this, like we are overlooking something
15:57 labrown joined #mojo
15:58 xaka joined #mojo
16:05 crab it feels pretty horrid
16:13 jzawodn joined #mojo
16:13 andrefs joined #mojo
16:34 zeke joined #mojo
17:00 jzawodn joined #mojo
17:01 sri 37signals says 80 chars is evil :) http://37signals.com/svn/posts/3250-clarity​-over-brevity-in-variable-and-method-names
17:02 sri "make_person_an_outside_subscr​iber_if_all_accesses_revoked" oh my
17:11 jzawodn joined #mojo
17:13 fibo joined #mojo
17:14 baton8 joined #mojo
17:18 vervain "Church of 80-character Lines" It took a significant effort of will to continue reading after that slap in the face.
17:18 vervain s/Church/ridiculous Church/
17:20 batman joined #mojo
17:21 nour does the latest version of mojo::server have a build_app method?
17:22 nour Can't locate object method "build_app" via package "Mojo::Server" at ./script/application.run line 28
17:22 nour someone on the shared env i work on changed the mojo server version
17:22 nour dunno if they downgraded or upgraded
17:23 nour how can i tell what version
17:30 * tempire pjaxes
17:30 * nour spits in your face
17:30 nour i'm so sick of coding
17:30 nour i want to be a fisherman
17:31 augensalat nour: perl -MMojolicious\ 99
17:32 nour anyone have a one-liner to install mojo::Server with its entire dependency tree to a local lib directory rather than somewhere else
17:33 * tempire sprinkles glitter on nour
17:36 * nour spurts on tempire
17:36 * tempire gives nour a flower
17:38 vel joined #mojo
17:50 mire_ joined #mojo
17:56 pingup3rl joined #mojo
18:08 ruz joined #mojo
18:19 nour i want to quit my job and go back to being a hippy coder
18:19 nour no money, being poor but feeling satisfied
18:19 nour too bad i have a wife and kid :-(
18:19 * nour is a slave to $
18:23 nour anyone know if its possible to throttle people with qos
18:27 baton8 joined #mojo
18:41 xaka joined #mojo
18:49 hide joined #mojo
19:06 marcus wass
19:13 marcus nour: no, I think you need remote stabbing prototcol
19:17 batman joined #mojo
19:33 mike_ stupid question I can't see to find the answer for: how do I configure hypnotoad (ports, etc) in a full app?
19:33 marcus mike_: hypnotoad section of config?
19:34 marcus mike_: I believe it's covered in the cookbook
19:35 marcus mike_: app->config in lite apps is $self->config in full app startup...
19:39 ZadYree joined #mojo
19:51 pingup3rl joined #mojo
20:02 perlite_ joined #mojo
20:04 xaka joined #mojo
20:07 mike_ marcus: was pure pebkac, thanks
20:07 marcus mike_: sure, np.
20:08 fitnerd joined #mojo
20:10 fitnerd I am using Mojo lite and am setting MOJO_MODE=testing in the same line as I call morbo.  There is a ./log directory.  I was expecting a 'testing.log' file based on what the docs say but there isn't one there
20:21 fitnerd never mind it was my log level
20:40 vel joined #mojo
20:43 bluescreen_ joined #mojo
20:46 batman joined #mojo
21:38 vervain Has there ever been discussion to return 405 instead of 404 if there is a matching route but with a different method?
21:45 lukep joined #mojo
21:49 pingup3rl joined #mojo
22:54 DaniBunny joined #mojo
22:58 mandreacchio joined #mojo
23:01 andrefs joined #mojo
23:03 xaka sri: hi there, i see that Mojo::Reactor::Poll uses "fileno" call everywhere that leads to some issues when you don't have IO::Handle, but an integer, so your hands are tied and you can't use reactor. for an exampe IO::Select (and IO:Poll) works with both IO::Handle and integers so probably mojo should do the same?
23:05 xaka btw, i removed all fileno calls from Poll.pm, run tests and everything still green so ;)
23:09 DaniBunny joined #mojo
23:21 crab vervain: yes, there has
23:21 crab and no, we won't.
23:22 crab i don't remember why, though :-)
23:34 mandreacchio_ joined #mojo
23:53 arpadszasz joined #mojo
23:57 vervain crab: Then would you say that this http://pastebin.com/cADSTWyY pattern is ok?
23:57 jwang joined #mojo

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