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

IRC log for #mojo, 2016-09-03

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

All times shown according to UTC.

Time Nick Message
00:33 sri dave: and kraih#2445
00:34 * sri just hit level 100 and was pleasantly surprised by the rain of loot boxes since levels require less xp again and he immediately jumped to level 103
00:36 sri purl: batman is also http://i.giphy.com/K99PCwPDr9XUY.gif
00:36 purl okay, sri.
00:39 dave done
00:40 dave I'm only 60 myself...impressive to get 100 given how long you've been playing
00:47 sri and i'm still terrible at it ;p
01:14 cafe joined #mojo
02:20 vicash left #mojo
02:37 noganex_ joined #mojo
03:03 bit_shifter joined #mojo
03:16 bit_shifter The "Non-blocking request" example from the Mojo::UserAgent doc hangs the program for ~20 seconds after the "say" call: http://sprunge.us/ALFC?pl .  What am I missing?
03:28 jberger bit_shifter: I'm assuming it is keep-alive on the connection
04:24 disputin joined #mojo
04:48 cas joined #mojo
04:50 cas is there any way to set the default_format in Mojolicious::Lite?  I've got a bunch of routes in an 'under' group that I want rendered as text/plain but I don't want to repeat "format=>'txt'" on every line.
04:51 daemonic joined #mojo
04:53 kaare joined #mojo
05:09 sri put it into the stash in the under declaration
05:10 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#Optional-placeholders
05:16 cas yeah, i'm also trying to avoid writing a sub for each item - most of the are just fixed strings.  i think i've figured out a way to do what i want with just a # placeholder and a bunch of if/elsif statements
05:44 Lee joined #mojo
06:09 ilbot2 joined #mojo
06:09 Topic for #mojo is now ???? nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org | Overwatch!
06:10 omega joined #mojo
06:13 chansen_ joined #mojo
06:13 stephanj joined #mojo
06:13 haarg joined #mojo
06:15 phillipadsmith_ joined #mojo
06:16 stryx` joined #mojo
06:17 trobotham joined #mojo
06:21 mrallen1 joined #mojo
06:21 jehdin joined #mojo
06:22 charsbar joined #mojo
06:22 daemonic joined #mojo
06:23 mfontani joined #mojo
06:26 jberger joined #mojo
06:33 mrEriksson joined #mojo
06:33 robinsmidsrod joined #mojo
06:35 kwa_ joined #mojo
06:35 kwa joined #mojo
06:35 Dandre joined #mojo
06:36 genio joined #mojo
06:36 mgrimes joined #mojo
06:38 dod joined #mojo
06:39 mgrimes_ joined #mojo
06:42 Zx3 joined #mojo
06:42 dod joined #mojo
06:44 marcus finally found some time to watch jberger's cmos interview. Great stuff, jberger!
06:46 genio_ joined #mojo
06:46 Dandre joined #mojo
06:51 mgrimes joined #mojo
06:52 vytas joined #mojo
06:52 stryx` joined #mojo
06:52 sivoais joined #mojo
06:57 genio joined #mojo
07:03 go|dfish joined #mojo
07:03 Dandre joined #mojo
07:05 xdg joined #mojo
07:23 xdg joined #mojo
07:26 Grinnz joined #mojo
07:37 go|dfish joined #mojo
07:50 dod joined #mojo
07:55 mtj joined #mojo
08:12 anton joined #mojo
08:23 anton joined #mojo
09:09 go|dfish joined #mojo
09:10 Jonis joined #mojo
09:16 nicomen joined #mojo
09:36 cuechan joined #mojo
10:40 juikuen joined #mojo
10:49 mishanti2 Has anyone else run into cpanm fetching 02packages.details.txt.gz from a mirror, but not finding a dist/module in the file even though it is clearly listed there?
11:05 pink_mist example?
11:06 mishanti2 It's a private mirror sadly. The weird thing is that the file that cpanm places in it's data directory has the exact same checksum as the file on the server.
11:06 mishanti2 Oh. *facepalm*
11:07 mishanti2 Naturally it cares about the headers, and there is a proxy in between futzing with them.
11:09 mishanti2 "Content-Type: application/octet-stream" !== "Content-Type: application/x-gzip"
11:25 Vandal joined #mojo
11:52 cafe joined #mojo
12:11 irqq joined #mojo
13:07 jberger marcus: thanks!
13:08 cuechan_ joined #mojo
13:42 dod joined #mojo
13:49 mpapec joined #mojo
13:50 mpapec yesterday I was unjustifiably labeled as misogynist from unprovoked channel member
13:50 mpapec http://irclog.perlgeek.de/mojo/2016-09-02#i_13139151
13:50 mpapec at the same time, it was me that was warned to be very careful to what I say next
13:50 mpapec http://irclog.perlgeek.de/mojo/2016-09-02#i_13139238
13:50 mpapec although I didn't call anyone names as before mentioned member did (nor did he received a warning for it)
13:50 mpapec I guess this tells something about evenly applying rules to all members, and keeping high moral grounds
13:59 Riviera joined #mojo
13:59 dod joined #mojo
14:14 asarch joined #mojo
14:22 dod joined #mojo
14:30 haarg thanks for the rule lawyering
14:40 jberger mpapec: i defended your ability to have your political views remember
14:40 jberger nic was told that too
14:41 jberger Your UD link came very close to insulting the spirit of the code of conduct of the mojo project
14:41 jberger Which isn't just about insulting people
14:42 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Contributing#CODE-OF-CONDUCT
14:42 jberger Now if you'll recall, my first action was to try to get everyone to calm down
14:43 jberger That's the first point, friendly and patient
14:43 jberger And i ask for that now too
14:43 genio jberger: Do you think you'll ever want to get back into doing physics research?
14:44 jberger I'd like to but i also enjoy what i do now
14:44 jberger I think I've settled on the dream job being a software consultant for research groups
14:45 jberger Scientists write terrible code
14:45 mishanti2 And often work on cool problems.
14:45 jberger I figure if i could be a line item in a budget proposal it might work out
14:45 jberger Yeah
14:46 genio The renters at my rental home are a married couple where one already has his PhD in physics and the other is finishing hers.  They're likely to move back to Italy upon completion.  Seems like it's hard to find research work still
14:46 mishanti2 I once wrote a C++/QT gui application for peptide analysis for a local university. Pretty interesting stuff. (No, I know nothing about the field).
14:47 jberger genio: the Wikipedia page linked in the post gabor made had an interesting quote
14:47 jberger About losing a generation of scientists because of that budget cut
14:48 jberger It might be right
14:49 jberger I bet two phd students make good renters
14:49 genio My wife has her PhD in BioMedical engineering and does cancer research.  She's also having a hard time with funding right now
14:49 genio jberger: Yea, they keep the house in really good shape.  my only complaint is their lack of yard work
14:49 jberger Gah! Let's not fund cancer research!
14:49 jberger They don't have time for yard work
14:50 genio really nice people too
14:50 jberger My research was in ultrafast instrumentation
14:51 jberger And i can understand cutting on that more than cancer; sigh
14:51 genio I don't quite get cutting research funding.  I get cutting a lot of other superfluous funding, but research?! nah
14:53 jberger All the other funding is some senator's pet project
14:53 genio http://neuroscience.ufl.edu/2016/01/15/drs-lan-hoang-minh-matt-sarkisian-colleagues-publish-in-jan-2016-oncotarget/ <-- I can't even understand the papers a lot of times
14:53 jberger Remember how right after the sequester they exempted air traffic controllers, but only after they all tried to get home for the weekend
14:54 kaare joined #mojo
14:55 jberger "Sonic hedgehog"?!
14:55 disputin joined #mojo
14:56 jberger genio: i assume that's your wife's group. Is that your wife?
14:57 genio yea, that's her
14:57 jberger I went to yapc brasil when it was being coordinated by some grad students, they showed me their work
14:58 jberger They are seriously saving lives with perl
14:58 genio yea, some guy discovered some thing in his cancer research and got to name it. I forget the story of why he called it that, but I think it had to do with his son and his son's love for the sonic game
14:58 jberger genio: neat, my wife is (half) asain as well
14:59 jberger Damn autocorrect asian (what is asain?)
14:59 genio She's Vietnamese but born and raised in France.  heh
15:00 jberger Makes sense historically
15:00 genio yea, her parents fled to Paris during that whole thing (really sad stories there)
15:00 jberger Mmmmm now i want bahn mi
15:00 jberger I'm sure
15:01 jberger My wife was born here but her family was essentially exiled by Marcos
15:01 jberger Her grandfather survived bataan
15:02 jberger Wish they would tell the stories more honestly, but I'm sure it's hard
15:03 genio yea, those kinds of stories are extremely interesting, but always make you feel bad for wanting to know.
15:06 genio There is talk about them getting together soon to go and visit Vietnam.  I'm really looking forward to that (in a year or so)
15:06 jberger That'd be cool
15:06 jberger We keep talking about visiting the Philippines but it is quite a trip
15:07 genio yea, that's the problem for me.  It's one of those trips where you need quite a bit of time to do it properly.
15:07 jberger And Hawaii is so nice abs much closet :p
15:07 jberger I'm not even going to correct that autocorrect
15:08 genio haha
15:11 jberger Anyway in brasil they are using perl to sequence cancer genes and find easily matched patterns so they can quick match them
15:12 jberger Then when you go in for surgery they can quick check tissues to know that they have cut far enough back to actually remove all the cancer cells
15:12 jberger Really amazing
15:20 genio That sounds like an awesome project to work on
15:30 vicash joined #mojo
15:42 jonasbn joined #mojo
15:49 kaare joined #mojo
15:57 jonasbn what is the easiest what to debug how routes and controllers stack up, I have a plugin, which works in several applications and one where it does not
15:58 jonasbn the routes are visible on the 404 page in development mode, but the log tells me that the URL is routes to another controller instead of the plugin
16:25 jberger jonasbn: remember that the first matching route wins
16:25 jberger Maybe you have a wildcard route declared earlier that is catching your request?
16:30 PryMar56 joined #mojo
16:37 jonasbn jberger: have bitten by that once before :-)
16:37 jonasbn jberger: the order presented on the 404 pages, does it reflect the actual order?
16:38 jonasbn I tried removing ALL other routes, no luck
16:51 anton_p joined #mojo
16:53 jberger what do you get from the request?
16:53 jberger it just goes to the wrong controller or you get a 404 or a 500 or what?
16:55 jberger if it is a 404 then I suspect you aren't actually rendering any content
16:56 jberger if it is the wrong controller ...
16:56 jberger what does your plugin do, does it try to mutate the routes?
16:56 * jberger guesses that is the problem
16:56 jberger and it used to kinda sorta work, but not anymore
17:00 jonasbn the plugin provides some standard routes we use on all our applications for Nagios monitoring
17:01 jonasbn so it adds additional routes prior to the setting up of the actual application routes
17:10 jonasbn hmmm I can circumvent the problem by adding the routes manually, I guess that will have to do for now
17:10 jonasbn jberger: as you say, I have to figure out the routing spaghetti of using several plugins on top of each other
17:11 mpapec jberger: as an conclusion, I should not post UD link, but calling me misogynist is perfectly fine
17:11 mpapec sounds reasonable. not :/
17:11 * jonasbn welcomes himself to the magnificent world of modern web applications
17:22 Craftsmanship joined #mojo
17:23 Craftsmanship Is there a named version of delay->begin from Mojo::IOLoop::Delay?
17:24 Craftsmanship the ->begin callbacks seem a tad spooky if you have much going on during the formulation of the steps
17:36 jonasbn jberger: thanks for the help, have a nice weekend
17:36 jonasbn left #mojo
17:38 zivester joined #mojo
17:52 preaction Craftsmanship: what do you mean by named version? like, you want to name the callback and see when it happens in a log or something?
18:23 mpapec it would be great to have helper for Mojo::IOLoop->delay
18:23 mpapec as $self->delay is not of any help when programming websockets
18:24 mpapec perhaps $self->newdelay(..)
18:25 mpapec yes, I can write it myself, but still..
18:32 preaction i don't see how the current delay helper is not of use when using websockets.
18:40 mpapec preaction: dind't look closely but I've had to use Mojo::IOLoop->delay instead of $c->delay
18:40 mpapec in order to work
18:40 mpapec (I'm also using nested loops)
18:41 preaction that starts to sound like a bug, so it'd be good to try to identify it. but if you don't remember, then i wouldn't report it
18:41 mpapec I could try to make smallest possible example of this behaviour
18:42 mpapec possibly it's not bug at all
18:43 polettix joined #mojo
18:46 mpapec I guess there is a reason why https://github.com/jberger/MojoForum/blob/master/lib/MojoForum/Helpers.pm#L144
18:46 mpapec isn't using $c->delay
18:47 preaction my guess would be it pre-dates it
18:48 mpapec from my experience $c->delay is singleton and works great with classic rest urls
18:48 disputin joined #mojo
18:49 preaction MojoForum started in Feb 19, 2014. Delay helper added Jun 30, 2014
18:54 mpapec so there is no use case for Mojo::IOLoop->delay?
18:55 preaction no, there certainly are use-cases. you're not always in a controller method, for example
18:55 preaction you don't even have to be in Mojolicious to use Mojo::IOLoop
18:58 mpapec I think most important part is that $c->delay is singleton
18:59 mpapec and thus not suitable for nesting
18:59 mpapec (loop inside loop)
19:09 anton joined #mojo
19:11 * Craftsmanship looks back at IRC ...
19:12 Craftsmanship I simply mean that the order/nature of calls to ->delay determine the order of arguments to the final callback, which could suck if you made 4 or 5 non-blocking requests in the setup phase
19:13 Craftsmanship it makes unpacking the results tricky
19:13 Craftsmanship if I add another, i have to count how many calls to ->delay I made, and add the   $thing_name_txn in the right place in the arg list of the callback
19:13 Craftsmanship but I guess if I were starting those http requests in a loop it would be even more upsetting
19:15 preaction you could make your own callback that called the callback returned from begin... except you'd have to call begin outside the callback to get the callback for your callback to call
19:15 preaction *deep breath*
19:15 * preaction writes an example
19:16 Craftsmanship delay( sub { $ua->get( $_ => $_[0]->delay_named( $_->host ) for @urls }, sub {  my ($txn) = { $_[0]->result_named('aybabtu.com') ...} );
19:18 Craftsmanship Sure, I could write a thing that keeps track of the indices in both directions, that's true.
19:18 jberger I'm confused too
19:18 jberger $c->delay isn't a singleton
19:19 jberger I do agree that it probably isn't the best for websocket (once you have completed the handshake) but that's because the error handler that the helper sets up is for an http request
19:19 Craftsmanship gah, that should be begin_named
19:20 jberger you can see here that there isn't much in this helper that applies to anything but an HTTP request: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Plugin/DefaultHelpers.pm#L80-L85
19:20 jberger and all that remains is Mojo::IOLoop->delay
19:20 Craftsmanship I'm not sure where the websocket bit came from, I just don't want to have to remember which order I called ->begin in
19:21 jberger sorry, the websocket thing came from mpapec
19:21 jberger named ...
19:22 jberger I guess I can see why you want that
19:22 jberger but I've really never had the need
19:22 Grinnz_ if delays aren't quite doing what you want, you could try Future with Future::Mojo, though be warned you'll have to start from scratch in how to think about things
19:23 jberger once I get very complex behaviors, I usually abstract them into another nonblocking method (possibly with its own delay)
19:23 Craftsmanship i guess I could just write my own helper that did book keeping the way I want
19:24 jberger you can also just close over some hash on your own (maybe that is what you just said)
19:24 sri mpapec: since you brought it up again... nic did not call you a misogynist, he called you out for misogynistic language, which i totally support
19:24 Akron joined #mojo
19:25 sri mpapec: and the way you use terms like "safe space" to ridicule those that don't agree with you is very much not cool with me either
19:26 Craftsmanship What's the "Overwatch!" in the /topic about?
19:26 sri we only talk about overwatch here now ;p
19:27 Grinnz_ yeah what's all this off-topic perl talk
19:28 Craftsmanship that would make the reference to irclog somewhat self fulfilling  then ...
19:28 preaction Craftsmanship: this works: https://gist.github.com/preaction/1e9fc68a8b3ef7611d34cf792b269f5e and yeah, it'd be interesting to see it wrapped up in a helper of some kind
19:28 jberger and I'll agree strongly with sri about ridiculing trying to be inclusive, and add that this upsets me too (even if nic wasn't technically right about language policy): http://irclog.perlgeek.de/mojo/2016-09-02#i_13139024
19:29 Craftsmanship preaction: oh, that would do it.
19:30 Grinnz_ preaction: i like that
19:30 Craftsmanship wait - am I in the middle of a dispute about an afk person saying "motherfucker"?
19:30 preaction i did learn that closures wrap the slot not the value, just like javascript :S. it'd be nice if i didn't have to name the begins uniquely. so probably a hash to register the begins
19:31 Grinnz_ Craftsmanship: IRC is asynchronous, you're not in the middle but happening at the same time :P
19:31 preaction think of it as a very fast-moving forum. multiple topics can be discussed at once
19:31 Craftsmanship and none of them very clearly
19:31 * preaction bumps the meta-discussion
19:32 Craftsmanship anyway, my callbacks were likely to be named after databased ids, so that's likely fine
19:32 Grinnz_ great, now there's a meta-meta-discussion
19:32 sri yea, you basically have to read the backlog for the day to follow everything
19:33 Craftsmanship and i bet there's no use in suggesting that the term doesn't relate to actual mothers or actual sex, 'cause that's not how this kind of discussion ever works.
19:33 Craftsmanship even when it's async
19:33 Grinnz_ Craftsmanship: it was already said that wasn't the dispute
19:33 Craftsmanship so we all agree then.
19:33 Craftsmanship lovely.
19:34 Craftsmanship I guess in another 8 hours that other dude will come back to life
19:34 Craftsmanship preaction: why the zeros?
19:34 Craftsmanship is that "just pass everything"?
19:34 preaction why what zeroes?
19:35 dod joined #mojo
19:35 sri omg
19:35 sri when did this happen? http://www.slideshare.net/brian_d_foy/perl-528-new-features
19:35 Craftsmanship my $begin = $delay->begin( 0 );
19:35 preaction the "offset" to begin defaults to 1, because it assumes you're just doing: $ua->get( 'example.com', $delay->begin ); and it will get the $ua as its first argument, which is useless to you. so i explicitly set it to 0
19:35 Craftsmanship sri: saw it today.
19:35 sri how could i have missed those new signature features :o
19:35 preaction it has to be a joke
19:36 preaction no discussion on p5p for any of that at all
19:36 jberger here's a variant on preaction's https://gist.github.com/jberger/38237c4a8d361feaa1be2e59060b4eda
19:36 jberger in which you just get name => $tx pairs
19:36 jberger in %args
19:37 sri oh, it does look like a joke
19:37 Craftsmanship The conflict markers were the clue.
19:38 Craftsmanship obviously we need to preserve being able to shift left on heredocs named <<
19:40 jberger "(O) This program appears to be a waste of time. Exiting."
19:40 preaction 5.24 (or maybe 26) does warn on conflict markers. and there's a feature under consideration for killing leading whitespace on heredocs, which removes '' as a heredoc name
19:40 jberger yeah, joke
19:41 sri not a good joke, got me excited there for a second
19:41 Craftsmanship Well, some good products start out that way
19:42 jberger as jokes?
19:42 * jberger refers the reader to parrot
19:42 Craftsmanship also often phrased as "just crazy enough to work"
19:43 preaction https://gist.github.com/preaction/1e9fc68a8b3ef7611d34cf792b269f5e here's a golfed version of mine without the weird state thing
19:43 preaction (but use the weird state thing, because it's clearly superior)
19:44 sri preaction: you could do $delay->$named_begin('google') if you're going for style points
19:44 Grinnz_ theyd have to core a type system for those signatures. Type::Tiny core time!
19:44 Craftsmanship There aren't any other authors working on this, so i'd only be making myself sad
19:44 preaction sri: ooooooooooooooooh. /me goes back to edit
19:45 preaction ... or maybe even worse: sub Mojo::IOLoop::Delay::named_begin { ... }
19:46 Craftsmanship this is going really well.
19:46 sri Grinnz_: UNIVERSAL::DOES kinda is a core type system
19:46 sri matching on the ->DOES value of arguments is not a stretch
19:46 Grinnz_ kinda, but it would be a verbose one
19:53 jberger I've never understood the non-role version of does
19:53 jberger UNIVERSAL::DOES I guess is how you are denoting it
19:54 Grinnz_ it's just another instance of "roles are kinda like inheritence" that's almost right enough to work
19:55 Craftsmanship Either you DOES or you DOESN'T, seems fair enough to me
19:56 jberger Grinnz_: but how do you use it? from the class author's perspective
19:56 jberger like how can I say that this class DOES something other than its package name
19:56 Grinnz_ add it to @ISA
19:56 jberger the documentation in UNIVERSAL explains the use from the consumer's standpoint
19:57 jberger then it is just the same thing as UNIVERSAL::isa
19:57 Grinnz_ yes
19:57 Grinnz_ but Moo and Moose override it to be more useful
19:58 jberger so the actual answer is "override DOES in the class"
19:58 Grinnz_ if you implement roles, yes
19:59 Grinnz_ also Role::Tiny overrides it too
19:59 Grinnz_ forgot about that
20:41 cafe joined #mojo
21:34 sri btw. any other feature requests for Mojo::Pg, while i'm still working on it
21:41 sri ?
21:42 polettix joined #mojo
22:35 disputin joined #mojo
22:57 Akron joined #mojo
23:19 jberger sri: is there any way to make notifications more fork-safe?
23:20 sri jberger: what scenario are you referring to?
23:20 jberger if you subscribe and then fork the child gets very strange errors
23:21 jberger specifically I was trying to make my job queue listen for notifications and then just spawn workers without doing the unsubscribe/stop/spawn/start/subscribe that minion does
23:21 jberger and maybe it would work for minion too
23:22 jberger let me see if I can come up with an example
23:24 sri considering perl has no fork hooks, it seems unlikely we could do much
23:25 sri i mean, this exists https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/PubSub.pm#L39
23:26 sri no clue if maybe DBI has some magic to borrow
23:27 jberger yeah, right now I'm just trying to build a small-scale, but you might be right
23:28 jberger and of course in small scale it works just fine :-P
23:28 sri as far as i remember DBI only does the InactiveDestroy thing, which merely makes sure forked processes don't close the connection a parent might still be using
23:38 jberger ok well if I can't replicate simply it might of course be my problem
23:38 jberger and this isn't a problem I've worked much on yet
23:38 jberger so that's very possible
23:46 jberger in my large example the errors I get are like:
23:46 jberger message type 0x49 arrived from server while idle
23:46 jberger and
23:46 jberger message type 0x5a arrived from server while idle
23:52 sri think those mean that the same connection is being used by two processes
23:54 sri basically, you'll have to start and event loop on process 1, start listening for notifications, fork process 2, keep the loop running, and then perform a query in process 1
23:54 sri s/d//
23:54 jberger so the forking is via fork_call
23:54 jberger so it should reset the ioloop in the child
23:55 sri yes, reset will prevent it i think
23:56 sri maybe if you're leaking it won't
23:57 sri ->reset is pretty strong already though, i doubt it could leave traces behind
23:58 jberger I'm going to try replacing fork call with subprocess
23:58 sri maybe with EV some stuff can leak? *shrugs*
23:58 jberger just in case
23:59 sri doesn't fork call reset the ioloop?
23:59 jberger it does
23:59 sri should be the same then
23:59 jberger but I wonder about the next_tick
23:59 jberger not using EV actually
23:59 jberger not installed on my dev box
23:59 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Reactor/Poll.pm#L94

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