Camelia, the Perl 6 bug

IRC log for #mojo, 2010-07-22

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

All times shown according to UTC.

Time Nick Message
00:05 sekimura_ joined #mojo
00:09 stephan48 question...
00:09 stephan48 when i have the i18n plugin and have english as default lang
00:09 stephan48 could i basically omit the english lang file?
00:10 sri ye
00:11 stephan48 fine :)
00:11 stephan48 since i got the app thingy working now i try now to convert my  hp to a mojo app
00:11 stephan48 or better the placeholder for my hp ;)
00:13 sri Zzz
00:13 stephan48 good night sri :)
00:13 sri nn :)
00:13 stephan48 nn?
00:23 xantus_ non nude, or night night :P
00:23 stephan48 :)
00:24 xantus_ Mojo URL docs...
00:24 xantus_ $url->query->params(foo => 'bar')
00:24 xantus_ should be param
00:25 xantus_ params accepts an array ref
00:30 stephan48 mh
00:31 xantus_ mh?
00:31 xantus_ hh
00:36 stephan48 mh i have a strange issue with the i18n module
00:47 stephan48 as sri sayed i dropped the english dict
00:48 stephan48 but now i get blank page when i access page with lang set to english/get it only in german
00:48 stephan48 and when a phrase is missing in a dict i get a blank page too
00:51 sekimura joined #mojo
00:53 stephan48 but more to that later now good night :)
01:15 syn joined #mojo
01:19 xantus_ nn
01:24 xantus_ nice
01:29 xantus_ config mojo using a couch doc
01:43 xantus_ plugin 'couch_config' => [ 'http://127.0.0.1:5984/configs' => 'mojo_config' ]
01:43 xantus_ mojo_config is the doc id
01:48 xantus_ will post it later on github
01:48 xantus_ theres a couch db module that goes with it
02:44 ashleydev joined #mojo
03:13 janus joined #mojo
03:17 yakudzo joined #mojo
03:18 su-bzero joined #mojo
04:03 tholen42 joined #mojo
04:48 Foxcool joined #mojo
05:18 Su-Shee joined #mojo
06:31 Alias_ joined #mojo
06:58 esskar joined #mojo
07:10 jest joined #mojo
07:34 yko joined #mojo
08:42 dotan joined #mojo
09:12 fhelmberger joined #mojo
09:15 yko joined #mojo
09:15 yko hm. looks like Mojo::DOM is a hungry one
09:16 yko ->at produces nice memory leak
09:17 yko but i can be wrong :)
09:50 cognominal joined #mojo
09:51 * sri yawns
09:51 yko ouch. it's not ->at, its ->parse
09:51 yko morning
09:52 sri yko: feel free to fix
09:52 yko digging about it
09:54 vti strange that some it people can't write in simple english
09:55 * yko blushes.
10:05 sri i have a strange feeling someone doesn't understand http pipelining or so
10:05 sri and vti cleared it up
10:06 yko found leak, fixing
10:06 dotan sri: I think there was an example or a demo you had (maybe in your old blog) which implied http pipelining = streaming
10:06 sri yea, http pipelining is something entirely different
10:06 vti and is not actually used in browsers ;p
10:07 sri actually it is
10:07 sri firefox has settings to enble it
10:07 sri *+a
10:08 sri all servers that are http 1.1 compliant have to support pipelining, only clients can opt out
10:08 sri and most clients just disable it with a setting due to too many broken servers out there
10:12 vti there is only one reall http1.1 webserver
10:12 vti and it's called...
10:12 vti MOJO!!!!!
10:13 sri actually all big name web servers get it right :o
10:16 sri it's even trivial to implement on the server side
10:17 sri http is so much more complicated on the client side
10:25 sri yko: where is the leak?!
10:26 * sri cracks the whip
10:26 * vti cracks the crack
10:27 yko sri: http://github.com/kraih/mojo/bl​ob/master/lib/Mojo/DOM.pm#L808
10:27 yko here i think
10:27 garfield [ lib/Mojo/DOM.pm at master from kraih's mojo - GitHub ]
10:27 garfield http://xrl.us/bht4ja
10:30 yko sri: but i'm still unshure
10:33 yko at least, if replace $$current with [] - parse does not leak
10:40 sri yko: huh, why would that weaken not work?
10:40 yko wait. i think there's in another place also
10:40 yko at least there's circular ref in _end i found
10:40 yko at 'return'
10:41 yko but i think there's more leaks.
10:46 chansen joined #mojo
10:56 vti sharifulin ignores me :(
10:57 GitHub1 joined #mojo
10:57 GitHub1 mojo: master Sebastian Riedel * f46d3f2 (2 files in 1 dirs): cleanup - http://bit.ly/bLOnvX
10:57 GitHub1 left #mojo
10:57 sri yko: that might fix it
10:57 sri the fact that i had to use isweak should have been a hint :)
10:58 * sri hugs vti
10:58 vti why doesn't it work as expected?
10:59 vti i mean isweak checking
10:59 sri vti: i'm not entirely sure, but i think i've weakened the wrong scalar
11:00 yko checking
11:01 yko nmake is hell slow... :\
11:02 yko hehe, main leak fixed, but there's more :D
11:03 sri -.-
11:04 yko not shure
11:04 yko it's so small, let me test
11:05 * yko parses 3gb of html with Mojo::DOM
11:05 sri :)
11:05 vti nice :D
11:05 vti yko: how long does it take? :)
11:05 sri a bit much for a dom parser
11:05 yko actually DOM is slow ithink, but im lazy to rewrite code in TreeBuilder or something like that
11:06 yko vti about 4h on my notebook i think
11:06 vti oO
11:06 * yko thinking, if he should rewrite that code in treehtml
11:06 vti where did you get 3gb html file? :D
11:07 yko files
11:07 jawnsy joined #mojo
11:07 yko not just single file
11:07 yko downloaded with Mojo::Client, shure!
11:07 vti data mining? ;p
11:07 vti content stealing? ;p
11:07 sri :o
11:07 yko nope... anyway, Mojo::Client spider that downloads that html code will finish only in 3-4h, so i'm lazy to rewrite in Tree::Builder
11:08 yko ye, something like that
11:08 * yko giggles.
11:08 yko onem ore thing to detect memory leaks
11:09 yko i was wrong, now im shure there's no more leaks in Mojo::DOM
11:09 sri \o/
11:10 yko sri++
11:10 yko i couln't find that leak :(
11:10 sri ah, TreeBuilder uses an xs parser, it should be faster
11:10 yko much
11:10 yko i think ill rewrite the code anyway, huh
11:10 vti it would be nice if we had an automatic XS discovery in Mojo, so it will grab Mojo::DOM::XS if that's available
11:11 vti or Mojo::JSON::XS, without writing Mojo::JSON::Any and replacing that in all places
11:11 vti Mojo::Headers::XS :)
11:12 sri well, the few optional xs prereqs we have already annoy the hell out of me
11:12 sri i really don't want to have to worry about more
11:13 sri if we can make modules like Mojo::JSON::Any easier sure, but in core is not an option
11:13 vti but it makes it really hard to use xs, and every time one has to write the same fallback code, and then replace class_name everywhere, and not everywhere it is possible and son on
11:14 vti *so on
11:14 sri where is it not possible?
11:14 vti how can i replace Mojo::Message for example, if you inherit it in Mojo::Message::Request
11:15 sri huh?
11:15 sri the transaction builder can be overloaded
11:15 sri there is a Mojo::Message::XS available?
11:15 vti so it is possible to use alternative parser?
11:15 vti i was going to write one...
11:16 sri of course it is possible
11:16 vti with the same oo interface
11:16 sri not sure about that
11:16 sri why would i worry about somethign that doesn't even exist?
11:17 vti i don't know :)
11:17 sri ...
11:17 vti i guess it is better to write own tx object with the same public interface and pass it everywhere, is this possible?
11:18 sri see Mojo.pm
11:18 yko it's possible to just preload your Mojo::Message::XS and into Mojo::Message namespace, it would prevent loading true Mojo::Message
11:18 yko if place that in script/myapp before use Mojo
11:18 sri thats another possibility
11:19 yko shure that's dirty, but maybe than sri, looking on our dirty and ughly design  consider to make possibility to overload native Mojo api :D
11:19 sri but before you start replacing parts with xs modules, it might be worth optimizing the perl code we have
11:20 sri the current code is not optimized at all
11:20 sri a few 100% performance increase should be easily possible
11:21 sri that said, http performance is quite unimportant
11:22 sri vti: ok, since you were not very clear, what *exactly* do you want?
11:25 sri there are still low hanging fruits
11:25 sri like unneccessary accessor calls
11:25 sri those are huge performance killers
11:25 sri yet nobody bothered looking for them...
11:27 vti oh, well
11:28 vti i have a performance fix for mojo::base
11:28 vti not really huge
11:28 sri show
11:29 sri vti: now, what exactly is too slow for you?
11:29 vti nothing is
11:30 sri then why annoy me with it? :(
11:30 vti i am just asking
11:30 vti :)
11:30 vti https://gist.github.com/e0da0fd2b6128a296f97
11:30 sri you were complaining for no reason
11:31 sri vti: that code is not performance relevant
11:32 vti i was complaining that if i wanted to write xs module i would have to repeat myself like in mojo::json::any
11:32 vti but maybe that's my problem
11:33 sri repeat?
11:34 sri so you are complaining that replacing a parser with a xs version takes 3 instead of 1 line of code?
11:34 vti don't kill me
11:34 * sri sets vti on fire
11:35 sri vti: maybe you should start working on real problems ;p
11:35 vti sri: maybe :)
11:35 sri vti: and read this! http://www.slideshare.net/Tim.Bunc​e/develnytprof-v4-at-oscon-201007
11:36 garfield [ Devel::NYTProf v4 at OSCON 201007 ]
11:36 garfield http://xrl.us/bht4nw
11:36 sri very good talk about optimization
11:37 sri we have a component system, as long as components can be manually replaced with other components it is perfectly fine imo
11:37 sri i really don't care if it takes 1 or 5 lines of code
11:37 sri as long as it's possible
11:38 sri xs auto magic means a lot of pain for me, and i will fight to prevent it
11:38 sri IO::Socket::INET6... case closed ;p
11:39 crab what's wrong with IO::Socket::INET6?
11:39 crab (i've never used it or tried to)
11:39 sri it never works
11:39 crab how come?
11:39 sri it breaks every release in a new unfunny way
11:40 sri like 90% of our cpantesters fails ever were because of it
11:40 dotan sri: ojo doesn't seem to work for me on the command line with basic auth (twitter api, name/pass in url). Mojo::Client does work
11:40 sri i have it disabled wherever i can by default now
11:40 sri dotan: ojo *is* Mojo::Client
11:44 dotan sri: I know. It's like magic that it gives me a forbidden while M::C works.
11:45 sri dotan: doesn't make much sense
11:47 dotan http://gist.github.com/485873
11:47 garfield [ gist: 485873 - GitHub ]
11:48 * sri notices that vti is hiding now that sri told him how to optimize
11:49 vti sri: ;p
11:53 yko Does HTML::TreeBuilder use any XS stuff?
11:53 sri yko: yes, HTML::Parser
11:53 yko im not shure, but it seems to me that TreeBuilder works with the same speed as Mojo::DOM :D
11:54 sri it's a pure xs parser as far as i can see
11:54 sri that would be funny
11:56 yko i mean not speed of parsing html, but speed of finding something in parsed tree
11:56 sri no idea about that
11:57 sri but i really don't care about performance as long as something is *fast enough*
11:57 yko 'those crazy russians...' (c) sri
11:58 sri :D
12:01 sri actually, i don't even think there are many cases where you'll notice a real difference if your json parser does 1000 or 100000 messages per second
12:02 sri besides micro benchmarks
12:02 vti ok!
12:02 sri you brought it up ;p
12:04 sri but i would really like it if someone searched and profiled for low hanging fruits
12:05 sri Mojo::Stateful might also be a performance killer
12:06 vti afair it was always ioloop
12:07 sri Oo
12:07 vti i will stop now!!
12:07 sri vti: what makes you think that?
12:08 sri the examples directory has a minimal http server for ioloop profiling
12:08 vti i used to run ntyprof when i was profiling showmethedesktop
12:08 sri well, then it's io in general
12:08 sri which is actually a good sign
12:09 vti ye
12:09 sri btw. have you seen stackvm?
12:10 sri http://stackvm.com/
12:10 garfield [ StackVM - virtual machines from your browser! ]
12:10 sri it's pretty much showmethedesktop on node.js
12:10 sri the vm part can be ignored, they just use vmware
12:11 vti damn it
12:11 sri they have the exact same performance problems you had
12:11 vti yko: we have to finish showmethedeskopt!
12:11 yko i see
12:11 vti i want to run it as a service with showmetheshell too
12:11 vti and try to make some money :D
12:11 sri moving a mouse cursor is almost impossible
12:12 vti i was going to rewrite some vnc crap in C
12:12 sri performance will still be crap i bet
12:12 vti js is slow too, ye
12:12 vti on mobile devices that could be impossible
12:12 sri showmetheshell is much better short term
12:13 yko there's showmethershell for mobiles :D
12:13 vti showmetheshell doesn't need that much polishing as vnc
12:13 sri how about showmetheshell on ec2? :)
12:14 yko sri: there's also problem with Mojo::Client i think.... if you are downloading 3gb files with single process, your temp dir will contain all 3gb :D
12:14 sri yko: where else would those 3gb go?
12:14 vti sri: never used clouds so far
12:15 sri yko: or do you want them in RAM? :D
12:15 yko well, you're right, but there's no cleanup in tx destroy i think
12:15 sri yko: there is in asset destroy
12:16 sri dotan: no idea why that happens, it's magic :/
12:19 vti sri: i am afraid people won't trust ssh credentials to us :)
12:20 sri vti: thats why you sell the vnc software as a whole, or ec2 vms :)
12:23 GitHub154 joined #mojo
12:23 GitHub154 mojo: master Sebastian Riedel * 7e6d065 (2 files in 2 dirs): added test - http://bit.ly/aFjwoN
12:23 GitHub154 left #mojo
12:23 vti i don't understand how do i sell open source, except selling it as a service =/
12:23 sri dotan: i can't replicate it in a test, seems to work flawless
12:24 sri ok, if it's open source you sell it as a service or under a commercial license with support contract
12:31 yko joined #mojo
12:33 Alias_ joined #mojo
13:03 GitHub180 joined #mojo
13:03 GitHub180 mojo: master Sebastian Riedel * 53249ff (2 files in 2 dirs): cleanup - http://bit.ly/bsf5P4
13:03 GitHub180 left #mojo
13:04 sri dotan: might have fixed it
13:05 crab master Sebastian Riedel. heh.
13:06 vti obey your master!
13:09 yko Mojo::DOM seems to be litle bit faster then HTML::TreeBuilder
13:10 sri ...BLASTWAVE
13:10 yko gggg
13:11 yko sri++
13:11 yko damn, that was really fun... *laughing*
13:12 sri http://www.romanticallyapo​calyptic.com/home?page=25
13:12 garfield [ Romantically Apocalyptic ]
13:12 garfield http://xrl.us/bhsvdx
13:12 yko ye
13:24 sri sharifulin is weird, if he wants to ask something why doesn't he just ask Oo
13:29 vel joined #mojo
13:39 crab who is sharifulin and what did he do instead?
13:40 sri see mailing list
13:44 crab oh, i see. i'm not on the list.
14:33 dotan sri: sorry, I'm an idiot. I had junk on the end of my password in one oneliner. Wrote the test and saw I was mistaken.
14:34 sri dotan: actually you were right
14:34 sri there was a bug
14:34 sri i reproduced it :)
14:34 sri it was possible to geenrate lower case http methods, which twitter seems not to like
14:34 sri *generate
14:35 dotan !!
14:35 dotan oO, even
14:38 GitHub113 joined #mojo
14:38 GitHub113 mojo: master Sebastian Riedel * e981972 (3 files in 3 dirs): cleanup - http://bit.ly/blIEQz
14:38 GitHub113 left #mojo
14:39 sri think it's better to require embedded apps to inherit from Mojo
14:44 GitHub172 joined #mojo
14:44 GitHub172 mojo: master Sebastian Riedel * 6ba961c (1 files in 1 dirs): fixed typo - http://bit.ly/99h3CP
14:44 GitHub172 left #mojo
14:46 sri still undecided, should we accept everything with a handler() method or just Mojo subclasses :S
14:46 sri thoughts?
14:57 vti no idea
14:57 vti does it really matter?
15:01 ashleydev joined #mojo
15:07 sri vti: not for me, but maybe someone had plans
15:08 sri the thing about base class detection is that you can just throw all your modules into the same directory, and the dispatcher just picks up controllers and app
15:09 sri *+s
15:09 vti but you check controller's base class
15:09 sri yes and app base classes now (Mojo)
15:10 sri controllers can be apps now too ;p
15:10 sri so if everything with a handler() method is considered an app, it gets tricky
15:11 sri whatever, i think the current solution is the right one
15:12 vti oO
15:12 sri vti: http://github.com/kraih/mojo/blob/mast​er/lib/Mojolicious/Guides/Routing.pod # search for embedding
15:12 garfield [ lib/Mojolicious/Guides/Routing.pod at master from kraih's mojo - GitHub ]
15:12 garfield http://xrl.us/bhpfwt
15:12 sri i've rewritten that part yesterday
15:14 vti so plugins can be really evil...
15:14 vti embedding their own applications and controllers
15:14 sri sure
15:15 sri vti: whenever you append "..." i think you are being sarcastic -.-
15:15 dotan sri: The Mojolicious::Plugin::MyEmbeddedApp example - maybe just a core plugin that accepts a hash of paths and app names and adds detour routes to all of them?
15:15 sri dotan: why?
15:15 vti sri: hm, sorry :)
15:16 sri dotan: the point is to give you flexibility, not to abstract embedded apps (for now)
15:16 dotan Because I wrote one and it was so trivial I felt dirty
15:16 sri ;p
15:16 dotan I see your point.
15:17 sri well, make it a plugin, if it gets popular we'll core-ify it :D
15:17 dotan You have support, but no conventions or ecosystem yet.
15:18 sri i'm all for adding common conventions to the core, but those need to be established first
15:20 sri sharifulin should really just come here to ask questions
15:34 ashleydev_ joined #mojo
15:43 GitHub114 joined #mojo
15:43 GitHub114 mojo: master Sebastian Riedel * fb06ca3 (1 files in 1 dirs): simplify embedding examples - http://bit.ly/bsxux4
15:43 GitHub114 left #mojo
15:46 sekimura joined #mojo
15:53 _mpu "But note that by default the original path will simply be reused for the embedded application." why is this the default ?
15:53 sri _mpu: why not?
15:55 sri partial matching is something the developer needs to really think about first
15:55 _mpu $r->route('/foo')->to('bar#'); +  get '/foo' => sub { there is redundant information
15:55 sri _mpu: whats the alternative?
15:56 sri make ->route just partial match by default?
15:56 sri (no thats not an option)
15:57 _mpu okay
15:57 _mpu :)
15:57 sri the alternative is not to show how embedding really works and just use detour() for all examples
15:57 sri you are not supposed to use to() for embedded apps really
15:57 sri i just want to show step by step how it works ;p
15:59 _mpu use detour !!
15:59 _mpu :)
15:59 _mpu here is the solution
16:03 GitHub90 joined #mojo
16:03 GitHub90 mojo: master Sebastian Riedel * d0a0172 (1 files in 1 dirs): simplify embedding examples - http://bit.ly/cY4OER
16:03 GitHub90 left #mojo
16:03 sri ok, killed that example
16:07 GitHub109 joined #mojo
16:07 GitHub109 mojo: master Sebastian Riedel * 50ab699 (1 files in 1 dirs): cleaned up examples - http://bit.ly/aq729i
16:07 GitHub109 left #mojo
16:07 _mpu we don't have anymore hardcore internals information
16:07 _mpu ...
16:08 sri nope, thats all mine now!
16:08 sri think i like the current version
16:10 Grauwolf "the value of being easy or readable to newbies or outsiders is largely tied to the value of being a newbie or an outsider. Once you are neither you really need your language to have other strengths". i like that quote
16:11 sri hehe
16:12 sri nice one
16:16 Grauwolf source: http://news.ycombinator.com/item?id=1537497
16:16 garfield [ Hacker News | " ... as well as some explanation of why that should matter."It doesn't.I've he... ]
16:30 ashleydev joined #mojo
16:36 Grauwolf http://code.foo.no/2010/07/21/​moving-perl-up-the-value-chain
16:36 garfield http://xrl.us/bht5bo
16:44 sri thats what i'm saying for ages now...
16:45 sri what perl really needs is a sleek cms like drupal
16:47 sri http://groups.drupal.org/jobs # seriously
16:47 garfield [ Drupal Jobs | groups.drupal.org ]
16:47 sri 1 of 167 ;p
16:47 zakame hmm kinda reminds me of that intent to get the everything engine on perlmonks move to perl6 (or is that perl6monks?)
16:48 sri how is that related?
16:49 zakame haven't thought through that, it just reminded me of that discussion some weeks ago
16:49 sri ;p
16:51 dotan Regarding Perl Apps - look at this other HN link - http://www.roundhousesupport.com/b​log/9-things-you-should-be-doing-w​ith-your-server-but-probably-arent
16:51 garfield [ 9 Things You Should Be Doing With Your Server, But Probably Aren't - RoundHouse Managed Server Support ]
16:51 garfield http://xrl.us/bht5cp
16:52 dotan Why are all those server apps written in Ruby?
16:52 dotan (yeah, yeah, DSLs)
16:52 zakame here's the perlmonks thread: http://perlmonks.org/?node_id=846326
16:52 Su-Shee because perl is niche language nowadays and usally nowhere mentioned in web-related articles and such.
16:52 dotan But it's also that ruby hackers need to manage their own servers to get their web apps to work
16:52 garfield [ New PerlMonks for Perl 6 - A Good Idea ]
16:54 Su-Shee "perl community unified"? I call it "lock-in" nowadays. you can't even google perlstuff properly.
17:03 sri Su-Shee: what have you done lately to improve perl and its reputation?
17:06 vti :D
17:06 * vti grabs pop corn
17:06 * sri grabs a pitchfork
17:08 Su-Shee sri: sold perl stuff for about half a million euro.
17:10 sri Su-Shee: how to google that? :)
17:10 Su-Shee you know.. this commercial thing.. bringing perl into companies and businesses..
17:12 Su-Shee oh, and I researched for szagab. also for this commecial thing. and implemented some stuff in mysql dbd 6.
17:38 sri jeez... unbuffered writing to the client would be horrible
17:38 sri (re list)
17:39 sri blocking write calls all across the internet, does that really sound like a good idea? Oo
17:41 Grauwolf sri: i'm more the wordpress kind. but yes. you're right
17:44 Grauwolf the only two blog/cms/wiki-thingys i remember off the top of my head are foswiki an movabletype
17:45 Grauwolf but installing them isn't nearly as easy as drupal or wordpress
17:46 sri http://groups.google.com/group/mojolicio​us/browse_thread/thread/df2874b4de3b337a # hope my last response was not too rude
17:46 garfield http://xrl.us/bht5jd
17:47 sri but i wanted to make it absolutely clear
17:49 vti safari crashed because of showmetheshell =/
17:53 robinsmidsrod when I add a variable to the $self->render() call, how can I verify if that variable is set before I use it in an ep template?
17:53 robinsmidsrod just using $var blows up if it is unset
17:56 sri robinsmidsrod: it's just perl, don't think you can
17:57 sri the alternative is to use $self->stash(...)
17:57 sri i think we also have a stash helper
17:57 robinsmidsrod sri: so if exists $self->stash->{'var'} would work?
17:58 sri for what?
17:58 robinsmidsrod for checking if the key is present in the hash sent to the $self->render() call
17:58 robinsmidsrod ...from a template
17:59 sri using $var is compile time
17:59 sri my advice is simply not to have optional stash vars
17:59 sri set them to undef or so
18:01 robinsmidsrod then I'd have to make an abstraction layer just for the sake of having optional settings in my api, that seems a little bit boring...
18:01 robinsmidsrod where is $self->stash documented?
18:01 sri some controller base class
18:02 sri <% my $var = stash 'var' %>
18:02 sri use this then
18:08 mvuets joined #mojo
18:13 robinsmidsrod seem slike if ( exists stash->{'var'} ) { ... } works
18:13 robinsmidsrod wasn't aware of the stash helper
18:20 sri all helpers are in the two plugins
18:20 sri guess i should add a full list to the cheatshet
18:20 sri *+e
18:20 mvuets joined #mojo
18:40 spleenjack joined #mojo
18:56 Su-Shee left #mojo
19:17 ask joined #mojo
19:27 stephan48 sri: you told me yesterday that when i have constructs like l('my sentence') in my templates which are in english i could ommit the english dict or?
19:27 sri stephan48: sure, you just need the default skeleton
19:27 stephan48 you mean leave the $Lecture thingy empty?
19:28 sri i think the maketext documentation explains that best
19:29 sri stephan48: t/mojolicious/i18n_lite_app.t is about as minimal as it gets
19:29 sri defaulting to en, with only a de dictionary
19:30 vti i can't figure out how to use websockets in a normal app =/
19:31 sri whats normal these days...
19:31 vti i am used to lite!
19:31 vti you spoiled me
19:31 sri vti: any normal route will do
19:31 sri there is no magic :)
19:32 sri websocket in lite is just a get with an additional check
19:32 vti so i just do ->websocket(1)?
19:32 sri only if you want the check
19:32 sri no (1) required i think
19:34 sri the websocket handshake is just a normal get request with a few magical headers
19:34 stephan48 is there some thing like chaining possible in lite? i want to prepend the lang code( / for en and /de for de) before all files
19:34 stephan48 in docs i wasnt able to find something
19:37 dotan waypoints?
19:38 sri under '/:lang' => sub {...};
19:38 sri ?
19:39 sri oh wait
19:39 sri under '/:lang' => {lang => 'en'};
19:39 sri that should do it
19:39 sri but generally thats a bad idea
19:40 stephan48 why?
19:40 sri i would just use header detection by default and store user preferences in a session
19:40 sri less effort
19:40 stephan48 k
19:40 stephan48 i dont like that :)
19:40 sri header detection just works out of the box
19:43 stephan48 and what would i do when i want to make it possible for $user to change the lang on per link basis?
19:44 sri sounds like crazy talk
19:44 stephan48 why?
19:44 sri why would a user want that?
19:45 sri "oh yea lets see...i want my preferences in chinese...the file list in german...and the login page in french..."
19:45 dotan sri: because he has a half-assed translation, maybe? the user would want to switch language as a fallback
19:45 sri naah, i don't think so :)
19:45 stephan48 jop
19:45 stephan48 for example
19:45 sri dotan: my solution includes that
19:45 stephan48 dotans way is one use case
19:46 sri reload and update cookie
19:46 dotan sri: http://corky.net/dotan/log​/images/perl6-watchmen.jpg
19:46 garfield http://xrl.us/bht5xn
19:47 sri lol!
19:48 sri dotan: but why not the orange one?
19:48 sri *shakes fist* i hate the purple version
19:49 dotan :) I like the orange one best, but I wanted something specifically perl 6, and not the Rakudo one (so not the pink).
19:50 sri :/
19:53 sri dotan: have you tweeted it yet? :)
19:53 dotan yep.
19:56 sri retweeted
19:56 Grauwolf lol
19:56 Grauwolf nice
20:03 stephan48 http://hpnew.stejau.de/ <- sri i have there now no en dict. but i get all german content even when the lang is en...(look in site header)
20:03 garfield [ Stephan Jauernick - lang: en - Main Page ]
20:03 sri stephan48: it's tested
20:03 stephan48 k.
20:04 stephan48 but theres also no en dict in test and there it seems to work also...
20:04 sri stephan48: umm, i get all english clicking the link
20:05 sri did you call the languages helper with your custom language?
20:06 sri like <% languages stash 'lang'; %>
20:06 sri otherwise it would still use header detection
20:06 stephan48 i wrote the languages thingy in my action
20:07 stephan48 sri: please look into the header of the site... there it says lang: en - Startseite
20:07 stephan48 where Startseite is "Main Page" in the template file
20:08 sri no idea
20:08 stephan48 :/
20:09 sri try turning it into a failing test case if you want me to take a look
20:11 stephan48 ok
20:11 dotan sri: uploaded slightly different version, your logo now pink instead of split-dog-brain-purple.
20:12 sri dotan: better :)
20:14 dotan :)
20:24 dotan left #mojo
20:53 vti sri: http://showmetheco.de:4040/
20:53 garfield [ ShowMeTheShell ]
20:54 sri but i don't trust you!
20:54 vti :D
20:55 vti unique link is generated, you can send it to a friend, and he will join
20:55 vti like a web screen
20:56 sri cool
20:56 sri you need a video preview
20:56 vti ye
20:56 sri anyone got a garbage ssh shell for me? :)
20:57 sri will make a video
21:05 stephan48 sri: you saied here you get english? http://hpnew.stejau.de/
21:06 stephan48 "Main Pageen" not "Startseiteen"?
21:06 stephan48 sri: i can make you a acc but can i trust you? :)
21:06 sri german
21:06 stephan48 "Startseiteen"?
21:07 sri ye
21:07 stephan48 k
21:07 stephan48 thats strange
21:07 stephan48 $t->get_ok('/')->status_is(200)->content_is("Main Pageen\n");
21:07 stephan48 when i access the page this way i get a correct match
21:08 stephan48 http://abc123.pastebin.com/5UnARi69
21:08 garfield [ $t->get_ok('/de')->status_is(2 - Stephan48 - 5UnARi69 - Pastebin.com ]
21:08 sri accept language headers
21:09 stephan48 k
21:09 stephan48 but i set the lang.......
21:09 stephan48 you can see at the "en" behind the Startseite
21:10 sri is the live site cgi?
21:10 stephan48 no
21:10 stephan48 ap2 proxyed via proxypass
21:10 stephan48 but not reverseproxy i think
21:14 sri i might be able to replicate the bug
21:19 sri interesting, you can't switch languages
21:19 sri fixing
21:20 stephan48 :)
21:20 stephan48 so not my bug?
21:20 stephan48 my failure*
21:50 GitHub132 joined #mojo
21:50 GitHub132 mojo: master Sebastian Riedel * 497fc00 (4 files in 4 dirs): fixed language switching in Mojolicious::Plugin::I18n - http://bit.ly/9ZdI3c
21:50 GitHub132 left #mojo
21:50 sri stephan48: that should fix it
21:51 ltriant joined #mojo
21:52 sri problem was that we didn't really geenrate a proxy class for the default language
21:52 sri *generate
21:53 sri now you can switch at any time
21:54 stephan48 i am thinking now about using the "under" stuff to make it possible to specify a ?lang param to switch lang
21:55 stephan48 is this a good or rather a bad idea?
21:56 sri not worse than the stuff before ;p
21:56 stephan48 not worser but not better?
21:56 dotan joined #mojo
21:57 sri just try it
21:58 ferreira joined #mojo
21:58 stephan48 works now
21:59 sri vti: happy birthday! :)
21:59 stephan48 1 min to early :)
21:59 sri he's in another timezone
21:59 stephan48 ah!
21:59 stephan48 vti: happy birthday, and i am sorry for you :)
22:01 vti sri: thanks :)
22:01 vti stephan48: why sorry? ;p
22:02 stephan48 vti: $time_left_till_dead-$1_year ;)
22:03 vti it decreases with every second!
22:03 stephan48 yea
22:03 stephan48 but the server op would kill me when i remind you of that each second so i do it once a year ;)
22:06 vti very nice of you ;p
22:08 vti time for bed, tomorrow is a great day :D
22:10 dotan happy birthday vti!
22:20 tempire Can a default layout be set in startup?
22:21 sri yes ->defaults(layout => ...)
22:22 sri or per route
22:22 sri (github only feature)
22:23 sri Zzz
22:49 ashleydev joined #mojo
22:57 stephen joined #mojo
23:22 ask joined #mojo
23:46 baton8 joined #mojo

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