Camelia, the Perl 6 bug

IRC log for #mojo, 2011-10-08

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

All times shown according to UTC.

Time Nick Message
00:08 j3nnn1 joined #mojo
00:56 metaperl joined #mojo
01:10 ispy_ joined #mojo
01:18 diegok joined #mojo
01:28 ispy__ joined #mojo
01:37 ispy_ joined #mojo
01:37 sri hmm, we could do this without too much side effects http://pastie.org/2658629
01:40 sri would have the advantage that the same code keeps working in normal and lite apps
01:41 SmokeMachine joined #mojo
01:50 gshank joined #mojo
01:52 crab hi.
01:52 * sri waves
01:52 ispy__ joined #mojo
01:54 grim_fandango sri: Thanks so much for the clarification on multiple calls to before_dispatch.  Printing the request URLs answered my question nicely.
01:55 crab maybe post a followup message to the list explaining it for others
01:55 grim_fandango Good point.
01:55 purl nice and sharp
01:58 grim_fandango If you put a hat on it no one would notice!
01:59 grim_fandango crab: I followed up with an explanation.
02:00 sri grim_fandango++ # followup
02:01 crab i wrote http://toroid.org/ams/etc/m​ojolicious-static-resources while trying to understand hooks
02:01 metaperl|2 joined #mojo
02:01 sri long time ago we also logged static requests, but that gets annoying fast
02:02 sri btw. https support seems rather good in my tests now
02:03 metaperl|3 joined #mojo
02:05 grim_fandango One of these days I'm going to have to try out the nginx bandwagon.
02:06 crab hop on, who knows where it will be tomorrow?
02:14 MojoGuest570 joined #mojo
02:14 MojoGuest570 From: http://news.ycombinator.com/item?id=1277067 (11 hits)
02:14 sri crab: btw. have you tried keep-alive yet with nginx?
02:14 MojoGuest716 joined #mojo
02:14 MojoGuest716 From: http://news.ycombinator.com/item?id=1277067 (12 hits)
02:26 ispy_ joined #mojo
02:29 grim_fandango Is there an easy way figure out which requests AREN'T for static content?
02:29 grim_fandango I would prefer to not do some kind of string matching in the plugin.
02:30 ispy__ joined #mojo
02:42 grim_fandango More specifically, I think I'd like this plugin to do it's magic only when the request matches a pre-defined route.  Is that possible or are hooks evaluated too early in the process?
02:43 * grim_fandango thinks out loud
02:43 grim_fandango Maybe the plugin needs to export a helper that gets evaluated by something in the routing.
02:46 crab grim_fandango: read the article i wrote
02:46 crab sri: no, i haven't tried it. i've been sick.
02:47 crab grim: also: set a value somewhere in the stash and check in the hook.
02:50 grim_fandango crab: Your article makes sense but I want the caching to occur before the controller takes control of the request.  I think managing this from the routing is probably my best option.  This is sort of a mid-way point between before_dispatch and the controller itself, I think.
02:50 grim_fandango Maybe I'm completely misunderstanding things - I've been known to do that (a lot).
02:51 crab i have no idea what you're doing, so i can't comment
02:53 grim_fandango What I'm doing is grabbing a bunch of stuff from a Couch database and making a look-up type hash for the data so my application can infer relationships between the documents.  I want this to happen for certain requests and have it rebuilt every so often by the caching engine (CHI, in this case).  I want this stuff ready for when the controller takes over so I don't need to write stuff like update_cache() in the contr
02:53 grim_fandango oller itself.
02:54 grim_fandango It might be a moot issue; I'm just playing with different ways of getting the actions the data that they need ahead of time.
02:54 sri that sounds rather app specific, nothing i would put in a plugin
02:55 sri plugins are for truly reusable stuff, app logic goes into the application
02:58 grim_fandango Ya, it's only going to be re-usable between a couple of mini-apps.  I wasn't thinking of publishing this, just hoping to share it with a couple of apps that are mounted in different spots.
02:59 grim_fandango But good point, maybe it's just a good fit for the plugin architecture.
03:00 sri it's funny how the answer to almost all app design questions (like this one) is bridges
03:00 crab :-)
03:00 sri i would bet all you really want is a helper plugin you can use in a bridge
03:03 sri (or of course "under" for lite apps)
03:06 sri i'm actually surprised nobody has written a hook plugin yet for hooks with routes/paths
03:07 tempire "a hook plugin yet for hooks with routes/paths"
03:07 tempire do I have to read that whole dialog to understand what that means?
03:07 sri app->before('/whatever' => sub {...});
03:08 sri it's from sinatra
03:08 tempire ah
03:08 tempire once you understand bridges, that becomes a bit moot
03:08 grim_fandango Ya, bridges are great stuff.  Thanks sri.
03:09 sri tempire: true
03:10 * tempire is cooking tri-tip roast with boiled potatoes
03:10 * tempire invites the channel over
03:11 sri i've been thinking about path matching in hooks because of this little hack https://github.com/kraih/mojo/blob/master/​t/mojolicious/upload_stream_lite_app.t#L31
03:12 * sri just had fresh cannelloni
03:14 tempire why is the weaken $tx; needed?
03:14 sri http://www.beefitswhatsfordinner.com​/newsletter/images/newsletter/4787Pe​stoRubbedTriTipRoastTomatoSauce.jpg
03:14 sri google results look tasty though
03:15 sri tempire: because the on_progress closure is inside $tx
03:16 sri circular references are usually not too bad in perl, the real problem are closures like that one
03:17 sri specifically the line i linked to refers back to $tx, from inside $tx
03:18 sri i kinda like using smart match as a cheap replacement for a path matching regex
03:18 sri $req->url->path->parts ~~ [qw/upload whatever/];
03:19 sri instead of $req->url->path =~ /^\/upload\/whatever$/
03:20 sri hmm
03:21 sri maybe path should just be extended a little
03:21 sri if $req->url->path->matches('/upload/whatever')
03:22 sri since these callback and hook hacks do happen every now and then
03:22 sri and don't have access to routes
03:24 sri maybe $req->url->path->has_prefix('/upload')
03:35 tempire ->has_part
03:42 ispy_ joined #mojo
03:50 sri i kinda like ->matches
03:55 crab i like matches too
03:59 crab they're useful to light the stove
04:03 sri lets settle on $path->match('/upload')
04:03 sri ;p
04:04 sri it would be a part wise comparison, so /foo matches /foo/bar but not /foobar
04:06 ispy__ joined #mojo
04:21 ispy_ joined #mojo
04:28 GitHub51 joined #mojo
04:28 GitHub51 [mojo] kraih pushed 1 new commit to master: http://git.io/_1EFyA
04:28 GitHub51 [mojo/master] added experimental match method to Mojo::Path - Sebastian Riedel
04:28 GitHub51 left #mojo
04:28 sri i think that covers most use cases
04:33 sri something more advanced like $path->match('/foo/:bar/*whatever') would be silly i guess
05:00 Vandal joined #mojo
05:01 ispy__ joined #mojo
05:13 vel joined #mojo
05:33 tempire aw
05:33 tempire kernel shepherd died.
05:33 tempire AGAIN!
05:34 GitHub88 joined #mojo
05:34 GitHub88 [mojo] kraih pushed 1 new commit to master: http://git.io/Ooa1jA
05:34 GitHub88 [mojo/master] added a few more path matching tests - Sebastian Riedel
05:34 GitHub88 left #mojo
06:04 arpadszasz joined #mojo
06:25 sugar joined #mojo
06:26 ispy_ joined #mojo
06:44 ispy__ joined #mojo
06:56 jwang joined #mojo
07:26 ispy_ joined #mojo
07:56 Foxcool joined #mojo
08:28 MojoGuest196 joined #mojo
08:28 MojoGuest196 From: http://www.google.nl/url?sa=t&source=web​&cd=4&ved=0CDgQFjAD&url=http%3A%​2F%2Fdev.xantus.org%2F&rct=j&q=HTML5​%20IRC%20Client&ei=OwmQTuTFBdGE-waxyIneC​g&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
09:18 smpb joined #mojo
09:39 ispy__ joined #mojo
09:57 ispy_ joined #mojo
10:10 ispy__ joined #mojo
10:27 ispy_ joined #mojo
10:35 ispy__ joined #mojo
10:48 ispy_ joined #mojo
10:56 noganex joined #mojo
11:01 ispy__ joined #mojo
11:08 ispy_ joined #mojo
11:13 ispy__ joined #mojo
11:35 ispy_ joined #mojo
11:43 osprey joined #mojo
11:58 Eugene joined #mojo
12:02 andrefs joined #mojo
13:12 marcus come on baby light my fire
15:16 metaperl joined #mojo
15:53 batman joined #mojo
16:29 * crab lights a fire under marcus
16:52 marty joined #mojo
17:18 marty Good morning my pyromaniac pals
17:38 marcus crab: lucky that you had those matches!
17:38 thowe On the Catalyst wiki, I am really wanting to remove some of these spammy tags that have been put on some pages.  Is there a way to kill tags in their entirety?
17:50 sri thowe: wrong channel?
17:52 Topic for #mojo is now Mojolicious real-time web framework ♥ http://mojolicio.ushttp://irclog.perlgeek.de/mojo/todayhttp://dev.xantus.org
17:54 thowe sri, No, they run Mojo...
17:54 sri you want #mojomojo
17:55 thowe I was trying to ask a general mojo question, but I also instinctively added some context.  Sorry if it came out confusing.
17:55 thowe whoa, really?
17:55 sri mojolicious is the web framework i wrote after catalyst
17:55 thowe haha.  Well, I did that too.
17:55 thowe er s/did/dig/
17:56 thowe Sorry, I *am* in wrong channel.
17:56 thowe Learning Mojolicious is on my todo list, but it's behind a few other things atm :(
17:56 sri aww :(
17:57 thowe I am learning Catalyst, but it has also turned into learning web dev in general, learning Perl better, learning DBIC, learning jQuery...  I'll get there.
18:01 thowe In a nutshell, what is cool about Mojo that is there bcause of 20/20 hindsight with Catalyst?
18:03 thowe Or maybe there is some "About" page I should be reading.
18:11 Eugene joined #mojo
18:25 marty thowe:  Have a look at mojolicious.org - Lots of good stuff there.  Very fun to use.
18:46 GitHub21 joined #mojo
18:46 GitHub21 [mojo] kraih pushed 1 new commit to master: http://git.io/XSwPcA
18:46 GitHub21 [mojo/master] fixed another small Mojo::IOLoop::Server bug - Sebastian Riedel
18:46 GitHub21 left #mojo
19:03 metaperl after looking here ( http://search.cpan.org/~sri/Mojolicious-1.99​/lib/Mojolicious/Lite.pm#Stash_and_templates ) and here ( http://search.cpan.org/~sri/Mojolicious-​1.99/lib/Mojolicious/Controller.pm#stash ) I still have no explicit data on whether multiple key-value pairs can be passed to ->stash() ... I bet they can, the examples just dont imply it
19:03 metaperl after looking here ( http://search.cpan.org/~sri/Mojolicious-1.99​/lib/Mojolicious/Lite.pm#Stash_and_templates ) and here ( http://search.cpan.org/~sri/Mojolicious-​1.99/lib/Mojolicious/Controller.pm#stash ) I still have no explicit data on whether multiple key-value pairs can be passed to ->stash() ... I bet they can, the examples just dont imply it
19:04 metaperl after looking here ( http://search.cpan.org/~sri/Mojolicious-1.99​/lib/Mojolicious/Lite.pm#Stash_and_templates ) and here ( http://search.cpan.org/~sri/Mojolicious-​1.99/lib/Mojolicious/Controller.pm#stash ) I still have no explicit data on whether multiple key-value pairs can be passed to ->stash() ... I bet they can, the examples just dont imply it
19:04 metaperl oh sorry
19:04 metaperl my window was not scrolling :)
19:12 Eugene joined #mojo
19:19 metaperl Supposedly ::Client was deprecated ( http://groups.google.com/group/mojolicio​us/browse_thread/thread/8cfeb69b73ae6b1 ) but the docs dont say so ( https://metacpan.org/module/KRAIH/Mojol​icious-0.999924/lib/Mojo/Client.pm#post )
19:20 metaperl ah, those are old docs
20:00 Eugene joined #mojo
20:30 baton8 joined #mojo
20:35 perlite_ joined #mojo
20:35 baton8 joined #mojo
20:41 abra joined #mojo
21:15 marty joined #mojo
21:21 l3l1p joined #mojo
21:34 GitHub132 joined #mojo
21:34 GitHub132 [mojo] kraih pushed 1 new commit to master: http://git.io/mnHfIA
21:34 GitHub132 [mojo/master] added a few more patch matching tests - Sebastian Riedel
21:34 GitHub132 left #mojo
21:37 perlrocks joined #mojo
21:49 arthas joined #mojo
22:09 GitHub90 joined #mojo
22:09 GitHub90 [mojo] kraih force-pushed master from 84b4da0 to 992bd1a: http://git.io/BhzC7A
22:09 GitHub90 [mojo/master] added a few more path matching tests - Sebastian Riedel
22:09 GitHub90 left #mojo
22:31 metaperl How would I create the headers used in this curl command using Mojolicious - http://pastie.org/2662912
22:39 marty metaperl:  I think something like this will work.   $tx->req->headers->header('​X-PAYPAL-SECURITY-USERID', 'api_username');
22:41 metaperl marty: so after setting the headers, you might call $tx->req->post_form ( $url, %form_data);
22:41 metaperl and how does $tx get its value? I was thinking I need to use Mojo::UserAgent for this
22:47 marty Yes, I think you can use Mojo::UserAgent for this.  I would use a post_form for it.  But I'm not certain. I've never sent headers with post_form.
22:50 metaperl yeah the code for post_form returns a $tx
22:52 metaperl wow the doc for args for tx are quite implicit - http://search.cpan.org/~sri/Mojolicious-​1.99/lib/Mojo/UserAgent/Transactor.pm#tx
23:07 metaperl but the code is so crisp I think I can figure it out
23:11 osprey left #mojo
23:18 GitHub194 joined #mojo
23:18 GitHub194 [mojo] kraih pushed 1 new commit to master: http://git.io/roUVHw
23:18 GitHub194 [mojo/master] added another user agent example - Sebastian Riedel
23:18 GitHub194 left #mojo
23:32 sri metaperl: that should make it more obvious
23:32 metaperl is it Mojolicious or something that I did? each time I warn something in my ::Lite app, a completely Carp::cluck backtrace is printed
23:33 sri something you did
23:33 purl hmmm... something you did is messed up, or my missing something.. get the error from the error_log.. it should say more than 500
23:33 sri purl: forget something you did
23:33 purl sri: I forgot something you did
23:34 sri purl: something you did is <reply> IT WASN'T ME!!!
23:34 purl OK, sri.

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