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

IRC log for #mojo, 2016-05-09

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

All times shown according to UTC.

Time Nick Message
00:25 sri curious how nobody seems to be using ubuntu on windows yet
00:26 bpmedley My SSD for playing around is bricked, I think..
00:28 sri now that i'm playing with windows i'm starting to wonder if maybe i should have gone for the 512mb ssd ;p
00:31 frogz joined #mojo
00:31 bpmedley https://eshop.macsales.com/shop/ssd/owc/macbook <-- sri, maybe these people can help with a ssd addon
00:31 sri hahahaha
00:32 sri it's a new macbook
00:32 bpmedley Hrrm, might be worth an email..
00:33 sri it looks like this on the inside https://www.ifixit.com/Teardown/Retina+MacBook+2016+Teardown/62149
00:33 bpmedley That is art, for sure..
00:34 sri there's no upgrading
00:36 sri only thing you can do is pay 230 euro extra upfront to get the big ssd
00:36 bpmedley http://www.theverge.com/2016/1/4/10708016/samsung-portable-ssd-t3-ces-2016 <-- Something like this might be possible?
00:40 sri i think that's actually possible, but those are still expensive too
00:48 * sri puts it on his amazon wishlist though :)
01:01 jontaylor joined #mojo
01:04 frogz joined #mojo
01:25 nicomen joined #mojo
01:32 frogz joined #mojo
01:57 frogz joined #mojo
02:13 noganex joined #mojo
02:24 frogz joined #mojo
02:52 frogz joined #mojo
03:17 frogz joined #mojo
03:42 frogz joined #mojo
03:58 PryMar56 joined #mojo
04:02 jontaylor joined #mojo
04:08 frogz joined #mojo
04:10 lluad I have one of the previous generation of those (for VMs and databases to live on) and it's nice. Runs a little warm, but it's nice and fast.
04:31 frogz joined #mojo
04:45 ribasushi joined #mojo
04:47 irqq joined #mojo
04:56 frogz joined #mojo
05:20 frogz joined #mojo
05:39 dod joined #mojo
05:43 cpan_mojo Mojolicious-Plugin-UnicodeNormalize-1.20160509 by CHROMATIC https://metacpan.org/release/CHROMATIC/Mojolicious-Plugin-UnicodeNormalize-1.20160509
05:44 dod joined #mojo
05:44 frogz joined #mojo
06:09 frogz joined #mojo
06:10 dod joined #mojo
06:33 frogz joined #mojo
06:48 henq joined #mojo
06:57 frogz joined #mojo
07:04 AndrewIsh joined #mojo
07:21 frogz joined #mojo
07:46 frogz joined #mojo
07:52 jontaylor joined #mojo
07:53 henq joined #mojo
07:56 Dandre joined #mojo
08:10 frogz joined #mojo
08:12 Vandal joined #mojo
08:29 osfabibisi joined #mojo
08:32 punter joined #mojo
08:34 frogz joined #mojo
08:38 punter sri: My apologies for yesterday. I didn't mean to upset you. I just wasn't aware of how strong my wording was. I'll be more careful in the future.
08:59 frogz joined #mojo
09:23 meshl joined #mojo
09:23 frogz joined #mojo
09:47 frogz joined #mojo
10:04 irqq joined #mojo
10:11 frogz joined #mojo
10:25 reneeb joined #mojo
10:27 Kripton joined #mojo
10:36 frogz joined #mojo
10:38 meshl joined #mojo
10:53 kaare joined #mojo
10:55 dvinciguerra_ joined #mojo
11:00 frogz joined #mojo
11:07 tchaves joined #mojo
11:24 frogz joined #mojo
11:48 frogz joined #mojo
12:05 punter joined #mojo
12:13 frogz joined #mojo
12:37 frogz joined #mojo
12:41 dustinm joined #mojo
12:41 coolo joined #mojo
12:43 gizmomathboy joined #mojo
12:53 iliyarey joined #mojo
13:01 frogz joined #mojo
13:04 asarch joined #mojo
13:05 ramortegui joined #mojo
13:25 iliyarey Hey guys. can anyone help me with some test im running? is there any way I can get the result of an get_ok() method?
13:25 frogz joined #mojo
13:26 batman iliyarey: $t->tx->res;
13:27 iliyarey Oh, that was simple. Thanks batman!
13:27 batman it often is simple in the mojo world, hehe :)
13:47 orev joined #mojo
13:50 CHYC_ If the following doc patch is unsuitable for inclusion then that's fine, but I wouldn't mind knowing either way. It certainly would have helped me immensely https://github.com/chy-causer/mojo/commit/c670a32f38398b6b124c7ea2a42297cc7f2a70d3
13:50 frogz joined #mojo
13:53 jberger CHYC_: does that improve upon http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Under
13:53 jberger The tutorial is a minimal getting started for the most part
13:55 jberger I would expect to find advanced concepts in "under" in the routing guide and indeed that's where it is
13:55 CHYC_ I guess it's where to draw the line as to what constitutes advanced concepts.
13:58 jberger Nonblocking is barely mentioned in the tutorial and each tutorial section is very small
13:58 jberger The under section might already be the longest
13:58 jberger I think I'd vote -1 tbh
13:59 jberger Though i appreciate the effort
13:59 * jberger dislikes turning down effort
13:59 jberger CHYC_: perhaps could that example become a blog post?
13:59 CHYC_ jberger: No offence taken at the -1.
14:00 jberger We're always happy for blog posts with interesting examples
14:01 gryphon joined #mojo
14:02 CHYC_ Given that the two examples are similar but not identical, is Mojo::IOLoop->timer with cb more idiomatic than $c->delay with $delay->begin?
14:03 jberger I think it might be that way in the guides for pedagogical reasons
14:04 bpmedley CHYC_: A blog post would be sweet
14:04 jberger The delay helper hasn't been introduced yet
14:04 jberger For a blog post i would certainly use the helper
14:04 jberger Since it will handle errors with a 500 rather than no response
14:11 CHYC_ Writing prose does not come naturally for me, but certainly the more stuff online to help people like me wouldn't hurt :). jberger, I've read most of your blog posts, which are great, but unfortunately seem to be for Mojolicious 5 and are a little different to how you'd use Mojolicious today :(
14:12 jberger yeah, I should go back and update old posts :(
14:12 jberger maybe I should just collect them into a book :P
14:13 CHYC_ Ctrl+P :)
14:13 jberger CHYC_: prose isn't hard though
14:14 jberger pretend you had a friend sitting next to you and explain your example post to them
14:14 bpmedley The examples portion of the mojo book i started could be expanded.. With proper credit given.. :)
14:14 frogz joined #mojo
14:14 jberger that's usually how I try to write blog posts
14:14 preaction not everyone finds prose easy though :p
14:14 jberger preaction: sure, I know, I'm just giving a little pointer
14:15 Kripton joined #mojo
14:34 PryMar56 joined #mojo
14:37 cpan_mojo Mojo-IRC-Server-Chinese-1.7.8 by SJDY https://metacpan.org/release/SJDY/Mojo-IRC-Server-Chinese-1.7.8
14:38 frogz joined #mojo
14:49 meshl joined #mojo
14:50 henq joined #mojo
14:52 good_news_everyon joined #mojo
14:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vrexd
14:52 good_news_everyon mojo/master 6d52202 Sebastian Riedel: Perl 5.24 has been released
14:52 good_news_everyon left #mojo
14:58 iliyarey Is there a way to disable the colon placeholder for the routing?
14:59 sri yes https://github.com/kraih/mojo/blob/master/t/mojolicious/routes.t#L218
15:00 jberger :o
15:00 jberger TIL
15:00 sri it's pretty low level though
15:03 frogz joined #mojo
15:27 frogz joined #mojo
15:37 sri looks like perl 5.24 is a little fater than 5.22
15:38 sri 2317 rps vs 2201 rps
15:41 sri gotta love the new macbook, for microhttp.pl i get up to 26248 rps
15:41 sri i mean microhttpd.pl ;p
15:42 sri with the old one it was around 16k i think :o
15:42 bpmedley Oh wow!  That validates the purchase..
15:42 preaction now i'm jelly. i gotta wait for the new mac mini if they make one...
15:46 lluad They seem to have stopped making good mac minis. Guess they were cannibalizing the iMac market.
15:48 preaction they were last refreshed a couple years back, and a couple years before that, etc...
15:49 preaction i mean, that's the point of the thing. for those who can't afford the 2x imac and already have a apple cinema display or junk
15:49 lluad Yeah, they discontinued the quad core i7. The new ones are _nice_, but only dual core i5 nice.
15:50 frogz joined #mojo
15:51 preaction eh. i'd be replacing a core 2 duo, so it'd be an upgrade either way
15:51 lluad Yeah. And the GPU is nice in the new ones too.
15:51 sri apple's product lineup is a bit weird now
15:52 sri still selling the non retina macbook pro
15:52 lluad It is.
15:52 lluad Macbook Air is still around.
15:52 sri yea
15:52 preaction wow... my mini is from 2007. i've never had a computer last that long...
15:53 Grinnz_ depends how you define "computer", some of my hard drives are from 2006ish...
15:53 sri not bad
15:54 preaction Grinnz_: main board. cpu+motherboard combo. replace any bit of that, and you've got a new computer
15:54 lluad I have a server from the late 90s that's still working. Given the electricity burns vs the oompt it provides I don't power it up very often, though. :)
15:54 Kripton joined #mojo
15:54 Grinnz_ preaction: hmm... I replaced CPU, motherboard, and GPU alternating about every year or so...
15:55 preaction yeah, that's not an old computer at all
15:55 Grinnz_ haven't reinstalled windows since like 5 years ago though
15:56 sri until last year i had a sparcstation from 1999 that still worked
15:57 sri good old sun :,(
16:05 sri intersting how postderef is enabled by default in 5.24
16:10 jberger it didn't syntactically conflict with anything
16:10 jberger postderef interpolation is still protected by feature though
16:11 jberger "$aref->@{qw/two items/}" doesn't work without feature
16:19 frogz joined #mojo
16:23 osfabibisi joined #mojo
16:27 henq joined #mojo
16:30 dod joined #mojo
16:48 henq joined #mojo
17:03 dantti_laptop joined #mojo
17:29 genio sri: Did this happen for you on your Mac with:   perlbrew install perl-5.24.0     https://gist.github.com/genio/ff5004e580fdf078c592894e1539e2c3
17:30 sri genio: no
17:30 genio hrm :/
18:27 frogz joined #mojo
18:54 Kripton joined #mojo
19:09 frogz joined #mojo
19:29 frogz joined #mojo
19:44 sri so, i got ubuntu for windows installed
19:44 sri and nothing works :S
19:44 sri can't install anything with cpan, all broken
19:45 jberger sri: I think genio knows something about that
19:45 sri yea, he warned me
19:46 genio sri: Hang on.  There's something you need to patch to get going
19:46 sri and it eats disk space like crazy
19:46 sri just windows + ubuntu is 35gb
19:46 jberger meanwhile I am trying to use advisory locks in minion to lock a resource, and it seems that Minion::Worker/Job etc don't keep the db connection and so the advisory lock is dropped
19:46 jberger :(
19:47 genio sri: https://github.com/Microsoft/BashOnWindows/issues/186  The bottom of this issue has the fix for File::Find which will then allow installing things
19:47 sri that's correct, advisory locks are pretty silly
19:48 jberger blast, that's what I get for making a toy example first
19:48 genio Basically, Ubuntu on Windows isn't quite linux-y enough yet.
19:49 genio s/fix/temporary work-around/
20:05 irqq joined #mojo
20:20 frogz joined #mojo
20:21 Grinnz_ joined #mojo
20:25 sri genio++ # it worked
20:25 genio \o/
20:25 sri and i have confirmed that hypnotoad zero downtime upgrades work on windows now
20:25 cpan_mojo Mojolicious-Plugin-AssetPack-1.08 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.08
20:26 batman ^^ now with support for jpeg and png files :)
20:26 sri after getting notifications for garbage microsoft wants me to buy at least 3 times
20:27 pink_mist sri++
20:36 bpmedley batman++
20:37 meshl joined #mojo
20:39 batman bpmedley :)
20:39 batman just need to get some feedback on the default settings... they are probably not the best :/
20:43 meshl joined #mojo
20:45 punter joined #mojo
20:53 jberger sri++ very cool
20:59 frogz joined #mojo
21:04 frogz_ joined #mojo
21:11 jberger wow autarch is really finding odd ones: https://github.com/kraih/mojo/pull/955
21:15 sri yea, that's another -1 from me i guess
21:15 sri the explanation is just not good enough
21:16 jberger when would $0 not be a file on disk?
21:16 sri yea, he didn't go into any detail
21:17 haarg it can be changed to change what PS reports
21:17 haarg fucking autocorrect
21:17 haarg ps
21:17 sri we know, but when does that happen in a mojolicious app?
21:17 pink_mist jberger: perl -E 'say $0'
21:18 haarg starman does this for example so you can tell the difference between workers and master
21:18 sri and then why would you rather want to load FindBin late?
21:18 pink_mist jberger: or even just $0 = "this is not a file on disk";
21:19 jberger sri: he answers that, he says that he can guarantee that the first code path with give him a result and so he doesn't get to the fallback
21:19 jberger but I think that makes it a heisenbug for the next guy
21:19 sri that's silly
21:19 sri exactly
21:20 jberger I commented as much
21:21 haarg I don't have opinions on the pr, was just answering jberger's quesion
21:22 haarg I generally hate FindBin, but the PR seems like probably the wrong solution
21:24 sri he might even be using psgi and starman
21:24 sri since morbo and hypnotoad preload FindBin anyway
21:25 jberger I was wondering about that
21:26 jberger I have no idea what he's talking about
21:27 irqq joined #mojo
21:28 sri reads like "no, you're wrong" to me, in a lot of words
21:28 sri without actually elaborating on it
21:29 sri i have to question his motivation for bringing up these weird pull requests
21:30 sri maybe he wants it to look like we don't care
21:30 sri to sell a switch to a different framework
21:31 sri those pull requests are just too weird
21:32 haarg yeah, having different use cases is so bizarre
21:33 sri we don't know his use case
21:35 autarch joined #mojo
21:35 sri but i'l stay out of it from now on
21:36 autarch wow, sri, that's pretty harsh
21:36 autarch we're using mojo at work, this is a real issue I encountered
21:36 autarch this is not some ploy
21:37 autarch anyway, I agree that maybe the PR is the wrong solution - it would be even better if Mojo::Home avoided FindBin entirely
21:38 autarch I'm not deep enough in the core to know exactly what surgery would be needed - I did suggest an alternative approach in the PR discussion - if the entry point to a mojo app can capture and store cwd() then Mojo::Home can use that later rather than relying on FindBin and $0
21:39 autarch FindBin should really only ever be used in context of a script writing - use lib "$FindBin::Bin/../lib"
21:40 pink_mist what makes you say that FindBin should only be used by a script?
21:40 autarch pink_mist: well, this is one good example
21:41 autarch the specific use case here is that https://metacpan.org/pod/WebService::PayPal::PaymentsAdvanced::Mocker creates a Mojolicious::Lite app internally
21:41 autarch the app is specifically for use inside test code
21:42 autarch basically FindBin relies on some state that you can't rely on outside of "right when my script starts up"
21:43 jberger sri: I wouldn't jump that direction, lets assume good faith
21:43 autarch the strategy that Mojo::Home uses when given a class name (look in $INC and find what contains lib/) is a bit saner
21:45 * jberger tries to replicate
21:45 autarch jberger: I wrote a test to demonstrate the issue in the PR
21:46 sri jberger: yea, i'll leave it alone
21:46 sri fighting with windows got me really annoyed today
21:46 autarch my job doesn't pay me to troll mojo
21:47 jberger oh a job that pays to troll might be kinda fun :-P
21:47 autarch we have a fairly complex code base with a lot of moving parts and a really big test suite, sometimes I find some weird issues and try to fix them
21:47 sri since some people seem outraged by my behavior i'll give myself a timeout
21:48 sri left #mojo
21:50 jberger autarch: sorry, I'm not commenting, I'm really thinking about it
21:50 autarch that's cool
21:50 autarch if we could do the alternative fix i suggested, maybe point me at where to start - I don't know the internals quite well enough to figure out if that could work
21:52 jberger for the record, sri has given himself a tempban under our own code of conduct, just in case anyone is wondering
21:53 jberger a good demonstration of our code of conduct applying to even ourselves
22:05 jberger annoyingly, github search excludes the symbol $
22:05 jberger so I'm putting together a quick set of ack results for assigning to $0
22:05 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/Server/Hypnotoad.pm#L42
22:05 jberger (note that the line above that reads from $0)
22:06 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/Server/Morbo.pm#L45
22:06 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/Server.pm#L46
22:07 jberger actually I wonder if something like that last one could be useful in Mojo::Home?
22:08 autarch I really do think getting rid of using FindBin entirely would be ideal
22:08 autarch also, if you're going to set anything why not just set $ENV{MOJO_HOME}?
22:09 * autarch goes to dig up the stack trace ... I'm not sure we hit Mojo::Server or Morbo
22:09 jberger you would almost certainly hit Mojo::Server at least
22:09 jberger it is possible not to
22:10 autarch ah, yeah, Mojolicious::Lite will load Mojo::Server eventually
22:10 autarch but this died _before_ calling anything in Mojo at all, loading Lite loads ... which eventually loads Mojo::Home, which loads FindBin, which dies
22:11 jberger Mojo::Server::Hypntoad is the only place in the code that reads from $0 directly
22:12 jberger and Mojo::Home and Mojo::Server are the only places that use FindBin
22:12 autarch reading $0 in code that is expected to be invoked directly from the CLI is entirely reasonable
22:12 autarch reading $0 in random library code is not
22:12 autarch in an extreme case you could be a Perl interpreter embedded in a larger C program or something
22:12 jberger hypnotoad makes lots of these things very complex
22:13 jberger since the mechanism for hot-reloading preforking servers basically leaves you very little state that can move between processes
22:13 autarch env vars?
22:13 jberger thats the other place, yes
22:14 jberger I'm having to get my mind back into that space
22:14 autarch I mean, hypnotoad is setting some env vars there too - but anyway, the hypnotoad thing is not the issue - it's CLI code, right?
22:14 jberger I've been deeply into SQL (probably too deeply tbh)
22:14 jberger autarch: for the most part yes
22:14 jberger I mean you probably can load the module if you want, but I can't think of too many reasons to do so
22:15 autarch the most correct fix I can think of is that all CLI code should set MOJO_HOME as early as possible
22:15 autarch and Mojo::Home should just not use FindBin at all
22:15 jberger Morbo shouldn't matter here either, Morbo is the development (read: not for testing or production) server
22:15 autarch I suspect that'd let you remove the wacky FindBin stuff in Mojo::Server too, which I assume exists purely to make Mojo::Home happy
22:16 jberger actually I suspect (but don't know for sure) that all of that is to support hypnotoad
22:16 autarch the only place that uses FindBin besides calling FindBin->again is Mojo::Home, AFAICT
22:17 autarch FindBin->again just forces FindBin to go through its "set the package vars like $Bin" dance again
22:18 autarch it doesn't actually return a result or have any other side effect
22:20 jberger I wonder if the problem with setting MOJO_HOME is that you want to give the application a chance to set that env var too
22:21 mishanti1 jberger: At least at my $work we've (perhaps ab)used setting MOJO_HOME.
22:22 Grinnz_ our application sets $self->home in startup (using a common function elsewhere which uses Mojo::Home...)
22:23 mishanti1 I do recall some apps doing stuff to that env-var in projects where the structure was not really "mojo-ish" or something. *fuzzy memory*
22:24 autarch jberger: maybe set the env var if it's not set already?
22:24 autarch that seems reasonably safe
22:25 jberger except that I don't think that is the load order
22:26 autarch well, in that case it's even safer, right? if your code wants to set it to something else that's fine
22:28 autarch if you set MOJO_HOME to something insane that would already break Mojo::Home, regardless of the change we're discussing, because Mojo::Home always prefers the env var
22:30 jberger so I'm trying something else out
22:30 jberger the question I think is what to do if loading FindBin fails
22:31 jberger the biggest concern I have for your initial patch is that it won't prevent a failure, just kicks the can down the road far enough for you guys
22:32 autarch that's a fair point
22:32 autarch like I said, using FindBin this way is just wrong
22:32 meshl joined #mojo
22:32 jberger http://paste.ubuntu.com/16326215/
22:33 jberger right, but until I could really do a deep dive I don't know what removing it would do
22:33 jberger ^^ that's a patch on top of yours
22:33 jberger I have no idea what sri would think of it
22:33 autarch yeah, that seems suboptimal ;)
22:33 jberger but I like it a little bit more
22:33 autarch now you've kicked the can even _further_ down the road
22:34 jberger right, to when someone tries to actually use $home and it doesn't know anything
22:34 jberger :s
22:34 autarch exactly, that seems just as problematic as my version
22:34 jberger maybe it should just die at that point?
22:34 autarch is that ok in Mojo-land? if so, then yes, that seems sane
22:34 autarch maybe do that for now and plan to excise FindBin later with a better solution
22:36 Grinnz_ as a point of reference, it would be a breaking change for our project to move the FindBin logic to the shipped scripts, because we use our own scripts to kick off morbo/hypnotoad for various reasons (but that could also be argued to be my own fault :)
22:37 autarch Grinnz_: what do you mean by move the FindBin logic?
22:37 autarch I'm suggesting that any code called from CLI scripts should set MOJO_HOME early to a sane value - that'd keep Mojo::Home working and remove the need for it to use FindBin at all
22:37 Grinnz_ we don't currently do anything with MOJO_HOME
22:38 autarch you wouldn't have to under my proposal either
22:38 autarch I'm saying something in the Mojo core should set MOJO_HOME - whatever the entry point for scripts is
22:38 autarch for example whatever app->start calls
22:38 Grinnz_ the entry point for scripts is Mojo::Server's constructor/run method
22:39 Grinnz_ or Mojo::Server::Daemon more specifically
22:39 autarch ->run should set it, not ->new
22:40 jberger this is a patch I'm thinking about now
22:40 jberger http://paste.ubuntu.com/16326420/
22:40 jberger but I have to commute
22:40 jberger back in a bit
22:41 Grinnz_ Mojo::Server::Daemon constructs the app as passed to run
22:41 Grinnz_ this is where the home is set IIRC
22:41 autarch jberger: maybe add something like "this can happen if $0 is set to a value that is not the same as the script that started your application"
22:41 jberger still seems to me like this is a bug in FindBin ... at least to some amount
22:42 autarch well, it is, but it's unfixable
22:42 autarch it's not so much a bug as a design flaw
22:42 autarch but AFAIK FindBin was only ever designed for scripts to use to set lib dirs
22:42 Grinnz_ er, Mojo::Server::Morbo and Mojo::Server::Hypnotoad each *contain* a Mojo::Server::Daemon and construct the app themselves, actually
22:44 autarch FindBin is a perfectly good hack for use in scripts, and not really usable for libraries, frameworks, etc.
22:44 Grinnz_ with ->load_app on the daemon
22:44 Grinnz_ that's where that FindBin->again you saw happens
22:46 jberger Oh and that should probably be -d in my patch
22:46 Grinnz_ yeah
22:46 autarch ah, right
22:47 Grinnz_ if that check is even needed; I would assume if it didn't die then it found a valid directory
22:47 jberger Literally writing that up as i was packing up to leave ;p
22:47 jberger Grinnz_: probably right
22:47 punter joined #mojo
22:51 autarch I'm going to be afk but I'll stay in the channel, and I'll be around tomorrow too
23:19 frogz joined #mojo
23:48 frogz joined #mojo
23:56 trwww joined #mojo

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