Camelia, the Perl 6 bug

IRC log for #mojo, 2012-08-23

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

All times shown according to UTC.

Time Nick Message
00:14 SmokeMachine joined #mojo
00:24 trone_ joined #mojo
00:37 o_o joined #mojo
01:31 o_o joined #mojo
01:33 lukep joined #mojo
01:47 l3l1p joined #mojo
01:56 jeen joined #mojo
01:59 d4rkie joined #mojo
02:22 l3l1p joined #mojo
02:31 lukep joined #mojo
02:32 Liam`` joined #mojo
02:44 noganex_ joined #mojo
02:48 l3l1p joined #mojo
02:53 lukep joined #mojo
03:05 nich0s joined #mojo
03:20 xaka1 joined #mojo
03:30 zpmorgan https://gist.github.com/3431889
03:31 zpmorgan $self->req->app diesn't determine the host or the port number
03:31 zpmorgan er, $self->req->url
03:31 zpmorgan am I missing something?
03:33 * zpmorgan upgrades to 3.32...
03:35 zpmorgan same with 3.32
03:39 nich0s left #mojo
05:02 jeen joined #mojo
05:22 zpmorgan has anyone here used mojo::req->url?
05:24 zpmorgan it's not just for ip addresses. example: zpmorgan.com
05:30 zpmorgan should I file a bug report? I know that a workaround is easy; I just wanted to know if I'm missing something obvious.
05:31 jeen joined #mojo
05:36 zpmorgan okay, so I did $url = $url->parse($url->base); That captures both port & host.
05:44 crab maybe you want $self->req->url->abs
05:45 lukep joined #mojo
05:47 scott joined #mojo
05:47 Britzel joined #mojo
05:52 davido joined #mojo
06:09 mire_ joined #mojo
06:10 zpmorgan thanks crab!
06:12 eugen joined #mojo
06:14 crab you're welcome.
06:16 venkatk_ joined #mojo
07:09 Vandal joined #mojo
07:12 dod joined #mojo
07:14 batman_ joined #mojo
07:42 pau4o joined #mojo
08:01 arthas joined #mojo
08:06 arthas joined #mojo
08:07 arthas joined #mojo
08:11 arthas joined #mojo
08:27 fhelmber_ joined #mojo
08:35 davido joined #mojo
08:47 jeen joined #mojo
08:58 marcus good morning, fellow hoomans.
08:59 buu NEIN
08:59 buu NEEEEEEEEEIN
09:02 marcus wass?
09:02 marcus good morning fellow doshmen?
09:04 buu EXTERMINATE EXTERMINATE EXTERMINATE
09:04 * Kwa nods
09:13 azawawi joined #mojo
09:18 jeen joined #mojo
09:41 buu Forgive me for ranting but I look up the documentation for ::UserAgent->get and it tells me "Same as Transactor->tx" so I go there and it shows me: "         my $tx = $t->tx(GET  => 'http://kraih.com' => {DNT => 1});" with literally zero explanation of {DNT=>1}
09:58 azawawi link plz?
09:58 azawawi and hi
09:58 purl salut, azawawi.
09:59 buu Me?
09:59 purl it has been said that buu is unconvinced by my arguments but the problem is solved. or buu or channels Dr. Seuss or explosion-prone or a disturbing thought.
09:59 buu It's in Mojo::UserAgent::Transactor
10:25 crab DNT is a header field.
10:26 batman_ is there a way in st2 to autoindent some text? i got some xml in one string that i would like to make "pretty"
10:29 * east recently read that DNT stands for DoNotTrack, IIRC
10:29 batman_ yay! i had the wrong syntax :)
10:30 batman_ reindent works like a charm
10:31 crab east: yes
10:39 east buu: here's some documentation Mr. buu: http://search.cpan.org/per​ldoc?Mojo%3A%3AHeaders#dnt
11:37 jeen joined #mojo
11:51 * sri yawns
12:01 ghandi joined #mojo
12:02 ghandi left #mojo
12:02 ghandi joined #mojo
12:04 ghandi Hi There! I'm searching for a good place to set a session ID. So i can easily check if there is a session with an id present then do nothing. but if a new session was created without an id i want to set a generated id. any ideas?
12:09 spleenjack joined #mojo
12:23 jeen joined #mojo
12:35 crab why not use the in-built signed sessions?
12:38 * crab idly wonders why so many people spell gandhi as ghandi
12:39 ghandi It's a nickname, not my real name ;)
12:40 ghandi I use the signed sessions. But i have to store more data than the max. 4kb a cookie can handle. So i need to store an id to lookup the data on the next request.
12:40 judofyr joined #mojo
12:40 ghandi but i don't want to check-and-create the id all the time on many diffrent places.
12:40 ghandi But currently i use an before_dispatch hook which seems to do what i want.
12:40 crab ghandi: so what's the problem, then?
12:41 crab i mean, it seems reasonable to do that in a before_dispatch hook in your case
12:41 ghandi i was looking out for something like the auto-Methods of catalyst or something. and found the before_dispatch hook only 5 minutes ago ;)
12:41 ghandi wasn't realy shure if the request ist readily parsed in the hook
12:42 crab it is.
12:42 sri http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
12:42 sri that's closer to auto methods
12:43 sri hooks are mostly framework extensions, not application logic
12:44 ghandi hmmm...so i have a look onto bridges
12:45 ghandi thanks! :)
12:50 gryphon joined #mojo
13:15 bluescreen joined #mojo
13:18 d4rkie joined #mojo
13:50 sri crab: you still don't have a gravatar!
14:19 * sri has been wondering if we should deprecate Mojo::IOLoop::Delay->begin/end for just ->next
14:25 Leandr joined #mojo
14:26 judofyr sri: does ->next make sense with plain Delay (e.g. no steps)?
14:27 sri judofyr: just as much as begin/end imo
14:27 sri $delay->begin; $delay->end; vs. my $next = $delay->next; $next->();
14:27 sri just without the ordered/unordered problem
14:28 judofyr ah, right
14:28 krism joined #mojo
14:30 krism hello, i recently upgraded from mojolicious 2.98 to 3.32. i am using the template toolkit renderer. the old version of mojo would use its built in exception.development.html.ep template in the event of an uncaught exception,
14:30 krism but it seems the new version won't - it gets stuck in an infinite loop of "Template error in "exception.development.html.tt": file error - exception.development.html.tt: not found"
14:31 d4rkie joined #mojo
14:31 krism the simplest solution seems to be for me to add my own exception template, but it makes me wonder if i am doing something wrong/stupud :)
14:31 sri krism: i believe the tt renderer plugin has been updated for that
14:31 krism ... besides misspelling stupid. :)
14:34 krism oh, i didn't realize that was a separate thing, thank you. :)
14:34 * sri loves "cpan-outdated | cpanm" for updating all cpan modules ;)
14:36 krism yeah, updating that plugin did the trick - at least it doesn't get stuck in the infinite loop anymore. it still doesn't display the old exception page, but i really should be making my own to email me the exceptino anyway..
14:37 Kwa I am using a single route ($r->any('/:controller/:name')->to(action => 'index');) for my controllers. I'm also using render to automatically pick up the template (so /messages/someusername renders /messages/index.html.ep). This means that all the templates I have open all have the same name - index. Not a massive deal, but I'd prefer it if I could do the equivalent of: $r->any('/:controller/:na
14:37 Kwa me')->to(action => ':controller'); How can I do that?
14:37 azawawi left #mojo
14:46 marcus tempire: didn't you fix the deploy thingie?
15:00 Kwa Hmm, I'll work something out. :)
15:15 nic Kwa: Try $r->any('/:controller/:name')->to(action => $self->stash->{controller})
15:16 nic (I haven't ever done that myself, I'm just making it up based on reading Mojolicious/Guides/Routing#Generic_placeholders
15:17 Kwa nic: interesting, let me try it
15:18 nic (I don't have much confidence in it -- I know it's possible, but not _how_ to do it :) )
15:21 Kwa nic: It doesn't seem to work, never mind. Like I say, it's not a massive deal, but it would've been nice.
15:21 Kwa :)
15:22 nic It's definitely possible, but the people who know are on coffee break at the mo
15:24 Kwa Just trying to figure out by reading the routing docs how to execute a subroutine to do a lookup of :name and insert something into the stash. So /messages/somename, /details/somename do a lookup for each request for 'somename'. I thought bridges would work but it's executed before the stash gets :name. :/
15:25 Kwa $r->bridge->to(controller => 'bridge', action =>'lookup')->route('/:cont​roller/:name')->to(action => 'index');
15:29 sri Kwa: $self->match should have the name somewhere
15:30 sri $self->stash(template => $self->match->captures->{name}) or so might work
15:30 sri i'm just guessing though
15:32 sri (in a bridge that is)
15:33 Kwa sri: Thanks, got the :name from $self->match->captures->{name}.
15:33 sri \o/
15:33 Kwa :D
15:53 xaka1 joined #mojo
16:00 d4rkie joined #mojo
16:01 Lucas1 joined #mojo
16:08 gryphon_ joined #mojo
16:25 o_o joined #mojo
16:35 Britzel joined #mojo
16:43 Coff joined #mojo
16:43 Coff fuuuu.... just converted a 3.7K lines lite app to a full app. Glad I'm done.
16:45 Coff Loving how easy it is compared to other frameworks.
16:56 judofyr joined #mojo
17:02 krism when there is an uncaught exception, shouldn't mojolicious fallback to displaying its included exception_development.html.ep file? doesn't seem to be happening, but we are using the tt renderer otherwise
17:05 sri krism: it should
17:07 krism hmm, it doesn't seem to for me. the following is logged http://pastebin.com/sARFHxVW and an empty 500 response is returned to the client
17:07 sri it's most likely a bug in the ttrenderer
17:07 sri maybe it doesn't return false if it didn't render anything
17:08 krism it did use to work for me on mojo 2.98, but yesterday i upgraded to 3.32 :)
17:09 sri it only worked by accident ;)
17:10 o_o joined #mojo
17:10 krism doh :)
17:11 sri the api renderers should follow is pretty well defined, if they don't bad things happen i'm afraid
17:12 sri http://mojolicio.us/perldoc/Mojolicious/Guides/​Rendering#Adding_your_favorite_template_system
17:13 sri http://api.metacpan.org/source/PLICEASE/​Mojolicious-Plugin-TtRenderer-1.22/lib/M​ojolicious/Plugin/TtRenderer/Engine.pm
17:13 sri looks like the unless ($ok) block doesn't return false
17:14 sri i have no clue why it calls render_exception though
17:14 sri that's wrong
17:14 purl sri is channeling thoth!
17:14 * sri pats purl
17:14 * purl pats sri back, harder
17:14 krism huh, thank you
17:14 sri if there's an error it should just rethrow it
17:14 * sri shrugs
17:15 * sri thought marcus fixed that
17:15 krism changing my local copy to return false did indeed fix the issue, thank you
17:21 barwin joined #mojo
17:23 batman_ joined #mojo
17:23 inokenty joined #mojo
17:33 sri krism: make sure to file a bug report
17:34 sri https://github.com/abh/mojox-renderer-tt
17:36 sri marcus: the whole block with the render_exception call looks wrong, rethrow or return false should be all that's neccessary
17:36 krism sri, ok
17:45 krism sri, done, thank you again for all the help :)
17:47 judofyr joined #mojo
17:47 good_news_everyone joined #mojo
17:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/r6a6VA
17:47 good_news_everyone [mojo/master] simplify renderer requirements - Sebastian Riedel
17:47 good_news_everyone left #mojo
17:48 sri not sure if i should mention the rethrowing of errors in the recipe too
17:55 good_news_everyone joined #mojo
17:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JkYkKA
17:55 good_news_everyone [mojo/master] use more appropriate variable name in renderer example - Sebastian Riedel
17:55 good_news_everyone left #mojo
18:02 good_news_everyone joined #mojo
18:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/eXr6Fw
18:02 good_news_everyone [mojo/master] mention how renderers are supposed to handle exceptions - Sebastian Riedel
18:02 good_news_everyone left #mojo
18:02 sri i guess it needs to be mentioned, since there's so much confusion
18:11 good_news_everyone joined #mojo
18:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/FvIUYg
18:11 good_news_everyone [mojo/master] small optimizations - Sebastian Riedel
18:11 good_news_everyone left #mojo
18:30 good_news_everyone joined #mojo
18:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/bigbYw
18:30 good_news_everyone [mojo/master] clear up renderer example some more - Sebastian Riedel
18:30 good_news_everyone left #mojo
18:31 asarch joined #mojo
18:36 sri spam spam spam
18:57 memowe joined #mojo
19:01 nic I'd like to have a Lite app that I can run from morbo/hypnotoad and also run unit tests against
19:01 nic I'm thinking one way to do it is to define the app in a .pm that just happens to put the routes in 'package main'
19:02 sri https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/external_lite_app.t#L15
19:03 nic aha, eccellente
19:03 nic thank you
19:10 good_news_everyone joined #mojo
19:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/L_R4Dw
19:10 good_news_everyone [mojo/master] fixed renderer example - Sebastian Riedel
19:10 good_news_everyone left #mojo
19:17 good_news_everyone joined #mojo
19:17 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/-DGW_Q
19:17 good_news_everyone [mojo/master] a few more documentation tweaks - Sebastian Riedel
19:17 good_news_everyone left #mojo
19:18 sri phew
19:37 tempire marcus: doing it now
19:37 sri a wild tempire appears
19:38 tempire <3 pluck
19:42 venkatk_ joined #mojo
19:42 batman sri: small optimazition: is perl faster without () or did you refer to readability?
19:43 sri readability is an optimization too :)
19:43 batman :)
19:43 batman at least for devs
19:58 xaka1 joined #mojo
19:59 * marcus is optimiized for the couch
20:02 fhelmber_ joined #mojo
20:02 batman marcus: not even looking at my pull request? :)
20:04 marcus batman: nice one on the hgetall!
20:05 marcus batman: merged both your pull requests
20:06 marcus guess I'll push a release of the OAuth2 driver now
20:06 batman sweet!
20:06 batman and no failing tests either ;)
20:06 marcus got my laptop back from repairs today too.
20:06 batman marcus++ # awesome
20:06 batman oh. can i ask how many gazillion norwegian kroners it cost?
20:08 batman in redis, if i want to delete an element in a list and i also need them to be in a given order, then i need sorted sets right?
20:12 o_o_ joined #mojo
20:17 marcus batman: 8999,-
20:17 marcus for a new screen
20:19 marcus batman: you can delete an element from a list using http://redis.io/commands/lrem ?
20:19 batman marcus: shit
20:19 batman marcus: but then i need to know the index
20:19 Britzel Evening. Probably a more D::C related question, but can't figure it out in mojo. I have a large resultset which I want to display in chunks (pages). I want to use the 'page' feature of D::C. How to I remember the current resultset across requests in mojo? Full blown session tracking, or is there an easier way?
20:19 batman i think i'll use sorted sets
20:20 marcus batman: no, it removes the first instance of the key.
20:20 batman marcus: oh!
20:20 batman nice
20:20 marcus batman: For example, LREM list -2 "hello" will remove the last two occurrences of "hello" in the list stored at list.
20:20 sri marcus: you had to pay for the repairs?
20:20 batman DC comics, or dbic aka dbix::class?
20:21 * sri hopes for DC comics
20:21 marcus sri: they found physical damage on it. apparently it has been damaged during transport.
20:21 sri damn
20:21 batman Britzel: ->search(undef, { page => $self->param('page') || 1, rows => 60 });
20:21 marcus sri: will attempt to get it on travel insurance.
20:22 Britzel batman: that simple? Ok :)
20:22 batman marcus: it's insane :(
20:22 batman Britzel: then track ?page=X in the browser
20:22 Britzel sorry, D::C as in DBIx::Class
20:22 sri aww
20:22 batman Britzel: say "dbic" instead. just as many chars and people understand you
20:23 Britzel batman: rgr, will do. I thought I would have to keep the previous rs around.
20:23 Britzel ok, will do in the future.
20:23 batman "roger" is a bit more characters, but it makes you sound less of a monkey :/
20:23 batman Britzel: you can't keep the old rs around.
20:24 Britzel sorry, radio amateur slang, that 'rgr' :) Old habits die hard.
20:24 batman you need to add special tracking if you are afraid you will loose/get data
20:24 batman Britzel: aha! sorry then :(
20:24 batman i have no idea how to solve the last problem though... i just wouldn't care
20:25 sri just don't keep the resultset around
20:25 sri it doesn't scale
20:25 Britzel ok. I thought it would be worthwile to keep it, performance wise.
20:25 batman no. don't do that :)
20:25 Britzel Ok, I wont keep it.
20:25 krism hi sri, after grahams changes to the ttrenderer plugin (mainly replacing that unless ($ok) block with "die $self->tt->error unless $ok", i'm back to the same problem - where mojolicious doesn't seem to use to the included exception templates
20:26 * batman wonder why anyone uses tt these days...
20:26 krism i get a "file error - exception.development.html.tt" followed by an empty 500 to the client
20:27 batman Britzel: just do what i wrote :)
20:27 Britzel batman: already doing that. Thanks!
20:27 batman Britzel: and it works?
20:27 tempire marcus: uploaded, with other bugfixes too
20:27 Britzel batman: ok, i am not _that_ fast :D
20:27 sri krism: might be because it is still not returning false for missing templates
20:27 batman ;)
20:28 sri krism: but i'm only guessing again
20:28 Britzel batman: but keeping the current page around and using that in the next request is easy.
20:28 krism yeah, i think that's exactly the problem
20:28 krism i'll dig into it more
20:28 sri krism++
20:28 batman Britzel: keep it on the client side. don't do it on the server side
20:30 Britzel batman: Um, not sure about that. I just planned to have a page parameter, which is sent back with the click on the 'next page' button. The receiving controller increases it, gets the rs and snds it off again.
20:30 Britzel Bad idea?
20:30 sri krism: maybe the exception type can be checked
20:31 Britzel Or even simpler: with the rs the controller sends page number fpor previous and next page, and I put that on the action of the buttons.
20:31 batman Britzel: no. works like a charm. just don't keep $rs or $rs->pager variables on the server side during multiple requests
20:31 Britzel batman: ah, ok, yes, thats what I gathered. Thanks :)
20:31 batman create my $rs on each request
20:31 sri krism: or a small check before the process call, like return unless -r $self->template_path($options);
20:32 sri together with the inline/data check
20:39 perlite_ joined #mojo
21:03 Coff joined #mojo
21:04 plicease joined #mojo
21:04 Coff Anything in particular that should be the first thing I check when Mojo throw a "Processing request failed: Can't use string ("MyApp::Foo") as a HASH ref while "strict refs" in use"?
21:15 plicease sri, mojo 3.33 breaks the tt plugin.  I can see that the plugin is not doing what the the recipe specifies to get the DATA template, but I am getting undef back from $r->get_data_template($options).
21:20 sri you are not guaranteed a data template
21:20 sri if there is noe you get undef
21:20 sri *none
21:21 plicease okay in the example i am using there is a data template.
21:21 plicease i copied basically the example from the recipe.
21:21 sri please be more precise
21:24 plicease this is my test http://pastebin.ca/2197674
21:29 sri umm
21:29 sri plicease: if you add "say $r->get_data_template($options);" it shows anything
21:31 plicease i get a blank line.
21:33 sri plicease: http://hastebin.com/raw/wucedecugi # works flawless
21:35 plicease okay works in 3.33 but not 3.32 i can work with that.
21:36 sri that is correct, 3.33 is smarter and the last argument is a no-op now
21:36 plicease i will fix TtRenderer and add 3.33 as a prereq
21:37 plicease thanks.
21:38 sri thanks for fixing the tt renderer
21:40 Lucas1 joined #mojo
21:45 rem_lex|pivo joined #mojo
21:46 good_news_everyone joined #mojo
21:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mgTf6g
21:46 good_news_everyone [mojo/master] bring back IO::Async recipe - Sebastian Riedel
21:46 good_news_everyone left #mojo
21:47 sri looks liek i was wrong, and IO::Async::Loop::EV works fine
21:51 lukep joined #mojo
21:59 sri IO::Async should actually work pretty well with steps, since it always passes the invocant too
22:00 krism joined #mojo
22:05 xaka1 in case of delayed responses i see homeless 200 OK (52.639481s, 0.019/s) messages in the log, mb it makes sense to log url as well?
22:12 sri xaka1: do you have a pretty proposal?
22:15 zivester joined #mojo
22:16 xaka1 it's not easy to propose something that won't waste your logs :) if you don't have delayed responses, the sequence of log messages is good - GET <URL> -> Dispatch ... -> 200 OK and in that case additional URL logging would only make it less readable
22:16 xaka1 but if you have delayed responses, in 5 minutes you would see tons of 200 OK that dont fit anywhere, they would just follow each other
22:17 Antisoche Hi - is there a command to render text from within a template?  I want to do something like "%print <html> if( $condition )" (versus <%if($condition){%><html><%}%>).  Is there an easy way to do that or do I need to restructure?
22:17 sri i've thought about getting rid of the GET foo message and merge it into the timer one
22:17 xaka1 i was thinking about "200 OK <URL>" - the only solution i see
22:17 sri yes, was thinking the same
22:18 krism joined #mojo
22:18 sri is the method actually important?
22:18 sri i usually don't care much when testing stuff
22:18 sri 99% is just get
22:20 xaka1 method is very important, especially if you follow the REST i.e. GET /Tasks != PUT /Tasks
22:23 sri [Fri Aug 24 00:23:42 2012] [debug] 200 OK (0.000861s, 1161.440/s) [GET http://localhost:57868/foo/bar].
22:24 * xaka1 nods
22:25 sri but if nothing gets rendered you see nothing
22:27 Antisoche Hmm. In case this is getting logged anywhere, it looks like the answer is:  "%== '<html>' if( $condition );"
22:28 sri see topic, big brother is watching :)
22:29 * tempire watches
22:45 sri tempire, marcus, crab: you're welcome to join http://groups.google.com/group/mojolicio​us/browse_thread/thread/a836b5ce53cadd23
22:57 sri tempire++
23:19 mire_ joined #mojo

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