Camelia, the Perl 6 bug

IRC log for #mojo, 2012-11-23

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

All times shown according to UTC.

Time Nick Message
00:03 sri it might actually cause new problems though
00:04 sri compare "curl -v -X POST www.chefkoch.de" with "curl -v -X POST -H 'Content-Length: 0' www.chefkoch.de"
00:04 sri :S
00:09 SmokeMac_ joined #mojo
00:09 egopro joined #mojo
00:10 good_news_everyone joined #mojo
00:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gwUO_g
00:10 good_news_everyone mojo/master 1e5af14 Sebastian Riedel: documentation tweaks
00:10 good_news_everyone left #mojo
00:11 sri well, unless there are a few votes everything stays the way it is
00:14 SmokeMac_ joined #mojo
00:35 nicomen when using the tt plugin, is there some way to get its instance so I can use define_vmethod ?
00:35 nicomen I want to implement a simple map() method for LISTs
00:36 nicomen $self->renderer->handlers->{tt} gives me a dummy
00:36 davido joined #mojo
01:00 tempire I read: code would be fine without it, and might cause a new problem.
01:06 sri both versions are RFC 2616 compliant, with different side effects
01:08 sri current does not work with some very old and broken versions of lighttpd apparently, new one could result in 4xx responses if you don't manually set Content-Length
01:09 sri (for request methods that require a body that is)
01:10 mattastrophe joined #mojo
01:14 nicomen shouldn't it set the correct content-length if not provided?
01:14 Mike-PerlRecruiter_ joined #mojo
01:16 sri we are talking about Content-Length: 0
01:17 hlin joined #mojo
01:18 nicomen because someone has set it to 0 on purpose?
01:18 sri because the body is empty
01:18 nicomen oh
01:19 nicomen and old lighthttpd broke if it is set to 0?
01:19 nicomen -ht
01:20 nicomen ah on get requests....
01:31 aptituz joined #mojo
01:32 egopro joined #mojo
01:48 geira joined #mojo
02:27 hlin joined #mojo
02:39 heytrav anyone have a suggestion regarding my hypnotoad logfile question above?
02:53 Gedge joined #mojo
02:59 Gedge_ joined #mojo
03:18 noganex_ joined #mojo
03:35 Foxcool joined #mojo
03:38 rem_lex|pivo joined #mojo
03:41 egopro joined #mojo
03:58 titus joined #mojo
03:58 titus left #mojo
04:04 d4rkie joined #mojo
04:07 laouji joined #mojo
04:32 sri janus: less hackish solution btw. $ua->on(start => sub { $_[1]->req->headers->remove('Content-Length') if $_[1]->req->fix_headers->headers->content_length eq '0' });
04:32 sri :)
04:35 amirite joined #mojo
04:35 amirite does placement of 'has' attributes matter in a package/script?
04:35 amirite i think i remember reading something about it in docs
05:07 asarch joined #mojo
05:28 Vandal joined #mojo
05:36 Foxcool joined #mojo
05:58 spleenjack joined #mojo
06:02 ovnimancer joined #mojo
06:42 dpetrov_ joined #mojo
06:51 hlin joined #mojo
07:01 yakudza joined #mojo
07:19 d4rkie joined #mojo
07:53 drift_ joined #mojo
07:54 dod joined #mojo
07:56 spleenjack joined #mojo
08:00 mire__ joined #mojo
08:17 dpetrov_ how can I define a union into Moo?
08:19 hlin joined #mojo
08:21 dod joined #mojo
08:40 ver joined #mojo
08:43 fhelmber_ joined #mojo
09:16 geira joined #mojo
09:20 alexeiras joined #mojo
09:35 sinkovsky joined #mojo
09:44 Foxcool joined #mojo
09:45 Britzel_ joined #mojo
10:06 sinkovsky joined #mojo
10:06 sinkovsky joined #mojo
10:08 spleenjack joined #mojo
10:43 batman left #mojo
10:48 dabudabu joined #mojo
10:48 alexeiras joined #mojo
11:05 SmokeMac_ joined #mojo
11:48 spleenjack1 joined #mojo
11:50 mire__ joined #mojo
11:57 spleenjack joined #mojo
12:01 spleenjack joined #mojo
12:29 marcus joined #mojo
12:40 phips|mac joined #mojo
13:13 spleenjack joined #mojo
13:14 migo joined #mojo
13:17 Mike-PerlRecruiter_ joined #mojo
13:18 amirite_ joined #mojo
13:32 amirite_ how can i check if an object 'has' something
13:39 spleenjack joined #mojo
13:39 amirite_ shouldn't attributes be flagged as such somewhere in the instance
13:40 nic not following the question
13:40 amirite_ rather than just building getter/setter methods maybe they should be flagged in some way so that we can differentiate defined attributes rather than screwing up with a $self->can( "attr" ) test
13:41 nic oh
13:41 nic what's the problem with $self->can ?
13:44 amirite_ the problem for me occurs when i pass a parameter to new or some other constructor that runs $self->$key( $val ) if $self->can( $key )
13:44 amirite_ i do indeed want it to run the setter if it's an attribute, but if it's a sub routine i don't want it called
13:45 mjy hm mojo get breaks URLs with escaped latin 1 chars it seems
13:45 mjy mojo get /m%E4h results in /mÃ?h
13:47 nic amirite_: that's fairly specific behaviour; can achieve it easily if you have "my @Fields = qw( name address etc );" near top of class defn
13:48 nic I'm finding that quite handy in some of my classes cos I can do stuff like "@$self{@Fields} = @validated_values"
13:48 nic and sri pointed out the other day you can use the shorthand "has \@Fields"
13:49 nic @$self{@Fields} = map rewrite, @given_values
13:50 amirite_ so if i pass name to the new constructor it will or won't get set?
13:51 amirite_ i'm running into recursion occaisionally because i tend to name both sub routines and parameters with a common generic single word
13:53 amirite_ why not define an instance routine 'has' which returns 1 or undef if a class has an attr ?
13:55 nic imo that would be a bit clumsy
13:59 amirite_ why? if self->can is useful then self->has is also useful, and more specific
13:59 amirite_ can refers to verbs, has refers to nouns
14:00 nic How is 'has' going to work with the existing 'has'?
14:00 cosmincx joined #mojo
14:02 amirite_ something like--  return $_[1] ? 1 : undef if ref $_[0] eq __PACKAGE__;
14:02 amirite_ maybe
14:02 amirite_ dunno
14:02 amirite_ eq caller
14:03 amirite_ i.e. differentiate $self->has() from has 'attr'
14:18 trone I wrote « % my %attrs = ( … , onclick => "function('thing')" , … );  %== tag 'button' => ( %attrs ) => begin » and %== escape the onclick value "'"'s. I can avoid this escaping?
14:21 sinkovsky joined #mojo
14:41 asarch joined #mojo
15:07 ObseLeTe joined #mojo
15:50 yakudza joined #mojo
15:58 sinkovsky joined #mojo
16:11 sinkovsky joined #mojo
16:13 sh4 joined #mojo
16:17 mattastrophe joined #mojo
16:40 avkhozov joined #mojo
16:50 mire__ joined #mojo
16:51 sinkovsky joined #mojo
17:32 sinkovsky joined #mojo
17:57 dod joined #mojo
17:58 sri \o\
17:58 sri /o/
18:00 dpetrov_ joined #mojo
18:00 tempire _o/
18:01 tempire \o_
18:01 sri https://github.com/kraih/mojo/issues/417 # wonder if i should just close this issue or leave it open for discussion
18:02 sri with that little information i somehow don't see it turn into a sensible discussion
18:04 sri i guess it's meant as a feature request, since he said "IMO"
18:05 tempire that's my interpretation
18:05 tempire *understanding
18:09 sri ok, closing it with a link to the contributing guide
18:12 sri i guess long term we should target this spec http://www.whatwg.org/specs/web-app​s/current-work/multipage/urls.html and leave RFC 3986 behind
18:15 b2b joined #mojo
18:16 b2b
18:16 b2b Hello
18:16 sri o/
18:17 b2b sri? hey are you sebastian riedel?
18:18 sri that's me
18:18 b2b of course you are. Good Job, excellent Framework
18:18 sri glad you like it
18:18 b2b are you the only one "on duty" right now?
18:18 b2b this is my first time in this chatroom
18:19 sri you never know
18:19 b2b :) i just used the who command
18:20 sri i bet most of our americans are still busy eating turkey
18:20 b2b :) thanks to time differences, its turkey time there
18:21 b2b you know, i actually dropped in to see if anybody couzld help me with a mojo problem that got me stumped. i wasnt expecting to meet YOU here :)
18:23 b2b i am trying to open/use 2 database handles in my mojolicious app. somehow, the second helper is just not working. No hypnotoad, only morbo. i searched EVERYWHERE (=google+duckduckgo)
18:23 b2b :)
18:26 b2b I am using  Mr. Van-Staverens module Mojolicious::Database::Plugin - i would have been thrilled if i had stumbled upon HIM here
18:26 sri now rephrase that as a question ;)
18:26 b2b hehe
18:27 b2b ok. Question: is it possible to have two/more Database helpers if i call them something different like this: helper => db1 ... helper => db2
18:27 sri ah, i see the problem though
18:27 sri you'll have to file a bug report i'm afraid
18:28 b2b :(
18:28 b2b i see. so its a known bug eh?
18:28 sri https://github.com/benvanstaveren/Mojo​licious-Plugin-Database/blob/master/li​b/Mojolicious/Plugin/Database.pm#L16
18:28 sri the attribute name is hardcoded
18:28 sri it should be based on the helper name
18:29 sri no idea of it's a known bug, just saw it in the code
18:29 b2b damn you're fast
18:29 b2b :)
18:30 b2b i see it too
18:30 sri if it said something like "$app->attr(($conf->{helper} || 'db') . '_dbh' => $dbh_connect);" it should work
18:31 b2b but thats kinda what the next line says no? wait...
18:31 sri ben is not here atm i'm afraid, but he's generally fast with applying patches and releasing a new version
18:31 b2b my $helper_name = $conf->{helper} || 'db';
18:32 sri the helper uses the attribute though
18:32 sri "return shift->app->dbh" needs to change too
18:32 b2b true
18:32 sri currently there can only be one "dbh" attribute
18:33 b2b which is what i suspected after banging my head against the wall all night yesterday
18:33 sri i suspect the plugin is not meant to be used multiple times
18:33 b2b yeah, seems like
18:34 sri should be easy to change though
18:34 b2b you know, thats the crazy thing about releasing software. sometimes, you never imagine in what use cases your software ends up being used
18:34 sri tell me about it :)
18:34 b2b :)
18:35 b2b if you knew what I have been up to with YOUR software... - just kidding :)
18:39 b2b say, do you mind if i copy our chat transcript into the email i am writing to ben?
18:42 b2b Oh and finally, Thanks!!!!! for the help and for creating such an excellent framework.
18:44 sri not at all, channel logs are public, you could just link to it
18:44 sri see topic
18:45 b2b wow i am soooo old school :)) i havent used irc in years
18:49 buu HELLO FRIENDS.
18:49 buu I AM HERE TO RESTORE THE BALANCE IN THE CAPITAL LETTER FORCE.
18:49 sri https://github.com/kraih/mojo/issues/417 # haha, looks like there's a discussion after all, but nobody actually understands the problem
19:05 alexeiras joined #mojo
19:47 xaka joined #mojo
20:18 sinkovsky joined #mojo
20:22 d4rkie joined #mojo
20:23 sh4 joined #mojo
20:25 D4RK-PH0ENiX joined #mojo
20:35 b2b joined #mojo
20:37 mire__ joined #mojo
20:40 d4rkie joined #mojo
20:46 heytrav does anyone know where the logfile should be (or how to configure) when running a "cpanified" app with hypnotoad?
20:47 heytrav I've deployed it under a local directory set up with local::lib so everything is under ~/perl5/..
20:49 sinkovsky joined #mojo
20:57 perlite_ joined #mojo
20:58 bobkare heytrav: the ability to configure that is up to the app, I think by default you might get a logfile if you create a log directory under whereever it thinks the app directory is in that case
21:01 avkhozov hi, can someone explain me how to use the restricted placeholders?
21:01 avkhozov if i use similar example as in documentation (http://mojolicio.us/perldoc/Mojolicious/Gu​ides/Routing#More_restrictive_placeholders) $r->get('/test/:n/', n => qr/1/)->to('example#test', n => 0); I get HTTP404 error, but if I use Mojolicious::Lite examples $r->get('/test/:n/', [n => qr/1/])->to('example#test', n => 0); all works fine.
21:02 avkhozov I use non Mojolicious::Lite application
21:11 heytrav bobkare: ok, that's kinda what I thought. I'm just not sure where it thinks the app directory is
21:20 bobkare heytrav: from the mojolicious::commands docs: /path/to/my/app eval 'say app->home'
21:22 stickpin win 3
21:28 heytrav bobkare: ok, I'll try that out. Thanks!
21:45 SmokeMac_ joined #mojo
21:45 Averna joined #mojo
21:47 mjy joined #mojo
21:53 mattastrophe joined #mojo
22:08 mjy hm the cookie handling in Mojo::UserAgent has a bug it seems
22:09 sri https://github.com/kraih/mojo/issues/417 # is there anything i need to be more clear about here?
22:10 mjy are you "kraih"?
22:10 sri i am
22:10 mjy the URLs work with all browsers and LWP
22:10 mjy what exactly do I need to prove? That clients aren't free to rewrite URLs?
22:10 janus sri: thought about header rewriting and messing with http in general, in that case an event could make sense to some extent, not sure if that's enough of a reason though
22:10 sri that's not relevant
22:11 sri mjy: where is the correct handling of latin1 in URLs explained?
22:11 mjy there is no latin1 in this url
22:11 mjy it's escaped
22:11 mjy it happens that if you unescape it, it is probably latin1
22:11 mjy but that is left to the server
22:12 mjy the client is not supposed to unescape it
22:12 sri so, how do we normalize URLs if we don't know the charset?
22:12 mjy for the client it is ASCII
22:12 mjy why do you need to normalize it?
22:12 * sri gives up
22:13 mjy *shrug*
22:13 mjy I suppose everyone else is doing it wrong then
22:13 mjy and such URLs are not allowed to exist ;)
22:14 sri just talk to another core dev please
22:14 mjy I see...
22:14 alexeiras joined #mojo
22:33 * sri wonders if bad github isses are caused by him being too responsive there
22:34 sri i'm gonna try ignoring them for a big
22:34 sri s/g/b/
22:34 sri argh!
22:34 sri bit!
22:35 mjy I can assure you that unfriendly responses do not motivate anyone to post apparent deficiencies
22:36 sri you've not seen me unfriendly yet
22:39 mjy I am not terribly interested in personal issues etc., I am just interested in replacing our LWP based code with Mojolicious and whenever an issue arises that seems to be a bug, I report it so that a) we do not have to monkeypatch it to get stuff to work, b) others may benefit. Do with it what you like ...
22:39 sri marcus, tempire, crab: think i'm burned out, please take over github issues for a bit
22:41 sri my last action will be to reopen https://github.com/kraih/mojo/issues/417
22:41 sri do with it what you like
22:42 sri TOO MUCH VAGUE KILLED THE SRI
22:43 bobkare is that normalization thing something new? mojo get "http://www.lokalavisa.no/av​is.php?anavn=Gr%F8nfjellgal" seems to work for me on the old version I'm on
22:47 mjy hm %F8 works for me too, strange
22:48 mjy ah because it is in the params ...
22:48 mjy $ MOJO_USERAGENT_DEBUG=1 mojo get -M HEAD -v "http://www.lokalavisa.no/avi%​F8s.php?anavn=Gr%F8nfjellgal"
22:48 mjy -- Blocking request (http://www.lokalavisa.no/avi%C3​%B8s.php?anavn=Gr%F8nfjellgal)
22:49 mjy it only gets changed in the path
22:49 bobkare Ah, http://www.hero.no/mottak/mott​ak/haugaland/%28valg%29/mottak seems to trigger something
22:50 bobkare that's actually really weird cause it's just plain ascii
22:53 bobkare Oh, never mind
22:54 bobkare that's just because it was a redirect which obviously didn't have the title element I asked for
22:54 mjy what happens for you? I only get the unescaped URL, which seems OK behaviour since ( ) are fine unescaped ... (well actually ... they're "reserved")
22:55 mjy @sri thanks for reopening
22:56 bobkare sorry, I think I'm now out of crazy real-life URLs with escaped latin1 in the path
22:58 bobkare well, I have more, but that's stuff that's broken enough it doesn't work anywhere. Amazing what utter crap you find in this national company registry data
23:00 mjy well if everyone complied with specs ... we'd have no browser issues and probably 1000s of people out of work ;)
23:05 jzawodn joined #mojo
23:42 SmokeMachine joined #mojo

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