Camelia, the Perl 6 bug

IRC log for #mojo, 2010-08-13

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

All times shown according to UTC.

Time Nick Message
00:01 xantus_ http://code.google.com/p/perldroid/
00:02 xantus_ Mojo on my droid? :P
00:39 esskar_ joined #mojo
01:28 tempire How do I turn off automatic html entity encoding for ep templates?
01:33 stephen joined #mojo
01:51 xantus_ tempire: use <%== instead of <%=
01:51 xantus_ that what you mean?
01:52 tempire ah, xml escaped result
01:52 tempire I was looking for mention of html entities
01:52 tempire thanks
02:45 MojoGuest104 joined #mojo
02:45 MojoGuest104 From: http://news.ycombinator.com/item?id=1277067 (3 hits)
02:53 yakudzo joined #mojo
03:00 janus joined #mojo
03:03 ask joined #mojo
03:14 gabiruh joined #mojo
03:17 Kai_ joined #mojo
03:17 Kai_ can I have an example of add_hooks? :S
03:19 tempire http://github.com/kraih/mojo/blob/mas​ter/lib/Mojolicious/Plugin/Charset.pm
03:20 Kai_ thank you
03:20 tempire simpler: http://github.com/kraih/mojo/blob/mast​er/lib/Mojolicious/Plugin/PoweredBy.pm
03:24 Kai_ do I have to put a plugin in a perl module? :(
03:33 Kai_ tempire: What I'm trying to do is this: I'm using websockets. I can't run a flash policy server. If flash can't find a policy server it connects to the socket and asks for a policy file. How do I set up mojolicious to return a string when given a certain string before the websocket handshake?
03:33 Kai_ and by return a string I mean send a string to the client
03:54 sri xantus++ # very cool
03:55 sri Kai_: you can't do that
03:56 sri mojolicious plugins are powerful, but they can't change protocols
03:57 sri the big question is why can't you run a flash policy server?
04:00 ask joined #mojo
04:03 tholen42 joined #mojo
04:13 [2]awnstudio joined #mojo
04:14 Kai_ shared hosting
04:14 Kai_ to run something on port 843 you need to be root :|
04:15 Kai_ sri: ^
04:15 sri but you are allowed to run your own web server?
04:15 Kai_ i can run mojolicious on port 8874 without being root
04:16 Kai_ i think ports below somewhere around 1000 require root
04:16 sri mhm
04:17 sri you could really only build a small proxy server, handle the flash thing yourself and forward everything else
04:17 Kai_ i'll try that sometime else
04:17 Kai_ i'm fine with sticking to webkit browsers :D
04:17 * Kai_ <3 webkit
04:18 sri indeed
04:18 Kai_ safari and chrome have webkit support by default. \o/
04:18 sri safari support is still broken
04:18 Kai_ chrome since v4, safari since v5. safari&chrome combined = >10% market share
04:18 Kai_ sri: is it the old kind?
04:18 Kai_ wait no, i tried it on safari and it works
04:18 sri nope, just broken
04:18 Kai_ wait...
04:19 Kai_ yeah.
04:19 sri it sometimes suddenly stops working
04:19 Kai_ what webkit version does safari 5 use?
04:19 sri webkit nightly has it fixed
04:19 sri only a matter of time until safari 5 starts working with an update
04:19 Kai_ in my experience chrome 6 has had a good implementation
04:20 Kai_ which is why i use chrome 6.
04:20 sri i only know chrome on os x which is still broken
04:20 Kai_ among other reasons of course
04:20 Kai_ sri: yeah :(
04:20 Kai_ safari doesn't really feel very native on any platform but it's worth it for all the awesomeness
04:20 Kai_ s/safari/chrome/
04:21 sri i expect all websocket implementations to break once again
04:21 sri latest protocol spec is too stupid
04:22 Kai_ how recent is the spec?
04:22 sri a month old or two
04:23 Kai_ is it the one with sec-websocket-key and things like that?
04:23 sri ye
04:23 Kai_ well, it's very annoying to implement but security is security :p
04:23 sri i don't see the point
04:23 Kai_ I don't really see how letting plain old HTTP clients mess with websockets could be bad
04:23 Kai_ yeah
05:05 sri http://github.com/blog/699-making-​github-more-open-git-backed-wikis # cool
05:06 Kai_ rawr, don't call it open at all until we get the full github source
05:08 sri http://github.com/github/gollum # the wiki is open source :)
05:14 dynax60 joined #mojo
05:14 koban joined #mojo
05:33 dynax60 joined #mojo
05:48 koban joined #mojo
05:55 koban joined #mojo
06:07 geekus joined #mojo
06:07 geekus I'm trying to convert a set of EPL templates to TT
06:08 geekus I have things like $self->{stash}->{foo} and $self->req->params('xyz') in my EPL
06:08 geekus I'm not too familiar with TT... if I don't modify the controller at all, how can I get at these same things in TT with Mojo
06:09 geekus will self be passed into the TT for vars?
06:09 geekus so do I say self.stash.foo
06:15 geekus CPAN page for MojoX::Renderer::TT says "Template parameter are taken from  $c-stash >." but that's a typo
06:15 geekus are there examples anywhere using TT templates?
06:20 sri [% c.stash %] i guess
06:22 geekus but what is "c"
06:22 geekus is $c the $self
06:22 sri think so
06:32 geekus yes c.req.param('foo') works and so does c.stash.foo
06:32 geekus thanks
06:38 mvuets joined #mojo
06:39 geekus and in a layout you think I just do [% c.render_inner %]
06:40 sri with the latest cpan version you might also be able to use helpers like [% h.content %]
06:41 geekus ok... I'll give that a try
06:41 geekus I personally like the RoR type templates better... but TT is what is being used on my project... so I'm trying to make it fit!
06:42 sri sure, thats why we have multi renderer support :)
07:02 ysyrota joined #mojo
07:14 arthas joined #mojo
07:43 yko joined #mojo
08:06 vti sri: 'mojolicious help daemon' doesn't have option 'daemonize' explained
08:10 sri there is no option daemonize
08:13 dynax60 sri, what to do if we need the build-in web-server to make it daemonized?
08:14 sri you make your own little script to start the daemon or use daemon_prefork
08:14 sri which has --daemonzie
08:14 dynax60 ok! thanks
08:15 sri daemonizing is not portable, so daemon can't support it
08:15 sri daemon_prefork is unix specific, so it can
08:16 sri daemon is supposed to be able to run everywhere perl can :)
08:25 sri daemon_prefork is pretty much always better for deployment
08:26 sri it scales with cpus, and workers get restarted after 1000 requests
08:26 sri and and and :)
08:26 sri with --clients 10 you can also make workers go async
08:27 sri giving you a pool for normal async daemons
08:28 vti async async!
08:37 esskar joined #mojo
08:37 esskar moin
08:37 esskar about the include feature in ep:
08:37 esskar when I set a variable inside the included template
08:37 esskar it is not set outside the template
08:38 esskar can i change that behaviour somehow?
08:40 sri actually only variables you pass to render/include are localized
08:42 sri or do you mean <% my $foo = 23; %>?
08:43 sri that would be impossible to share
08:43 sri you include the result, not the template
08:44 sri merging templates would be a huge ca of worms
08:44 sri *can
08:46 sri esskar: you need to give such questions some context
08:47 esskar i put $self->stash(picture => undef)
08:47 esskar then i set $picture inside the included template
08:47 sri doesn't work
08:47 esskar and want to use it outside the template
08:47 esskar i know :)
08:48 esskar just wanted to know if there is a switch
08:48 sri you can set the stash value though
08:49 sri i think we had support for that at some point
08:49 sri anyone remember why it was removed?
08:51 esskar sri: works
08:51 esskar thanks
08:51 sri mayeb it was because you couldn't delete stash values in templates
08:51 sri since they would just get set again at the end of the template
08:53 sri which could be very confusing
08:57 achromic xantus_: going to renew mojopaste.com?
09:01 esskar sri: is <%= include 'foo', picture => \$picture %>" working?
09:01 sri sure
09:02 sri picture will be localized though and not available outside
09:02 esskar that's schade!
09:02 esskar :)
09:02 sri why?
09:02 sri you can always set picture in the stash to make it available everywhere
09:03 esskar well, but then i can't still say $picture and have always to use $self->stash('picture')
09:03 esskar it's ok though
09:03 sri huh?
09:04 sri the whole stash is initialized as local vars
09:04 sri (apart from the fact that there's a stash helper)
09:04 esskar in my controller i say $self->stash('picture' => undef)
09:05 sri why?
09:05 esskar then i say inside the included template
09:05 esskar <% $self->stash('picture' => $p) unless $self->stash('picture'); %>
09:05 esskar outside the template $picture remains undef
09:05 esskar i have to use <%= $self->stash('picture')->name =%>
09:06 esskar now
09:06 sri how would you mplement that behavior?
09:07 esskar <%= include 'foo', picture => \$picture %> using this syntax, it would be nice, to have $picture changed in the outside template when it was changes inside the include template
09:07 sri tie is a lot of overhead...
09:08 esskar but rarely used
09:08 sri exactly
09:08 sri rarely used but you would always pay
09:09 esskar there could be a ENV var or an addional include parameter
09:09 sri that would be a mess
09:09 esskar execuses :)
09:09 sri inconsistency all over the place
09:09 esskar no, it's fine how it is now
09:10 sri feel free to prove that the overhad is manageable :)
09:10 sri *overhead
09:11 esskar maybe using a different command. but it's not that important
09:12 sri i would like to see some numbers for Tie::Scalar
09:12 sri like how expensive initialization is
09:13 sri usage doesn't matter
09:13 sri since thats opt-in
09:13 esskar how is include implemented now?
09:13 sri has nothing to do with include
09:13 sri actually the whole implementation doesn't matter
09:14 sri i would just like to know how much more expensive tie is compared to assigning a value from a hash :)
09:14 sri on its own, out of context
09:15 esskar ok
09:17 sri the expensive part will be the TIESCALAR call i guess
09:17 sri since you have one method call overhead per stash value
09:17 baton8 joined #mojo
09:23 ysyrota how to get current route in a template?
09:23 sri ysyrota: depends on your definition of current route
09:24 ysyrota sri: well, where I can read about helper functions in templates? I mean url_for, etc.
09:24 * sri can't follow
09:25 Htbaa joined #mojo
09:25 sri most essential helpers have a equivalent method in Mojolicious::Controller
09:26 sri and they are listed in the helper plugins
09:26 sri you might want to be more specific with your questions
09:27 ysyrota sri: Mojolicious::Controller has url_for() that returns URL to current route, but calling url_for in template doesn't work
09:27 ysyrota sri: is there a way to get URL of current route?
09:28 sri thats what url_for does
09:28 sri without arguments
09:28 sri the helper is just a small wrapper around the controller method
09:28 sri so they should work just the same
09:28 ysyrota sri: but I get error Mojolicious::Plugin::EplRenderer:70 [9797]: Template error in "m0.html.ep": Route "" used in url_for does not exist
09:29 sri do you ever call ->render?
09:30 sri actually wait
09:30 sri there is something strange
09:31 sri "...if ($name) { croak qq/Route "$name"..."
09:31 sri thats the part printing the error
09:31 sri not the slightest idea what could cause that
09:32 sri your error seems impossible
09:33 sri and i have to give up here, please make a minimal test case so i can investigate
09:33 MojoGuest252 joined #mojo
09:33 MojoGuest252 From: http://www.google.co.uk/url?sa=t&amp;source=web​&amp;cd=3&amp;ved=0CCQQFjAC&amp;url=http%3A%2F%​2Fdev.xantus.org%2F&amp;rct=j&amp;q=websockets%​20demo&amp;ei=wQxlTO-xE9G94AaJ9NmwCg&amp;usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&amp;cad=rja (1 hits)
09:33 MojoGuest252 dfgdfg
09:33 ysyrota sri: here is the full error message: http://gist.github.com/522614
09:34 sri ysyrota: umm...thats a newline
09:34 sri did you call url_for "\n"?
09:35 sri you are doing something weird
09:35 ysyrota sri: teh templates contains only one string: <% content 'm0' => url_for %>
09:35 sri where is the ;?
09:36 sri that will get compiled to something unpredictable
09:36 sri url_for;
09:36 ysyrota sri: oops
09:38 ysyrota sri: thank you
09:40 sri esskar: basically we would have one object overhead per stash value
09:41 sri i would say we have 10 valid stash values average per request
09:45 sri not sure if it's worth it
09:45 sri 10 object instantiations overhead per template
09:45 sri each include costs extra
09:56 esskar hmm
09:58 koban joined #mojo
09:58 esskar ok, got to leave
09:58 esskar back to work on monday
09:58 esskar thanks for the talk
09:58 esskar bye
10:03 yko Sri can i ask your apply little patch? :)
10:04 sri yko: of course you can ask
10:04 yko greap :D
10:04 * yko asking.
10:05 yko http://github.com/yko/mojo/commit/f2d​4ff2903e00a1547cb0d0123ad2b0f695e20da or see pull request
10:05 yko 7 characters makes so much difference :)
10:05 yko Actually i just want to ask, is it ok using deeper namespaces for commands?
10:06 sri hmm
10:06 yko sure, generate loads it's plugins
10:06 sri problem is that it breaks listing
10:06 yko hmm. you are right.
10:06 yko that's for what i was asking
10:06 sri thats why generate and the like have their own lister
10:06 yko damn, everything was so good. :\
10:07 sri i think if you go deeper you should just use a custom lister
10:07 yko i dont't think you would like lister in 'routes'
10:07 sri what do you need it for?
10:07 yko i want verbose routes :)
10:08 sri ./myapp verbose_routes?
10:08 sri ./myapp yko_rocks
10:08 yko ok :(
10:08 yko enyway thank you
10:08 yko *anyway
10:09 MojoGuest911 joined #mojo
10:09 MojoGuest911 From: http://www.google.com/search?ie=UTF-​8&amp;oe=UTF-8&amp;sourceid=navclien​t&amp;gfns=1&amp;q=websockets+demo (1 hits)
10:09 sri ./myapp routes-verbose is not exactly pretty
10:09 yko ./myapp routes-v looks good :p
10:09 yko but i understand you, you are right
10:10 sri maybe your verbose stuff is so good it should be in core?
10:10 sri ./myapp routes -v
10:10 yko it's experimental for now
10:10 yko but ye, i thinking of that
10:10 yko maybe one day :D
10:11 yko anyway i want to make it separate command for a while, if people (or at least core team) would like it - than we can talk about implementing in core
10:11 yko Actually, who cares what people would like :D
10:12 * yko playing bandura and sings sad song.
10:13 * sri cares what people would like
10:14 yko you are bot, should you? :)
10:15 yko wait a minute... where's my rifle?
10:25 sri i'm like the evil twin of skynet
10:30 yko :))
10:35 sri i will crush the next person to say i'm scary...
10:38 yko who said that you are scary?
10:39 sri i'm not supposed to say :/
10:39 yko Youre so sweet and lovely one, and that military cap and so stylish cup...
10:39 sri :D
10:39 * sri hugs yko
10:39 yko and even that glasses, ye ♥
10:48 vti oO
11:07 al joined #mojo
11:19 ysyrota is there a way to get name of current template?
11:20 sri don't think so
11:23 ysyrota sri: ok, thanks. I will put the name in template
11:25 sri ysyrota: why do you need the name?
11:26 ysyrota sri: I want to highlight current items in menu on page
11:27 sri sounds like you could just use $self->match->endpoint->name or so
11:27 ysyrota sri: the menu isn't flat and, for example, if I select page on 3rd level, I want to hightlight appropriate 3rd, 2nd and 1st level menus
11:27 sri which would be the name of the current route
11:28 sri hmm
11:35 sri oh, tie'd stash values in ep templates would also be inconsistent with other template engines like TT
11:36 sri really seems like a better idea to consider them read only
11:36 sri thoughts?
11:38 sri not to mention bad practice, since actual logic doesn't belong in a template
11:42 mvuets joined #mojo
11:42 ysyrota sri: in case you are interested, this is the sample where I needed template name http://gist.github.com/522735
12:03 janus that reminds me of the stash clash fights i had, doing somthing against it is highly appreciated ;)
12:04 vti sri: did you commit your ioloop improvements?
12:25 arthas joined #mojo
12:35 gabiruh_ joined #mojo
12:40 sri janus: stash clash what?
12:40 sri vti: not yet
12:44 sri janus: if there's a problem you need to bring it up the right way
12:44 mvuets_ joined #mojo
12:51 janus heh, haven't found the time yet, hence no specific arguments for a problem description yet
12:52 janus but basically i've put things in the stash and wondered why things broke ;)
12:52 janus as in, i didn't look before what's in it already
12:53 janus as of now... can be dismissed as whining i think ;)
12:55 sri ah, so there is no problem
12:57 janus :)
13:01 sri it's just the usual tradeoff for a global namespace
13:42 dotan joined #mojo
13:52 * und3f is listening to Muddy Waters - I've Got My Mojo Working
13:53 und3f My mojo really working :P
13:57 MojoGuest830 joined #mojo
13:57 MojoGuest830 From: http://www.google.fr/search?hl=fr&amp;q=ex​tjs+websocket&amp;cts=1281707823313&amp;aq​=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai= (1 hits)
13:57 MojoGuest830 Waou
13:57 ysyrota und3f: check one more time :-)
13:57 yko xantus++
14:05 sri xantus++ # indeed
14:05 yko ouch. http://dev.xantus.org/ doesn't work for me (ff, chrome, opera)
14:06 MojoGuest336 joined #mojo
14:06 yko strange :\
14:08 sri must be your mojo
14:08 * sri forwards yko some of the "no mojo in pants" spam
14:09 yko my mojo?
14:09 sri you have to get your mojo working
14:09 yko :\
14:12 und3f yko, just like muddy waters
14:14 yko ahhh... true.blood.s03e08.ru
14:15 yko btw, Sookie sound in russian very similar to bitch that brings some fun
14:42 ashleydev joined #mojo
14:49 koban left #mojo
14:51 dotan left #mojo
15:28 arthas_ joined #mojo
16:07 Akron joined #mojo
16:39 Akron left #mojo
17:36 xantus_ sri: mojolicious.net is coming up for expire, do you want to take it over?
17:36 sri not really
17:38 xantus_ k
17:38 xantus_ I renewed mojopaste
17:39 xantus_ and I'll probably redo it
17:41 xantus_ wait, what does a normal flash policy file request look like
17:57 ask joined #mojo
18:11 * sri would like some shoerter domains for a change :/
18:11 sri *-e
21:11 figaro joined #mojo
22:09 ashleydev joined #mojo
22:12 ashleydev_ joined #mojo
23:03 su-bzero_ joined #mojo
23:13 ask_ joined #mojo
23:45 ask joined #mojo

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