The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-04-08

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

All times shown according to UTC.

Time Nick Message
00:26 russum1 joined #mojo
00:29 jack joined #mojo
00:47 aggrolite joined #mojo
00:55 laouji joined #mojo
01:01 punter joined #mojo
01:12 hotsnow joined #mojo
01:28 klapperl joined #mojo
01:39 aggrolite joined #mojo
01:47 crab i have a question about logging, but i won't tell you what it is
01:48 DuMu joined #mojo
01:53 mtths joined #mojo
01:55 laouji joined #mojo
01:56 laouji joined #mojo
01:56 btyler joined #mojo
01:58 aggrolite joined #mojo
02:03 disputin joined #mojo
02:22 DuMu joined #mojo
02:50 laouji joined #mojo
03:01 alnewkirk joined #mojo
03:01 laouji joined #mojo
03:08 vmmello___ joined #mojo
03:32 russum joined #mojo
03:34 russum1 joined #mojo
03:56 mtths joined #mojo
04:17 laouji joined #mojo
04:30 laouji joined #mojo
04:34 mtths joined #mojo
04:37 sh4 joined #mojo
04:58 stl joined #mojo
05:01 stl joined #mojo
05:07 stl joined #mojo
05:08 Gedge_ joined #mojo
05:11 stl joined #mojo
05:52 Vandal joined #mojo
06:06 Eke- joined #mojo
06:11 sujithm joined #mojo
06:46 dod joined #mojo
06:52 rem_lex joined #mojo
07:04 kwa heh - I bet it was a good question though
07:04 eseyman joined #mojo
07:07 da5id joined #mojo
07:08 edestler joined #mojo
07:11 mtths joined #mojo
07:12 mtths joined #mojo
07:14 mtths joined #mojo
07:14 maxhq joined #mojo
07:15 rawler joined #mojo
07:16 mtths joined #mojo
07:18 inokenty joined #mojo
07:19 denis_boyun joined #mojo
07:25 sujithm joined #mojo
07:29 denis_boyun joined #mojo
07:30 mtths joined #mojo
07:33 mtths joined #mojo
07:36 sujithm joined #mojo
07:38 trone joined #mojo
07:42 basiliscos joined #mojo
07:48 fhelmber_ joined #mojo
08:01 dpetrov_ joined #mojo
08:42 sujithm joined #mojo
09:18 mire joined #mojo
09:28 al joined #mojo
09:35 al joined #mojo
09:44 Kovensky joined #mojo
09:58 hesperaux joined #mojo
10:05 denis_boyun joined #mojo
10:14 cpan_mojo MojoX-Plugin-AnyCache 0.01 by CHGOVUK - http://metacpan.org/release/CHGOVUK/MojoX-Plugin-AnyCache-0.01
10:35 Akron joined #mojo
10:40 sujithm joined #mojo
10:42 laouji joined #mojo
10:43 sujithm joined #mojo
10:46 d4rkie joined #mojo
10:46 sujithm_ joined #mojo
10:51 meshl joined #mojo
11:02 d4rkie joined #mojo
11:14 ua_1 joined #mojo
11:14 ua1 joined #mojo
11:51 marty_ joined #mojo
12:08 dvinciguerra joined #mojo
12:26 neilhwatson joined #mojo
12:32 sujithm joined #mojo
12:34 yakudza joined #mojo
13:11 mire joined #mojo
13:18 gryphon joined #mojo
13:37 hesco I just upgraded my installation to the latest versions of Mojo (4.91) and Mojo::Test::More (0.05).  That resolved some long standing noisy deprecation warnings but introduced new ones:  Use of uninitialized value $handler in hash element at local/lib/perl5/Mojolicious/Renderer.pm line 230.
13:37 hesco Use of uninitialized value $handler in concatenation (.) or string at local/lib/perl5/Mojolicious/Renderer.pm line 235.
13:38 hesco Any thoughts on wht might clean up those warnings?
13:45 sri yay, mongodb 2.6 release is planned for today
13:47 genio I'm still very "meh" on Mongo
13:47 sri mango now does a version check btw. so it will be obvious when the mongodb version is too old https://travis-ci.org/kraih/mango/jobs/22499448
13:54 btyler joined #mojo
13:55 KindOne joined #mojo
13:57 neilhwatson mutt
13:59 spuelrich joined #mojo
14:01 beyondcreed joined #mojo
14:03 good_news_everyone joined #mojo
14:03 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/S_UE7g
14:03 good_news_everyone mojo/master 0de8d93 Sebastian Riedel: fixed small handler detection bug in Mojolicious::Renderer
14:03 good_news_everyone left #mojo
14:05 KindOne joined #mojo
14:06 sri oh, and just as i said that, mongodb 2.6 has been released :)
14:13 crab sri!
14:13 sri crab!
14:28 sh4 joined #mojo
14:32 Akron Do you use a different template handler than the default one (i.e. ep)?
14:32 Akron (Sorry - that was @hesco)
14:35 hesco Akron: I'm rendering html, but using ep
14:41 disputin joined #mojo
14:42 mport joined #mojo
14:46 bluescreen joined #mojo
14:51 Akron hesco: And you resolved all deprecation warnings before you updated?
15:05 punter joined #mojo
15:05 aggrolite joined #mojo
15:22 jim joined #mojo
15:25 jim in controller class, how to change the attribute? $self->app->attr(attr1=>value) doesn't work
15:33 sri hesco: my last commit fixed the warning
15:34 Akron sri++
15:34 hesco thanks sri, will upgrade again soon then
15:42 sujithm joined #mojo
15:47 meshl joined #mojo
15:51 crab jim: what attribute? are you looking for $self->app->attr1("value")?
15:52 crab without knowing what attr1 is, of course, i don't know if you are or not looking for that.
15:52 jim crab: the attr1 is from has attr1 =>sub{ return DateTime->today;};
15:52 jim and i want change it in the controller
15:55 crab _who_ "has attr1"? is it the controller or the app?
15:56 jim it is the app
15:57 jim crab, $self->app->attr1("value") works, thank you. It looks like the setter is automatically generated.
15:59 crab yes.
15:59 jim Mojo::Base doesn't explicitly document this feature.However, the synopsis has an example.
16:16 sri changing application state from a controller is a bad idea, it doesn't scale past one process
16:19 jim sri: I want the app always have a sense of current date, what do you recommend to achieve that?
16:19 jim currently I'll update the date in controller methods.
16:20 sri i don't understand the problem
16:21 russum joined #mojo
16:22 russum1 joined #mojo
16:22 jim in a few controller subroutines I need to access today's date, so I created an attribute in app class and in / subroutine I update this attribute so that other subroutines can access today's date.
16:24 sri you're inventing a problem
16:24 sri just put it in the stash and be done with it
16:25 jim but stash is non persistent, how can other subs in the controller access its value?
16:26 denis_boyun joined #mojo
16:27 stephan48 create a toplevel bridge which puts the date into the stash
16:28 btyler I think "persistent" might be a confusing choice of words, here
16:29 jim stephan48, will look into that, currently the only bridge i've used is for authentication. btyler: I think I kind of want a variable that is live across a user activity session till user finishes with submit a button.
16:34 crab the current date?
16:35 crab weird
16:35 jim crab: yes today's date
16:36 jim the Mojolicious::controller doc says Stash is the Non-persistent data storage and exchange for the current request, as I understand if you set a stash value in one sub, the value won't be available in another sub in the same controller or in another controller. Is it correct?
16:37 thien_ joined #mojo
16:38 Adura What's wrong with the date being in the session?
16:39 jim Adura, the user may not logout and the session persists across days.
16:40 sri seriously, you're inventing a problem, the syscall time() performs is not that expensive
16:41 jim sri, calling system clock is what I tried to avoid:-D but you are right
16:41 sri you're using DateTime for crying out loud
16:41 jim I can simply call DateTime->today in each sub
16:42 sri DateTime is super duper slow already, optimizations are pointless
16:43 jim maybe i'll just use time, the reason i use Datetime is it is compatible with postgres time and date date types.
16:44 sri the first rule of optimization... PROFILE!!!1
16:45 jim agree, overthought on this one:)
16:45 sri Devel::NYTProf is your friend
16:46 jim I think I only used that once..  Thanks everyone.
16:50 tianon NYTProf is beautiful <3
16:52 denis_boyun_ joined #mojo
16:55 * sri starts to really love bulk operations
16:57 sri writing a variable number of chunks for GridFS was a mess before, now it's pretty and easy to follow \o/ https://github.com/kraih/mango/commit/66bdde075bfeb551eaaf783f3098553e7dd6a51d
17:00 russum joined #mojo
17:03 dod joined #mojo
17:05 cmihai joined #mojo
17:09 thien_ joined #mojo
17:12 bluescreen_ joined #mojo
17:18 dod joined #mojo
17:24 davido_ joined #mojo
17:24 sri oh, another limit to take care of, 1000 batch operations per command
17:31 sri phew and done
18:16 psimanx1 joined #mojo
18:21 Farow joined #mojo
18:31 jim i think I found a bug regarding using param taghelper in javascript block: https://gist.github.com/githubfun/10167840
18:35 jim somehow the template system treats dash in the get parameters as minus sign
18:39 crab the template system, is it?
18:39 crab what do you expect console.log(2014-03-03) to do?
18:39 jim hmm i expect it to be a string.
18:40 crab because of... magic?
18:41 jim the test may not be good, let me double check
18:41 crab surely you don't expect param('x') to return something enclosed in double quotes
18:41 crab or any sort of quotes
18:44 jim Thank you crab, it is catch, yes the template system returns the perl values verbally.
18:46 crab you're welcome, but this really has nothing to do with "the template system"
18:47 crab you are generating console.log(2014-03-03) from your template. the subtraction is happening in javascript.
18:47 jim you are right, initially i had no idea where the 2008 is coming from
18:47 crab if you want to generate console.log('2014-03-03'), then you should add quotes in your template.
18:47 jim yup, all fixed
19:01 punter joined #mojo
19:04 Eke- joined #mojo
19:09 good_news_everyone joined #mojo
19:09 good_news_everyone [mojo] kraih tagged v4.92 at d0667a8: http://git.io/iKVERA
19:09 good_news_everyone left #mojo
19:09 good_news_everyone joined #mojo
19:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/sPX89Q
19:09 good_news_everyone mojo/master 9192694 Sebastian Riedel: bump version
19:09 good_news_everyone left #mojo
19:43 dvinciguerra joined #mojo
19:48 sri jberger: your bot does not appear to announce anything anymore
19:49 aggrolite joined #mojo
19:49 sri wtf?
19:49 sri https://metacpan.org/release/Mojolicious-Plugin-YamlConfig
19:49 sri https://metacpan.org/release/AMIRITE/Mojolicious-Plugin-YAMLConfig-0.01
19:51 jim dupe effort.. authors should talk here
19:51 sri yea... that first plugin has only been out since 2010
19:53 sri hope the second doesn't get past the pause indexer
19:54 sri of course pause is down again...
19:57 DaTa w00t?
19:57 purl w3 0wnz j00r s3rv3r d00dz
20:01 DaTa what should I say? GTFO of my namespace?
20:02 sri that's what i would say :)
20:03 sri i do wonder how the pause indexer handles it though
20:04 sri does not seem to be listed in metacpan or s.c.o search results, just recent uploads
20:04 DaTa he has already renamed it to M::P::NourConfig?
20:05 DaTa https://github.com/sharabash/Mojolicious-Plugin-NourConfig/commit/4514c2dd168f807838146702baf277315943dcfb
20:11 genio Nour?
20:11 genio ah, his first name
20:14 cmihai Hi. Just wanted to say mojo is incredibly awesome :D.
20:14 cmihai I started writing some code that read __DATA__ sections, uudecode binaries, replaced tokens, websocket ua stuff, etc. for a self-contained script with no heavy dependencies - then realized mojo does every, more, and much better than I could imagine. Great stuff, guys.
20:15 jim add it to favorite on metacpan
20:15 cmihai And with morbo as well - I feel like I've never been more productive doing this sort of stuff :D
20:16 sri \o/
20:17 cmihai (and let's not even go into the insane ways I tried to implement the json parsing I had to throw away haha)
20:25 cmihai Speaking of insane ways of doing things, is there a better way to implement caching for JSON requests so I don't hammer the server? Currently I'm doing md5(username) to create a filesystem / url safe name, then writing that to disk with move_to & checking the age.
20:26 KindOne joined #mojo
20:26 btyler cmihai: is using a real caching layer like redis or memcached an option?
20:28 btyler if cache expiry is just time based, redis can set keys to expire after a certain time with pretty minimal fuss
20:29 beyondcreed joined #mojo
20:29 cmihai Don't think so - I'm trying to keep things lite and user-accessible (external or additional dependencies need to be kept to a minimum).
20:30 cmihai Ex: the app is a self-contained script that people can run - get a cached set of json requests and a JavaScript grid of the results. That way - I can actually distribute the json with the HTML report as well.
20:31 cmihai Performance isn't really an issue - keeping it portable and lightweight to run on Win/Cygwin/Lin/AIX with bog standard perl / minimal or no depds is the priority.
20:32 btyler oh, I misunderstood your original question, thought you were talking about lightening the load from the server perspective by responding to requests from a cache rather than hitting a db/etc.
20:33 cmihai Nope. I'm building a report off 30+ json requests off some API. I want to cache those requests for at least 1 hour instead of fetching a new one every time the user(s) refresh.
20:34 cmihai The heavy lifting / reporting is done in JavaScript (DOJO GRID) anyway - so I want to have the ability to run cmdline, UI or -email-reports (html+json) so I actually serve the JSON from get /cache to begin with. So I have /cache/md5(userid@domain)/request
20:34 cmihai the md5 is done to ensure the userid is filesystem and url safe.
20:37 mire joined #mojo
20:41 alnewkirk joined #mojo
20:42 cpan_mojo Mojolicious 4.92 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-4.92
20:55 good_news_everyone joined #mojo
20:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6TiP1w
20:55 good_news_everyone mojo/master 6965939 Sebastian Riedel: attribute value is boolean
20:55 good_news_everyone left #mojo
21:45 gryphon joined #mojo
22:13 odc joined #mojo
22:14 d4rkie joined #mojo
22:32 d4rkie joined #mojo
22:32 hesco The behavior I seek is that an invalid submission reloads the previously entered data and returns the user to the form, to correct invalid data, assisted by error messages exposed on the form. I adapted from the perldoc at: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Rendering.pod#Form-validation  and wound up with code which looks like this:  https://gist.github.com/hesco/1782d63d3b9cc8cc3894  But it still doe
22:32 hesco s not work for me.  Seeking clues, please.  Any pointers would be appreciated. Thanks.
22:39 vmmello joined #mojo
23:05 hesperaux joined #mojo
23:48 cooper joined #mojo
23:56 aggrolite joined #mojo

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