Camelia, the Perl 6 bug

IRC log for #mojo, 2013-03-29

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

All times shown according to UTC.

Time Nick Message
00:01 Caelum also, any way to get a stacktrace?
00:14 arthas joined #mojo
00:38 moltar joined #mojo
00:54 Caelum is $c->req->url supposed to give me the full URL? I only get the path and query string
00:55 Caelum the host name is correct in the error screen though
01:01 anewkirk ->to_string should give you the whole thing
01:01 anewkirk I guess it depends on the configuration
01:01 anewkirk paoxy_pass, ect
01:02 anewkirk proxy*
01:12 Caelum ->to_string gives me same, as I expected
01:12 Caelum since I would guess the stringification overload calls to_string
01:12 Caelum as for configuration, I'm using plack+mod_perl2
01:18 TitanOfOld joined #mojo
01:25 Caelum anyway, I just didn't define an action for my form so I don't need it right now
01:25 Caelum but it would be nice if it worked
01:27 ka2u joined #mojo
01:28 d4rkie joined #mojo
01:30 cfedde is there a way to do basic auth with Mojo::UserAgent that does not require encoding username/password in the url?
02:08 anewkirk Caelum, given https://metacpan.org/source/SRI/Mojolicio​us-3.91/lib/Mojo/Message/Request.pm#L233
02:08 anewkirk ... it loos like it wants either SERVER_PROTOCOL or HTTPS from ENV
02:09 anewkirk ... or and/or HOST
02:09 anewkirk .. you could manually set them in your apache virtualhost container
02:10 anewkirk e.g. SetEnv SERVER_PROTOCOL http; SetEnv HOST example.com
02:10 anewkirk if, for whatever reason, they're not automatically being set
02:16 gtodd joined #mojo
02:17 Caelum anewkirk: I have the right vars, since I wrote this: http://gist.github.com/5268298
02:18 Caelum when I noticed this problem last time
02:19 Caelum anewkirk: HOST not HTTP_HOST ?
02:24 Caelum cfedde: you could probably use a Mojo::URL and set the authority?
02:26 Caelum anewkirk: also the error screen shows the host and crap
02:26 Caelum anewkirk: so it's probably not that
02:26 cfedde Caelum: would that not also encode it into the url rather than using the WWW-Authenticate header?
02:27 Caelum oh
02:27 cfedde and Authorization:
02:29 Caelum don't really see anything in the docs
02:29 cfedde Caelum: yeah. I thought I was overlooking something.
02:30 cfedde I've fallen back to using WWW::Mechanize.
02:39 TitanOfOld joined #mojo
02:40 anewkirk (looking now)
02:47 anewkirk Caelum, what's you apache config look like?
02:56 Meiermann joined #mojo
03:00 Caelum anewkirk: it's very plain, no virtual hosts or anything
03:00 Caelum anewkirk: http://gist.github.com/5268465
03:06 anewkirk Caelum, yeah, given that setup, I don't see any reason why it wouldn't be running as CGI and parsing the ENV
03:06 anewkirk sri, ^
03:07 Caelum anewkirk: it's actually running under mod_perl (that particular script)
03:08 Caelum anewkirk: but I could try a cgi
03:13 anewkirk Caelum, I was talking more about the https://metacpan.org/source/SRI/Mojolicio​us-3.91/lib/Mojo/Message/Request.pm#L148
03:13 Caelum anewkirk: same thing happens in plain CGI mode
03:14 anewkirk ?
03:14 Caelum anewkirk: when I run this as a CGI instead of mod_perl: http://gist.github.com/5268521
03:14 Caelum anewkirk: $c->req->url is empty
03:14 anewkirk require Data::Dumper; die Data::Dumper::Dumper($c->req->{state})
03:14 anewkirk .. should say cgi
03:14 Caelum for which, mod_perl or cgi?
03:15 preflex_ joined #mojo
03:15 anewkirk either
03:15 Caelum by the way you can do $c->dumper
03:15 anewkirk yeah, above is just a habbit of mine
03:16 anewkirk ... also, app->cgi('cgi') # will force CGI-mode
03:16 anewkirk ... I meant app->start('cgi') # will force CGI-mode
03:16 Caelum state is 'finished'
03:17 anewkirk on the request object?
03:17 Caelum yeah, $c->req->{state}
03:18 Caelum also 'finished' under mod_perl
03:18 Caelum brb have to block an IP from a script kiddie
03:18 anewkirk np
03:19 anewkirk ... btw, I don't see anything wrong with re-parsing request using ENV as the source
03:19 anewkirk e.g. $c->req->parse(%ENV)
03:21 Caelum oh interesting, it wasn't a script kiddie, it was scan10.ws.symantec.com
03:22 Caelum thank you, symantec, for attacking random people's servers without permission
03:22 anewkirk yup :}
03:30 Caelum anewkirk: if I fixup $c->req->url in a before_dispatch hook it won't find my routes anymore
03:30 anewkirk paste the code
03:31 Caelum anewkirk: http://gist.github.com/5268592
03:33 anewkirk where are you calling that from?
03:34 Caelum it's in an import for my "import all our crap" module
03:34 anewkirk hrmmm
03:34 anewkirk not sure
03:34 anewkirk may need jberger or sri to chime in on this one
03:35 Caelum oh well, it's ok, don't waste any more time. I really appreciate the help.
03:35 Caelum I don't need it at the moment anyway
03:35 jberger ?
03:35 Caelum jberger: my $c->req->url has no host/port
03:35 Caelum jberger: only path and query
03:36 jberger this is on your server?
03:36 Caelum yeah "server" (the apache in my homedir)
03:37 Caelum this happens both in plack+mod_perl2 and cgi mode
03:38 Caelum but the error screen has the host/port info
03:39 * jberger is going through the docs
03:39 * jberger is probably also not the best one for this
03:40 Caelum anewkirk: also, completely unrelated, here's a quicksort in Scala: http://gist.github.com/5268625
03:40 Caelum anewkirk: isn't that gorgeous?
03:42 anewkirk not particularly
03:43 Caelum oh well, I like it
03:43 anewkirk quicksort? ... as opposed to longsort?
03:44 jberger Caelum, what about ->to_abs?
03:44 jberger http://pastie.org/7158091
03:45 Caelum anewkirk: maybe you'd like this one better: http://www.haskell.org/haskellwiki​/Introduction#Quicksort_in_Haskell
03:45 Caelum jberger: trying
03:46 Caelum jberger: hey that worked!
03:46 jberger :-)
03:47 Caelum jberger: thank you very much!!!
03:47 * jberger is happy to help
03:47 anewkirk :}
03:50 Averna joined #mojo
03:58 Caelum jberger: it seems though, that this behavior is somewhat counterintuitive. Especially $c->req->url->host returning undef
03:58 jberger I think it makes sense that the request url is relative
03:59 jberger now maybe you would argue that the host method on a relative url would make it absolute, but that sounds like it would have more problems than it solves
03:59 Caelum does it? if you do <form action='[% c.req.url %]'... it won't work for example
03:59 jberger thats what url_for is for
04:00 jberger or better yet, form_for
04:02 Caelum jesus, a form builder? sri rewrote like half of cpan in this thing
04:03 Caelum and better at that, mostly
04:06 Caelum jberger: how does form_for resolve the route name? is that the controller#method thing? or method in current controller?
04:06 Caelum I've only been writing lite apps so far
04:07 jberger you can use the current_route helper
04:07 jberger if you really want the form to point back to itself
04:08 Caelum that is cool, I didn't know there was such a thing
04:08 Caelum what I'm asking though, is what is the name of a route?
04:08 jberger one thing that most people seem to get wrong is that automatic route naming happens if you don't do a name
04:09 jberger by default the route name is the path with non-word chars stripper
04:09 jberger hahaha
04:09 jberger stripped
04:09 Caelum and I'm guessing I can't do a name in a lite app
04:09 jberger so /route/:to/:path is named routetopath
04:10 Caelum nice
04:10 jberger acutally you can, its the last arg to the route def
04:10 Caelum oh awesome
04:10 jberger any '/' => sub { ...  } => name
04:10 jberger any '/' => sub { ...  } => 'name'
04:11 Caelum I've been using $c->req->url->parts->[1] for this up to now
04:11 jberger (which is how any '/' => 'name' works btw)
04:12 jberger once you get comfortable with url_for and names and the stash, this stuff gets nice and abstract (in the good way)
04:12 jberger *route names
04:13 Caelum speaking of
04:13 Caelum it would be really nice if you could pass an array of path parts to url_with
04:15 jberger ?
04:16 Caelum c.url_with('foo') gives you /foo, so it would be cool if you could do c.url_with(['foo', 'bar']) to give you /foo/bar
04:16 ka2u joined #mojo
04:16 jberger how is the /foo/bar route defined?
04:17 jberger is it really /:foo/:bar ?
04:17 jberger because then you do url_for 'foobar' => { foo => 'foo', bar => 'bar' }
04:18 jberger hmm, or maybe without the hashref
04:18 jberger just kv pairs
04:19 jberger otherwise you aren't really using the url_for power, you should probably just use Mojo::URL
04:20 jberger Mojo::URL->new->parts([qw/foo bar/])->to_string
04:21 jberger hmmm, something isn't right in that last example, but its close
04:21 Caelum I don't remember exactly why I wanted it, but I was using url_with because it preserves the query string
04:21 Caelum and we pass around the session_id in the query string
04:22 jberger why not in the session?
04:22 Caelum I don't know, we have weird government clients, some of them might forbid cookies or something
04:23 jberger could be
04:23 jberger how do you prevent spoofing?
04:23 Caelum we check the REMOTE_ADDR against the one the session was created with
04:24 jberger sounds ok to me, I'm really not an expert in the security aspects of this
04:27 * jberger is actually the resident mad scientist, this is his hobby
04:32 Caelum which science?
04:33 jberger physics
04:33 Caelum cool
04:33 jberger https://github.com/jberger/Thesis
04:33 jberger just a few more weeks!
04:35 Caelum electron microscopes?
04:36 jberger and ultrafast lasers
04:36 jberger :-)
04:36 jberger https://github.com/jberger/Thesis/b​lob/master/inc/hardware/column.jpg
04:37 Caelum what are ultrafast lasers for? would they help with optical routing?
04:37 jberger we generate ultrashort electron pulses rather than a continuous stream
04:37 jberger gives you time resolution on the order of the duration of the pulse
04:38 jberger ~100 fs
04:38 jberger which is what you need for atomic dynamics
04:38 Caelum could you watch a protein with it?
04:39 Caelum or would it destroy it
04:39 Caelum sorry, I'm asking you idiotic questions
04:40 jberger oh you would probably destroy it, but you might learn something interesting first
04:40 jberger the conformal dynamics of protein are an interesting subject
04:40 jberger but personally I'm just in the instrumentation physics
04:40 beyondcreed joined #mojo
04:43 Caelum my dad's a mathematician, unfortunately I didn't inherit any of that from him :) I crashed our server a few times because I forgot that permutations grow at a factorial rate
04:43 jberger M4TH BOMB!!
04:46 jberger anyway, nice chatting
04:47 jberger nite all
04:47 jberger o/
04:49 Caelum good night
05:25 ka2u joined #mojo
05:35 Dr^ZigMan joined #mojo
05:43 good_news_everyone joined #mojo
05:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_K68Kg
05:43 good_news_everyone mojo/master 57dec85 Sebastian Riedel: more Mojo::Message::Request examples
05:43 good_news_everyone left #mojo
05:43 sri those to_abs examples are like all over the place, no idea why they get overlooked still
05:44 sri hopefully that's the right place now -.-
05:44 basiliscos joined #mojo
05:58 TitanOfOld joined #mojo
06:12 D4RK-PH0ENiX joined #mojo
06:12 sri hmmmm
06:13 * sri wonders if Mojo::DOM should have special support for <template> tags http://www.html5rocks.com/en/tutorials/webc​omponents/template/?redirect_from_locale=de
06:16 sri marcus, jberger, crab, tempire: something to look into!
06:46 Caelum well, it might be just that I'm used to catalyst
06:47 Caelum I'd expect eg $c->current_url to possibly be relative, but not $c->req->url
06:47 sri yea, i botched that in catalyst :)
06:47 Caelum hehe
06:48 sri ->req->url having a ->base makes much more sense when you think about it
06:49 Caelum the thing with all urls being absolute was one reason I wrote the SmartURI plugin (it does some other stuff too)
06:49 Caelum the hardest part of that was "make a subclass of URI..."
07:13 Vandal joined #mojo
07:27 maxhq joined #mojo
07:28 maxhq joined #mojo
07:43 jzawodn joined #mojo
07:48 denisboyun joined #mojo
07:51 rem_lex|pivo joined #mojo
07:55 dod joined #mojo
07:56 Britzel_ joined #mojo
07:57 d4rkie joined #mojo
08:06 coff joined #mojo
08:09 dod joined #mojo
08:10 suy joined #mojo
08:27 Gedge joined #mojo
08:44 suy joined #mojo
09:01 D4RK-PH0ENiX joined #mojo
09:32 d4rkie joined #mojo
09:34 ver joined #mojo
09:53 fhelmber_ joined #mojo
10:03 Adura joined #mojo
10:09 BeDa joined #mojo
10:39 Britzel joined #mojo
11:15 sh3 joined #mojo
11:42 mire joined #mojo
12:03 bg joined #mojo
12:09 Gedge_ joined #mojo
12:26 b2b joined #mojo
12:30 Gedge joined #mojo
12:42 * jberger reads about <template>
12:44 jberger I'm not sure what Mojo::DOM would do differently
12:44 jberger it shouldn't ignore it probably
12:45 jberger but it also can't use js to use them properly
12:45 jberger in the end its partway between a comment and a DOM element right?
12:45 jberger tough one
12:59 bowtie joined #mojo
13:16 TitanOfOld joined #mojo
13:18 sri jberger: ignoring in general seems very wrong, then we wouldn't do anything with them
13:18 sri *couldn't
13:19 jberger right, I agree
13:20 jberger thanks for pointing this out though, I have several places where the template tag might help make things easier
13:20 jberger nothing mojo related
13:21 sri browsers are only starting to support it
13:21 jberger oh
13:21 * jberger should have looked at an implementation char
13:21 jberger t
13:21 jberger I've been porting a PHP site to "static"/client-side
13:22 jberger for hosting on github
13:22 jberger http://pdlporters.github.com
13:27 jberger sri: I can't find an availability chart! thats probably a bad sign right :-P
13:28 sri i only know it's in firefox nightly
13:30 jberger I never trust charts like this in wikipedia, but it doesn't look good: http://en.wikipedia.org/wiki/Comparison_of_l​ayout_engines_(HTML5)#Related_specifications
13:30 jberger well something to keep my eye on
13:30 jberger sounds really useful
13:31 denisboyun joined #mojo
13:33 mire joined #mojo
13:43 btyler joined #mojo
14:01 jpn joined #mojo
14:14 jberger sri: http://tong.ijenko.net/2013/03/mojolicou​s-render_later-and-weaken-transactions/
14:15 sri seen it already, at first i was expecting bad advice, but he actually gets it :)
14:15 jberger ok
14:17 gryphon joined #mojo
14:17 jberger then again, isn't this why hypnotoad has the ``graceful'' stuff?
14:17 sri no
14:18 * jberger reads again
14:19 sri the ideal solution would have been $self->on(finish => sub { undef $timer }); but the one shown is ok too
14:20 jberger oh, he's killing the client!
14:21 jberger oh nm
14:22 sri you always have to be prepared for the client closing the connection in evented apps
14:23 sri in which case $self->tx will become undef
14:23 sri since it's weakened and the daemon was the one holding the last strong ref
14:24 jberger hmm, good to know
14:24 jberger I'm glad I mentioned it then, I learned something sri++
14:27 sh4 joined #mojo
14:28 Vandal where can I find client's user agent?
14:31 marty Vandal: $c->req->headers->user_agent
14:31 marty \o
14:42 asarch joined #mojo
14:43 Vandal marty, thank you
14:43 mtths joined #mojo
14:44 sh3 joined #mojo
14:59 mmtths joined #mojo
15:08 GabrielVieira2 joined #mojo
15:09 mtths joined #mojo
15:09 labrown joined #mojo
15:34 btyler joined #mojo
15:48 inokenty joined #mojo
15:48 bluescreen joined #mojo
15:53 vel joined #mojo
16:23 D4RK-PH0ENiX joined #mojo
16:30 d4rkie joined #mojo
17:04 sri hmmm
17:04 * sri has a finished the monotonic clock support patch and wonders if he should just apply it already
17:09 sri it will only be monotonic on linux for now, but we can't really unit test it anyway
17:09 mire joined #mojo
17:11 good_news_everyone joined #mojo
17:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/W0QspA
17:11 good_news_everyone mojo/master bdc2ebd Sebastian Riedel: added monotonic clock support to make Mojolicious more resilient to time jumps (closes #469)
17:11 good_news_everyone left #mojo
17:11 sri well, it's done :o
17:15 sri linux is now by far the best deployment target for mojolicious apps
17:16 sri you get hypnotoad with epoll (EV) and monotonic clock
17:24 suy sri++ \o/
17:29 good_news_everyone joined #mojo
17:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/apJWEA
17:29 good_news_everyone mojo/master f2cb9cd Sebastian Riedel: explain that monotonic clock support depends on Time::HiRes
17:29 good_news_everyone left #mojo
17:33 dod joined #mojo
17:34 marty sri++
17:40 sri \o\
17:40 sri /o/
17:43 rihegher joined #mojo
17:59 ajmrch joined #mojo
18:03 heytrav joined #mojo
18:10 suy joined #mojo
18:41 rihegher left #mojo
18:44 D4RK-PH0ENiX joined #mojo
18:45 btyler joined #mojo
18:52 sh3 joined #mojo
19:14 d4rkie joined #mojo
19:26 good_news_everyone joined #mojo
19:26 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/S8EkxA
19:27 good_news_everyone mojo/master fc1cb8f Sebastian Riedel: small optimizations
19:27 good_news_everyone left #mojo
19:41 mire joined #mojo
19:45 dpetrov_ joined #mojo
19:53 bluescreen_ joined #mojo
19:54 bluescreen__ joined #mojo
19:54 berov joined #mojo
20:16 moltar joined #mojo
20:25 sh4 joined #mojo
20:28 BeDa joined #mojo
20:38 basiliscos joined #mojo
20:40 bpmedley_ joined #mojo
21:00 jberger_ joined #mojo
21:12 basiliscos1 joined #mojo
21:15 Zx3 joined #mojo
21:20 bluescreen joined #mojo
21:37 gtodd left #mojo
21:41 denisboyun joined #mojo
22:15 chansen sri: I just say your commit regarding steady_time(), why not emulate a monotonic increasing time on platforms that doesn't support CLOCK_MONOTONIC?
22:15 * chansen s/say/saw/
22:17 sri chansen: do you have a simple solution? i've thought about playing with POSIX::times to emulate it... but too complicated to be worth it imo
22:19 sri but i guess linux only works for now, it's *the* deployment platform after all
22:19 sri EV is meh on everything else too
22:19 chansen no ready solution, but should be simple
22:20 chansen nopaste?
22:21 chansen http://paste.scsys.co.uk/238062
22:28 sri ah, i've thought about something like that too, but the precision kinda sucks when the clock gets stuck in the past
22:29 sri i'd rather have it fail i think, easier to debug
22:31 sri (not that i've done any research on how well it can actually be emulated in software)
22:31 sri but if there's a decent way to emulate it... that really should be in Time::HiRes :)
22:33 sri btw. the reports we got in the past about time jumps were for regular ones, not one time events
22:35 chansen I don't think you can do much better than the nopaste when it comes to emulation in PP unless you attempt to access the TSC in assembly or in c API's
22:36 chansen "regular ones" as in DST jumps?
22:37 sri i think the last one was about servers with spotty internet connection that resync with an ntp server at random times :)
22:38 chansen ah, ok
23:16 hrupp_ joined #mojo
23:20 ka2u joined #mojo
23:35 gryphon joined #mojo

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