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

IRC log for #mojo, 2017-12-02

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

All times shown according to UTC.

Time Nick Message
00:42 marty joined #mojo
00:55 berov joined #mojo
01:00 Leffe joined #mojo
01:23 berov left #mojo
02:23 schelcj joined #mojo
03:33 sivoais joined #mojo
03:35 ilbot2 joined #mojo
03:35 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
04:09 asarch joined #mojo
05:38 aborazmeh joined #mojo
07:17 jberger yawn
07:17 jberger ok day 2! https://twitter.com/joelaberger/status/936855779549655040
07:17 jberger I'm going to have to start making these shorter or I'm not sure if I have another 22 in me :-P
07:32 karjala_ joined #mojo
07:47 jamesaxl joined #mojo
07:53 Vandal joined #mojo
08:02 Leffe joined #mojo
08:07 Leffe joined #mojo
08:34 Leffe joined #mojo
08:44 trone joined #mojo
08:50 Leffe joined #mojo
08:58 Leffe joined #mojo
09:29 dod joined #mojo
10:00 jamesaxl hi
10:00 purl what's up, jamesaxl.
10:03 jamesaxl I have 18 routes and one of them that I want to make it accessed from public addr(internet) and others just from internal. is there any solution than check path of every route?
10:15 mfontani http://mojolicious.org/perldoc/Mojolicious/Routes/Route#under ?
10:27 jamesaxl mfontani: thank you
11:44 sri retweeted
11:45 brunoramos joined #mojo
11:52 sri jberger: btw. i pinned a link to your calendar on our google group
12:12 karjala_ joined #mojo
12:12 good_news_everyon joined #mojo
12:12 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYIx
12:12 good_news_everyon mojo/master 0c513be Sebastian Riedel: more url_for examples
12:12 good_news_everyon left #mojo
12:22 Leffe joined #mojo
12:26 dim0 joined #mojo
12:27 brunoramos joined #mojo
13:20 tchaves joined #mojo
13:21 Leffe joined #mojo
13:24 sri btw. perltidy will be able to format promise code nicely in the next release \o/ https://rt.cpan.org/Ticket/Display.html?id=123749#txn-1760034
13:26 sri maybe add some more cases if you can think of some
13:30 sri i'm not even sure if the ->then(sub {...}, sub {...}) case makes sense as it is presented there
13:30 sri (and is presented in our docs at the moment)
13:30 Leffe joined #mojo
13:35 dim0 joined #mojo
14:23 PsimanX1 Mojo::File and a minor question really but has there been any prior discussion about implementing exists / is_file / is_dir rather then usage of -e/-f/-d?  Would make for more readable code imho?
14:24 Gedge joined #mojo
14:25 sri PsimanX1: i don't think that's true
14:26 sri -e $file is fine imo
14:27 PsimanX1 Hmm ok interesting.  No probs.
14:29 dod joined #mojo
14:43 sh14 joined #mojo
15:11 jberger sri: nice, thanks
15:12 jberger I need to start posting on Reddit too
15:16 ladnaV joined #mojo
15:17 mohawk joined #mojo
15:23 CandyAngel I just realised, after doing lots of messing about to differeniate between numeric and string ids that that might be why string ids have to be at least 2 characters..
15:24 CandyAngel And numeric ids are only 1 character -.-
15:35 esh joined #mojo
15:43 dim0 joined #mojo
15:44 dod joined #mojo
15:54 berov joined #mojo
16:08 karjala_ joined #mojo
16:24 ChmEarl joined #mojo
16:50 cascardo joined #mojo
16:50 gordonfish joined #mojo
17:06 good_news_everyon joined #mojo
17:06 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbY8P
17:06 good_news_everyon mojo/master b83ce9e Sebastian Riedel: format multiple closures consistently
17:06 good_news_everyon left #mojo
17:07 sri we already had that with delay steps
17:08 jberger BTW I'm happy to accept guest posts for the calendar
17:08 jberger I'd especially like to solicit someone to write one about the promises stuff
17:09 * sri hides
17:11 jberger Hehe
17:12 jberger And a less commitment option to help is topic suggestions
17:12 jberger I have several more in my head but the number isn't 22 yet
17:14 sri (while eating way too many seasonal treats from the christmas market http://images.lecker.de/mutzenmandeln-F715401,id=513046c7,b=lecker,w=440,h=440,cg=c.jpg)
17:14 jberger Ooooooo what are those?
17:15 sri we call them mutzenmandeln, think we talked about those last year too :)
17:15 pink_mist some almond thing?
17:15 sri you said they were similar to doughnut holes or something
17:15 pink_mist at least mandel in swedish means almond
17:15 jberger probably they look good this year too though
17:16 preaction look like beneighs to me
17:16 sri it's a bit like doughnut , but there's also small pieces of almonds and vanilla
17:17 jberger doughnut holes are ok but there are better fried dough treats out there
17:17 sri it's also not as soft as doughnut
17:18 sri and soooooo tasty
17:18 * jberger drools
17:18 sri best baked treat in germany, but you can only get it in november and december around here
17:19 jberger I like pfeffernusse too
17:19 sri https://c1.staticflickr.com/1/28/63826882_ac497fff8f.jpg
17:19 jberger Oo
17:46 berov joined #mojo
18:06 sh14|2 joined #mojo
18:21 CandyAngel jberger: Have you seen how your examples look if you disable JS? :P
18:31 CandyAngel Learned some stuff though :)
18:32 * sri tries to remember if there were any features recently that we still wanted to add to mojo
18:46 noganex joined #mojo
19:04 disputin joined #mojo
19:04 gizmomathboy joined #mojo
19:19 jabberwok Congrats jberger , sri on making Slashdot re: Advent Calendar
19:19 jberger :o
19:21 jberger you know, I didn't setup google analytics, now I kinda want to
19:21 jberger my site's still up, that's a good sign
19:25 preaction (static websites)++
19:29 disputin joined #mojo
19:32 vicash cue the stupid perl jokes from the 90s by users with IDs > 10^6
19:40 jberger hehe, yeah, the comments are terribad
19:41 jberger who cares, I don't think I've ever front paged anything before
19:41 Grinnz nice!
19:41 jberger (I do remember when mojo hit the front page of HN while I was in Maui once)
19:41 bit_shifter joined #mojo
19:41 sri jberger++
19:43 Grinnz while it sucks to read ignorant comments like that, its always a good reminder that the perl (and perl6) community is still an echo chamber of sorts
19:52 vicash i respectfully disagree about the echo chamber. surely perl has some bad reputation from the past, but there are plenty of languages available and people should use the best tool for the job. python and java are only popular because universities use them and students who learn those languages use it as a hammer for every problem. its like why VB6 was popular in the 90s because it made almost anyone with low skills a programmer.
19:53 vicash javascript is the VB6 of today
19:56 Grinnz i agree, but i don't think that means we're not an echo chamber. just because we know popularity isn't everything doesn't make it common knowledge
19:57 * vicash nods
19:57 Grinnz and it's why i think the perl 6 community severely overestimated the value of keeping the perl name in the past (which they are hopefully coming around on)
19:58 trone joined #mojo
20:00 vicash they should call Perl6 Qerl
20:03 good_news_everyon joined #mojo
20:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYV6
20:03 good_news_everyon mojo/master 1f6f00c Sebastian Riedel: add websocket_p method to Mojo::UserAgent
20:03 good_news_everyon left #mojo
20:04 disputin1 joined #mojo
20:04 sri not entirely sure about websocket_p yet, but it's nice for a) showing a good use of the return $promise pattern in ->then handlers, and b) gets rid of the $tx->is_websocket check
20:05 Grinnz that does look nice
20:12 vicash jberger: will you be writing a blog post on how to use promises with mojo for the uninitiated folks like me ? as for Single sign on, I implemented a simple temporary solution to verify that the request IP is the same as the IP that the user is currently logged in with for each request. i track the user login history and logout all other sessions on login first before letting the user login. it doesn't solve multiple users behind the
20:13 vicash i mean multiple users using the same login credentials behind the same IP address.
20:14 vicash i will find a javascript solution to uniquely identify each user based on browser and let you know if i succeed.
20:27 good_news_everyon joined #mojo
20:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYrk
20:27 good_news_everyon mojo/master 9cdcc8c Sebastian Riedel: use websocket_p in the cookbook too
20:27 good_news_everyon left #mojo
20:30 good_news_everyon joined #mojo
20:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYrq
20:30 good_news_everyon mojo/master af2c1f4 Sebastian Riedel: no need to be so terse in the guides
20:30 good_news_everyon left #mojo
20:40 good_news_everyon joined #mojo
20:40 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYrX
20:40 good_news_everyon mojo/master fe8a8cc Sebastian Riedel: connection errors get higher priority
20:40 good_news_everyon left #mojo
20:41 sri promises are slowly creeping into the documentation everywhere :)
20:45 jberger vicash: I'd love a post on promises, I'm not sure I'm the one to do it
20:46 jberger I'm every bit as uninitiated as you are
20:46 kaare joined #mojo
20:47 sri conceptually, they are not all that complicated
20:48 sri they are a container for state, with three states, pending, fulfilled and rejected
20:49 sri pending -> fulfilled and pending -> rejected are the only allowed transitions
20:50 sri you can transition them by calling ->resolve or ->reject with a list of values values or none
20:51 sri when you have a promise you can attach closures to the fulfilled and rejected state
20:51 sri those are handlers
20:52 sri you do that by calling ->then or ->catch
20:52 sri which both return a new promise
20:52 sri which gets fulfilled or rejected based on the result of the handler it is attached to
20:54 sri if a handler returns a promise, that promise gets inserted into the chain, and the followup promises waiting for the handler now wait for that new promise
20:56 sri otherwise, if they just return an arbitrary value, the followup promises get a ->resolve call with that value
20:56 sri so, return values matter quite a bit, every handler in the chain decides what the next handler will get
20:57 sri fulfilled handlers are pretty simple that way, they just return values for the next handler
20:58 sri reject handlers are different, they act as an actual "catch", whatever they return (if it is not another promise) gets passed to the next FULFILLED handler
20:58 sri so, they kinda "recover" the promise chain
21:00 sri and that's basically all you need to know i think
21:02 sri the core concept is that ->then(sub {...}) closures generate a value to be passed to the closures of the next ->then(sub {...}) and so on
21:04 sri you can also make the followup promises reject from your handler of course, just by throwing something with die()
21:04 sri since the handlers run in an eval {...}
21:05 sri Mojo::Promise->all() and Mojo::Promise->race() are totally unimportant for understanding promises
21:05 sri they just combine promises to make new promises
21:08 sri if you want something more visual, this might work https://scotch.io/tutorials/javascript-promises-for-dummies
21:09 sri almost the same as our promises
21:16 sri now you know all i know about promises :)
21:35 jberger :D
21:35 jberger (that looks like a blog post :-P)
21:35 * jberger is shameless
21:38 jberger so reading that over, I think I mostly get it
21:39 jberger I'd need to play with the chaining to really grok it
21:39 jberger but I don't understand the recovering from an error via catch
21:40 jberger don't you usually want to branch your code at an exception?
21:40 jberger I don't think I'd usually want to continue with my code as before if there was an exception ahead of it
21:41 Grinnz the catch callback would be responsible for that
21:41 Grinnz it could die to pass on a failure
21:41 Grinnz or return a failed promise
21:43 Grinnz it's situation dependent how you'd handle that really
21:44 Grinnz like a lot of the time, you'll put a catch handler at the end of a promise chain, the code would handle the exception, and then resolve the chain
21:44 sjn > Mojo::Promise->all() and Mojo::Promise->race() are totally unimportant for
21:44 sjn understanding promises
21:44 sjn > Mojo::Promise->all() and Mojo::Promise->race() are totally unimportant for
21:44 sjn understanding promises
21:44 Grinnz but that failure could have come from early in the chain, and just made all the intermediary promises fail
21:44 sjn oops, sorry :)
21:44 * sjn is reading & lurking o/
21:44 jberger sjn: o/
21:45 sjn heya jberger
21:45 purl i think jberger is http://i.imgur.com/UPfFmXF.jpg or Foreman
21:46 jberger sjn: shall we get an utepils next year? looks like we might get a few chances
21:46 sjn that would be awesome :)
21:50 sjn jberger: you're planning on going to the #pts also?
22:02 CHYC jberger: I used to write a lot of scripts using Scriptalicious, but I'm starting to find that Mojolicious::Command provides a much better way to write maintainable scripts. Putting aside Mojolicious the web framework and expanding on features that are explicitly not web related may be a nice topic to cover.
22:03 jberger sjn: if I'm invited
22:03 jberger two trips to oslo sounds like quite a lot of travel, but I'll try to make it work
22:03 jberger CHYC: yes, commands and the command system is definitely on my list
22:03 jberger but thanks for the vote
22:04 Grinnz Mojolicious::Command is most useful when you want to write scripts that have access to your application (mainly, its config and helpers, for instance)
22:07 CHYC jberger: Glad it was already on your radar.
22:29 preaction I just found out about Mojo::URL->path->merge(...), which is pretty fun. <%= url_with()->path->merge( "api" ) %> turns / into /api and /admin into /admin/api
22:39 sri jberger: you can also rethrow the exception in the reject handler to make it reach the next reject handler
22:39 sri it's only recovered if you don't
22:40 sri it's no special logic though, just any handler that throws an exception triggers the followup reject handler
22:40 sri resolve or reject handler, it's the same
22:41 sri jberger: oh, and take whatever you like for the blog posts, and feel free to poke me with questions
22:44 sri preaction: are you sure, that sounds like a bug Oo
22:45 preaction what should happen?
22:45 sri i'd expect /admin to turn into /api with ->merge('api')
22:45 sri only /admin/ would become /admin/api
22:47 sri same rules your browser follows with paths in html
22:49 jberger IIRC it has to do with the slashes or lack thereof, both on the base and merging paths
22:55 good_news_everyon joined #mojo
22:55 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYM7
22:55 good_news_everyon mojo/master 18b20d9 Sebastian Riedel: test connection errors too
22:55 good_news_everyon left #mojo
22:56 sri preaction prolly just mixed up his example, i doubt there really is a bug
22:56 sri has like a million tests right out of the rfc
23:30 good_news_everyon joined #mojo
23:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYyF
23:30 good_news_everyon mojo/master 4ea8a83 Sebastian Riedel: show an HTTP action in the README too
23:30 good_news_everyon left #mojo
23:41 good_news_everyon joined #mojo
23:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbYSg
23:41 good_news_everyon mojo/master ede53ee Sebastian Riedel: mention MVC
23:41 good_news_everyon left #mojo
23:50 good_news_everyon joined #mojo
23:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbY9k
23:50 good_news_everyon mojo/master 4e4ce8e Sebastian Riedel: link to the comparison of both application types
23:51 good_news_everyon left #mojo
23:59 good_news_everyon joined #mojo
23:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbY9E
23:59 good_news_everyon mojo/master 6a32ff8 Sebastian Riedel: more consistent examples
23:59 good_news_everyon left #mojo

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