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

IRC log for #mojo, 2016-07-14

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

All times shown according to UTC.

Time Nick Message
00:02 jberger sri: there are stories that pokemon go is actually a spy-agency ploy to get photographic data from places they can't easily image
00:02 * jberger puts on tin-foil hat
00:08 Vitrifur joined #mojo
02:10 genio http://gizmodo.com/samsung-finally-gave-us-the-laptop-apple-should-have-1783121461  hrm.  I wish there was somewhere around that I could play with one
02:15 preaction why does it need to be spy-agency ploy? Google wants that data too
02:16 ningu joined #mojo
02:16 ningu if I have MyApp::Controller::Foo, every request will create a new instance of that object, right?
02:17 ningu if it's dispatched to it, I mean
02:20 jberger yes
02:21 ningu ok
02:22 ningu was just going through the code to confirm :)
02:24 sri genio: lol
02:26 sri i like what samsung did with their phones... but that laptop looks hoorible
02:27 genio only for the trackpad claims
02:27 genio I don't care about much else as long as it functions
02:28 Grinnz a decent 13" laptop, sign me up
02:28 Grinnz i had to settle for 15.6" for this one because the only 14" i could even find with what i wanted was a razer
02:28 * sri likes the 13" macbook pro
02:29 Grinnz that said, I don't plan to buy another laptop for the forseeable future
02:29 ningu 13" macbook pro is what I use
02:29 ningu sdd, lots of RAM
02:29 ningu ssd*
02:29 Grinnz the optimus stupidity with the video card has really put me off them and I don't really need a laptop for any reason
02:29 genio I'm still using my 2011 15" MBP.  I doubt I'll buy a new one until this one's dead, dead, dead
02:30 genio 16 GB ram, 500 GB SSD, 2.2 GHz i7
02:30 sri really the only thing i'm missing is a dgpu
02:31 genio AMD Radeon HD 6750M 512 MB  could be better
02:32 sri think the iris 6100 in mine is actually better than that
02:32 genio you probably also have a retina display, which I do not
02:32 sri oh
02:32 * sri considers retina display a must have now
02:33 genio yea, this thing's old. "late 2011"
02:33 sri text is sooo frickin crisp
02:34 genio and oops, only a 480 GB SSD, not 500
02:34 genio but honestly, with the SSD, this things feels soo much faster than it used to.  I don't feel the need to get a new machine
02:34 sri i never thought it would make such a big difference for programming, but it's so much nicer on the eyes when you're looking at code all day long
02:36 sri going from blurry text to retina feels a bit like the feeling of going from hdd to ssd back in the days ;p
02:37 genio haha.  if my mac ever dies, I might find out about that :)
02:37 sri it's not as impressive with windows actually
02:39 sri the default 4:1 scaling in os x is what makes it so breath taking
02:47 noganex_ joined #mojo
04:05 asarch joined #mojo
04:36 prajith joined #mojo
05:22 anton joined #mojo
05:34 ningu is Mojolicious::Plugin::Database the/a recommended way to handle a database connection in Mojolicious?
05:37 preaction which database? Postgres should use Mojo::Pg. otherwise, dunno, never used it
05:37 ningu yes, postgres
05:37 ningu ok
05:37 Grinnz that plugin is pretty much useless IIRC
05:38 ningu ok
05:38 ningu Mojo::Pg looks reasonable
05:39 ningu can I (for now) just get the dbh and use plain DBI calls with it?
05:39 preaction if you're doing that, why not just use dbi?
05:39 ningu because of preforking issues
05:39 Grinnz if you're just doing queries with DBI, you can just use ->db->query instead
05:39 ningu hmm... ok
05:40 ningu I will see
05:40 preaction dbi has preforking issues?
05:41 ningu I also would like to use a connection pool if possible, or maybe that "just works" with hypnotoad?
05:41 ningu preaction: https://metacpan.org/pod/DBI#AutoInactiveDestroy
05:41 Grinnz Mojo::Pg handles this if you use ->db only when you need a handle
05:41 ningu ok, cool
05:41 preaction ningu: why are you creating database connections before you fork then?
05:42 Grinnz AutoInactiveDestroy should really be default in DBI, only isn't for backcompat
05:42 ningu preaction: afaik I am not but figured it was some strange interaction with hypnotoad, because the issue only arises there
05:42 Grinnz anyway Mojo::Pg handles getting you a new connection after fork so it's much simpler
05:42 ningu sounds good
05:43 ningu oh, doh
05:43 ningu I see what's going on now
05:43 ningu I was trying to be "smart" I suppose
05:43 ningu before I understood the prefork issues
05:44 ningu ok, so let me be a little more specific
05:45 ningu I have one main controller in this app and it proxies all requests to a single, global object. it's important not to recreate that object for each request (I could explain why if you want). it's totally fine however for the dbh to be unset when the object is created and only set on the forked children
05:45 ningu I just realized I was not currently doing this because stupidity
05:46 ningu however, once I fix that, I assume it will be ok?
05:46 Grinnz it's generally easiest to store the Mojo::Pg object wherever you want, and not store dbh itself anywhere
05:46 ningu right, that's fine
05:46 ningu I don't need to store it on the global object at all
05:47 ningu well
05:47 ningu I will probably make a copy of it on there, but I can reset it at the start of each request (and this is all sync code)
05:48 ningu a separate question, will memoize (specifically CHI::Memoize) work fine if I run it during Moo's BUILD on the global object that the controller instantiates?
05:48 ningu it is meant to be memoized across all copies of the object on all forked processes. backed by redis
05:50 preaction you're trying to make a singleton via CHI::Memoize using BUILD?
05:50 ningu that is one way to put it, yes
05:51 ningu the important thing is it should be consistently memoized
05:51 ningu however that is accomplished
05:51 preaction how are you using memoize inside BUILD?
05:51 preaction are you memoizing BUILD itself?
05:51 preaction because that won't work
05:51 ningu no, of course not
05:52 ningu I am just calling memoize('foo') inside BUILD
05:52 preaction why would you want to memoize an object method, and more than once?
05:53 ningu because they aren't really object methods in some sense
05:53 ningu they may have different dbh's but the results will be the same for the arguments after $self
05:53 ningu there are only a few of these in the app
05:53 ningu I am having it return a signature for the args after $self so it ignores $self
05:55 ningu this is an attempt to retrofit an old (and huge) CGI app so the internals are a bit suboptimal
06:20 ningu so with Mojo::Pg, do I just call ->db to get a handle in one of the forked children, and use it? I should get it via ->db at the beginning of every request, right?
06:21 ningu and I assume I wouldn't call ->disconnect
06:21 Grinnz correct to both
06:22 ningu ok, cool
06:22 Grinnz doesnt have to be at the beginning of the request, just whenever you need it
06:22 ningu well, yes
06:22 ningu I just meant calling it (at least) once per request is fine
06:22 Grinnz also, ->db isn't a DBI handle, it's a Mojo::Pg::Database object so look at those docs for how to use it
06:22 ningu yes, I read that
06:22 Grinnz it's a container for the dbh though basically
06:22 ningu not sure I fully grok it but that's ok
06:22 ningu yeah, I will migrate to the ->query stuff soon once I get this working
06:43 cuechan joined #mojo
06:56 ningu cool, it seems to be working now. yay
07:08 AndrewIsh joined #mojo
07:13 Vandal joined #mojo
07:26 trone joined #mojo
08:00 jamesaxl joined #mojo
08:15 nothing joined #mojo
08:38 dod joined #mojo
08:43 dod joined #mojo
09:48 mishanti1 joined #mojo
10:08 kid51 joined #mojo
10:11 dod joined #mojo
10:16 stryx` joined #mojo
10:22 stryx` joined #mojo
10:44 kaare joined #mojo
10:59 cuechan joined #mojo
11:15 Slatibart Hi, is there a library/example app which does all the web account creating, reseting of passwords, changing passwords, sending out confirmation account emails  and so on for you. ?
11:19 tchaves joined #mojo
11:24 dotan joined #mojo
11:41 Dada joined #mojo
12:06 pink_mist I'm unsure which of those features Galileo has, but that's the thing I would start looking at
12:06 pink_mist https://metacpan.org/pod/Galileo
12:06 pink_mist Slatibart: ^
12:16 jabberwok Slatibart: as a starting point, also look at http://perltricks.com/article/193/2015/9/18/How-to-send-verification-emails-using-Mojolicious/
12:20 kes joined #mojo
12:36 dod joined #mojo
12:47 nic Grinnz: Re SetUserGroup, I'm thinking _setusergroup should become a noop if the process is already running as the target user (could check group too for completeness I guess)
12:48 nic at the moment it fails if the current user is unprivileged
12:49 nic (this is on linux, separate from the trouble I'm having on a nasty CentOS box)
12:49 nic (heh, "linux" eq 'debian' in my head)
12:53 genio https://metacpan.org/pod/Rethinkdb seems... meh.  *nudges sri to make Mojo::Rethink*
12:53 neilhwatson joined #mojo
13:03 gizmomathboy joined #mojo
13:10 Dada joined #mojo
13:25 dantti_laptop joined #mojo
13:32 marty joined #mojo
13:35 dvinciguerra_ joined #mojo
13:40 mtj joined #mojo
13:59 ashimema joined #mojo
14:33 prajith joined #mojo
14:38 disputin joined #mojo
15:22 PryMar56 joined #mojo
15:26 marty joined #mojo
15:31 Grinnz_ nic: might be doable, but the synopsis gives examples of ways you could check yourself
15:45 nothing joined #mojo
15:57 che-quest joined #mojo
16:01 dod joined #mojo
16:33 asarch joined #mojo
17:05 janus joined #mojo
17:14 dod joined #mojo
17:16 cuechan joined #mojo
17:23 itaipu joined #mojo
17:33 sri maybe we can have a 7.0 release next week
18:15 zelda joined #mojo
18:22 dod joined #mojo
18:59 asarch joined #mojo
19:08 kid51 joined #mojo
19:09 itaipu joined #mojo
19:54 Kripton joined #mojo
20:15 CW2 joined #mojo
21:01 cpan_mojo Mojo-SQLite-0.022 by DBOOK https://metacpan.org/release/DBOOK/Mojo-SQLite-0.022
21:02 pink_mist wonder how much of my mojo stuff will break with 7.0 :P
21:12 jberger not a ton of breakago so far, right?
21:13 jberger breakage even
21:27 wingfold joined #mojo
21:38 jberger https://metacpan.org/pod/Acme::Hodor
21:41 jberger ok so who wants to play spot-the-bug?
21:41 jberger this is a fun one that just happened to us
21:42 jberger plugin SetUserGroup => { user => app->config->{user} || die "user must be in config", group => app->config->{group} || die "group must be in config" };
21:42 jberger your config looks like { user => 'nobody', group => 'nogroup' }
21:43 jberger the code dies with "group nobody does not exist"
21:43 jberger and I'll even give you the hint that SetUserGroup has the line my $group = $conf->{group} // $user;
21:44 jberger and it indeed dies if the group you specify doesn't exist
21:44 Grinnz_ die greedy's up the group param
21:44 jberger yurp
21:45 jberger that is parsed as:
21:45 jberger plugin SetUserGroup => { user => app->config->{user} || die("user must be in config", group => app->config->{group} || die "group must be in config") };
21:45 jberger what an odd language this is
21:50 haarg warn, print, and die all take a list
22:22 jberger it made sense once I worked it out
22:22 jberger but I'm mostly just surprised that it hasn't happened to me before
22:23 jamesaxl joined #mojo
22:25 absolut_todd joined #mojo
22:39 disputin joined #mojo
22:56 dvinciguerra_ joined #mojo
23:13 disputin joined #mojo
23:20 sri genio: afraid there is pretty much no chance i will work on anything rethinkdb
23:21 sri i mean, they'd basically have to hire me to do it, got burned too bad with mongodb
23:22 sri otherwise i'm 100% invested in postgres now
23:42 disputin joined #mojo
23:53 sri re 7.0, are we sure about the code name?
23:55 jberger NERD FACE?
23:55 jberger I like it
23:55 sri i changed it weeks ago
23:56 sri -.-
23:58 sri maybe the novelty has worn off, and we should just get rid of code names

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