Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-26

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

All times shown according to UTC.

Time Nick Message
00:02 human39 joined #mojo
00:15 lammel2 left #mojo
00:17 mattastrophe joined #mojo
00:23 tm1 joined #mojo
00:24 run4flat_ joined #mojo
00:25 run4flat_ Greetings all. Q: I want to route /some/rout/*.png to /my/project/root/dir/something/*.png. I think this is simple, but I can't figure out how to do it. Which docs manual covers it?
00:25 run4flat_ clarificaiton: /some/route/*.png is where the user points their browser
00:26 run4flat_ er, maybe my last line didn't send...
00:26 run4flat_ and /my/projects/root/dir/something/*.png is on my HD
00:27 run4flat_ Mojolicious::Guides::Rendering doesn't quite seem to cover this
00:27 buu run4flat_: When you say route, you mean deliver the files, right?
00:27 run4flat_ yeah
00:27 mattastrophe joined #mojo
00:28 run4flat_ I have seen quite a bit about routing to templates, etc
00:29 run4flat_ but I just need a basic path rewrite mechanism to retrieve existing static files
00:29 buu What's wrong with creating a route for /foo/:pngname; then mapping that to a handler that does something like $app->static->serve($app,'file/name')?
00:29 run4flat_ I didn't know about $app->static->serve(...)
00:29 run4flat_ :-)
00:30 run4flat_ thanks!
00:30 run4flat_ that, basically, was my question.
00:30 buu my $success = $c->render_static('images/logo.png');
00:30 buu I think is a slightly better way to get there
00:31 buu You might need to add the paths to your static object though
00:31 run4flat_ but this is covered under the controller, right?
00:31 run4flat_ I can read docs then, as long as I know where to look.
00:32 sri http://mojolicio.us/perldoc/Mojolicious/​Guides/Rendering#Rendering_static_files
00:33 run4flat_ d'oh, how did I miss that?
00:33 run4flat_ thanks, sri
00:33 run4flat_ wow, I even remember reading that more than once
00:33 * run4flat_ clearly needs another beer
00:37 shmuel joined #mojo
00:38 run4flat_ ah, ok, so here was my confusion: the Guide docs say you can use this to render stuff from DATA and from the public directory (http://mojolicio.us/perldoc/Mojolicious/​Guides/Rendering#Rendering_static_files). Now, I don't want to serve files from my public directory, but from another location.
00:38 run4flat_ The docs from the render_static method go further and indicate that you can specify a relative directory: http://mojolicio.us/perldoc/Mojo​licious/Controller#render_static
00:39 jberger run4flat_, you can also add another path to the static files path
00:40 jberger push @{$app->static->paths}, ...
00:40 sri public *directories*
00:40 sri not directory
00:40 * jberger checks
00:40 run4flat_ sri, duly noted
00:41 run4flat_ but I could go the other way around, and generate said file *in* the public directory to begin with
00:41 run4flat_ s/directory/directories/
00:41 run4flat_ (though I'd have to pick a specific on, eventually)
00:41 run4flat_ :-)
00:42 run4flat_ I think what I'm looking for is this guy:http://mojolicio.us/perldoc/Mojolicio​us/Guides/Rendering#Custom_responses
00:42 run4flat_ but, I don't know enough about html responses to know
00:42 run4flat_ I think I have a solution to move forward. Thanks!
00:42 jberger cool
00:46 komodo joined #mojo
00:54 run4flat_ left #mojo
01:07 ka2u joined #mojo
01:11 d4rkie joined #mojo
01:20 hlin joined #mojo
01:31 egopro joined #mojo
01:58 buu joined #mojo
02:04 duncanthrax joined #mojo
02:06 tv joined #mojo
02:12 freman joined #mojo
02:12 freman greetings folks, much less stressed today have some time to do some re-writing
02:13 freman now... at current I execute a whole bunch of downloads sequentially with blocking code
02:13 freman ala $result = $ua->get($_) foreach (@downloads);
02:14 freman this is clearly suboptimal
02:15 freman thinking of switching to $self->ua->get('', sub {}) pattern but that's going to need some sort of wrapper to track the file it's up to
02:15 freman or, should I just stick with the original method?
02:17 freman There's a pattern in the cookbook for a parallel blocking request, but I'm after sequential blocking requests
02:17 freman (being run in a way as to not piss off hypnotoad)
02:25 shmuel so what you want is a sequensial non-blocking requests?
02:26 shmuel freman: kind of a weird concept. they only block each other...
02:27 freman yes, well there's limited bandwidth
02:28 shmuel you can do it with the normal non-blocking pattern. let me scratch something.
02:33 TitanOfOld joined #mojo
02:33 shmuel freman: what about:
02:33 shmuel my @list = (urls...);
02:33 shmuel my @results;
02:33 shmuel my $func = sub {
02:33 shmuel my ($ua, $tx) = @_;
02:33 shmuel push @results, $tx if $tx;
02:33 shmuel return $self->render(...) unless @list;
02:33 shmuel my $url = shift @list;
02:33 shmuel $self->ua->get($url => __SUB__);
02:33 shmuel }
02:34 shmuel $func->();
02:34 shmuel recursion to the rescue! :-)
02:34 freman ouch, that hurt my head
02:34 freman but.... should work
02:35 shmuel not tested, compiled or anything.
02:35 shmuel of course.
02:35 freman I just have to work it into the rather large complicated method of working things we have (including incomplete file detection, file resumption, etc)
02:35 freman yeh of course, it's something we might be able to do tho :D
02:35 freman there should never be more than 5 or so files so I don't need to worry about the stack :D
02:36 shmuel you can make $url external to the loop, so you will always have the current downloaded file
02:37 freman this is being executed by websocket request so we can skip the self render... or just $tx->send('done') in it's place
02:37 freman and we can print status
02:37 freman it's awsome
02:40 shmuel good luck.
02:44 freman thanks
02:45 freman now I just have to track down the cause of Can't locate object method "event" via package "Mojolicious::Routes::Route" at App/Common/Controller.pm line 167
02:45 freman and we'll be set :D
02:46 freman oh, that's because my automagic bridging code
02:48 freman didn't like me converting a whole bunch of gets and posts to events
02:48 freman (using attribute handlers to define the routes)
03:17 freman ok, half way through porting that...
03:18 freman wasn't as hard as I expected, just have to predeclare a whole bunch of variables before the sub
03:18 freman hey guess what
03:19 freman found a oopsie with hypnotoad
03:19 freman if you've got a request open and you change the clock... hypnotoad goes spaz
03:20 freman and kills the apparently 'hung' children that haven't responded in years (eg: your system time was stuck in 1970 and suddenly jumps to 2013)
03:50 jamesw joined #mojo
03:50 freman once I finish re-writing the downloader I'll write a demo case
03:58 jeen joined #mojo
04:32 freman *sigh* __SUB__ not available on centos...
04:35 jeen joined #mojo
04:36 mauke_ joined #mojo
04:38 preflex_ joined #mojo
04:48 GabrielVieira joined #mojo
04:53 ka2u joined #mojo
04:54 sri shmuel: please do not paste code into this channel!
04:57 sri freman: http://mojolicio.us/perldoc/M​ojo/Reactor/Poll#DESCRIPTION
04:58 freman yeh, so that's what hypnotoad is using?
05:03 sri we could support monotonic clocks in mojolicious, but you would have to convince zerfram to apply this patch https://rt.cpan.org/Ticket/Display.html?id=78656
05:12 freman *shrugs* my code is littered with hotfixes for mojolicious if I have to add another so be it
05:13 sri huh?
05:14 sri i don't see any bug reports from you
05:22 freman that's because you've previously convinced me "it's not the mojo way" which I accept and then work around :D
05:23 sri ok :)
05:24 mattp joined #mojo
06:25 tempire joined #mojo
06:43 GabrielVieira2 joined #mojo
06:51 Britzel joined #mojo
06:52 tempire joined #mojo
06:53 azawawi joined #mojo
06:54 azawawi hi
06:54 azawawi sri: ping
06:56 lammel2 joined #mojo
06:56 good_news_everyone joined #mojo
06:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/VrhnoQ
06:56 good_news_everyone mojo/master b9901be Sebastian Riedel: fixed small domain detection bug in Mojo::UserAgent::CookieJar (closes #458)
06:56 good_news_everyone left #mojo
06:56 sri azawawi: pong?
06:57 azawawi sri: how r u?
06:57 sri pissed off
06:57 azawawi sri: i was just wondering if mojo was going 5.14.x only when 5.18 is here
06:57 * sri keeps swearing at RFC 6265
06:58 * azawawi takes a look at RFC 6265
06:58 jeen joined #mojo
06:59 azawawi I just used a 5.14-ism in Farabi and these keep creeping up when you try/learn new Perl features...
06:59 sri i used to like that RFC because it's pragmatic... but rules for comparing stuff are scattered all over the place
06:59 yakudza joined #mojo
06:59 sri azawawi: unlikely
07:00 sri azawawi: but you're welcome to open a mailing list thread about it, if the community accepts 5.14 only i'm ok with it too
07:04 PanzerBjorn joined #mojo
07:04 PanzerBjorn How can I set server configuration in a complex application?
07:05 PanzerBjorn For instance to set workers to 8 for an app.
07:05 * azawawi looks at the flame in the distant horizon
07:05 PanzerBjorn (Also how can I check to ensure that 8 workers are spawned at any given time?)
07:07 Mike-PerlRecruiter_ joined #mojo
07:07 azawawi sri: interesting thing about the following report is that after using 5.14-ism s///r, an unreferenced SV error in IO::Socket::IP appeared, http://www.cpantesters.org/cpan/report​/470df5ed-6bf7-1014-9299-e11d25572501
07:08 sri ewww
07:09 sri PanzerBjorn: http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#Hypnotoad
07:10 PanzerBjorn @sri: Yes, I read that, it only explains how to set the server params for Lite apps, not full apps.
07:10 sri please don't skip the documentation parts explaining how lite apps relate to full apps
07:11 sri you are supposed to learn lite first, if you don't do that the whole documentation won't work for you
07:11 buu Really?!
07:12 buu That explains a lot
07:12 sri http://mojolicio.us/perldoc#TUTORIAL
07:12 PanzerBjorn Well, sure, in Lite you set server configs with app->{ hypnotoad => { config => value } }; - I get that. But there's no bareword app-> in a full app.
07:12 sri it says so right at the start
07:13 sri "Almost everything you learn there can also be applied to normal Mojolicious applications and is considered a prerequisite for the guides."
07:13 jzawodn joined #mojo
07:13 PanzerBjorn Rather than assume that I can use $self->app->{ hypnotoad => { ... } ); and potentially crash my production server for X amount of time, I thought I'd come here to confirm before I wreck my server.
07:14 sri PanzerBjorn: don't skip the growing guide
07:14 PanzerBjorn I've read it over a dozen times now, and just read it again BEFORE coming here, @sri. There's no example for setting server configs in a full app, I scoured it.
07:16 sri there are examples like "app->secret('Mojolicious rocks');" turning into "$self->secret('Mojolicious rocks');", what exactly is hard to understand about that?
07:16 marcus new york I love you, but you're bringing me down.
07:17 PanzerBjorn I guess what's hard to understand is the difference between app-> being $self and $self->app ?
07:18 sri oh, you're learning perl while learning mojolicious?
07:20 sri $self depending on context seems to be a common problem among folks learning perl
07:20 buu $self is the same as app inside App.pm, but you need $self->app inside the controller.. right?
07:20 PanzerBjorn Well, I've been getting paid over $160k/yr for more than 15 years now to develop Perl apps, so I guess yeah, I'm still learning Perl. Aren't we all?
07:20 sri yea
07:21 sri PanzerBjorn: then you have a 5 year headstart on me
07:21 PanzerBjorn I'm trying to come up to your framework rather than using Apache with Perl/CGI and mod_perl2, trying to get up with the times. No, I'm not aware of $self outside of it's purpose in a package method.
07:22 marcus class method
07:22 marcus or rather object...
07:22 PanzerBjorn And I'm not familiar with Mojo's structure internally, sorry. The point of a web framework, to me, is to abstract that away.
07:23 marcus panzerbjorn: It's rather useful to understand the concept of and 'app' and a 'controller'. It's not really internal.
07:24 PanzerBjorn Well, sorry I'm having trouble understanding that, it's difficult after spending so much time working in highly structured and fixed-type languages like Java and C#. The idea of "Perl objects" still doesn't grok to me.
07:26 ObseLeTe joined #mojo
07:26 PanzerBjorn Admittedly, the last time I "learned anything in Perl" was back in version 5.4 - I'm trying to catch up though.
07:30 marcus panzerbjorn: reading perltoot might be useful
07:30 PanzerBjorn Alright, so assuming I have changed my number of workers correctly, how would I check to see it's working after a restart? Will they appear in a `ps ax`?
07:30 marcus yes
07:30 sri we could rename it all to $c and $app in the documentation to make it easier to grok, but would that really do our users a favor? they will still encounter $self in the wild
07:32 marcus sri: we should only do that if we think it's better in real world apps.
07:33 sri hmmm, right, it might even get cargo cultet into apps
07:36 PanzerBjorn @marcus: What would a thread look like in a `ps ax`? I don't see anything that clearly appears to be one in mine after setting workers to 8 and restarting.
07:37 ACE joined #mojo
07:37 ACE_ joined #mojo
07:37 ACE hi there
07:37 sri o/
07:38 ACE i have a question to Test::Mojo
07:39 ACE $t->get_ok('/abcdef')->status_isnt(404);  this code is fail    i cant understand
07:39 ACE this route response is 404 . but test fail
07:39 ACE can u understand it ?
07:40 sri s/isnt/is/
07:40 ACE sorry!! . paste code is differents
07:41 ACE $t->get_ok('/abcdef')->status_is(404);   this code is fail
07:49 ACE i do study more! thx >sri
07:56 PanzerBjorn Hmmm, I set workers to 8 and I'm seeing 11 in `ps ax`.
07:58 ver joined #mojo
07:58 spleenjack joined #mojo
07:58 PanzerBjorn And the development.log file is flooding with messages about starting a zero downtime software upgrade...
08:03 Vandal joined #mojo
08:04 marcus Panzer: hypnotoad workers Are preforked, not threads.
08:04 GabrielVieira joined #mojo
08:04 PanzerBjorn Ah, got it. So they don't need to be managed by the init-start system.
08:05 marcus And when you restart, hypnotoad starts new workers before it kills off the Old ones.
08:05 PanzerBjorn Okay, that was it. Removing the restart option from the init/*.conf file fixed it. Thanks.
08:05 PanzerBjorn Errr, the respawn option.
08:13 PanzerBjorn THanks for the help Marcus. =)
08:15 suy joined #mojo
08:20 dod joined #mojo
08:21 PanzerBjorn left #mojo
08:25 dpetrov_ joined #mojo
08:34 ver joined #mojo
08:35 dod joined #mojo
08:35 daxim joined #mojo
08:49 Vandal is there a way to share code between tests?
08:56 maxhq joined #mojo
09:08 freman make the code into a library and include it?
09:09 GabrielVieira2 joined #mojo
09:11 GabrielVieira3 joined #mojo
09:12 Vandal I was hoping on some magic
09:12 jeen joined #mojo
09:12 n0n joined #mojo
09:15 n0n hi. little problem with routing here: got a bridge for authentication at the start of any route. inside this auth i get the user and therefore user's role. additionally each route has a condition. in fact i'm trying the examples from m::plugin::authorization. problem is now, that the bridge code is executed after the evaluation of the conditions.
09:15 dotan joined #mojo
09:15 ObseLeTe joined #mojo
09:15 ObseLeTe joined #mojo
09:16 n0n (so no role available a condition evaluation)
09:16 n0n at
09:20 fhelmber_ joined #mojo
09:30 * tm1 loves over() routes :-D
09:34 n0n suggestions?
09:35 n0n instead of the over() routes one could check authorization inside the controller actions... but ...
09:37 egopro joined #mojo
09:38 egopro_ joined #mojo
09:59 egopro joined #mojo
10:04 cobra joined #mojo
10:22 jamesw joined #mojo
10:24 jpn joined #mojo
10:25 bd i am trying to use L::Inotify2 with Mojo, however I am not getting called when the file changes: http://paste.debian.net/hidden/1c71a9a7/
10:30 jpn joined #mojo
10:58 fhelmber_ joined #mojo
11:09 jontaylor joined #mojo
11:10 jontaylor I've realised that my testing is lackluster, so i'm trying to write a test suite for my mojo app, and i'm using the mojolicious tests to fill in gaps in my knowledge
11:11 jontaylor but one issue I'm having is working out a nice way to mock out the authentication in Mojolicious::Plugin::Authentication
11:11 jontaylor I don't want to post to my session/create action before each controller test, as thats slow and repetitive
11:12 jontaylor I thought about having a method that does something like this
11:12 jontaylor Mojolicious::Controller->new({app => $self->app})->authenticate('a','b');
11:12 jontaylor but that doesn't seem to set up the session correctly
11:16 jeen joined #mojo
11:18 ladnaV joined #mojo
11:24 bd seems loke morbo is the one to blame, using ::Daemon I get notifies
11:26 GabrielVieira joined #mojo
11:33 n0n joined #mojo
11:35 ObseLeTe joined #mojo
11:45 ObseLeTe joined #mojo
11:49 baton8 joined #mojo
11:50 n0n joined #mojo
11:55 tm1 left #mojo
11:56 ka2u_ joined #mojo
12:02 n0n joined #mojo
12:19 SmokeMachine joined #mojo
12:30 spleenjack joined #mojo
12:33 Kovensky joined #mojo
12:53 jeen joined #mojo
12:58 crab jontaylor: why do you have to do it before each test?
12:59 crab jontaylor: i post to /login and Test::Mojo keeps the cookie.
13:02 GabrielVieira joined #mojo
13:04 jontaylor I think thats what i'll end up doing crab, I just wanted all my tests to be as isolated as possible
13:04 crab ok
13:21 GabrielVieira2 joined #mojo
13:27 jberger sri: as I was learning I had a hard time on occasion because $self->helper_name applied to both the app and the controller
13:27 jberger so sometimes I would be confused with which one I had
13:27 jberger now it makes sense of course
13:28 jberger but I think using $app and $c in the doc wherever possible is probably a Good Thing (TM)
13:30 * jberger just found Mojolicious::Plugin::Bcrypt
13:30 * jberger <3 Bcrypt and <3 plugins and <3 plugin authors
13:32 spleenjack joined #mojo
13:44 good_news_everyone joined #mojo
13:44 good_news_everyone [mojo] jberger created lite_doc_patch (+1 new commit): http://git.io/Vm9lpA
13:44 good_news_everyone mojo/lite_doc_patch 5db5874 Joel Berger: explain why Mojolicious::Lite is a prerequisite for the guides
13:44 good_news_everyone left #mojo
13:45 jberger (its still odd seeing that pop up when I do things!)
13:46 travis-ci joined #mojo
13:46 travis-ci [travis-ci] kraih/mojo#297 (lite_doc_patch - 5db5874 : Joel Berger): The build passed.
13:46 travis-ci [travis-ci] Change view : https://github.com/kraih/mojo/commit/5db58749c498
13:46 travis-ci [travis-ci] Build details : http://travis-ci.org/kraih/mojo/builds/5070867
13:46 travis-ci left #mojo
13:47 jberger I'm glad travis approves of my doc-only patch :-)
13:50 moltar joined #mojo
13:50 mattastrophe joined #mojo
13:50 Britzel_ joined #mojo
13:50 gryphon joined #mojo
13:52 crab i just don't understand the point of that bcrypt plugin
13:55 ka2u joined #mojo
13:57 jberger crab: nice to not have to muck with settings and making the right length salt and all
13:57 jberger two nice helpers
13:57 jberger just a convenience
14:00 mattastrophe joined #mojo
14:05 n0n joined #mojo
14:05 n0n more mojo
14:18 bluescreen joined #mojo
14:25 sri jberger: i don't like "Lite syntax", nowhere in the documentation is it called that
14:30 sri i specifically didn't want to link to Mojolicious::Lite so many times from that section either
14:30 sri it looks awkward too
14:30 crab lite syntax is missing creamy mojoliciousness?
14:31 sri should the ontroduction to the documentation really mention that Mojolicious::Lite is only a small wrapper around Mojolicious?
14:32 sri s/o/i/
14:34 Mikey sri: yes.
14:35 Mikey had i known that, i'd probably have read Mojolicious::Lite to translate the examples written exclusively in lite
14:35 sri meh
14:35 Mikey i guess i should have anyway
14:35 Mikey but the rationale was "complexity i don't need to understand"
14:35 Mikey "since im not using it"
14:42 btyler joined #mojo
14:45 jberger sri: but you see where I'm going with this tho
14:46 jberger and I do think that it should mention that its a small wrapper
14:46 jberger I think outsiders/newcomers think that there is a major difference between Lite and Full
14:46 sri "A really fast and fun way to get started developing web applications with Mojolicious is the L<Mojolicious::Lite> tutorial. Since the micro web framework is only a thin wrapper around the normal web framework, almost everything you learn there can also be applied to full L<Mojolicious> applications. Since this notation is commonly used throughout the guides, it is considered a prerequisite, you should definitely take a look!"
14:46 * jberger reads
14:47 jberger other than the two sentances in a row starting with since (which I also did when composing this btw) that looks fine
14:47 sri oh, right
14:47 sri i changed that second sentence last minute again
14:47 jberger This notation ..
14:48 jberger or whatever
14:49 sri "A really fast and fun way to get started developing web applications with Mojolicious is the L<Mojolicious::Lite> tutorial. Since the micro web framework is only a thin wrapper around the normal web framework, almost everything you learn there can also be applied to full L<Mojolicious> applications. This notation is commonly used throughout the guides and is therefore considered a prerequisite, you should definitely take a look!
14:49 sri "
14:49 jberger looks great
14:49 crab how about "A really fast and fun way to get started with Mojolicious is the L<Mojolicious::Lite> tutorial. This micro web framework is a thin wrapper around the normal web framework, and nearly everything you learn there is also applicable to L<Mojolicious> applications. Since the Lite notation is commonly used throughout the guides, it is considered a prerequisite. You should definitely take a look!"
14:50 jberger sri didn't like the idea of calling it "Lite notation"
14:50 sri same
14:50 jberger but I do like "This micro web framework ..."
14:51 * sri dislikes the Lite abbreviation in general
14:51 crab then it should say something like "The examples throughout the documentation use Lite, so it is considered a prerequisite"
14:52 crab because if you say "this notation", it isn't clear what you're talking about at all.
14:52 crab you're not calling it a notation in the preceding sentence.
14:52 crab then it can be spelled out.
14:52 mattastrophe joined #mojo
14:53 crab maybe "The documentation contains Mojolicious::Lite examples throughout, so this notation is considered a prerequisite to ..."
14:53 jberger crab, thats good
14:53 crab or "the documentation uses mojolicious::lite for its examples, so ..."
14:54 jberger that says what we really mean
14:54 sri then we have two links to Mojolicious::Lite again :/
14:54 crab yes. i'm a big fan of saying what we really mean.
14:54 jberger don't have to link the second time
14:54 crab why does the second one have to be a link?
14:54 sri a bare Mojolicious::Lite without link looks like a typo to me :S
14:54 crab stop being grumpy
14:55 jberger well I'm sure you can handle the wording, but I think the message is good
14:55 sri i'm not grumpy actually
14:55 crab you can't hate the abbreviation, hate the full thing without a link, hate links, AND expect people to understand what it means :-)
14:55 crab sri: sure, i was kidding about being grumpy
14:55 * jberger gives crab and sri each a lollipop
14:56 sri it's the first thing our users read, so a little attention to detail is in order imo
14:56 jberger big agree there
14:57 sri it has to look good here http://mojolicio.us/perldoc#TUTORIAL and here https://metacpan.org/module/SRI/Mojoliciou​s-3.87/lib/Mojolicious/Guides.pod#TUTORIAL
14:57 crab i can't really imagine users thinking "hmm, this mention of Mojolicious::Lite one sentence after the earlier mention isn't linked, this framework sucks"
14:57 ka2u joined #mojo
14:57 sri crab: and then we get a typo fix every other day ;)
14:57 crab actually, scratch that. i can totally imagine it.
14:57 jberger crab, I think the idea isn't so much link or not, but monospace or not
14:58 sri what about "This micro notation..." maybe?
14:59 jberger that works for me, it says "this is just a subset syntax"
14:59 crab ok. do i understand correctly that we want a way to say that Mojolicious::Lite is something you must understand, without saying "Lite", or linked or unlinked "Mojolicious::Lite"?
14:59 * crab thinks a little
14:59 jberger personally I would say two links to something important to read isn't the worst idea
15:00 jberger but I do see sri's "cleanliness" point
15:01 jberger I propose 4 links, the last two in jest "Ok have you read L<Mojolicious::Lite> yet? L<Mojolicious::Lite>." :-)
15:01 * jberger is really just kidding
15:01 crab such levity is inappropriate to these wighty proceedings
15:01 crab weighty
15:01 * jberger loves the FAQ from mailinator
15:01 crab (damn, hope there aren't any wights listening)
15:01 btyler perhaps refer to the tutorial rather than Mojo::Lite? like "This tutorial introduces notation used throughout the guides, and is considered a prerequisite. You should check it out!"
15:02 sri btyler: good idea
15:02 jberger btyler++
15:02 crab btyler: i considered that, but then we're not saying anything about why the notation-that-must-not-be-named is nice
15:02 jberger also I almost typed bytler, I think you should use that nick!
15:03 crab on the other hand, we're not saying much about it now either.
15:03 jberger no I think we should still have the "Mojolicious::Lite is a wrapper ..."
15:03 jberger btyler's fix is just for the second sentance
15:04 btyler ^
15:04 jberger presumably
15:04 sri "The simplified notation introduced in the tutorial is commonly used throughout the guides and is therefore considered a prerequisite, you should definitely take a look!"
15:05 jberger sri: can I see the entire stanza as you have it right now; do you still call it a tutorial before then?
15:06 jberger from previous posts it looks like you would
15:06 sri "A really fast and fun way to get started developing web applications with Mojolicious is the L<Mojolicious::Lite> tutorial. Since the micro web framework is only a thin wrapper around the normal web framework, almost everything you learn here can also be applied to full L<Mojolicious> applications. The simplified notation introduced in the tutorial is commonly used throughout the guides and is therefore considered a prerequisite
15:06 sri , you should definitely take a look!"
15:06 jberger ok
15:06 jberger coll
15:06 crab "A fast and fun way to get started with Mojolicious is the L<Mojolicious::Lite> tutorial. This micro web framework is a thin wrapper around the normal web framework, so nearly everything you learn is also applicable to L<Mojolicious> applications. The tutorial introduces notation that is used in examples throughout the documentation, so it's considered a pre-requisite. You should definitely take a look!"
15:06 jberger cool
15:07 jberger I'm ok with either
15:07 bd Would an example on how to use linux::inotify2 with mojo::lite be something you'd be interested in FAQ/Cookbook/... -wise?
15:07 crab i tend to leave out adjectives like "really"
15:08 crab bd: sounds like a blog post to me
15:08 jberger or a wiki entry
15:08 crab i think a blog post would be better, personally
15:08 jberger probably
15:09 crab it's nice to see lots of different sources talking about mojolicious, rather than just see one wiki
15:09 jberger yeah
15:09 crab and wiki entries that aren't kept up-to-date are blog posts in disguise
15:09 jberger wiki entries tend to get lost in the shuffle, where blog posts get read when posted
15:09 sri i think i like the "This micro web framework..." start from crabs version more
15:10 bd crab: blog post it is then
15:10 crab i don't like the run-on ", you should definitely take a look!" thing, but it's consistent with the rest of the documentation, you should probably use it! ;-)
15:11 sri "be applied" or "applicable"?
15:11 jberger bd, what are you doing with inotify2? you are informing something on the server side?
15:11 crab sri: maybe "nearly everything you learn also applies to ..."
15:11 crab shorter, loses nothing.
15:11 jberger oh nm
15:11 jberger I was thinking of libnotify
15:11 crab (but i'm not sure it's _true_)
15:12 * sri nods
15:12 sri i think we got it now :)
15:12 jberger the behavior of `under` is the only real oddity between the two
15:13 jberger sri: I don't know where it would go, probably in Growing, but an explicit example of how to translate Lite under to full under might be handy
15:13 bd jberger: nah, my data comes from a csv and is written by another program. I read it into a hash when mojo starts and want to reread it if it changed.
15:13 good_news_everyone joined #mojo
15:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/v-wkGw
15:13 good_news_everyone mojo/master 0e41d20 Sebastian Riedel: new introduction for the tutorial
15:13 good_news_everyone left #mojo
15:13 jberger I know it IS documented, but presented as "change this to that" might help
15:13 jberger bd, yeah I figure it was something like that when I looked up inotify and remember that that is the file events one
15:14 jberger its not the first time I have mixed those two up (libnotify vs inotify)
15:14 crab sri: i don't like the noisewords, but ok, it's an improvement, i won't complain
15:15 jberger I like it
15:16 * sri is off running a few kilometers again now
15:16 jberger and if we get a few less "but what is `app` in full apps?" questions it will all be worth it
15:16 crab e.g. the "only" in "only a thin wrapper" changes the whole tone of that part of the sentence to be negative
15:17 crab man, i should get back to running.
15:17 jberger crab, I can see why you think that, but I think it says, "these aren't that different"
15:17 * jberger has gotten back into lifting lately
15:18 jberger besides being sore all the time, I feel great
15:18 jberger :-)
15:18 yakudza joined #mojo
15:24 * jberger really likes how few lines are in Lite.pm
15:24 jberger kinda amazing
15:24 dotan joined #mojo
15:25 Mikey does /js/jquery.js always respond?
15:25 jberger actually that reminds me, is there a good way to get "lines of code" vs "lines of pod" vs "lines of tests"
15:25 crab mikey: don't use it. use your own jquery
15:25 jberger or number of tests
15:25 crab mikey: the internal one is for internal-only and may change and break things
15:25 Mikey ok.  thank you.
15:26 jberger Mikey, you might want to use a CDN though
15:26 jberger often thats faster than hosting your own, and only is a hassle if you are developing offline
15:27 Mikey *nod* we're using backbone and optimizing a custom bundle
15:27 jberger https://developers.google.com/s​peed/libraries/devguide#jquery
15:27 jberger oh ok
15:27 Mikey but we noticed this "phantom" jquery
15:27 Mikey when we moved from a simple include from /js/jquery.js
15:27 jberger oh gotcha
15:27 Mikey we noticed it shifted from 1.9 to 1.8.2
15:27 Mikey which was like a moment of ?!
15:28 Mikey just thought i'd ask thank you guys
15:28 jberger Mikey, IIRC its mostly for the nice dev 500 pages
15:28 Mikey yeah, i figured
15:29 Mikey maybe it's worth moving to a less canonical / standard place to put jquery locally?
15:29 Mikey just a thought
15:29 jberger I think they did move it somewhere lately
15:29 jberger hmmm
15:29 jberger wait 1 I have an idea
15:29 Mikey lemme make sure i'm updated
15:31 Mikey Mojolicious is up to date. (3.87)
15:31 Mikey it's nbd for us tho, just kinda freaky and wanted to ask for sanity reasons
15:32 jberger kewl
15:32 jberger btw my idea didn't pan out
15:32 ka2u joined #mojo
15:34 jeen joined #mojo
15:35 d4rkie joined #mojo
15:36 sri jberger: yea, using under in the growing guide might be a good idea, but i'm not sure how it would fit in there
15:37 jberger me either
15:37 jberger just something to think about
15:39 good_news_everyone joined #mojo
15:39 good_news_everyone [mojo] jberger deleted lite_doc_patch at 5db5874: http://git.io/3PQ4fw
15:39 good_news_everyone left #mojo
15:40 jberger sri: for my talk I would like to show off your amount of testing
15:40 jberger do you have any statistics handy about sloc vs num of tests?
15:41 jberger does some tracker have that? ohloh or something
15:41 * jberger checks
15:43 jberger "took an estimated 8 years of effort (COCOMO model) starting with its first commit in October, 2008 "
15:43 jberger sri++
15:45 jberger Code Lines : 30,137
15:45 jberger but it can't tell the difference between code and tests probably right?
15:45 jberger so the 10k-ish tests are included in that
15:45 jberger roughly one line per test
15:46 jberger makes it 1 line of test per 2 lines of active code
15:46 jberger approximately
15:47 bjoernfan How does that compare with the number of lines on IRC?
15:47 bjoernfan :)
15:49 jberger hahaha
15:50 sh4 joined #mojo
15:51 bjoernfan Come on, you can do it! :)
15:51 jberger use Mojo::UserAgent to scrape irclog.perlgeek.de/mojo
15:52 bjoernfan Don't forget your tests. ;)
15:52 jberger then when moritz yells at your DDOSing his server, run away :-)
15:53 mattastrophe joined #mojo
15:55 sri jberger: 9215 lines of code in lib
15:55 jberger and you just broke 10k tests right
15:56 jberger thats quite a feat, more tests than lines of code
15:56 sri 10052 tests
15:56 jberger does ohloh count pod as code
15:56 jberger hahaha
15:57 jberger I bet it does
15:57 sri lib to t ratio is about 1:1.8 i believe
15:58 jberger oh that could make up for the difference
16:02 jberger I realized today that my talk doesn't have content negotiation
16:02 jberger might try to shoehorn that in somehow
16:02 ka2u joined #mojo
16:03 sri oh, yea that's kind of a big deal :)
16:03 jberger I might just have a little hash and template, when you ask for the json you get the hash as json html get the hash inserted into template, or text get some major key from it
16:05 dotan joined #mojo
16:05 jberger its looking a little nicer though: http://joel.phy.uic.edu:3000/
16:06 jberger I made a max width, and I put the navigation on the left, because most of my code examples are on the right
16:07 jberger now just a few meme pictures and I have a talk!
16:07 jberger :-)
16:14 ka2u joined #mojo
16:17 * marcus has a little hacking time while $offspring[0] is at dance school o/
16:18 * marcus wants a micro brew framework.
16:22 marcus I really agree with crab that cutting out stuff like 'really' makes for better reading.
16:22 basiliscos joined #mojo
16:24 marcus 'k, done with the scrollback.
16:24 marcus now for some mango.
16:33 jberger MOAR MANGO
16:33 jberger hmmm should I mention mango
16:33 jberger in passing?
16:38 crab didn't you just?
16:38 crab oh, in a talk. i see.
16:40 mattastrophe joined #mojo
16:43 btyler joined #mojo
16:43 kongelaks joined #mojo
16:48 good_news_everyone joined #mojo
16:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OsglIQ
16:48 good_news_everyone mojo/master 2b03611 Sebastian Riedel: no really
16:48 good_news_everyone left #mojo
16:48 sri meh, peer pressure
16:51 inokenty joined #mojo
16:53 jberger crab, yeah, sorry
16:53 jberger sri: its just one, breathe deep
16:53 * jberger is a bad influence
16:54 * sri starts hyperventilating
16:54 jberger I'm starting to think I might bundle this presentation stuff as a plugin
16:55 jberger even if I'm the only one who uses it, I can see reusing it
17:06 sri oops, mango is leaking memory like crazy :o
17:07 sri the fix might break a few hacks
17:17 xaka joined #mojo
17:17 bluescreen joined #mojo
17:20 Kovensky "no really" reads like "no, really" but missing a comma
17:20 Kovensky :>
17:27 n0n joined #mojo
17:41 jeen joined #mojo
17:53 SmokeMachine joined #mojo
17:59 dod joined #mojo
17:59 spleenjack joined #mojo
18:01 duncanthrax joined #mojo
18:39 mattastrophe joined #mojo
18:42 jeen joined #mojo
19:07 Mike-PerlRecruiter_ joined #mojo
19:19 BeDa joined #mojo
19:43 hesperaux i'm looking for advice...question follows
19:44 hesperaux i'm creating a web app in which 4 categories of things are kept in a database. I have helpers and routes for these. helpers do the database transactions and the routes handle the form POSTs. The html form for these is elsewhere in one place.
19:44 hesperaux I've created 4 controllers that now contain the routes and helpers (which were converted to subs)
19:45 hesperaux i don't want to continue because it feels kind of weird to have these separate. The subroutines in all 4 controller classes will need database access from a main controller plugin, and there is good chance that i'll want to use the now-localized subs from these 4 classes in other routes.
19:46 hesperaux so my question is: is there a proper way I should be doing this? Should I just make them into 4 plugins? I shouldn't put routes into plugins, so I'm kind of confused.
19:46 hesperaux sorry if that doesn't make sense
19:49 n0n joined #mojo
19:57 good_news_everyone joined #mojo
19:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/aV7UrA
19:57 good_news_everyone mojo/master 8e22221 Sebastian Riedel: introduce the concept of actions much earlier in the tutorial
19:57 good_news_everyone left #mojo
19:58 sri hopefully that will result in a smoother start
20:04 good_news_everyone joined #mojo
20:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/teIg-A
20:04 good_news_everyone mojo/master dc18428 Sebastian Riedel: tutorial tweaks
20:04 good_news_everyone left #mojo
20:05 sri wasn't really sure if i should use the term "invocant", but i guess it's good to establish that we're doing oo perl
20:17 bluescreen joined #mojo
20:23 perlite joined #mojo
20:35 jberger sri++
20:35 jberger good changes
20:35 jberger one tiny nit, that existed before
20:35 jberger https://github.com/kraih/mojo/blob/​master/lib/Mojolicious/Lite.pm#L156
20:35 jberger the comma on this line shouldn't be tehre
20:35 jberger there
20:37 * jberger wonders if he should just fix typos now rather than point them out
20:37 lukep joined #mojo
20:37 sri oh right, you americans use a lot less commas than germans
20:37 jberger and less capital letters
20:37 jberger IIRC
20:38 hesperaux jberger, Capital Letters I think you mean
20:39 good_news_everyone joined #mojo
20:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/LQMb1g
20:39 good_news_everyone mojo/master d377730 Sebastian Riedel: less commas
20:39 good_news_everyone left #mojo
20:39 jberger sri: I was thinking, and this might be totally shot down
20:39 * sri starts shooting
20:40 jberger might it be useful to have some of the translations of Mojolicious::Lite to full in the Mojolicious::Lite doc
20:40 jberger "in a full app the under method will work like this"
20:40 * sri keeps shooting
20:40 jberger thought so
20:41 sri maybe a cheatsheet on the wiki?
20:41 jberger yeah, thats probably it
20:41 jberger two column this ---> that for the different lite syntaxes
20:41 sri yea
20:42 hesperaux i agree with jberger - to me, a new user of full apps, i have found it slightly difficult to find docs
20:42 jberger Growing is an awesome document and I dont want to mess with it too much
20:42 hesperaux growing is great; although for some things i was unsure if it applied to lite or full
20:42 jberger but its job is to show the translation of an architecture as well as syntax
20:43 jberger a cheatsheet would be good for "you understood this in lite, now its that"
20:43 sri making "full" examples is tedious though
20:43 jberger right, thats part of why Lite is so useful
20:44 jberger the translations wouldn't need to be complete examples, in fact they shouldn't be
20:44 sri right, once you grok how they relate, the lite examples are lot faster to parse
20:44 jberger exactly
20:45 jberger I know when I was inflating Galileo from lite to full, I had to read the source for Lite's under several times before I grokked it
20:45 jberger which is why I keep coming back to that one
20:45 jberger I wouldn't say to change them, just understand how they relate
20:46 sri well, i wouldn't mind having under in the growing guide, if it fits in
20:46 * jberger feels bad about not writing this himself, doesn't like to spend other people's tuits
20:46 sri but perhaps a transitioning cheatsheet on the wiki would be better... with examples for groups and under especially
20:47 jberger if this still needs looking after once I'm done with my thesis, I will do that
20:48 jberger or perhaps when I need a break from it, after my talk on thursday
20:48 jberger until then I use that time for that
20:48 mauke <jberger> and less capital letters   <- the letters aren't less capital, there're just fewer of them :-)
20:48 jberger haha
20:48 jberger true enough
20:49 hesperaux +1 for cheat sheet
20:50 jberger mojo get 'http://openlibrary.org/subjects/perl.json' /works/0/title
20:50 mawuli_ypa joined #mojo
20:52 * jberger is liking openlibrary for ua examples
20:52 jberger mojo get 'http://openlibrary.org/subjects/perl.json' /works/0/authors/0/name
20:52 * sri likes to use twitter search
20:53 hesperaux jberger, any chance you could read my question from earlier and offer any advice? I'm stuck right now with how best to organize my code.
20:54 rem_lex| joined #mojo
20:54 sri mojo get http://search.twitter.com/search.json?q=perl /results/0/text
20:55 jberger nice
20:55 * jberger copies
20:57 BeDa joined #mojo
20:58 jberger hahah the thing I got when running the twitter example was a reference to 'Perl Harbor'
20:58 jberger spelling fail
21:00 dod joined #mojo
21:06 basiliscos joined #mojo
21:06 njlg joined #mojo
21:07 jberger hesperaux, I guess I really don't follow what you are trying to do
21:08 hesperaux i was afraid of that
21:08 hesperaux i'm asking about best practices. i have 4 controller classes to handle different web forms. they have subs and routes.
21:08 jberger do you have one form that stores all 4 things/
21:08 jberger ?
21:09 hesperaux yeah, you could say that
21:09 hesperaux they are technically different forms with different actions
21:09 hesperaux but on the same page
21:09 jberger but you would only ever submit one at a time
21:09 hesperaux the thing is, some of the subs in the controllers are needed all over, and all of those subs need database access (which is set up in the main controller)
21:09 hesperaux jberger, that's right
21:09 jberger invoking those particular actions
21:09 jberger ok
21:10 jberger ok so you are now into what is known as the model part of MVC
21:10 jberger you should make another class, that is not a controller which handles your DB actions
21:11 xaka joined #mojo
21:11 jberger that is then the heart of your model
21:11 hesperaux ah, ok
21:11 jberger how you tie into that is up to you
21:11 hesperaux would it make sense to be a plugin?
21:11 hesperaux that way i can register its methods to the application
21:11 jberger I might at first create a helper which holds an instance of that class
21:11 hesperaux oh, that's an idea
21:12 jberger or the instance can be in an attribute of the controller
21:12 jberger package MyController; has model => sub { MyModel->new };
21:12 jberger its really up to you at that point
21:12 hesperaux is there a documentation page on has()?
21:12 jberger in Mojo::Base
21:13 jberger its essentially an extremely lean version of something like Moose
21:13 hesperaux i'm afraid i've never heard of moose
21:13 jberger but there are distinct differences
21:13 jberger oh
21:13 jberger well in that case
21:13 jberger just read the documentation
21:14 jberger it essentially generates an instance attribute
21:14 jberger with getters and setters
21:14 jberger and a lazy default
21:14 hesperaux ok
21:14 jberger and a 'new' method
21:15 jberger isn't it odd that your controller classes don't need a 'new' method?
21:15 jberger they are subclasses of Mojolicious::Controller
21:15 jberger and it gets a new method from Mojo::Base
21:15 hesperaux so they extend Base?
21:15 jberger no, Base creates the new method especially for the class
21:16 hesperaux i should admit that i'm new to perl OOP. I've done OOP in java and other languages, but perl's OOP seems kind of subtle and different.
21:16 jberger but if it helps you to think about it in that way, you can (kinda)
21:16 jberger perl's OOP is incredibly (possibly too) flexible
21:17 jberger Moose is a large project in the Perl world making a useful subset and generators to make it a little easier and standardized, while still being flexible
21:17 jberger its biggest problem is that its rather huge
21:18 jberger so people have come up with tiny-er versions of it
21:18 jberger namely Moo
21:18 jberger Mojo::Base does something similar, but incredibly small, just enough
21:20 * sri starts to wonder if we should really just emulate a monotonic clock in Mojo::Reactor::Poll
21:26 mawuli_ypa joined #mojo
21:27 mawuli_ypa Hi, hypnotoad fails to start and prints Can't locate object method "config" via package "Mojolicious::Lite"
21:28 sri mojo version?
21:28 mawuli_ypa I have installed Mojolicious::Plugin::Config and JSONConfig
21:29 sri what do you mean you have installed them?
21:29 sri they are part of the core distribution
21:29 mawuli_ypa 2.23
21:30 mawuli_ypa i mean they are installed
21:30 mawuli_ypa i checked to make sure they exist
21:30 sri sounds like you have broken your legacy mojolicious installation
21:30 sri and things are conflicting now
21:30 sri you better start with a fresh 3.87
21:31 mawuli_ypa ok. i installed it via apt-get
21:31 mawuli_ypa i will install via the mojo iste now
21:31 mawuli_ypa *site
21:33 jberger apt-cache policy libmojolicious-perl
21:33 jberger Candidate: 2.98+dfsg-2
21:33 jberger ick
21:34 jberger and thats on Ubuntu 12.10
21:35 sri who's counting the years...
21:36 mattastrophe joined #mojo
21:37 jberger <3 CPAN/cpanm/perlbrew
21:37 sri !
21:37 cstamas jberger: I guess this can be installed to recent ubuntus http://packages.debian.org/exp​erimental/libmojolicious-perl
21:38 jberger it depends on js-jquery
21:38 jberger what does that even mean?
21:39 jberger I'm glad that debian is tracking more closely though
21:39 cstamas jberger: it means that jquery is not embedded in the package, but supplied as a separate package
21:39 cstamas jberger: at install time it is symlinked
21:40 stephan48 for the internal jquery lib?
21:41 stephan48 sri: do you keep that one uptodate?
21:41 stephan48 the file under /js/jquery.js?
21:42 sri no
21:43 sri that one got replaced with /mojo/jquery/jquery.js
21:43 sri which is kept up to date
21:43 sri (and for internal use only)
21:45 cstamas jberger: it will take a few months to get the package from expermental repo to unstable then it can go easily flow to ubuntu
21:45 jberger 2.98 is rather old
21:46 cstamas jberger: now debian is frozed for the release that's why it is hard to get mojolicious to unstable
21:46 jberger and I asked about depending on, because it doesn't. internally it has a file which happens to be jquery
21:46 jberger but the packagers shouldn't be touching that
21:47 cstamas jberger: I do not like it either, but that is how it works in debian
21:47 cstamas jberger: and for quite a large number of packages it makes sense
21:48 jberger cstamas, there is no mechanism for them to know what version is needed, it is not declared
21:48 jberger I understand shared dependencies
21:49 jberger but in order to do that in a sane way one must declare the dependency
21:49 jberger something that there is no mechanism to do in this case
21:49 cstamas jberger: if you say which version it requires the package can be adjusted
21:50 cstamas jberger: to tell the truth it would be great if you can do that
21:50 cstamas ;-)
21:51 cstamas the internal jquery is used in debugging mode if i got that right
21:51 cstamas is it?
21:52 sri it is
21:56 jberger anyway, I have to go blow the rapidly accumulating snow from my driveway
21:57 cstamas if you have ideas to improve the situation just say it
21:59 cstamas I was interested in keeping mojolicious in debian uptodate so I got involved in its packaging
22:02 freman hmmmm sri, I can't see how I can apply that patch you liked yesterday to our system (I mean, I know how to but this place is retarded) any other ideas to prevent hypnotoad spazing out when the clock is changed?
22:02 sri freman: what patch?
22:04 freman the monotonic clock patch - or was that unrelated to my issue
22:04 sri there is no monotonic clock patch for mojolicious
22:04 freman yeh that was for time hires
22:05 sri we don't support it since Time::HiRes only supports it on linux so far
22:05 freman if it was for mojo I could sneak it in and solve all my problems... and have the first non-12-hr day this month
22:07 sri so, you can't make it work yet
22:07 freman I'll give it my best shot if you can point me in the right direction
22:08 sri you could install EV
22:08 sri it uses a monotonic clock
22:08 freman ev is installed...
22:08 sri odd, no clue then
22:10 freman " EV for example will be automatically used if installed"
22:10 freman how automatic is that, if I don't "use EV" will it still find it?
22:10 sri MOJO_IOLOOP_DEBUG=1
22:11 freman tah, just writing a small test app to test it
22:15 rem_lex|pivo joined #mojo
22:16 freman -- Reactor (Mojo::Reactor::EV)
22:16 freman that's what we want to see
22:16 sri yes, it should be using a monotonic clock then
22:17 freman now testing on a slightly more live install of the app
22:18 freman hmmm live is using ev too
22:19 freman lol, screensaver doesn't use monotonic clock either
22:19 freman just set my clock forward a day and screensaver starts up
22:20 mattastrophe joined #mojo
22:20 sri forward shouldn't be a big deal, it's backwards that kills stuff
22:20 freman http://pastebin.com/anewA09i
22:20 marcus sri: Is it possible to use keyf with Mango? like, with a custom javascript function? (Background: looking to implement http://stackoverflow.com/questions/​5168904/group-by-dates-in-mongodb)
22:21 toebu joined #mojo
22:21 sri freman: oh, ok, hypnotoad can't use the monotonic clock from EV
22:21 sri can't be fixed
22:22 sri we need better support in Time::HiRes first
22:23 sri in fact, even if we emulated a monotonic clock, i don't think we could prevent jumps forward in time
22:23 freman time hires supports it in linux, could I just patch hypnotoad to use it?
22:23 jberger cstamas, sorry, I hope you understand, I thank the packagers
22:23 sri maybe, but you're on your own there
22:24 jberger I just am a little scared by the idea of replacing bundled/undeclared dependencies
22:24 freman better than where I'm at now if it works
22:24 cstamas jberger: yeah I got that
22:25 sri if i was going to add it to core i would start with Mojo::Util::monotonic_time or so, and switch all hires time() calls with it throughout the codebase
22:25 sri we mostly work with relative times, so it's not too hard
22:26 sri anyway, if you get os x support into Time::HiRes, the same day we will have support for it natively in core ;p
22:28 sri marcus: group is just a command, of course it works
22:29 sri there is no shortcut because those aggregation functions have mostly been abandoned
22:30 sri they suck with replication or so... now it's all aggregation pipeline and map/reduce
22:32 freman I'm still picking my way through packages... I'm too tired for this (our timelog application just warned me that I'm 21 hours ahead this fortnight)
22:35 sri freman: i suppose you could also set the heartbeat_timeout to some insanely large value that could never be reached
22:35 sri for a quick workaround, you're losing the safety net though
22:35 freman we already set it to an hour (before we knew what was causing it, because we're using dial up communications - no, this is not a sane organization)
22:36 TitanOfOld joined #mojo
22:37 sri marcus: ah, group doesn't work with sharding
22:37 sri just forget about it and make a pipeline
22:37 marcus sri: I really don't care about sharing tho :)
22:38 * sri shrugs
22:38 marcus (writing an app for our cantina to track lunch eaters)
22:38 marcus Doubt we will have scaling issues ;)
22:38 sri still... don't you want to learn the cool new features?
22:38 marcus sri: the main point of it was the custom date grouping tho
22:39 marcus Can I do that with a pipeline?
22:39 sri i think aggregate can do everything group can
22:41 sri http://docs.mongodb.org/manual/refe​rence/aggregation/#group-operators
22:41 sri there are grouping operators :)
22:41 marcus sri: so how do I pass a javascript function to pipeline?
22:42 sri why javascript?
22:42 marcus sri: custom key function to group by date?
22:42 marcus sri: If I'm to group by date, I have to create a key to group on.
22:43 freman if ($w->{time} + $interval + $timeout <= time) { - should be able to replace with clock_gettime(CLOCK_MONOTONIC) right?
22:52 marcus sri: looks like I can create d-m-y from a date with the aggregation framework. nice.
22:52 freman hehe can't use the *Mojo::Server::Hypnotoad::time = sub{} hack... looks like I'll need to make a local hypnotoad
23:07 freman http://pastebin.com/L2yyG8gd
23:11 hrupp joined #mojo
23:12 mattastrophe joined #mojo
23:44 jeen joined #mojo
23:46 mawuli_ypa joined #mojo
23:48 jpn joined #mojo
23:48 mattastrophe joined #mojo

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