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

IRC log for #mojo, 2017-10-10

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

All times shown according to UTC.

Time Nick Message
00:50 disputin joined #mojo
02:37 noganex joined #mojo
02:43 gryphon_ joined #mojo
03:15 disputin1 joined #mojo
03:30 disputin joined #mojo
04:04 dboehmer joined #mojo
04:07 mmp joined #mojo
04:22 ptlmrch joined #mojo
05:11 inokenty-w joined #mojo
05:39 aborazmeh joined #mojo
06:05 dod joined #mojo
06:16 dod joined #mojo
06:40 Vandal joined #mojo
06:44 dod joined #mojo
06:46 karjala_ joined #mojo
06:47 AndrewIsh joined #mojo
07:12 prg joined #mojo
07:33 trone joined #mojo
08:22 karjala_ joined #mojo
09:01 sri genio: looks like The Gifted might be the show Inhumans wanted to be
09:01 sri ETOOMANYMARVELSHOWS
09:05 rshadow joined #mojo
09:06 haarg soon all tv shows will be marvel shows
09:17 kes joined #mojo
09:18 kes Hi. How it would be better to setup default input values while validating?
09:25 rshadow joined #mojo
09:28 irqq joined #mojo
09:29 rshadow joined #mojo
09:35 aborazmeh joined #mojo
09:52 rshadow joined #mojo
09:55 rshadow joined #mojo
10:03 rshadow joined #mojo
10:08 rshadow joined #mojo
10:28 rshadow joined #mojo
10:29 tchaves joined #mojo
10:30 mattp joined #mojo
10:37 rba_ joined #mojo
10:44 rshadow joined #mojo
10:46 rba joined #mojo
10:54 pink_mist https://twitter.com/bagder/status/917638667782508544
10:59 sri haha
11:15 rshadow joined #mojo
11:25 rshadow joined #mojo
11:37 rshadow joined #mojo
12:02 Jonis sri: only seen the first episode of the gifted, it wasn't terrible. Unlike Inhumans.
12:03 sri not seen it yet, but might later today
12:09 marcus Added the gifted to my queue
12:09 Jonis enjoying ST:D, but actually The Orville feels a lot more Star Trek :p
12:10 marcus I've got a hard time with Seth MacFarlane as an actor :-/
12:10 Jonis yeah, I don't particularly like him
12:10 Jonis but I've enjoyed the episodes nontheless
12:11 sri yea, most of his shows/movies are too silly for me, but the orville is great
12:12 pink_mist I'm still not sure if orville is going in a comedy direction or not; I mean obviously it has a lot of comedy in it, but I'm not sure if that's going to be the main thing for it or not, it's hard to see where the overarching theme of the season will be going
12:13 Jonis Also, in these blade runner times, The stand-alone Philip K. Dicks Electric Dreams episodes are pretty good
12:13 Jonis that is, all four episodes so far have had different stories and actors
12:13 marcus ooh, very shiny
12:13 * sri is scared of blade runner 2049
12:13 Jonis It was awesome
12:13 sri my favorite movie is the original blade runner
12:14 Jonis I have to say I was apprehensive going into it, but I was converted by the end
12:15 marcus The reviews have been very promising
12:16 sri i've listened to the soundtrack already... and it didn't live up to my expectations
12:16 marcus I've finally found time to read the Rama series last week while on vacation btw. Such awesome scifi. Almost at the end now, kinda sad
12:17 Jonis oh, and mr robot starts again this week
12:17 sri during my vacation i've read ready player one and the third book of the old man's war series
12:18 sri really liked ready player one, so much nostalgia
12:18 Jonis might have to give it a go
12:21 sri well, technically i listened to the audiobook, which is narrated by wil wheaton, making it even better
12:21 marcus yeah, it's great.
12:21 marcus The followup is unfortunately just a pale shadow in comparison (Armada)
12:22 marcus I like the old man's war too, specially the first book.
12:22 sri yea, old man's war starts very strong and gets kinda boring after the second book
12:23 sri two months until the next expanse book comes out
12:24 sri definitely my favorite space opera
12:25 marcus are you on goodreads btw, sri?
12:25 sri nope
12:26 marcus I kinda like it because it automatically integrates with my kindle
12:27 marcus so when I start reading something it offers to mark it as in progress, and vice versa
12:37 gizmomathboy joined #mojo
12:37 karjala_ does it automatically mark the page number on goodreads as well?
12:37 karjala_ or % progress?
12:47 karjala_ If I have a perl on /opt/perl-5.26, how can I make local/bin/morbo use that perl instead of system or whatever else?
12:48 karjala_ Does it depend on which carton I used when I ran "carton install" ?
12:48 karjala_ instead of system perl, I mean
12:50 mib_2ws869 joined #mojo
12:51 marcus karjala_: seems you can do it at least, but not automatically https://www.goodreads.com/help/show/336-how-do-i-post-a-reading-progress-update-on-goodreads-on-kindle
12:52 karjala_ a
12:53 karjala_ I mean, when I launch morbo with /opt/perl-5.26/bin/carton exec morbo ... - will that morbo process use the perl from /opt/perl5.26?
12:58 karjala_ Maybe I should only take care of the shebang line on the startup script that was auto-generated?
13:03 karjala_ ok all i had to do was look at the source code of morbo - question answered
13:27 gryphon joined #mojo
13:29 jberger Ready Player One was great
13:30 jberger And agreed Armada lacked something especially in comparison
13:31 jberger I realized as I read it that the plot twist I wanted in Armada would basically have made it Ready Player One again
13:31 leont_ joined #mojo
13:32 jberger Haven't started Discovery, still pleasantly surprised by the Orville
13:33 jberger I don't even mind his acting, he's had some good scenes
13:33 jberger His distinct humor does pull me out of the story sometimes
13:34 jberger But it almost seems like that is happening less and less
13:41 rba_ joined #mojo
13:42 mcsnolte joined #mojo
13:46 rba joined #mojo
13:58 genio sri: ah. I haven't even heard of that one yet.
13:59 prg is there even a legal way to watch the Orville in Germany right now? https://www.werstreamt.es/ tells me otherwise...
14:08 maschine joined #mojo
14:22 rba_ joined #mojo
14:31 rba joined #mojo
14:34 mikegrb is there a way to tell mojo to not use a template for json and just return the the serialized json stash variable?
14:42 petru joined #mojo
14:52 leont_ joined #mojo
14:52 ChmEarl joined #mojo
14:56 karjala_ mikegrb, does this work? $self->render(json => $self->stash);
15:02 jberger mikegrb I don't understand your question
15:02 jberger are you just asking how do I render json to the client?
15:02 sh14 joined #mojo
15:02 jberger I suspect that you are actually talking about error responses in json apis, that's the usual context that this happens in
15:03 jberger hmmm, sri, now that I think of it, I wonder if that is a recurring enough question that we ought to think about a way to make that easier
15:04 sri jberger: knock yourself out
15:16 gryphon joined #mojo
15:24 mikegrb jberger: well, the issue was format recognition
15:25 mikegrb since the url was .json it was looking for a coresponding json.ep before calling the specified controller
15:26 mikegrb I changed my placeholder for the route from : to * to swallow the .json and called $c->render(json =>)
15:27 mikegrb I already had this in the code but was surprised to see the controller wasn't even getting executed because the template was missing (had some debug warns in the controller)
15:27 mikegrb that's what eventually lead me to figure out what was going on
15:30 jberger it should only try rendering after the controller action is called
15:30 jberger and that only if you haven't rendered something
15:33 mikegrb maybe a bug that was fixed, it's 7.27
15:33 jberger shouldn't be
15:33 jberger are you sure you were rendering something in your action?
15:33 jberger "I changed my placeholder for the route from : to * to swallow the .json and called $c->render(json =>)"
15:33 jberger seems to imply you weren't originally calling render
15:34 mikegrb well the $c->render(json=> was already there
15:34 mikegrb I had: if ($json) { $c->render( json => $data ) } else { $c->render }
15:35 mikegrb granted json was false because the format detection was eating the .json, but there is still a render in the else, and my ouptut to stderr in the action wasn't getting sent
15:36 jberger ah, yeah ->render() is basically the same as not calling render
15:36 jberger sorry, I had meant render(json => ...)
15:36 jberger that's my fault for using shortcuts in the discussion
15:37 jberger heres a one liner example you can play with:
15:37 jberger perl -Mojo -E 'a("/hi" => sub { $_->render(json => {qw/hello world/}) })->start' get /hi.json
15:40 mikegrb looks like it was a route issue... I had $r->get('/day/:date')->to('day#day') but it was looking for daydate.json.ep
15:40 mikegrb I didn't notice the name difference
15:41 mikegrb changing it from :date to * causes both 2017-09-23 and 2017-09-23.json to route to day#day
15:43 mikegrb and there was no "Routing to controller..." debug message when it was looking for .json.ep so I guess that was the autorouting goodness
15:43 mikegrb I'll go brush up on my routing documentation
15:47 Grinnz karjala: carton unfortunately uses #!/usr/bin/env perl last i checked which means it will install to whatever perl is first in your path. i tend to change that to match the perl i installed it with, as it should be
15:48 Grinnz at least when fatpacking carton
15:48 karjala_ joined #mojo
15:49 jberger mikegrb I'm guessing you have another similar route and by making the date a catchall you've just changed how it routes there
15:50 jberger reading back, what does $json come from?
15:50 karjala oh i see
15:50 mikegrb https://github.com/mikegrb/solar_ng/blob/master/lib/SolarNG.pm
15:51 karjala Grinnz: so I should do export PATH=/opt/perl-5.26:$PATH before running carton, right?
15:51 karjala I'll check it out
15:51 mikegrb jberger: $json is just from regex capture group for \.json on the end of the url https://github.com/mikegrb/solar_ng/blob/master/lib/SolarNG/Controller/Day.pm#L14
15:51 Grinnz karjala: actually the installed version looks to have the correct shebang. maybe its only when fatpacking
15:52 jberger mikegrb: https://github.com/mikegrb/solar_ng/blob/master/lib/SolarNG/Controller/Day.pm#L14 is not the right way to do it
15:52 jberger I see why you did, but yeah, that's what went wrong
15:52 mikegrb I know :<
15:52 jberger one sec
15:52 Grinnz karjala: whats supposed to happen is any script that you install has a shebang that uses the perl that installed it
15:52 Grinnz karjala: since it's only really guaranteed to work with that perl
15:52 karjala yes that would be ideal
15:52 jberger mikegrb: you want http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Content-negotiation
15:53 mikegrb duh, thank you
15:53 jberger either checking accepts or else using respond_to
15:53 jberger no problem
15:53 mikegrb yeah, and respond_to easily fits in the if where I was checking json
15:54 jberger you were thinking about it as a routing problem and if you go down that road you'll end up where you did
15:57 * sri just deployed something with systemd socket activation for the first time and it was really quite convenient
16:13 itaipu joined #mojo
16:41 ashimema joined #mojo
16:58 rshadow joined #mojo
17:06 petru joined #mojo
17:35 gryphon joined #mojo
17:55 karjala_ joined #mojo
18:01 gryphon joined #mojo
18:11 jamesaxl joined #mojo
18:14 jamesaxl joined #mojo
18:17 mgrimes joined #mojo
18:23 irqq joined #mojo
18:26 Ralesk joined #mojo
18:28 cng joined #mojo
18:31 rba_ joined #mojo
18:38 itaipu joined #mojo
18:41 jamesaxl joined #mojo
18:43 rba joined #mojo
18:57 rba_ joined #mojo
19:01 rba__ joined #mojo
19:01 CoderLee joined #mojo
19:02 CoderLee Anyone know how to set uo mojolicous on bluejost vps?
19:15 rba_ joined #mojo
19:18 mtj joined #mojo
21:28 * sri is not sure what to read/listen to next
21:29 sri maybe seveneves
21:30 jberger I really liked that
21:30 jberger just read it
21:30 jberger very creative
21:30 petru joined #mojo
21:31 sri also have red rising trilogy on the list
21:31 sri and amazon thinks i would like the silo trilogy because i liked ready player one... hmm
21:42 genio red rising... I liked the first book.
21:45 rba joined #mojo
21:55 gryphon joined #mojo
22:02 rba_ joined #mojo
22:16 rba joined #mojo
22:31 rba_ joined #mojo
22:46 rba joined #mojo
23:01 rba_ joined #mojo
23:37 disputin joined #mojo
23:48 disputin joined #mojo

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