Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-28

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

All times shown according to UTC.

Time Nick Message
00:10 jzawodn joined #mojo
00:13 Molaf_ joined #mojo
00:14 Miked joined #mojo
00:24 lammel2 joined #mojo
00:52 trmjoa joined #mojo
01:01 gtodd joined #mojo
01:03 gtodd Perl6:  "Arrays variables still begin with the @ sigil. And they always do, even when accessing stored items, ie. when an index is present."
01:08 Mike-PerlRecruiter_ joined #mojo
01:08 ka2u joined #mojo
01:12 shmuel joined #mojo
01:20 hlin joined #mojo
01:26 egopro joined #mojo
01:29 trmjoa joined #mojo
01:33 GabrielVieira joined #mojo
01:46 egopro joined #mojo
01:46 trmjoa joined #mojo
01:51 egopro joined #mojo
01:53 bpmedley http://paste.scsys.co.uk/226094
01:53 bpmedley Does this work for anyone?
02:00 d4rkie joined #mojo
02:00 d4rkie joined #mojo
02:04 davido joined #mojo
02:24 egopro joined #mojo
02:24 egopro joined #mojo
03:22 asarch joined #mojo
04:47 Miked joined #mojo
04:59 xaka joined #mojo
05:11 ka2u joined #mojo
05:17 fhelmber_ joined #mojo
05:26 ka2u joined #mojo
05:46 spleenjack joined #mojo
06:13 yakudza joined #mojo
06:27 venomo joined #mojo
06:39 egopro joined #mojo
06:54 Vandal joined #mojo
07:10 suy joined #mojo
07:35 _xaka_ joined #mojo
07:38 ObseLeTe joined #mojo
07:40 rem_lex| joined #mojo
07:43 venomo joined #mojo
07:51 dpetrov_ joined #mojo
08:07 shmuel joined #mojo
08:22 hlin joined #mojo
08:34 dod joined #mojo
08:41 dod joined #mojo
08:47 spleenjack joined #mojo
08:56 spleenjack joined #mojo
09:03 ObseLeTe joined #mojo
09:15 vervain nicomen++ I was pondering that just a day or so ago
09:15 bizam hi guys! when i abort http-request by user agent but controller still processing the request. Is it possible to synchronous interrupt?
09:16 kitt_vl joined #mojo
09:35 hlin joined #mojo
09:41 lppoix joined #mojo
09:41 davido joined #mojo
09:47 jontaylor joined #mojo
09:50 Achilles14 joined #mojo
09:51 nelio joined #mojo
09:52 SmokeMachine joined #mojo
09:53 Achilles14 hi all, I got this error "Global symbol "$errors" requires explicit package name at template user/signup.html.ep". But I don't wan't pass the $errors variable all the time, is there a solution? Since other template system will ignore undefined variable by default.
09:55 vervain you could try stash( errors ) instead
09:55 vervain in yoru template
09:57 Achilles14 I have just tried '% stash($errors);', not work. got above error twice.
09:58 vervain Ditch the $
09:58 vervain stash( errors )
10:04 SmokeMac_ joined #mojo
10:08 trone Maybe error here? http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#Rewriting - push @{$self->req->url->base->path->parts}, ← I believe that $self->req->url->path->parts make the right thing. $self->req->url->base->path->parts returns an empty list []
10:12 vervain trone: I think you may have missed what is going on; YOu are pushing the first part of $self->req->url->base->path->parts (shift) onto @{$self->req->url->base->path->parts} (push)
10:15 lukep joined #mojo
10:16 trone vervain: mmm. yep, I missed something. Those lines get the first path part and push it on a new path.
10:17 vervain Get the first path part of the request and 'move' it to the base.  It get both removed from path parts and added to base
10:18 vervain As long as you got it now :-)
10:19 trone yep, I got it. thanks
10:23 Miked joined #mojo
10:34 Achilles14 joined #mojo
10:47 dotan joined #mojo
10:51 wircus_ joined #mojo
10:51 batman joined #mojo
10:57 jontaylor_ joined #mojo
11:01 ObseLeTe joined #mojo
11:02 batman joined #mojo
11:02 wircus_ joined #mojo
11:32 wircus_ joined #mojo
11:32 batman joined #mojo
11:34 egopro joined #mojo
11:56 ObseLeTe joined #mojo
12:15 karel9 joined #mojo
12:19 karel9 Hi, I have some troubles with Mojo::Parameters and parameters without value. Not sure if you will consider it as a bug but here is a failing test case https://github.com/karel-m/mojo/commit/6​514126cae44ed3d6cf61ad92668bc85d74912ab
12:20 ObseLeTe joined #mojo
12:20 sri karel9: not unless you have a very good explanation for why it is a bug
12:22 karel9 sri: in my case I just needed to have stringified params exactly the same after some processing as they were in the original URL
12:22 sri not a bug then
12:23 karel9 sri: ok
12:52 SmokeMachine joined #mojo
12:57 SmokeMachine joined #mojo
13:08 Mike-PerlRecruiter_ joined #mojo
13:17 komodo joined #mojo
13:31 SmokeMachine joined #mojo
13:49 TitanOfOld joined #mojo
13:52 ryozi joined #mojo
13:55 inokenty joined #mojo
14:05 jberger nicomen, vervain https://github.com/kraih/mojo/wiki/​App-Installation-using-Module-Build
14:05 vervain jberger \o
14:05 jberger https://metacpan.org/module/Mojol​icious::Plugin::InstallablePaths
14:05 jberger o/
14:07 dpetrov_ joined #mojo
14:07 jberger I wrote the wiki entry after my initial work on Galileo
14:08 jberger then I generalized it when it seemed that it would be a nice thing to have
14:08 jberger so now the plugin does what the wiki entry did automagically
14:08 jberger (mostly)
14:09 sri nicomen: that recipe is not a "suggestion", it's in the HACKS section for a reason, all it does is show a concept
14:11 sri and we generally don't have recipes in core involving 3rd party modules
14:11 jberger sri: File::ShareDir is part of the workflow of M::B
14:11 jberger so not REALLY 3rd party
14:12 * sri disagrees
14:12 jberger but yeah, still probably out of the scope of Mojo docs
14:12 jberger thus the wiki entry and plugin
14:12 sri is it built into Module::Build?
14:12 Miked joined #mojo
14:12 sri does Module::Build automatically use it if it installed?
14:12 jberger support for it is, and it is automagically added as a dependency if used
14:12 vervain jberger: I just saw your link, missed it first time around.  Looks good thanks. Like I say, I was just 'thinking' about it the other day...not even 'reading' about it. :)
14:13 sri besides, not like we have any support for Module::Build in core
14:14 jberger https://metacpan.org/module/​Module::Build::API#share_dir
14:14 jberger right
14:14 * sri hates Module::Build ever since it didn't work out for Catalyst back in the days
14:14 nicomen sri: well, it would be how to package a Mojo app i a sane way, keeping assets inside program libraries is not very nice
14:14 * jberger <3 M::B (at least most of the time)
14:14 nicomen we have some projects internally that look like that now, because people didn't know better
14:15 jberger sri: when was that? year-ish?
14:15 sri 2006 or so
14:15 * jberger looks at changelog
14:15 sri we started pushing Module::Install after that
14:17 sri nicomen: the only way i see to get a recipe for that into core would be a general switch to Module::Build as our standard installation system
14:17 nicomen jberger: files under lib, it's just wrong
14:18 nicomen sri: I never mentioned module::Build, I meant sharedir with Module::Install, but if either works, even better
14:18 * sri doesn't like generalizations like that
14:18 nicomen sri: it makes separation of code and templates harder than necessary
14:18 bluescreen joined #mojo
14:19 sri nicomen: you lost me when you started with generalizations
14:19 nicomen if you need to move them in there anyway, there is no point in having rootlevel public and templates dir...
14:20 jberger nicomen, that was for easier location during the pre-install phase
14:20 jberger the files have a location relative to the main app module
14:21 jberger sorry if you don't like it, it works for me
14:22 vervain I'm pretty sure I have the same reservation though, but I've not played with it yet to be certain.
14:22 nicomen jberger: what is easier located?
14:22 vervain But my personal strategy is File::Sharedir and ./share in the app repository root
14:22 nicomen and in which location?
14:22 gryphon joined #mojo
14:22 nicomen vervain: Sharedirs exists exactly to store non-code data
14:23 vervain Not only does /share hold my assets but also my DBIx::Migration::Dir... stuff
14:23 vervain nicomen: *nod* exactly.
14:23 nicomen anyway, what other common install schemes are there?
14:24 nicomen is distzilla using M::B or M::I under the hood?
14:24 jberger because pre-installation, I can use a trick like this to find the files directory: https://metacpan.org/source/JBERGER/Mojol​icious-Plugin-InstallablePaths-0.02/lib/M​ojolicious/Plugin/InstallablePaths.pm#L19
14:24 jberger dzil uses either EUMM or MB
14:25 jberger I was under the impression that M::I was dying
14:25 sri you may not know this, but ShareDir is based on a hack i wrote for the Catalyst installer back in the days, which was based on a hack by acme, this stuff has been done long before ShareDir existed
14:27 jberger sri, I didn't know you were involved, but I knew that the mechanism existed long before the module
14:27 sri File::ShareDir is not magically cleaner than bundling files with your lib dir, it installs into the auto directory after all
14:28 sri it's basically just the same
14:28 gtodd silly question ...
14:28 gtodd does the exisitence of perl6 have any significance for Mojolicious ... over the medium term (24 months) ?
14:28 gtodd :-)
14:29 sri gtodd: no
14:29 gtodd good
14:29 jberger gtodd, you are guessing Christmas == Christmas 2014 then?
14:29 sri or kinda, some design decisions are made with a perl6 port in mind
14:29 gtodd I have a lot of perl6.core files on my system :)
14:29 vervain sri: Thanks for the explanation; I'll dig a little deeper into it.
14:30 jberger vervain, File::ShareDir is very simple, its just a recipe
14:30 gtodd yeah I was wonndering how people handle the existence of perl6 .. there does seem to be a way to write perl such that conversion is more possible
14:30 jberger but its nice because you don't have to rememeber the recipe
14:31 vervain jberger: I'd rather not use a module for a recipe though if it's trivial to do.
14:31 gtodd jberger: Christmas will happen when Christmas is ready ... and not before :)
14:31 jberger again, it is trivial, but its a tiny module that most users will already have
14:32 gtodd or when we are ready for Christmas ....
14:32 * jberger presses Santa's emergency stop button
14:32 gtodd all I know about perl6 is that I like some of the syntax  changes ... and that it seems to create large core files
14:34 jberger vervain, plus with my plugin you can have Module::Build::CleanInstall for free!
14:34 jberger (but you do have to pay separate shipping and handling)
14:35 wircus_ joined #mojo
14:35 batman joined #mojo
14:38 vervain jberger: I'll probably use your plugin when I get around to publishing a Mojo app, but for my projects the Mojo app is part of a much bigger picture.
14:38 * marty hugs mojolicous cuz it's fraking awesome!
14:38 vervain frakin' fanboy :-)
14:40 jberger vervain, I only use it for CPANable modules
14:41 jberger for apps that aren't intended for CPAN I just use the default behavior
14:41 * jberger hugs mojolicious too, pushes marty out
14:42 jberger I may have created a mojo convert this week actually
14:42 vervain jberger: My point is that the mojo app is _not_ the distribution, it's a rather tiny pary of it acutally. :-)
14:42 jberger he was trying to hack siri to let him make a way to unlock his front door
14:42 jberger was having ruby problems
14:42 jberger to I suggested a mojolicious webapp instead
14:42 jberger he liked the one line installation
14:42 jberger I gave him a Lite app to start from
14:43 jberger and now he seems hooked!
14:43 jberger vervain, understood
14:44 jberger https://gist.github.com/4596155
14:44 sri "The trick is to move the C<public> and C<templates> directories so they can get automatically installed with the modules, or to use a 3rd party module that can do this automatically for you."
14:44 sri would that make you happy?
14:44 * marty is fraking hooked on Mojolicious also.
14:44 ka2u joined #mojo
14:45 jberger sri: I don't care either way
14:45 wircus joined #mojo
14:45 marty Mojo ua made some development work very easy this weekend.  Just awesome stuff
14:48 jberger vervain, actually your point is a good reason why my plugin (and directory scheme) is useful. Who knows where your application is going to live in the directory structure, but with my scheme, it can be found BECAUSE its relative to your main app module
14:48 jberger not saying you need to use it, just an observation
14:48 vervain jberger: Ok thanks.  I do have to look into all of this more soon.  Right now I'm just getting business layer sorted out.  <slog>
14:49 sri the discussion reminds me of this cookbook recipe, and the question of how hacky recipes in the HACKS section can be https://github.com/kraih/mojo/commit/f5​e97f55fbd0788af812a2c39e84ada04c2a39e0
14:50 vervain sri: I don't think the docs really need to address it.  I'm only discussin it becuase it came up in my work recently.
14:50 jberger vervain, yeah
14:50 jberger actually you point out one problem I will have to think about
14:50 * sri ponders re-adding the keyword recipe again to make a point :)
14:50 jberger the M::B subclass assumes your App's name is the name of the webapp, which may not be true in general
14:51 jberger it is for the cases like I thought about, where its an app built for CPAN
14:51 jberger but not when its a smaller part of the whole
14:51 vervain jberger: It's absolutely not in my case.
14:52 jberger vervain, indeed
14:53 jberger I will have to ponder that one
14:54 jberger at least I did warn:
14:54 jberger "There is no allowance for different names of these folders nor of different locations for them relative to the main module. Patches will be considered, but the primary purpose of this module is the simple generic case; to do strange things the Mojolicious path manipulation system should be used directly."
14:54 jberger :-)
15:02 nicomen sri: hey it's not something crucial, I was just hoping that when I come up with a small "this is how to make a cpan dist with X method" it could be included in a hack section too
15:04 mugenken joined #mojo
15:08 Molaf__ joined #mojo
15:08 sri http://pastie.org/5908769 # should something like this be in the cookbook or not?
15:12 suy As a newbie, I'd say the more examples the better.
15:13 marcus sri: I'm worried people might use it.
15:14 marcus :)
15:14 sri :)
15:14 sri suy: code like "$caller->can('any')->([qw(GET POST)] => @_)" does not scare you?
15:15 * sri can think of much more evil keyword hacks actually
15:16 suy sri: I looked at it very quickly. I read mostly the usage of the new keyword, not the implementation. I like the fireworks that I see on my computer when I copy and paste code I don't understand. :-P
15:18 jberger suy: try this one then: http://codegolf.stackexchange.com/questi​ons/307/obfuscated-hello-world/3695#3695
15:21 * sri starts to remember why he decided not to keep the keyword recipe in the cookbook
15:21 suy jberger: OMG
15:21 sri https://gist.github.com/4351674 # stuff like this
15:23 jberger sri: that cute
15:23 jberger that's
15:23 sri also pretty evil ;p
15:24 sri since it doesn't work for delayed rendering
15:24 sri get_post '/' => sub { Mojo::IOLoop->timer(0 => sub { render text => 'Hello!' }) };
15:24 sri that can't work, ever
15:25 jberger I hadn't seen a good use for around_dispatch yet, and while that may be a scary one, I can now see the value
15:25 sri the primary reason frameworks based mainly on keywords can never be good at async
15:26 jberger srI: I can believe that
15:26 SmokeMachine joined #mojo
15:26 * jberger just promoted sri to srI
15:26 sri \o/
15:27 jberger sri: just curious, have you looked at Dancer/Dancer 2
15:27 jberger I often get people asking me why I don't use Dancer
15:27 sri you might also like this around_dispatch hack :) https://gist.github.com/1980385
15:28 jberger I usually say websockets and Mojo::Template, but I wonder if there is a deeper answer, and your previous comment reminded me of that
15:28 sri jberger: briefly, not particularly interested, it has no original features
15:28 Britzel joined #mojo
15:28 jberger and Test::Mojo
15:28 jberger ok, nm, I like mojo better
15:28 marty those examples scare the pants off me
15:28 sri frameworks from other languages interest me more, such as Play atm
15:30 marty And Lift  (scala)
15:30 sri original reason to add around_dispatch was custom exception handling and coroutines btw.
15:30 sri Lift seems to have lost, everyone is using Play now
15:31 marty Ahh, didn't know that.   I just follow out of curiosity.
15:31 jberger sri, can you remind me your ab invocation?
15:32 jberger trying to run the coro bench and I can't find it
15:32 * jberger will write it down this time
15:32 jberger -n 1000000 -c ??
15:33 sri -n value depends on the performance of your box
15:33 sri i like -n 10000 -c 100 -k
15:33 jberger as you know, thats essentially nil
15:33 sri without -k you're just benchmarking accept performance really
15:33 jberger thks
15:34 gtodd umm  OT but this is a perl channel .....  what is the easiest perl one liner replacement for something super simple like: awk {print $1}
15:34 gtodd perl -lane' print "$F[0]"'  seems too wordy :)
15:34 sri on os x it's terrible without -k, since there's a long dimishing return on file descriptors, so it can look like your app does nothing for a few seconds randomly
15:35 * gtodd is trying to massage text data for use with mojo ...l
15:35 gtodd It just seems right that the scripts use more perl and less awk and sed
15:36 sri perl -lane' print $F[0]'
15:36 sri \o/
15:36 sri perl -lane'print $F[0]'
15:36 sri actually!
15:37 sri http://icetothebrim.com/wp-content/uploads​/2012/02/i-have-no-idea-what-im-doing.jpeg
15:37 gtodd haha
15:38 gtodd that picture is the story of my life
15:38 gtodd :)
15:43 sri you might have more luck in #perl (freenode) with finding a perlgolf professional
15:44 asarch joined #mojo
15:44 marty any opinions on best practices for when to use nginx to server images versus hypnotoad?  I'm wondering if using hypnotoad to serve a few images per page is acceptable.
15:59 sri if it's acceptable it's acceptable :)
16:01 SmokeMachine joined #mojo
16:01 marty That's an acceptable answer.  thanks sri  :)
16:03 marty I'm actually surprised how well Hynotoad performs while serving images.   That's why I am considering just using it to keep things simple.
16:04 vervain marty: You could also use nginx caching magic to get the 'best of both'.
16:04 * marty googles nginx caching
16:04 d4rkie joined #mojo
16:06 vervain search 'nginx reverse proxy cache'
16:08 ka2u joined #mojo
16:08 gtodd thanks for mojo ... great tool :)
16:09 gtodd now if I could just use it to make the stock market go up ...
16:09 gtodd cheers
16:10 SmokeMachine joined #mojo
16:29 labrown joined #mojo
16:39 nicomen marty: we saved lost of cpu using ngnix for images
16:39 nicomen also moer available slots for processing actual dynamic requests in the backend
16:42 dod joined #mojo
16:42 nicomen $ echo one two | perl -pe's/ .*$//'
16:42 nicomen one
16:44 trmjoa joined #mojo
16:45 nicomen $ echo one two | perl -pe's/ .*//'
16:45 nicomen one
16:45 nicomen doubt you get it shorter :-P
17:01 SmokeMachine joined #mojo
17:05 xaka joined #mojo
17:13 SmokeMachine joined #mojo
18:24 trone I'm running a mojolicious webapp with hypnotoad behind an apache proxy as in https://github.com/kraih/m​ojo/wiki/Apache-deployment paragraph: Apache/mod_proxy (Path). Someone knows any redirect problem with this deploy setup?
18:26 bpmedley trone: are you haveing issues?
18:27 trmjoa joined #mojo
18:28 trone bpmedley: yep. My internal redirects fails and my browser show url with duplicated path part and wrong proxy server port.
18:29 yakudza joined #mojo
18:31 trone I have some problem also to debug, because I see the right redirect's url but after it, the browser goes in timeout and show wrong url. I suppose that something goes wrong between mojoapp and apache proxy server and this duplicate the path
18:31 bpmedley trone: What does your apache config look like?
18:32 trone (the path is: my.domain.com/sep -> go to mojo app in localhost:3001 that rewrite its internal url to add /sep/ before all.
18:32 bpmedley trone: http://paste.scsys.co.uk/226214  <-- This is mone
18:32 bpmedley *mine
18:33 trone bpmedley: http://paste.scsys.co.uk/226215 ← pretty similar. (I'll check your options :D )
18:39 trone oh.
18:39 trone bpmedley: maybe I found...
18:39 bpmedley http://paste.scsys.co.uk/226094
18:39 bpmedley Anyone have problems with template toolkit and DATA sections?
18:42 trmjoa joined #mojo
18:43 BeDa joined #mojo
18:45 dod joined #mojo
18:51 sri anyone know if ipv6.google.com is permanently down?
18:53 good_news_everyone joined #mojo
18:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6ySW_A
18:53 good_news_everyone mojo/master 9d2d8fb Sebastian Riedel: fixed small file descriptor leak in Mojo::UserAgent
18:53 good_news_everyone left #mojo
18:53 sri would never have found that leak if i wasn't stealing code for the mongodb client :)
18:55 sri same blocking/non-blocking hybrid design
19:15 dotan1 joined #mojo
19:33 asarch joined #mojo
19:44 trone the Mount plugin change just the base of Routes but don't provide a similar behaviour for Static ?
19:45 trone My point is that the stylesheet and javascript files of a mounted app aren't redirect, right?
19:46 trone "redirect" … bleargh. Sorry, I explain myself every time really in the worst way.
19:47 marty sri++  for blocking/non-blocking hybrid design -- sounds kewl
19:48 sri marty: with a little luck i can release the first alpha in a few days :)
19:49 marty \o/   I'll test the frak out of it
19:51 sri i went with the low level api btw. ->query($name, $flags, $skip, $limit, $query, $selector, $cb)
19:52 sri but i'm gonna enforce getLastError for operations that have no response otherwise
19:52 sri unsafe operations is something for later... who needs them anyway? ;p
19:53 marty meh, who wants to be unsafe
19:54 sri there's even ->get_more($name, $limit, $cursor, $cb) and ->kill_cursor($cursor, $cb), so it's really low level
19:54 sri everything else is built on top, such as cursor abstraction
19:54 marty Interesting.  mongo will allow files up to 16mb to be stored as BinData without using GridFS.  Kewl
19:55 sri not exactly, 16mb for the whole packet, with framing
19:55 * marty uses cursors a lot
19:55 marty I
19:56 sri i have not yet implemented cursors, but making them lazy should be pretty fun
19:57 * marty is rooting for sri
19:57 marty ~o~
20:00 sri ->db('foo')->collection('bar')->find({foo => 'bar'})->limit(10)->skip(5)->next(sub { my ($cursor, $err, $next) = @_; });
20:01 sri or just my $next = $cursor->next; if you're blocking
20:01 sri i've gone with $err as first argument for non-blocking, and die for blocking errors
20:07 sri so many tests to wrote :S
20:08 sri s/o/i/
20:11 SmokeMac_ joined #mojo
20:20 lukep joined #mojo
20:52 marcus I'm seeing something a bit strange
20:53 marcus if I start up an app at 3000, it seems I cannot start up another instance at another port
20:53 marcus it says address already in use even tho the ports doesn't match
20:54 marcus if I stop the other instance it listens to the right port and stop tho
21:01 sri marcus: works for me
21:03 bpmedley marcus: What command are you using?
21:03 marcus mm, I know. This app is listening to an extra port.
21:09 fhelmber_ joined #mojo
21:10 vervain Mojo not here: http://lists.perl.org/tag/web.html
21:10 wircus joined #mojo
21:10 batman joined #mojo
21:11 xaka joined #mojo
21:14 xaka joined #mojo
21:16 xaka joined #mojo
21:19 wircus vervain_: maypole on OTOH... ;)
21:25 vervain Anyone playing with http://foundationdb.com <- They use NoSQL and ACID in the same sentence.
21:41 sri hahahaha
21:42 sri another arbitrary code execution security flaw in rails
21:42 * sri pokes marcus
21:52 batman joined #mojo
21:52 wircus joined #mojo
22:08 marcus sri: yay
22:12 nicomen sri: wow
22:19 marcus sri: those guys sure do come from PHP.
22:26 wircus joined #mojo
22:26 batman joined #mojo
22:43 Miked joined #mojo
22:51 Averna joined #mojo
23:29 mattastrophe joined #mojo
23:59 davido joined #mojo

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