Camelia, the Perl 6 bug

IRC log for #mojo, 2010-10-24

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

All times shown according to UTC.

Time Nick Message
00:11 sri wow
00:23 spleenjack1 left #mojo
01:45 ashleydev left #mojo
01:45 tardisx left #mojo
01:45 meraxes left #mojo
01:45 und3f[A] left #mojo
01:45 jamesw left #mojo
01:45 memowe left #mojo
01:45 diegok left #mojo
01:45 rhaen left #mojo
01:45 ryanc left #mojo
01:45 fish_ left #mojo
01:45 kthakore left #mojo
01:45 DaTa left #mojo
01:45 hidek___ left #mojo
01:45 charsbr left #mojo
01:45 stephan48 left #mojo
01:45 crab left #mojo
01:49 ashleydev joined #mojo
01:49 tardisx joined #mojo
01:49 meraxes joined #mojo
01:49 und3f[A] joined #mojo
01:49 jamesw joined #mojo
01:49 memowe joined #mojo
01:49 diegok joined #mojo
01:49 rhaen joined #mojo
01:49 ryanc joined #mojo
01:49 kthakore joined #mojo
01:49 fish_ joined #mojo
01:49 crab joined #mojo
01:49 DaTa joined #mojo
01:49 stephan48 joined #mojo
01:49 hidek___ joined #mojo
01:49 charsbr joined #mojo
02:22 stereonaut joined #mojo
02:36 xantus sri: what method would you use to serve files out of two different static paths
02:37 xantus add a route and dispatch to a custom static dispatcher?
04:04 tholen42 joined #mojo
04:05 tl left #mojo
04:20 Drossel joined #mojo
04:23 Kulag left #mojo
05:19 stereonaut left #mojo
05:25 MojoGuest156 joined #mojo
05:25 MojoGuest156 From: http://www.google.com/ (1 hits)
05:25 MojoGuest156 left #mojo
06:23 mvuets joined #mojo
07:05 omega the docs for url_for is really not making much sense to me as a newb
07:24 omega how can I get the tests to output whats wrong when I get a 500 error?
07:27 omega or can I somehow "steal" the exception handling and return JSON exceptions?
07:50 xantus a custom handler method
07:51 omega say what?
07:51 xantus look at Mojolicious.pm : sub handler
07:52 omega yeah, that was about as meaninful as the docs for Mojolicious::Controller : sub url_for
07:52 xantus if you want to just handle exceptions generated by the tpl
07:52 omega I found something in the rendering guide about adding your favourite template system
07:52 omega I don't have any templates
07:53 omega its a pure webservice
07:53 xantus you can setup an exception.html.ep template that outputs json
07:54 xantus what don't you understand about url_for?
07:54 xantus it generates a url for the current route, you fill in the blanks if needed
07:55 omega I just wish the examples had actually been examples
07:55 omega does it fill in the :captures for me? can I specify stuff for after the ?
07:56 xantus it returns a Mojo::URL obj
07:56 xantus so you can call methods on that to add params, etc
07:56 xantus it auto strigifies to a url
07:57 xantus url_for( ... )->query->param(foo => 'bar');
07:57 und3f[A] is now known as und3f
07:57 omega see, something like that would be a good idea to have documented where url_for is documentet :)
07:58 xantus url_for is in Mojolicious::Controller
07:58 xantus and it says it generates a Mojo::URL
07:59 xantus is it also somewhere else?
07:59 omega no
07:59 xantus maybe in the guide
07:59 xantus yea
07:59 omega but I think documenting how to add query params fits well in the Controller-docs, in the section about url_for
07:59 omega or showing what it returns for some common scenarios
08:00 xantus that should probably go in the Routes guide
08:00 omega thats not where I go when I'm wondering how to use methods on $self in a controller action
08:01 xantus it seemed like a natural link from that to Mojo::URL...
08:01 xantus but maybe I've been using it for long enough
08:01 xantus I really have to get my Merlin fix before I sleep
08:02 xantus :) good luck
08:06 GabrielVieira left #mojo
08:11 omega tnx
08:25 kvorg left #mojo
08:29 MojoGuest293 joined #mojo
08:29 MojoGuest293 From: http://www.google.com/search?ie=UTF​-8&oe=UTF-8&sourceid=navcli​ent&gfns=1&q=websocket+demo (3 hits)
08:32 MojoGuest293 left #mojo
08:41 fhelmber_ joined #mojo
08:44 kvorg joined #mojo
08:59 perlrocks Twitter: "That explains why Catalyst or Mojo is much more popular ? #perl" --c9s http://twitter.com/c9s/status/28579522249
10:17 spleenjack joined #mojo
10:19 spleenjack left #mojo
10:23 spleenjack joined #mojo
10:30 dotan joined #mojo
10:50 kvorg left #mojo
10:51 punytan left #mojo
11:22 kvorg joined #mojo
12:29 marcus shit, I missed a party in Berlin :/
12:38 omega omg, how can you live with yourself?
12:38 marcus I can't. Bye cruel world
12:39 Alias__ Can I have your stuff?
12:39 omega as long as I get the new kindle
12:40 marcus I guess I'll buy a house instead, to console myself.
12:40 marcus considering buying http://www.finn.no/finn/realestat​e/homes/object?finnkode=24912898
13:37 Alias__ left #mojo
13:58 sri omega: patches welcome! :D
13:58 sri marcus: that looks very scandinavian
13:58 omega sri: I'm better at spotting things like that, than correcting them :p
14:07 sri OMEGA FAIL
14:17 und3f is now known as und3f[A]
14:28 sri i'm going to add two methods to the ioloop for dns
14:28 sri http://pastie.org/1244992
14:28 sri lookup is a small wrapper around resolve
14:29 sri it will try ipv4 first and only attempt ipv6 if there was no result
14:33 sri oh, jaegermonkey is now faster than v8
15:21 stephan48 sri: why dont try v6 first?
15:26 sri stephan48: why try v6 first?
15:26 stephan48 sri: newer :)
15:26 sri thats the worst reason i ever heard
15:26 sri ;p
15:26 stephan48 its unlikely that a ipv6 entry exists without a ipv4 entry :)
15:27 sri v6 will fail like 70%
15:27 stephan48 so often only ipv4 would be found
15:27 stephan48 :)
15:27 sri my own wlan router doesn't do v6
15:28 sri you should never ever prefer v6 to v4
15:28 sri maybe in 30 years
15:38 marcus sri: you might be surprised to learn it's scandinavian
15:39 marcus lots of people looking at it today tho, I think it might be sold at a high price.
15:39 rhaen moin!
15:39 rhaen *yawn*
15:39 marcus rhaen: moin
15:41 rhaen hm, well well - I am not sure what I am looking for
15:42 rhaen is there a way to access the mojo instance from outside?
15:42 rhaen something like the port number the server is running on
15:42 rhaen when started in daemon mode?
15:43 marcus step back?
15:43 rhaen hm, ok - I am experimenting with the apache mod_proxy_balancer
15:43 rhaen and I want to show a little page which display the server/port it's running on
15:44 rhaen as I don't know before the request to which daemon I will be forwarded
15:44 marcus oh, you mean in the request.
15:44 rhaen so its something like a demo to show - hej, you are now on daemon :3000 and now this is daemon :4000 as the url will be always the same
15:44 rhaen oh, yes.
15:45 marcus I think you can gather that from $self->req
15:45 sri you can
15:45 sri url base
15:45 rhaen yup - the $self->req is working perfectly
15:45 rhaen sri: using url_base?
15:48 marcus all_your_base
15:49 rhaen _are_belong_to_us
15:50 marcus $self->req->url->base
15:50 marcus $self->req->url->base->port
15:50 marcus I guess $self->req->url->port would suffice tho
15:51 rhaen true. Looks fine too me. thanks
15:51 * marcus waits for sri to tell him he's guessing wrong.
15:51 rhaen I think he'll tell you that's horrible deprecrated - even right now
15:53 sri you're wrong
15:53 sri and i was wrong -.-
15:53 sri $self->tx->local_port
15:54 marcus @o@
15:54 marcus holy crap.
15:55 marcus I just noticed The Walking Dead preair is out.
15:55 sri thats what i said 3 days ago!
15:55 marcus I less than three the graphics novel.
15:57 marcus sri: I was in berlin on friday and then had my parents visiting until 2 hours ago
15:57 marcus no time to check torrents
15:57 sri besides the walking dead you've not missed much
15:58 sri scandinavian you say, hmm
16:06 sri any thoughts about the dns methods?
16:15 dotan sri: what is it about Mojo that makes the perl debugger hang horribly? I'm not using IOLoop or anything, just Mojo::JSON->new->decode($string), which seems to complete ok when executed without -d...
16:16 sri dotan: i have no idea what you're talking about
16:16 dotan Let me see if I can write a test case.
16:26 dotan http://gist.github.com/643649 - perl $file runs (and complains about uninitialized value), perl -d $file hangs if I try to step over the decode() call
16:32 dotan It's probably not mojo related. I'll try and step through and see where it goes loopy.
16:32 sri ok, but what has that to do with mojolicious?
16:32 sri very likely not
17:00 spleenjack left #mojo
17:04 perlrocks Twitter: "Mojolicious convenient API (2) - Getting Started with Perl code samples http://htn.to/Cv5b6G" (ja) --memememomo http://twitter.com/memememomo/status/28611778856
17:09 forwardever joined #mojo
17:18 forwardever sri: is there a way to change the default behaviour regarding which template is called after dispatch, currently, the controller class determines the path where to look for templates (if not defined explicitly), now lets say I would like to locate all controllers under lib/MyApp/C/ e.g. lib/MyApp/C/Users.pm, in this case, mojolicious looks under templates/c/users, but I want it to check
17:18 forwardever templates/users, is there a way to change that behaviour?
17:19 sri dunno
17:25 forwardever do you thing that a class structure like lib/M lib/V lib/C as in other frameworks makes sense, an alternative might be to just leave controllers under lib/, but place models under lib/M or so
17:26 stereonaut joined #mojo
17:27 marcus forwardever: if he thought such a structure made sense, he probably would have made it default, like we did with catalyst? :)
17:31 forwardever marcus: hmm, maybe, but following MVC, it might make sense to seperate namespaces clearly, like MyApp::C and MyApp::M
17:32 marcus forwardever: giving models their own classes in catalyst was a huge mistake
17:32 forwardever why?
17:32 dotan forwardver: I think it's more like MyDataLib and MyWebApp
17:32 marcus forwardever: and mojolicious does not use views, it uses renderers.
17:32 marcus the view is the template..
17:32 marcus forwardever: because you shouldn't tie up business logic to your web framework.
17:32 marcus which is exactly what a model class does
17:33 mvuets Hello.
17:33 sri what marcus said
17:33 mvuets sri: i have a bug report for you (:
17:33 dotan and then both MyCommandLineUtils and MyWebApp1 and MyWebApp2 can both use MyDataLib
17:34 dotan (remove a both from the above, to taste)
17:34 sri anyway, MVC has nothing to do with naming, it is simply about separating logic, no more no less
17:35 marcus apple does not give their models special names either.
17:35 sri mvuets: you know how to report bugs right ;)
17:36 mvuets sri: i am (: take a look on a demo app first
17:36 mvuets http://ompldr.org/vNXd3bg/app.tgz
17:36 sri NO!
17:37 sri don't send me apps ever...
17:37 vti_ stephan48: so what did you fix?
17:37 sri mvuets: the most minimalistic test case possible please
17:37 vti_ fish_: not right now, tuesday
17:38 mvuets sri: there are 17 line at all
17:38 mvuets Including use strict/warnings (:
17:38 sri then nopaste
17:39 mvuets I was able to reproduce it only with external modules. Paste file by file?
17:39 sri i will never accept packaged apps, since that would encourage people to spam me with full apps to debug for them ;p
17:39 sri mvuets: yea, just copypasta
17:39 * marcus sends sri mojomojo-mojo-trunk.tgz
17:39 vti_ hi, btw
17:40 mvuets sri, hold on
17:40 marcus sri: PLEASE OPEN YOUR XDCC RECIEVE
17:40 * sri sets marcus on fire
17:40 mvuets sri: app: http://paste.debian.net/97986/
17:40 * marcus burns
17:40 mvuets sri: controller: http://paste.debian.net/97987/
17:40 forwardever dotan: if I get you right, that would mean that I have to create lib/MyApp/Users.pm and lib/MyData/UserModel.pm or so?
17:41 * sri gets marshmallows
17:41 marcus 'common#' is a very strange syntax, mvuets
17:41 mvuets url_for (from redirect_to) makes wrong url
17:41 marcus is that even allowed?
17:41 mvuets marcus: i implemented it long time ago (:
17:42 mvuets marcus: equals to (controller => 'common')
17:42 sri thats actually stolen from rails3 :)
17:42 marcus funky
17:42 sri mvuets: now what actually *is* the bug?
17:43 marcus url_for can't handle the route?
17:43 mvuets sri: i expect /logout redirect me to /, instead it goes to an infinite loop redirecting me to the same /logout
17:43 mvuets marcus: aye
17:44 marcus mvuets: uhm, but 'home' doesn not actually point to '/'
17:44 marcus it points to /:action
17:44 dotan forwardever: that's how I'd do it, but it's probably not the best practice if you want to distribute stuff via cpan.
17:44 sri hmm, interesting case
17:44 dotan left #mojo
17:44 mvuets marcus: um, right. to /home actually
17:45 stephan48 vti_: the theme for wordpress was named WordpressTwentysomething but the T from twenty had to be written non captial
17:45 sri the :action placeholder is defined as "logout"
17:45 vti_ stephan48: "theme" : "wordpress_twentyten"
17:45 mvuets sri: means current :action values is substituted?
17:45 sri ye
17:45 stephan48 vti_: k
17:45 sri shift->redirect_to('home', action => undef)
17:46 sri i guess that would fix it
17:46 sri hmm
17:47 sri otherwise you of course get an infinite loop redirecting to /logout
17:47 sri since action is always set to "logout"
17:48 mvuets I got it. If i would have several :placeholders, i have to undef them all. Not good
17:48 punytan joined #mojo
17:48 sri but i don't think there is another solution
17:48 sri the options are the current behavior or only generate /home
17:49 marcus sri: what, no mind reading? color me disappointed.
17:49 sri mind reading is not in the perl core :(((
17:50 marcus so that is what only core deps lead to.
17:50 sri :/
17:50 marcus I bet you can't do levitation either.
17:51 sri !tweet mind reading is not in the #perl core yet. :(
17:51 marcus at least not until Super::Conductor goes into the core at 5.16
17:51 perlrocks sri: http://twitter.com/perlrocks/status/28615133864
17:51 mvuets sri: redirect is like a new request, so new options. If i need i'll pass them, otherwise why not to use default ones?
17:52 sri mvuets: the topic is very very complicated
17:52 sri there are multiple levels of values being merged at different times
17:52 marcus I guess mvuets is saying you should only replace the placeholders if you matched a route that used them.
17:52 sri ah
17:53 sri discard current captures if we are using a new route endpoint
17:53 marcus it kind of makes sense.
17:53 sri kind of does
17:54 sri if i get a test case for that i'll make it work
17:56 sri cool, it only breaks one stupid routes test
17:57 sri that one is actually testing this specific side effect
17:59 mvuets Get rid of that!
17:59 sri also an interesting case
18:00 sri my $b = $r->bridge(/:id); $b->route('/edit')->name('edit'); $b->route('delete')->name('delete');
18:01 sri in this case edit can forward to delete without passing along the id
18:01 sri it gets inherited automatically
18:02 sri /23/edit -> redirect_to('delete') -> /23/delete
18:02 sri 23 is inherited
18:02 mvuets Explicit is better than implicit.
18:03 sri very complicated topic
18:03 mvuets (c) "Zen of Python" X:
18:05 sri i kind of agree in this case
18:05 sri ->url_for('articles_delete', id => 12)
18:07 Htbaa joined #mojo
18:09 GitHub108 joined #mojo
18:09 GitHub108 mojo: master Sebastian Riedel * a303536 (3 files in 3 dirs): fixed url_for to not inherit captures for new endpoints - http://bit.ly/aiDr3P
18:09 GitHub108 left #mojo
18:09 sri please test new behavior
18:14 mvuets sri: meanwhile what do you think about http://paste.debian.net/97879/
18:15 sri not sure about that one
18:17 sri at least the tests are not good enough
18:17 sri it needs to include actual checks and a route without callback at the end
18:19 sri i also want to get rid of "cb" in favor of "on" ;)
18:21 sri better make it a plugin for now
18:21 kvorg left #mojo
18:22 kvorg joined #mojo
18:28 mvuets sri: the fix works well for me. Tried few cases.
18:28 mvuets marcus: sri: thank you guys.
18:28 sri turn those cases into more unit tests ;)
18:31 kvorg left #mojo
18:33 kvorg joined #mojo
18:41 forwardever sri: recent changes seem to work, however had to make some changes as params now have to be passed explicitly
18:41 GitHub15 joined #mojo
18:41 GitHub15 mojo: master Sebastian Riedel * cb72634 (3 files in 3 dirs): added experimental support for IPv4 and IPv6 address checks to Mojo::URL - http://bit.ly/dkeddo
18:41 GitHub15 left #mojo
18:42 sri hmm
18:42 sri thats not so nice
18:42 sri hope i don't have to rollback
18:43 sri the route changes can only stay if they don't break apps out there
18:43 sri very very tricky topic
18:44 sri btw. above commit is more preparation for the async resolver
18:49 forwardever think that passing params explicitly makes sense (seems to be less magic)
18:54 forwardever sri: Mojolicious::Controller says there is no way to change the directory where mojolicious looks for templates by default, so template path is taken from controller stash value (split -), could you make this a bit more flexible?
18:54 sri forwardever: like?
18:55 sri all depends on if you find a nice way and how good your tests are
18:57 sri and much more importantly, why can't you use "namespace"?
18:57 sri app->routes->namespace('MyApp::C');
18:58 sri quite sure i told you about it at least a few times in the last week
18:59 sri btw. re naming
18:59 sri a well designed model layer is usually outside the webapp namespace
19:00 sri because it is independent and designed for multiple frontends
19:01 sri (if you're after true mvc separation)
19:03 forwardever sri: already understood that point, just playing around to evaluate the options, separate namespaces might make sense, on the other hand also makes things more complicated, most frameworks seem to do it the way you not recommend...
19:03 rhaen this mojo stuff is sooo cool!
19:03 rhaen awesome!
19:03 rhaen just awesome!
19:04 sri \o/
19:05 sri forwardever: which frameworks are you refering to?
19:05 rhaen just writing on my article about loadbalancing with apache servers
19:05 forwardever catalyst, rails
19:05 rhaen I use mojo for demonstration as it's so easy :)
19:05 sri forwardever: catalyst was my mistake, rails is very weird in that regard and it costs them
19:06 sri rails with something else than activerecord is very very painful
19:06 sri on the other hand if activerecord works for you it is amazing
19:07 sri you could also look at django
19:08 sri they do mvc entirely different
19:10 forwardever I mean even if a model is tied to a web app (is in the namespace of that web app), that doesn't mean that other apps cannot use this model as well, so maybe I do not fully understand the problem so far
19:11 sri have you actually worked with rails?
19:12 sri reading about it won't show you the tradeoffs
19:12 forwardever no, just played around a bit with rails, not an expert at all, much more familar with perl so far
19:12 sri the model layer in rails is very tightly coupled
19:12 sri reusing is almost impossible outside rails
19:13 sri thats the price you pay for that level of crud
19:14 sri regarding the MyApp::Controller namespace... app->routes->namespace('MyApp::Controller') will just work for that kind of layout
19:15 sri no other changes required
19:15 xantus http://labs.mudynamics.com/wp-con​tent/uploads/2009/04/icouch.html
19:15 sri ->to('foo#bar') will resolve to MyApp::Controller::Foo->bar and templates/foo/bar.html.ep
19:16 sri thats one of the reasons why i said detecting the app name won't work
19:16 sri because the controller namespace can be something entirely different
19:17 sri xantus: too bad fulltext indexing with couchdb is so hard :S
19:17 forwardever already playing around with this option, thanks for the hint and the patience
19:18 sri forwardever: you write down what you learn, so you get a little more patience ;)
19:18 forwardever :)
19:21 sri yes, wiki authors get more help *hint hint*
19:21 sri http://www.redmonk.com/jgovernor/2010/10/2​2/vmware-ceo-django-rails-open-frameworks-​apps-as-commodity-and-the-new-kingmakers # looking forward to what vmware comes up with
19:22 sri should be good for us too
19:22 xantus sri: yeah :(
19:22 sri i have a feeling fulltext indexing will be the holy grail for nosql
19:23 sri since it solves the ad-hoc query problem and is needed in almost all web apps
19:23 xantus I need some good perl wiki code
19:24 sri github wiki is good ;p
19:24 sri a mojolicious wiki with git backend would rock
19:24 xantus yeah, isn't it ruby or python?
19:24 sri ruby i think
19:24 xantus that what I was thinking
19:24 xantus that's
19:25 xantus I have been hacking on cloud9ide and mojo
19:25 xantus for the editor
19:26 xantus It'll probably replace mojopaste.com
19:26 sri cool stuff, will it have perl highlighting?
19:27 sri or javascript only again?
19:27 xantus definitely perl too
19:28 sri neat
19:34 rhaen interestig
19:34 rhaen err. Interesting
19:34 rhaen I am using 2 mojo daemons balanced with apache2
19:35 rhaen after 5000 requestsit slows down rapidly
19:35 rhaen and mojo looses all it's performance
19:35 rhaen oh, wait - now it's running again
19:35 rhaen strance
19:35 rhaen strange
19:36 rhaen again. Hm. well sounds like debugging - but today
19:37 sri sounds strange
19:38 rhaen http://pastie.org/1245534
19:38 sri are you testign against a live website?
19:39 sri because then i would like not care at all :D
19:39 rhaen this is the source http://pastie.org/private/hh9sff8hm6qhc88zcl8cw
19:39 rhaen and the balancer url is public right now :)
19:39 rhaen http://fcntl.de/balancer-manager
19:39 sri for reliable tests you can't use internet hosts
19:40 rhaen hm, true
19:40 rhaen well, ok - then forget everything I said
19:40 rhaen it's working :)
19:40 sri ;p
19:41 rhaen but it's cool to use mod_proxy_balancer for mojos daemon
19:41 sri i think most people would use nginx these days
19:45 rhaen booo!
19:46 rhaen but hej, I like those apache servers
19:46 rhaen people are just way too stupid to read the docs
19:47 forwardever vti_: bootylicious installation does not work on windows (git checkout-index: unable to create file t/model/documents/20101010​T12:13:14-foo-bar-baz.pod (Invalid argument))
19:47 sri i think it's more about nginx being better at handling 10000 keep alive connections
19:48 rhaen yeah - the 10k thing from lighty....
19:48 rhaen I am not sure about those benchmarks
19:48 rhaen if nginx is working for them - fine.
19:48 rhaen I use apache for everything now - after reading the docs
19:48 rhaen the proxy thing is awesome
19:49 rhaen but nginx is web scale
20:03 rhaen ok, bedtime for me. See you tomorrow
20:03 MojoGuest829 joined #mojo
20:03 MojoGuest829 From: http://news.ycombinator.com/item?id=1277067 (18 hits)
20:04 MojoGuest829 left #mojo
20:11 perlrocks Twitter: "After all Mojolicious:: Lite I wrote in" (ja) --fuba http://twitter.com/fuba/status/28624930399
20:22 und3f[A] is now known as und3f
20:23 und3f sri, you did it!
20:24 sri i did what?
20:24 und3f resolver?
20:24 sri on it :)
20:24 und3f or it is not a resolver yet?
20:24 sri preparations are done now
20:24 sri merging atm
20:24 und3f got it
20:44 fhelmber_ left #mojo
21:02 ltriant joined #mojo
21:07 alnewkirk left #mojo
21:15 Htbaa left #mojo
22:24 mvuets left #mojo
22:42 und3f is now known as und3f[A]
23:02 forwardever left #mojo

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