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

IRC log for #mojo, 2015-08-20

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

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:11 mrallen1 joined #mojo
00:12 meshl joined #mojo
01:01 jontaylor joined #mojo
01:39 bwf joined #mojo
01:53 njlg joined #mojo
02:02 asarch joined #mojo
02:03 asarch Can you "know" if the user wants to print your page (or if he already printed the page)?
02:07 Grinnz as in, printer print?
02:07 Grinnz i imagine you can mess with that in javascript
02:10 noganex joined #mojo
02:14 jberger You can't know if they actually printed it
02:14 jberger There are css ways to format for a printer
02:17 njlg joined #mojo
02:27 lluad You could tell if they downloaded a userid-tagged, printer-specific CSS file. But that's beginning to get silly. :)
02:27 noganex_ joined #mojo
02:34 njlg joined #mojo
02:35 kaare joined #mojo
02:41 jb360 joined #mojo
02:47 njlg joined #mojo
02:51 mrallen1 joined #mojo
02:51 hshong joined #mojo
03:25 jberger I do wonder about companies who are pinned to 5.10 essentially forever and yet expect new cpan modules to work flawlessly
03:28 * sri wonders if support contracts could actually work
03:29 jberger to support mojo or their mojo apps?
03:29 sri mojo
03:29 jberger I'll stop downplaying global destruction if you want me to :-P
03:30 sri heh
03:30 jberger ZOMG GLOBAL DESTRUCTION!!!!
03:33 sri something like this seems reasonable http://www.hwaci.com/sw/sqlite/prosupport.html
03:34 sri if there's a few interested companies i'll actually give it a try
03:36 jberger go for it
03:39 jberger re the issue conversation, global destruction order is never guaranteed, right? later perls just have a nice way to prevent error messages?
03:40 preaction calid and i have done a lot in re global destruction. there is some kind of order, in that object refs are destroyed first, but largely no
03:51 njlg joined #mojo
03:54 njlg joined #mojo
04:12 njlg joined #mojo
04:29 inokenty-w joined #mojo
04:42 McA2 joined #mojo
05:53 Lee joined #mojo
06:00 sri hmm, openssl support contracts seem a little less straight forward
06:00 sri https://www.openssl.org/support/contracts.html
06:06 sopanshewale joined #mojo
06:09 good_news_everyon joined #mojo
06:09 good_news_everyon [mojo] kraih tagged v6.16 at d469796: http://git.io/vsZoH
06:09 good_news_everyon left #mojo
06:10 good_news_everyon joined #mojo
06:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vsZoh
06:10 good_news_everyon mojo/master 6d1e9cf Sebastian Riedel: bump version
06:10 good_news_everyon left #mojo
06:10 corgi joined #mojo
06:29 crab hi
06:33 tempire HI!
06:37 dod joined #mojo
06:42 dod joined #mojo
07:01 AndrewIsh joined #mojo
07:15 PopeFelix joined #mojo
07:16 kivilahtio joined #mojo
07:21 eseyman joined #mojo
07:26 marcusr guise!
07:38 Vandal joined #mojo
08:06 nic joined #mojo
08:06 arpadszasz joined #mojo
08:06 nic crab: Just want to say thanks for the crypto modules you wrote a few years back
08:09 crab nic: heh, you're welcome.
08:19 nicomen Am I wrong to not expect memleaks on a bare bones mojo app? https://gist.github.com/nicomen/847f9bce9aa5a8806cf3
08:41 pink_mist of course there shouldn't be memleaks unless someone screwed up
08:44 nicomen well, maybe there is some magic that needs to be there
08:44 nicomen and will not end up as a leak
08:55 marcusr joined #mojo
08:55 espen joined #mojo
09:06 punter joined #mojo
09:08 dotan1 joined #mojo
09:12 meshl joined #mojo
09:20 good_news_everyon joined #mojo
09:20 good_news_everyon [mojo] marcusramberg created c_log (+1 new commit): http://git.io/vsnBa
09:20 good_news_everyon mojo/c_log e876336 Marcus Ramberg: Add shortcut for logger to controller, update examples and add pod
09:20 good_news_everyon left #mojo
09:20 melo joined #mojo
09:22 marcus Any non-trivial perl code leaks in my experience :p
09:22 Dandre joined #mojo
09:26 pink_mist nicomen: maybe you could do a git bisect of that?
09:27 nicomen pink_mist: you suspect it wasn't always there?
09:28 pink_mist I /hope/ it wasn't :P
09:30 D4RK-PH0ENiX joined #mojo
09:32 henq joined #mojo
09:35 d4rkie joined #mojo
09:49 henq joined #mojo
09:54 batman nicomen: same result if you do undef $t; ?
09:54 batman i was wondering if there might be some garbage collection that happen to late...
09:57 batman marcus: commented on your c_log branch, even if i think i'm -1...
10:05 arpadszasz joined #mojo
10:09 marcus batman: commented on your comment
10:10 Zoffix commentception
10:10 batman marcus: you know i like comments, so you put a comment inside my comment..?
10:10 batman :)
10:11 marcus Yo dawg
10:11 batman about optimisation... have you benchmarked that? ref sri's comments about optimisation from earlier today
10:12 marcus http://assets.yodawgpics.com/hashed_silo_content/silo_content/5887/resized/yoyos.jpg
10:12 batman :)
10:12 batman marcus: the conversation started around 00:19 (.no time)
10:15 batman marcus: did you look at my logf() helper? any feedback is much appreciated
10:17 marcus batman: It looks quite good too. Probably something I would need at some point.
10:19 batman ok. thank you.
10:36 jontaylor joined #mojo
11:09 henq joined #mojo
11:11 neilhwatson joined #mojo
11:33 henq joined #mojo
11:44 bd joined #mojo
11:44 asarch joined #mojo
11:45 asarch Have you seen this? Pure CSS Progress: http://codepen.io/rgg/pen/QbRyOq
11:45 jberger marcus: rather than an attribute with a default, why not a pure pass through shortcut method?
11:46 jberger sub log { $_[0]->app->log }
11:47 marcus jberger: I'm starting to think that would be smarter. I'm going to update my pull request
11:47 jberger ^5
11:50 good_news_everyon joined #mojo
11:50 good_news_everyon [mojo] marcusramberg pushed 1 new commit to c_log: http://git.io/vsc3R
11:50 good_news_everyon mojo/c_log c6de6af Marcus Ramberg: Update log to be an actual shortcut instead of an attribute
11:50 good_news_everyon left #mojo
11:52 jberger marcus: shouldn't the method be moved too?
11:54 good_news_everyon joined #mojo
11:54 good_news_everyon [mojo] marcusramberg pushed 1 new commit to c_log: http://git.io/vscs7
11:54 good_news_everyon mojo/c_log 8b47577 Marcus Ramberg: Also move the method, sorry jberger
11:54 good_news_everyon left #mojo
11:54 jberger hehe
11:55 berov joined #mojo
11:59 dod Hi. "mojo get" does not show the content of a response if this response is a long line without line termination (i.e. no CRLF). Is this expected ?
12:10 batman dod: sure it's not your terminal messing up the output? tried piping it to a file?
12:11 batman asarch: that's insane :)
12:11 batman i think css is moving faster than i can cope with now :/
12:12 batman it was simpler before when the most complex thing you could do was position:fixed; :)
12:14 asarch It goes too faster :-(
12:19 bd is there a way to feed mojo::ioloop->timer() a crontab line?
12:24 arpadszasz joined #mojo
12:31 odc bd, i don't think so but that would be a good plugin idea ;)
12:32 dod batman: yes, I've already piped the content given by curl into a file. There's neither  CR nor LF at the end of the 1.3MB (!) file
12:32 hernanGOA joined #mojo
12:33 batman dave: not curl, but "mojo get ... > outfile"
12:33 bd odc: there is  Schedule::Cron::Events that uses Set::Crontab to answer the "when will this crontab entry run next" question
12:34 bd wrapping that with a ioloop->timer() could work. but it pulls in a couple of modules
12:35 dod batman: "mojo get ... > outfile" results in an empty file
12:36 odc bd, good catch. Those 2 dependencies are pure perl so i wouldn't mind
12:38 bd odc: so when you said plugin, as in Mojolicious::Plugin::Crontab? Or does IOLoop support plugins too?
12:40 odc bd, the 1st one. Mojo::IOLoop has 'backends', not plugins
12:44 cpan_mojo Mojolicious-Plugin-AssetPack-0.59 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.59
12:50 batman bd: i would rather make Mojo::IOLoop::Crontab which has ioloop => sub { Mojo::IOLoop->singleton };
12:50 batman not sure if that's a good idea at all though.
12:51 batman and you probably want that to do recurring instead... unless you're actually making "at" (?)
12:54 bd batman: well you can use recurring for the 2nd and following call, but the first invocation most likely happens not at interval length but at $interval - $now % $interval
12:55 batman bd: you're absolutely right :)
12:55 bd so you need timer once, then you can pass off of to recurring
12:55 batman bd: what's the problem you're trying to solve?
12:56 bd batman: do stuff every hour or every x seconds
12:57 batman i get that. but _why_ ?
12:57 bd :)
12:57 bd basically pack generated logfiles, app-logfiles that is not mojolicious files
12:58 batman and why not use logrotate?
12:59 bd hm. have to look into it but my gut feeling is that it won't fit the problem.
13:00 batman yeah. sometimes the gut is pushing you around.
13:00 batman i spent quite some time trying to do what you do (not exactly, but close enough) just finding out that i was solving the wrong problem.
13:00 batman *but probably close enough
13:01 bd yeah. and it's a moving target so it may as well evolve into something where logrotate will actually fix quite good
13:06 ZoffixWork joined #mojo
13:07 corgi joined #mojo
13:10 ZoffixWork Mojolicious::Plugin::Bootstrap3 says "You can replace any of these static files in your own project." here https://metacpan.org/pod/Mojolicious::Plugin::Bootstrap3#STATIC-FILE-STRUCTURE  but *how* do you replace them exactly?
13:11 ZoffixWork Plugin doesn't put any in public/sass, so I created my own public/sass/bootstrap/_variables.scss, but it's not picking that up
13:17 batman ZoffixWork: that's weird. it should work exactly like that :/
13:17 batman let me see...
13:19 batman ZoffixWork: have you tried plugin "bootstrap3", {custom => 1}; and see what it creates?
13:22 ZoffixWork batman, that did the trick thanks. Though it only works if I name it "variables.scss" and not "_variables.scss". Good enough for me :)
13:22 ZoffixWork batman++
13:23 batman that's so weird... sounds like a bug.
13:23 batman which version of sass do you have? (sass --version)
13:24 ZoffixWork Sass 3.4.13 (Selective Steve)
13:24 ZoffixWork If I have both variables.scss and _variables.scss it does complain that it can't figure out which one to use :/
13:26 ZoffixWork Now it works with _variables.scss :S
13:27 batman ZoffixWork: that's good. that's the file you should use (_variables.scss)
13:28 batman ZoffixWork: maybe you need to upgrade assetpack to 0.59
13:28 batman i don't think that's the issue though...
13:34 ZoffixWork Weird. If I leave public/sass/bootstrap.scss unchanged, my custom variables.scss (or _variables.scss) doesn't work. But even if I add just a new line to bootstrap.scss, then it works with or without the underscore
13:37 ZoffixWork or even an extra space in the comment... Is it loading the bootstrap.scss that came with the plugin as well? I think maybe something's checksumming the file and doesn't load mine, thinking it's a duplicate of the other one. And since it's not loaded, the variables.scss are plugin's and not mine.
13:39 marty joined #mojo
13:45 howitdo joined #mojo
13:47 batman ZoffixWork: which version of M::P::AssetPack and ::Bootstrap3 ?
13:48 ZoffixWork :S now it stopped loading variables.scss again, while I was typing up an email ~_~ And adding newlines doesn't work, but if I comment out one of the @imports then it starts working. Seems random.
13:48 ZoffixWork batman, latest: http://fpaste.scsys.co.uk/497351
13:49 batman are you using morbo? are you watching the correct files?
13:50 ZoffixWork Morbo, yes. I'm using a "-w ."
13:51 batman how is that possible? would suppose that results in an infinite loop, since public/packed is changed on reload
13:51 Grinnz also if you have a log dir :)
13:52 batman ZoffixWork: so, i see from https://github.com/jhthorsen/mojolicious-plugin-assetpack/blob/master/lib/Mojolicious/Plugin/AssetPack/Preprocessor/Scss.pm#L94 that you need to copy bootstrap.scss, or the recursive md5 checking won*t work
13:53 batman Grinnz: yeah, hehe
13:53 batman ZoffixWork: i would start over and do what is documented, instead of copying files and renaming at random
13:54 batman so rm public/packed/*css and rm -r public/sass/* (or some version of those commands that works for you)
13:54 batman afterwards you leave {custom=>1} in and start "morbo -w public/sass" and see what happens
13:56 mrallen1 joined #mojo
13:56 ZoffixWork batman, do I copy _variables.scss to public/sass/bootstrap?
13:56 dimuls guys, about global logging: it was thinking out loud. About multiple apps with global warning: use Mojo::Log qw/ -app1 log_die log_error log_warn ... /;
13:57 batman ZoffixWork: no. custom=>1 takes care of all of that for you
13:57 ZoffixWork batman, not seeing anything. Only bootstrap.scss in sass
13:57 batman crap. i'm wrong. you're right.
13:57 batman that's stupid. need to fix that.
13:58 batman so yes: copy/paste _variables.scss into public/sass/bootstrap
13:58 batman do not rename the file.
13:58 batman then start morbo -w public/sass again
13:59 Grinnz dimuls, that would have to then find the app somehow, thats not really doable in any way i can think of
14:02 ZoffixWork batman, same issue. _variables.scss is not picked up unless I comment out one of the @imports in public/sass/bootstrap.scss
14:02 batman ZoffixWork: do you have css=>[] ?
14:02 ZoffixWork no
14:03 batman can you reproduce this is in a minimal app?
14:03 batman if so, please open a ticket.
14:05 dod joined #mojo
14:05 ZoffixWork Let me try.
14:05 dimuls Grinnz, why do logger need app? U need to just init logger module in each app, somethink like: use Mojo::Log 'init'; init(app_name => $app->log); And then in controllers: use Mojo::Log qw/-app:app_name log_debug .../;
14:05 batman ZoffixWork: try watching the same directory and make a typo in the bootstrap.scss and/or _variables.scss file just to see if that is picked up...
14:06 Grinnz dimuls, this is sounding more and more complicated when you could use Log::Contextual ;)
14:06 * batman doesn't get what the global log functions actually fix
14:06 dimuls maybe=) just thinking out loud
14:08 Grinnz batman, i believe mst mentioned a possible use case. being able to log in the app from the model or other functions that do not know about the app
14:08 batman Grinnz: why not just pass on the $log object to the model? after all, most of the log objects share the same interface
14:09 Grinnz batman, one more thing to keep track of...
14:09 batman interface = debug(), info(), warn(), ...
14:09 corgi joined #mojo
14:09 batman ok. works for me :)
14:10 Grinnz im not particularly for or against the idea, just i could see that being a reason
14:10 ZoffixWork batman, typo in variables doesn't do anything. Typo in bootstrap.scss does register, but if I comment out the typo it still works (i.e. variables start to load). If I then edit the variables, the changes don't propagate unless I nuke public/packed. But if I return bootstrap.scss to the original form, variables stop loading.
14:10 Grinnz with my app from work as an example; we have *hundreds* of functions in modules that are completely independent from the app
14:11 ZoffixWork Let me update my sass, if I'm not on the latest version, and then I'll see if I can make a testcase for a bug report
14:11 Grinnz in that case, i have a trap on SIG{__WARN__} and i just use warn ;)
14:11 batman ZoffixWork: i doubt that's sass version is the issue.
14:11 Grinnz but that wouldn't work well for debug, for instance
14:12 batman ZoffixWork: i could set up the test case myself, but i don't have time :(
14:12 batman please file a report when you have and i will fix the bug later tonight.
14:18 sh4 joined #mojo
14:37 sopanshewale joined #mojo
14:39 ZoffixWork batman, done: https://github.com/jhthorsen/mojolicious-plugin-bootstrap3/issues/5
14:40 ZoffixWork batman, there are two issues really. Not sure if they're related.
14:40 ZoffixWork Even if I change bootstrap.scss and get _variables.scss to load, I have to nuke public/packed every time I make any change to _variables.scss
14:40 Corgi joined #mojo
14:42 batman thanks!
14:46 batman reproduced. no idea why this doesn't happen in the other app i'm working on :(
14:47 CromeDome joined #mojo
14:50 berov left #mojo
14:51 batman ZoffixWork: and you haven't bundled M::P::AssetPack or something? you only have one version installed?
14:53 batman think i got it now!
14:54 ZoffixWork nope, not bundled.
14:57 berov joined #mojo
14:57 njlg joined #mojo
14:58 lluad joined #mojo
14:59 berov joined #mojo
15:05 kivilahtio_ joined #mojo
15:18 batman ZoffixWork: can you do cpanm https://github.com/jhthorsen/mojolicious-plugin-assetpack/archive/master.tar.gz and let me know if it fixes the issue?
15:18 batman it is tested, but i just want to be sure.
15:20 batman let me know when i can release
15:20 batman that was one ugly bug btw. sorry for not noticing before :(
15:21 ZoffixWork batman++ # works now :)
15:21 batman awesome!
15:23 cpan_mojo Mojolicious-Plugin-AssetPack-0.60 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.60
15:39 talexb joined #mojo
15:57 absolut_todd joined #mojo
16:01 absolut_todd joined #mojo
16:01 meshl joined #mojo
16:16 disputin joined #mojo
16:19 sri the security issue btw. is that ->log needs to be hidden from the router https://github.com/kraih/mojo/pull/832#issuecomment-133060064
16:22 sri too bad there is no test case https://github.com/kraih/mojo/issues/833
16:23 dod joined #mojo
16:24 Grinnz_ what do you mean "hidden from the router"?
16:25 sri https://github.com/kraih/mojo/blob/master/t/mojolicious/app.t#L94
16:29 jontaylor just for fun to see if I understand, is this so that the router doesn’t think that built in methods are user made controller actions?
16:29 sri yes
16:30 Grinnz_ ahh
16:33 jontaylor i imagine helpers don’t cause the same problem because they use autoload?
16:33 Grinnz_ right
16:34 sri correct, one of the reasons non-essential methods have been moved from Mojolicious::Controller into helpers
16:36 jontaylor hmm, is there a security concern then if I make methods in a controller that aren’t controller actions? For example if I abstract looking up an object from a DB into a method ?
16:37 jontaylor or is this only an issue for Lite apps?
16:38 sopanshewale joined #mojo
16:43 genio Why wouldn't that be in your Model?
16:43 genio which is a helper
16:45 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Optional-placeholders
16:46 Grinnz_ yeah its cause of the :controller and :action placeholders
16:46 Grinnz_ which i think are silly :)
16:47 Grinnz_ if you're not using those it should be fine
16:47 jontaylor previously i’ve pulled a line out of a controller action into another method in the controller purely so I can test it more easily later on
16:47 jontaylor without realising it could be a concern
16:51 eitz joined #mojo
16:52 jontaylor => All uppercase methods as well as those starting with an underscore are automatically hidden from the router
16:52 Grinnz_ yea, underscore methods are a good way to be safe with those
16:53 Grinnz_ it's a convention for private methods in general anyway
16:53 jontaylor yep so all my code is fine, turns out its fine anyway as I don’t use :action in my routes anywhere too
17:00 sri oh wow, scummy cdns are already cheating to make http/2 look better than http/1.1 :o http://www.http2demo.io/
17:01 sri they actually Connection: close for http/1.1 and cause TLS renegotiation for every tile
17:01 Grinnz_ haha
17:01 Grinnz_ benchmarks!
17:04 sri oh my, and apparently they used servers with different latency
17:05 sri this is a CDN you should never use
17:06 * batman likes cloudflare (if that wasn't obvious already, hehe)
17:08 sri this seems closer to reality https://http2.akamai.com/demo
17:13 KCL_ joined #mojo
17:30 njlg joined #mojo
17:33 esh joined #mojo
17:36 PryMar56 joined #mojo
17:39 sopanshewale joined #mojo
17:51 meshl joined #mojo
17:53 amon joined #mojo
17:56 berov1 joined #mojo
18:01 jontaylor joined #mojo
18:01 meshl joined #mojo
18:10 henq joined #mojo
18:39 KCL joined #mojo
18:46 njlg joined #mojo
18:51 buu sri: When I load the .io one the /1.1 takes 2.84s and the /2 takes 2.54, heh
18:52 sri buu: it's very very inconsistent apparently
18:52 sri bad CDN i guess
18:53 sri in fact, now i actually get Connection: keep-alive sometimes for the images over http/1.1
18:54 buu Yeah doing a ctrl-r gives me really strange results
18:54 sri this is really not how you showcase your cdn
18:54 hernanGOA ctrl f5
18:55 sri not that i like akamai much, they are responsible for a lot of the bad stuff in the http/2 spec
18:58 * sri would still like to write a nice http/2 implementation for perl
19:09 gryphon joined #mojo
19:23 njlg joined #mojo
19:26 njlg joined #mojo
19:40 njlg joined #mojo
19:51 zackiv31 joined #mojo
20:17 sri hmm, cpantesters dead? http://matrix.cpantesters.org/?dist=Mojolicious+6.16
20:18 sri oh http://www.cpantesters.org/index.html
20:18 sri that site could really use some love
20:19 hernanGOA and some sponsor
20:19 hernanGOA (dont know if there is any already)
20:19 sri you can donate on gratipay https://gratipay.com/for/perl/
20:21 hernanGOA havent donated there, but i donated $300 to EPO and standard "sponsored" yapc 2 years ago
20:21 hernanGOA its time to give more back again
20:27 ajr_ joined #mojo
20:29 henq joined #mojo
20:30 marty joined #mojo
20:41 zackiv31 joined #mojo
20:53 njlg joined #mojo
21:02 Onigiri joined #mojo
21:03 meshl joined #mojo
21:03 absolut_todd joined #mojo
21:08 Grinnz_ cpantesters has been down for a week or so :/
21:10 Grinnz_ well, since the 16th, i guess
21:22 henq joined #mojo
21:24 meshl joined #mojo
21:34 meshl joined #mojo
21:43 elik joined #mojo
21:43 meshl joined #mojo
21:53 meshl joined #mojo
21:54 jabberwok joined #mojo
22:05 meshl joined #mojo
22:10 njlg joined #mojo
22:14 meshl joined #mojo
22:17 melo joined #mojo
22:20 flamey joined #mojo
22:22 meshl joined #mojo
22:35 meshl joined #mojo
22:45 meshl joined #mojo
22:53 meshl joined #mojo
22:54 sri bummer
22:54 sri i really wanted to look at a fail result from cpantesters
22:55 sri there was something that seemed related to https://github.com/kraih/mojo/issues/833
22:55 spicyjack sri: maybe google cached your test?
22:56 sri i don't have the url
22:56 spicyjack sri: sort of doubtful, but might be worth a look
22:56 Grinnz_ cpantesters has been down since before the last release
22:56 spicyjack who gets your cpantesters e-mails?
22:56 Grinnz_ the person who did the upload i would guess
22:57 spicyjack I think the module owner also gets them
22:57 sri the change was a year ago
22:57 Grinnz_ ah
22:57 spicyjack I comaint, so I get them, and the owner of the modules also sees them
22:57 sri https://github.com/kraih/mojo/commit/959157c767c93e777d32e1b778103adce5c8cd65#diff-4e1bdb34da448764c931ba03e53f8feeL130
22:58 sri wow, i still remember making that change... soooo long ago :o
22:58 sri would have thought it was like maybe 3 months
23:02 henq joined #mojo
23:05 meshl joined #mojo
23:15 meshl joined #mojo
23:24 meshl joined #mojo
23:35 meshl joined #mojo
23:45 meshl joined #mojo
23:56 meshl joined #mojo

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