Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-18

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

All times shown according to UTC.

Time Nick Message
00:02 vervain joined #mojo
00:21 jnbek joined #mojo
00:31 shmuel joined #mojo
01:00 Molaf joined #mojo
01:03 asarch joined #mojo
01:04 ka2u joined #mojo
01:06 hlin joined #mojo
01:11 Mike-PerlRecruiter_ joined #mojo
01:26 mattastrophe joined #mojo
01:27 jda2000 joined #mojo
01:34 TitanOfOld joined #mojo
01:49 shmuel Hello. what is the best practices for user session?
01:50 shmuel I think that I should only store in the session the user ID.
01:50 TitanOfOld shmuel: You can do that, but you should have a token as well that can't be guessed easily.
01:50 shmuel Is it enough? because mojo sign it.
01:51 shmuel I thought about it. maybe the whole data+signature became one big token?
01:52 hesperaux joined #mojo
01:52 shmuel maybe I've become too philosophical, and should just add the token and get on with it... :-)
01:54 shmuel thanks, TitanOfOld
01:57 d4rkie joined #mojo
01:58 d4rkie joined #mojo
02:19 tempire shmuel: all you need is the user id
03:02 Caelum doesn't $c->session automatically write things to cookies?
03:04 noganex_ joined #mojo
03:10 tempire yes. unencrypted, signed by a secret server-side key.
04:03 noganex_ joined #mojo
04:21 jberger you remind me, I had Galileo setting a default secret, I shouldn't do that
04:21 jberger commit pushed, will be in 0.015
04:22 jda2000 joined #mojo
04:27 yakudza joined #mojo
04:29 xaka joined #mojo
04:46 ka2u joined #mojo
04:57 xaka joined #mojo
04:58 jda2000 Does Mojolicious use POE?
05:08 spleenjack joined #mojo
05:11 anewkirk noe
05:49 crab heh
06:33 amirite how can i chang ethe templates directory?
06:33 amirite or is it hard-coded?
06:35 crab app->renderer->paths
06:35 amirite cool
06:35 crab see Mojolicious::Renderer documentation for more
06:36 amirite or in startup{} $self->renderer->paths i assume
06:36 crab yes
06:37 amirite thanks crab
06:56 dhg joined #mojo
06:59 Vandal joined #mojo
07:02 dpetrov_ joined #mojo
07:14 KindOne joined #mojo
07:32 dod joined #mojo
07:57 ObseLeTe joined #mojo
07:57 trone_ joined #mojo
08:02 trone joined #mojo
08:07 trone_ joined #mojo
08:19 dod joined #mojo
08:24 suy joined #mojo
08:30 Foxcool_ joined #mojo
08:34 dod joined #mojo
08:42 taryk joined #mojo
08:48 taryk` joined #mojo
08:51 fhelmber_ joined #mojo
09:07 taryk joined #mojo
09:41 spleenjack joined #mojo
10:04 dhg joined #mojo
10:44 ladnaV joined #mojo
10:49 ObseLeTe joined #mojo
10:50 Vandal joined #mojo
10:53 ladnaV joined #mojo
10:59 Vandal joined #mojo
11:03 ladnaV joined #mojo
11:15 Vandal joined #mojo
11:20 ladnaV joined #mojo
11:22 Vandal joined #mojo
11:32 Vandal joined #mojo
11:39 bizam hi! what's this in tx: 'DOCUMENT_ROOT' => '/var/www/localhost/htdocs'?
11:41 taryk joined #mojo
11:41 KindTwo joined #mojo
11:42 taryk left #mojo
11:49 bizam oh, this is on tx->req->env->{DOCUMENT_ROOT} = '/var/www/localhost/htdocs'
11:52 bizam this is not mojolicious
11:53 vervain Maybe a cgi thing
11:54 nicomen something set by the a web server?
11:54 nicomen looks apache-ish
11:55 bizam yes, psgi env, sorry
11:58 vervain For this sort of thin I often search the source repository.  'git grep foo', 'ack foo', and 'grep -R foo *' are all handy.
11:59 vervain ANd sure enough DOCUMENT_ROOT is not used by mojolicious, but is in some tests.
12:02 bizam yes, I do
12:02 vervain *nod*
12:04 bizam my search :) for f in $( find $( perl -MMojo -e 'print map {$INC{$_} =~ s/Mojo.pm//; $INC{$_};} grep {/Mojo.pm/} keys %INC;' ) -name '*.pm' -path '*ojo*' ); do echo $f; cat -n $f | grep "htdocs" ; done
12:04 vervain That's gross :-)
12:05 nicomen vervain: ack-grep --all foo
12:05 nicomen (grep -R foo *)
12:05 vervain nicomen: Thanks, didn't know about --all
12:05 nicomen bizam: you want ack-grep --perl
12:05 vervain And grep -R foo * has was preprogrammed into the fingers decades ago.
12:06 vervain But then before -R existed it used to be find ./ | grep ... <- YUCK
12:06 nicomen vervain: sucks with subversion though
12:07 vervain Oh, my find command was poop; it used to be: find ./ -exec grep foo {} \;
12:08 vervain nicomen: I have a limited amount of experience with svn, what's the issue there?
12:08 nicomen vervain: it has .svn dirs in every dir
12:09 nicomen with more or less copies of your files
12:09 nicomen so grep -R matches lots of irrelevant files
12:09 nicomen same goes for cvs and others
12:09 vervain AH
12:10 vervain | grep -v .svn :-0 It gets worse
12:10 vervain After 10 minutes I'd end up with bizam grossness ;-)
12:13 bizam no, I have interest
12:15 vervain interest?
12:17 bizam i dont grossness
12:18 vervain I know.  Don't take it seriously, I'm just messing with ya.
12:18 vervain Don't they say that a unix user skill and command line length or correlated? :-)
12:20 bizam i like spagetti code ;)
12:20 rem_lex joined #mojo
12:27 amirite ur spaghetti
12:28 vervain gphsatite
12:28 vervain phsagtite sounds better though ;-)
12:30 bizam wops :-)
12:36 ladnaV joined #mojo
12:52 karel9 joined #mojo
13:08 Mike-PerlRecruiter_ joined #mojo
13:11 karel9 Hi, is there a chance for adding an extra tls_* parameter to be passed to Mojo::IOLoop::Server->new (and consequently to IO::Socket::SSL->start_SSL)?
13:11 karel9 I am particularly interested in SSL_create_ctx_callback
13:12 karel9 I know that it is perhaps too low level API (I do not even know if it is a public API), on the other hand it as simple as this https://github.com/karel-m/mojo/commit/4​5828921bb900c7fe68f01f73d338270deb4830b
13:21 sri if we don't need it for core functionality there is prettu much no chance
13:22 karel9 sri: I see, I am trying to implement server side SNI which migh be sometimes interesting also for mojo's core
13:23 sri it might
13:23 karel9 sri: In fact I have proposed adding server side SNI support to IO::Socket::SSL - https://rt.cpan.org/Public​/Bug/Display.html?id=82761 - but I do not know if it gots accepted
13:24 karel9 but having SSL_create_ctx_callback is just enough (+ you need fresh enough version of Net::SSleay witj SNI support)
13:25 sri i don't see a reason why you can't use IO::Socket::SSL::set_defaults() for now though
13:27 karel9 sri: sounds promissing, I'll give it a try
13:29 sri but i agree, for SNI support in core the whole thing would be done right, with new options everywhere
13:29 karel9 cool it works! sri++ # for IO::Socket::SSL::set_defaults
13:56 kmx sri: the latest Mojo release fails during make test on MS Windows
13:57 kmx I have a patch - I'll send it as pull request
14:01 bjoernfan sri: minor typo in docs, http://mojolicio.us/perldoc/Moj​olicious/Controller#redirect_to "prepare a 302", but 301 in code example ;)
14:02 bjoernfan Might upset perfectionists.
14:04 sri bjoernfan: that's not a typo
14:04 sri kmx: damn
14:06 bjoernfan Oh, guess the first one is a 302 and the second one is 301. The formatting confused me. Better refresh my memory of what status codes are which.
14:07 labrown joined #mojo
14:08 sri kmx: plan skip_all is enough to make the test pass?
14:08 iskyee joined #mojo
14:08 sri kmx: doesn't it still die on use ::Prefork?
14:09 kmx sri: yes, with my patch all tests pass
14:11 Miked joined #mojo
14:11 iskyee Is there an  hook can get  controller#action name before controller do its job,  so we can do action authorization in an single plugin
14:15 rem_lex|pivo joined #mojo
14:15 sri kmx: hmm, it's a bad solution
14:17 sri the command should at least be runnable on windows
14:17 sri argh
14:17 sri anyone else on windows who can test this patch? http://pastie.org/5718953
14:18 kmx joined #mojo
14:18 kmx sri: perl -Mblib -e "use Mojo::Server::Prefork"
14:18 sri kmx: does this work too? http://pastie.org/5718953
14:18 kmx on ms win dies with an error:
14:19 kmx Time::HiRes::ualarm(): unimplemented in this platform
14:19 sri and what if we don't import ualarm?
14:20 kmx I'll try your patch
14:20 yakubori joined #mojo
14:20 yakubori hola
14:23 sri oops, i forgot a use Time::HiRes ();
14:23 sri o/
14:26 kmx sri: your patch works nice, you can ignore my original  proposal
14:26 sri \o/
14:26 sri kmx++
14:27 kmx of course with TEST_PREFORK=1 prefork.t fails on MS Win but it is IMO expected
14:27 good_news_everyone joined #mojo
14:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/0L7dcg
14:27 good_news_everyone mojo/master a2429ad Sebastian Riedel: fixed Windows bugs in tests (closes #447)
14:27 good_news_everyone left #mojo
14:27 sri it's the same for TEST_HYPNOTOAD=1
14:28 kmx sri: exactly
14:28 sri looks like we'll have 3.82 later today
14:28 bluescreen joined #mojo
14:28 * sri hates windows
14:30 amirite me too
14:31 amirite and macos
14:33 yakudza joined #mojo
14:38 mattastrophe joined #mojo
14:43 yakubori i like them when sublight is coming through :P
14:43 yakubori err sunlight
14:44 ObseLeTe joined #mojo
14:52 gryphon joined #mojo
14:57 travis-ci joined #mojo
14:57 travis-ci [travis-ci] kraih/mojo#189 (master - a2429ad : Sebastian Riedel): The build was broken.
14:57 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/d1d2c910472f...a2429ad63b88
14:57 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/4231901
14:57 travis-ci left #mojo
15:13 b2b joined #mojo
15:15 ryozi joined #mojo
15:17 Britzel_ joined #mojo
15:17 nic It's not too late to add a third decimal place (3.811)
15:17 nic bah, I'm wrong
15:17 nic WE ARE TOO LATE!!!
15:18 nicomen 3.081 ?
15:18 nicomen hmno
15:20 nic Could go 3.081_001 but that would get a bit silly and break in those places where 3.81 > 3.082
15:21 nic It's Y2K all over again
15:22 * nic warns bank manager that job is in jeopardy
15:25 good_news_everyone joined #mojo
15:25 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/3hhW8w
15:25 good_news_everyone mojo/master 4d1f878 Sebastian Riedel: added support links to documentation
15:25 good_news_everyone left #mojo
15:29 sri seems reasonable to have that on all pages in the guides?
15:33 stephan48 i see no reason against it...
15:48 good_news_everyone joined #mojo
15:48 good_news_everyone [mojo] kraih tagged v3.82 at a8a6358: http://git.io/bkBtyw
15:48 good_news_everyone left #mojo
15:49 travis-ci joined #mojo
15:49 travis-ci [travis-ci] kraih/mojo#190 (master - 4d1f878 : Sebastian Riedel): The build was fixed.
15:49 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/com​pare/a2429ad63b88...4d1f87806a57
15:49 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/4232903
15:49 travis-ci left #mojo
15:50 dhg joined #mojo
16:09 mattastrophe joined #mojo
16:44 anaio joined #mojo
16:45 asarch joined #mojo
16:56 yakubori is there a way to specify a default route?
16:58 yakubori just put an any handler last?
17:20 ObseLeTe joined #mojo
17:21 xaka joined #mojo
17:26 yakubori yar, that looks like it be tha winner :P
17:29 basic6 joined #mojo
17:30 basic6 as far as i know, "file" is not a reserved stash value, so i can use it? or is it likely to become a reserved value in the future?
17:34 sri we've not added a new reserved stash value in a long time
17:35 sri (years?)
17:36 basic6 ok i'll rely on the list i've found and use "file"
17:36 sri last change to reserved stash values was a removal a year ago actually :)
17:36 sri only way i see for us to add new ones would be as a breaking change in a major release
17:37 basic6 okay
17:52 TitanOfOld joined #mojo
18:01 webar7 joined #mojo
18:02 labrown joined #mojo
18:09 ObseLeTe joined #mojo
18:09 ObseLeTe joined #mojo
18:26 d4rkie joined #mojo
18:28 dhg joined #mojo
18:32 webar7 I'm trying to use a custom tag to dump the contents of a  variable ...  %= t dumper $animals
18:32 webar7 animals is a list
18:33 webar7 but of course I get
18:34 webar7 Global symbol "$animals" requires explicit package name at template list.html.ep from DATA section line
18:34 webar7 :-\
18:34 webar7 cause I don't know what I'm doing
18:35 webar7 what do it put in            $animals = ... ;
18:36 webar7 to make it dump nicely
18:44 ObseLeTe joined #mojo
18:47 Caelum webar7: is the variable in your stash?
18:47 Caelum if I have a route like: get '/foo/*bar' => { bar => '' } # how do I get the 'foo' part out of the route spec?
18:58 webar7 ah ok
18:59 webar7 Caelum, I was just testing the thing by putting it in my $animals = '"horse", "cat". "dog"'; ....
18:59 webar7 so I should out it somewhere where mojo can get it for the rendering ...
19:08 dod joined #mojo
19:08 TitanOfOld Caelum: foo isn't a placeholder. You always know what it is.
19:12 sh4 joined #mojo
19:13 Caelum TitanOfOld: I "know" what it is in the route, but I'm calling a helper function which does not "know" what it is
19:14 Caelum TitanOfOld: so I'd like the helper function to introspect it
19:21 ObseLeTe joined #mojo
19:28 Caelum I got it, I can call app->routes->route->name
19:28 dhg joined #mojo
19:29 Caelum then just regex that
19:38 Caelum j
19:44 Caelum no that doesn't work
20:02 ObseLeTe joined #mojo
20:02 Caelum <3 before_dispatch hooks
20:03 dhg joined #mojo
20:15 Caelum how do I get the current controller from the app
20:17 lammel2 joined #mojo
20:21 Caelum w 6
20:35 bluescreen joined #mojo
20:42 Caelum hmm, plugin re-registers a plugin even if it's already been loaded, is that good or bad?
20:43 bpmedley_ joined #mojo
20:44 ObseLeTe joined #mojo
20:54 good_news_everyone joined #mojo
20:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZTw8jA
20:54 good_news_everyone mojo/master 2531343 Sebastian Riedel: better examples for routes attribute
20:54 good_news_everyone left #mojo
21:00 Caelum sri: I had an idea (which I used in my app): add a 'controller' accessor to app for the current controller
21:01 ObseLeTe joined #mojo
21:01 sri very very bad idea i'm afraid
21:01 ObseLeTe joined #mojo
21:02 sri there may be many many parallel requests active at any given time
21:02 Caelum oh right, this is an async framework
21:03 Caelum so if I'm calling something from a route, any sane way to get the route's context?
21:05 sri what is a route's context?
21:09 xaka joined #mojo
21:10 Caelum I don't know, I just want to get $c for the executing route from app-> in helper_function()
21:11 sri my $c = shift;?
21:12 * sri does not understand
21:12 Caelum without passing in $c
21:12 Caelum my $app = caller; my $c = $caller->app->something_that_gives_me_c;
21:14 Caelum though I guess passing in $c would be more sane
21:16 sri app has no connection to controller instances, you can't
21:16 sri there is no concept of "current context", there may be thousands active
21:17 sri if you don't have $c, you're screwed
21:18 sri you could say $c *is* the context, that's all you have
21:18 Caelum I see, thanks!
21:19 mattastrophe joined #mojo
21:20 marty meh, the perl MongoDB driver keeps mangling my booleans and turning them into strings.
21:20 sri marty: i'm starting soon! :)
21:20 marty \o/
21:21 sri in fact, i've started reading up on protocol changes
21:21 marty Looks like there is a lot of stuff there.
21:23 marty full stack Mojo will rule the world.  :)
21:23 sri \o/
21:24 marty so say we all
21:24 * marty is a total bsg fan boy now.
21:26 sri if only syfy would start making good scifi again :/
21:27 sri but instead they cancel alphas too now
21:27 sri (not that the second season was good... but still!)
21:28 marty aren't they working on some big project right now?
21:28 marty btw, one of the best things of bsg is the music.  wow, great stuff
21:29 sri yea... but that looks rather risky http://defiance.com
21:30 sri tv series and online game
21:31 marty yep, that's the one I was thinking of.   saw it mentioned in there 20th anniversary special.  That's what got me thinking about watching some TV again.
21:31 sri :)
21:32 sri have you watched firefly yet?
21:33 marty I watched the first episode, looked good.   Decided to go with bsg first, my brain can't follow two story lines simultaneously.
21:34 * sri is jealous... you have so many nice shows to watch
21:36 marty I gotta admit, it's nice being able to just go from episode to episode without any commercials and do not have to wait a week.  Yes, you should be jealous.   :)
21:39 Caelum for a login api call, does get_post '/login/*user_name/*password' make sense?
21:41 marty Seems very risky to me
21:42 Caelum that's true
21:44 Caelum also in terms of rest, since login is not an entity, would something like this be better: get_post '/do_login/*user_name'
21:45 vervain In RESTful stuff it's better to have nouns in your url rather than verbs.
21:45 sri from a purist point of view, logins are by definition anti-rest
21:46 vervain I disagree... if /user/foo?password=bar gives you data on the user then I don't see why that's not restful.
21:47 sri it's the stateful part that comes after
21:47 vervain Gotcha... that's koolaid level of purist though ;-)
21:48 sri if you were really RESTful you would get the exact same result for every request, without it depending on previous requests
21:48 sri but yea, it's silly purist :)
21:49 sri my point being, don't waste too much time trying to be more restful
21:49 sri because you will never ever be RESTful enough!
21:51 marty google packaged apps look interesting.   I wonder if they are evil.
21:52 tempire wat
21:52 * tempire wants alphas to come back
21:53 gryphon joined #mojo
21:53 sri tempire: shut up and watch some wrestling!
21:53 tempire erg
21:53 * sri sobs
21:54 b2b joined #mojo
22:01 perlite_ joined #mojo
22:09 tempire It's really no different from the years before bsg
22:09 tempire there was stargate
22:09 tempire then there was stargate and wrestling
22:10 tempire then there was wrestling
22:10 tempire there is always wrestling
22:10 tempire there will always be wrestling
22:10 tempire it is a metaphor for the struggle between human advancement and the common man
22:12 tempire we are always on the precipice.  syfy is an indicator of all of humanity.
22:12 tempire there is no state.  only movement.  let us all push towards advancement.
22:12 tempire behold the future
22:12 tempire images.tempi.re/behold-nyan.gif
22:12 tempire http://images.tempi.re/behold-nyan.gif
22:15 * marty giggles
22:15 sri orz
22:22 tempire fringe series finale tonight!
22:42 * sri roots for the observers
22:49 TitanOfOld joined #mojo
23:01 basic6 i'm trying to serve a static file, but my browser only receives an empty file: die "not found" unless -f $path; my $static = Mojolicious::Static->new(); $static->serve($self, $path); $self->rendered;
23:40 Caelum is there a way to throw a magic blessed exception that would just end a request
23:42 Caelum that would simplify some of my code (less return statements)
23:47 Caelum looking at Mojolicious::handler, no, there isn't
23:49 Caelum sri: good idea or bad idea? E.g.: if (not $@->isa('Mojolicious::Exception::EndRequest')) { $c->log->fatal("request failed: $@ ...); etc... }
23:56 Caelum I think that's how ->detach works in catalyst

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