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

IRC log for #mojo, 2015-12-19

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

All times shown according to UTC.

Time Nick Message
00:24 voldemortensen joined #mojo
00:27 sri good thing you've got your new cisa bill
00:28 sri gotta love when law enforcement can use your medical data agsinst you
00:35 stephan48 hey. what could possibly go wrong?
00:36 stephan48 surely the people who got access use the data responsibly.
01:24 meshl joined #mojo
01:35 basic6 in order to get $self->url_for->to_abs to return a valid frontend url (https://server/app/foo instead of http://localhost:8080/foo), is it ok to set $c->req->url->base(Mojo::URL->new( "https://".$c->req->headers->header("X-Forwarded-Host") ) in the before_dispatch hook?
01:36 Grinnz use https://metacpan.org/pod/Mojo::Server::Hypnotoad#proxy for hypnotoad or MOJO_REVERSE_PROXY=1
01:39 basic6 grinnz i have added proxy => 1 to the hypnotoad config but url_for->to_abs still returns the internal localhost address
01:39 Grinnz when running hypnotoad?
01:39 basic6 yes
01:40 Grinnz are you sure the header is set correctly?
01:40 sri X-Forwarded-Host is silly
01:40 basic6 which header
01:40 sri just let your reverse proxy preserve Host
01:41 sri all the cookbook configs do that
01:42 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Nginx
01:42 damaya joined #mojo
01:44 basic6 oh you mean ProxyPreserveHost On in apache
01:45 basic6 sri that's the one, i forgot that setting, thank you very much
01:46 sri oooh, postgres 9.5rc1 is out \o/
01:54 jberger Nice
01:59 jberger Oh dear gods https://www.washingtonpost.com/news/volokh-conspiracy/wp/2015/12/18/political-ignorance-and-bombing-agrabah/
02:00 jberger I don't want to live on this planet anymore
02:02 damaya joined #mojo
02:03 damaya Hell, are there any examples of Mojo::Redis2 that are not Mojolicious related?
02:12 asarch joined #mojo
02:17 jberger damaya: this is still the urlqueue thing?
02:18 jberger Redis isn't going to help you there
02:18 jberger Unless you're using it to build a cluster
02:20 damaya I'm using it as a bloom filter
02:20 damaya I wrote a bloom filter that uses Redis as a backend, but having issues with OOM, lol
02:20 damaya It's a distributed crawler, 60 instances on AWS
02:25 jberger Well as I don't have a cs background I'm just going to have to trust you on the bloom filter
02:25 jberger Do you have some code to look at to see if something obvious is wrong?
02:27 damaya Yeah sure!
02:31 shadowpaste "damaya" at 217.168.150.38 pasted "URLQueue.pl w/ Bloom Filter" (427 lines) at http://paste.scsys.co.uk/503091
02:32 damaya Cool, so that
02:32 damaya I always hit enter on accident :/
02:35 damaya I just started workig on the Mojo::Redis2 stuff today, so there's not much to it at this point unfortunately. That's why I was asking for "in the wild" examples :)
02:35 jberger You are doing ping and setbit Nonblocking on the same object in the same step
02:36 jberger Sane with getbit
02:36 jberger Do you even need to ping?
02:37 damaya lol, that is a complete copy/paste from the documentation with set changed to setbit
02:38 jberger Hmmmm
02:38 jberger I'd ask batman but he's on vacation
02:39 jberger It just seems odd
02:39 jberger Try removing those
02:44 jberger There's quite a bit of code there
02:45 jberger I don't especially like the style of having a Nonblocking function like add without having a callback argument
02:46 jberger Actually ha!  That's it
02:46 jberger Your call to check is always false
02:46 jberger You can't return from a Nonblocking function
02:47 jberger You are spidering everything every time
02:48 jberger damaya: ^^
02:48 jberger Tbh, just make check and add blocking
02:48 jberger They don't gain you much and make the code a lot harder
02:51 jberger Although if you are going to be doing a lot of requests (to check, specifically) in parallel that might be worth it, but check HAS to take a callback
02:51 jberger And so does everything that calls it
02:52 voldemortensen joined #mojo
02:52 * jberger taps the mic
02:52 jberger Is this thing on?
02:53 damaya jberger, holy crap!
02:53 damaya Thanks for looking at it, I'm just getting caught up reading what you said. Had to serve my kid some food real quick.
02:54 jberger No worries :p
02:54 jberger I think my work here is fine anyway :D
02:55 jberger Stupid autocorrect
02:55 damaya OK, so the problem is definitely in the Redis piece then. That gives me an awesome direction.
02:55 jberger s/fine/done/
02:55 jberger Yah
02:56 d4rkie joined #mojo
02:58 sri jberger: refactoring! :)
02:58 firnsy joined #mojo
02:59 jberger zomg
03:03 sri http://www.grafikart.fr/uploads/2015/01/refactor.jpg
03:06 jberger Man this is a lot of pressure
03:06 jberger I'm still not well enough to go see star wars :'(
03:07 sri http://cdn.meme.am/instances/56790844.jpg
03:09 jberger Hehe
03:26 noganex_ joined #mojo
03:44 damaya joined #mojo
04:21 sunrise joined #mojo
04:44 d4rkie joined #mojo
04:52 damaya joined #mojo
05:23 asarch I found this article from Andrew Sterling: http://www.onlamp.com/lpt/a/7267
05:23 asarch "Developing RESTful Web Services in Perl"
05:24 asarch However, he says that this article is actually in two parts: the first one about developing the REST API and, 2. developing the client for the API
05:24 asarch Do you know where could I find the second part?
05:26 bpmedley_ asarch : Do you need an example of an api in Mojolicious?
05:26 asarch Sure
05:26 asarch :-)
05:28 bpmedley_ asarch : http://blogs.perl.org/users/brian_medley/2014/11/using-minion-with-a-rest-api.html
05:29 asarch I saw that example in the very beginning of my search to understanding REST
05:29 asarch But I could not understand anything at all :-(
05:30 bpmedley_ Ok, we can dissect it.
05:30 bpmedley_ Let's create something smallish first.
05:30 asarch Ok
05:33 bpmedley_ https://bitbucket.org/snippets/bpmedley/Gd6Eq
05:34 damaya joined #mojo
05:36 asarch Ok
05:36 bpmedley_ Does that code make sense?
05:37 asarch Yes, it does. The server offers / for GET and /api/v1/hello for POST
05:43 asarch However, have you seen the second part of that article from Andrew Sterling?
05:43 bpmedley_ asarch : Please reload : https://bitbucket.org/snippets/bpmedley/Gd6Eq
05:44 bpmedley_ No, I haven't.   What features would you like to add to your REST API?
05:45 asarch GET, POST, PUT
05:46 bpmedley_ asarch : Please reload
05:47 asarch Clear!
06:01 asarch Oh, I have to leave :-(
06:01 asarch See you later
06:01 asarch And thank you very much bpmedley_
06:01 asarch :-)
06:01 bpmedley_ np
06:05 damaya joined #mojo
06:32 d4rkie joined #mojo
07:51 damaya joined #mojo
07:55 damaya So, making it non-blocking it's back to working but being slow :/
07:56 damaya non-blocking results in OOM coming along and killing it, arg!
07:56 damaya What are your thoughts on Mojo::Redis2 vs MojoX::Redis?
07:56 damaya Do they serve the same purpose?
08:00 damaya joined #mojo
08:13 Vandal joined #mojo
08:21 d4rkie joined #mojo
08:54 abra joined #mojo
09:13 sh4 joined #mojo
09:53 kaare joined #mojo
09:56 abra joined #mojo
10:09 d4rkie joined #mojo
10:17 trone joined #mojo
10:37 meshl joined #mojo
11:10 bpmedley joined #mojo
11:47 good_news_everyon joined #mojo
11:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0jQD
11:47 good_news_everyon mojo/master 1722184 Sebastian Riedel: use a more generic title
11:47 good_news_everyon left #mojo
11:57 d4rkie joined #mojo
12:06 sri more information on the juniper hack http://www.wired.com/2015/12/juniper-networks-hidden-backdoors-show-the-risk-of-government-backdoors/
12:06 sri hehe, cnn is already blaming the russians and chinese ;p
12:17 d4rkie joined #mojo
12:17 D4RK-PH0ENiX joined #mojo
12:25 damaya Net::DNS::Native is dying with socketpair(): too many open files. Checked my limit with ulimit -n and I see 1024. My concurrency is set to 500. Is there something I'm not getting here?
12:28 damaya Ah, it's Mojo::Redis2 that's causing it
12:33 damaya Really strange considering I'm doing this blocking: for ( 0 .. 999 ) { push @urls, $r->pop('key'); }
12:42 sh4 joined #mojo
13:25 asarch joined #mojo
14:12 meshl joined #mojo
14:55 bjoernfan joined #mojo
15:00 bjoernfan joined #mojo
15:20 abra_ joined #mojo
15:44 voldemortensen joined #mojo
16:55 jberger damaya: you are making http requests too
16:58 jberger Redis2 is what you want
17:05 tyldis joined #mojo
17:20 sugar joined #mojo
17:39 jb360 joined #mojo
17:44 sugar joined #mojo
17:48 hummeleBop joined #mojo
18:04 Adura joined #mojo
18:27 good_news_everyon joined #mojo
18:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vEvW0
18:27 good_news_everyon mojo/master 5a1fa9f Sebastian Riedel: mention non-capturing groups
18:27 good_news_everyon left #mojo
18:46 pink_mist maybe make use of /n?
18:48 pink_mist http://perldoc.perl.org/perldelta.html#Non-Capturing-Regular-Expression-Flag
18:54 jberger pink_mist: can't (at least not globally) because captures are used internally
18:55 pink_mist I meant for the interpolated regexen: m/foo(?n:$interpolatedregex)/
18:56 pink_mist I also meant to just mention it in the documentation
18:56 jberger To what end?
18:57 pink_mist jberger: to prevent interpolated regexen from capturing?
18:57 sri good idea
18:58 jberger Except that the user thinks it's going to work and $1 is wrong
18:58 pink_mist $1 would be wrong anyway, no?
18:59 jberger Yes
18:59 jberger /n is rather new isn't it?
18:59 pink_mist this way it doesn't mess up mojos internals
18:59 pink_mist yes it is
18:59 jberger Is it ignored on older perls?
18:59 pink_mist I don't know :/
19:00 jberger Are named captures fast yet?
19:00 sri they were never slow, just leaking memory like crazy
19:01 jberger Ah, I misremembered
19:01 jberger Do they still leak?
19:01 sri so, on which perl versions is (?n:...) supported?
19:01 sri jberger: not since 5.20 i think
19:01 jberger I think just 5.22
19:02 sri wait... (?n:...) is 5.22 feature? :(
19:02 pink_mist 5.22
19:02 sri ...
19:02 sri yea, then we can't use it for another 10 years or so
19:02 pink_mist ... damn, that long ;_;
19:02 bjoernfan joined #mojo
19:03 jberger https://metacpan.org/pod/distribution/perl/pod/perl5220delta.pod#Non-Capturing-Regular-Expression-Flag
19:03 sri realistically, we'll prolly never use it
19:03 pink_mist I did already link the 5.22 delta, jberger
19:03 jberger Argh I missed it
19:03 pink_mist sri: can still mention it in the documentation so the users can use it
19:04 jberger They wouldn't use it
19:04 sri meh, that only adds confusion
19:04 jberger IMO it would be useful to protect the internals
19:04 bjoernfan joined #mojo
19:04 sri if we start recommending a newer perl feature, we start with signatures
19:05 jberger But those who know how to properly do regex interpolation don't need hand holding
19:06 sri so far we've not even managed to come up with a plan for signatures... https://github.com/kraih/mojo/issues/830
19:06 jberger sri if we go to signatures everywhere when they are non experimental, would it benefit to set /n on the route parser and use named captures?
19:06 jberger Dinner that would require 5.24 anyway
19:06 jberger Argh
19:06 jberger Since
19:07 jberger # really autocorrect? Dinner?
19:07 sri now i'm hungry
19:07 jberger I think my autocorrect is hungry
19:07 pink_mist the keys are like right next to eachother :P
19:07 pink_mist ... also, I /am/ off to dinner now
19:07 pink_mist o/
19:08 jberger pink_mist: enjoy
19:08 sri jberger: even if we did that, we couldn't remove those notes from the docs... so meh
19:09 sri magical captuing group protection is bad
19:09 sri imagine someone developed on 5.22 and deployed to users on 5.14
19:10 sri better to fail consistently
19:10 jberger I'm envisioning a magical time when we move support to something more recent
19:10 sri a perl6 port seems easier
19:11 jberger I was just wondering if we would ever bump perl version at this point :s
19:11 jberger Signatures will exist and no cpan modules will ever use them :(
19:12 sri i would bump to 5.14 if there was a signatures polyfill on cpan we could use
19:12 sri (5.14 for the parser hooks)
19:13 sri but we've been waiting for that polyfill module for like 2 years now, it's not gonna happen
19:13 sri so, i guess no, we'll never bump the requirement
19:13 sri the good stuff is much too new
19:20 PryMar56 joined #mojo
19:45 jontaylor joined #mojo
20:15 cpan_mojo Mojolicious-Plugin-MountPSGI-0.09 by JBERGER https://metacpan.org/release/JBERGER/Mojolicious-Plugin-MountPSGI-0.09
20:52 * sri yawns
20:54 jberger sri: I got that MountPSGI monkey off my back (hopefully)
20:54 jberger so back to refactoring?
21:15 sri \o/
22:18 sri looks like the ruby folks are going with nghttp2 https://github.com/tenderlove/ds9
22:21 cpan_mojo Mojolicious-Plugin-MountPSGI-0.10 by JBERGER https://metacpan.org/release/JBERGER/Mojolicious-Plugin-MountPSGI-0.10
22:44 cpan_mojo Clustericious-1.12 by PLICEASE https://metacpan.org/release/PLICEASE/Clustericious-1.12
22:53 sugar joined #mojo
23:24 HtbaaPi joined #mojo
23:31 meshl joined #mojo

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