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

IRC log for #mojo, 2016-01-14

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

All times shown according to UTC.

Time Nick Message
00:09 orev vicash: what kind of login info are you storing in the session?
00:27 mattp "Many of the current Perl 5 users seem to perceive Perl 6 as a threat to Perl 5, so they either dismiss its existence entirely or attack it." wat. I'm not sure I've ever seen anyone express this
00:28 sri context?
00:28 mattp I guess zoffix isnt here right now, but src is http://blogs.perl.org/users/zoffix_znet/2016/01/why-in-the-world-would-anyone-use-perl-6.html
00:33 genio mattp: That conversation has taken place several times in here. :)  Zoffix (when he's around) doesn't mind arguing politely with you in private messages.
00:34 sri jnap++ # i agree completely with that
00:36 mattp genio: aye, why I pasted here
00:37 sri but... meh, i don't care about perl6
00:38 sri even the drama is boring
00:38 Grinnz_ "So which is it? If the Perl 5 community wants to maintain that Perl 6 is an entirely separate language, then why is the Perl 6 community getting attacked on the quality of their deliverables?" because it's still called Perl 6.
00:38 mattp I've started learning python. that is how I feel about perl 5 and perl 6 at present day
00:39 sri i'm investing more into javascript, need it anyway, no matter if i stay a perl5 programmer forever
00:41 Grinnz_ i maintain that the name remaining Perl 6 is the single reason for any animosity
00:41 sri they can't change the name though
00:41 Grinnz_ not anymore
00:41 genio not now anyway.  If anything, P5 will have to change names
00:41 sri even before
00:42 sri the language doesn't really have a niche, the only thing that gives it legitimacy is the name
00:42 Grinnz_ perhaps
00:43 Grinnz_ I would have really liked to see it released as "Rakudo" though, "by the creator of Perl"
00:43 mattp genio: perl 5 isn't going anywhere, nor is it moving in any actual direction
00:44 sri selfish me wants perl5 to die, so i can get rich :)
00:44 genio heh.  how would that make you rich?
00:44 sri but realistic me realizes how slowly things move... and i'll prolly be dead by then
00:44 Grinnz_ some people are trying their best to complain about p5p and kill off any further motivation they have :P
00:45 sri see cobol
00:45 sri programmers that are still good at cobol can name their price
00:45 genio mattp: I don't think that's a fair assessment at all.  The p5p team has been doing great work in making Perl better and better
00:46 Grinnz_ there's certainly been a lot more work on usability and efficiency since 5.20
00:46 genio p5p++
00:46 sri perl5 is here to stay
00:50 sri Swift is a bit of an anomaly, things are moving so fast there, and it will be one of the big languages in no time
00:51 mattp sri: really?
00:51 sri question is if it can leave the apple eco system
00:52 sri helps to have a monopoly on a niche and deep pockets i guess
00:55 cpan_mojo WWW-Crawler-Mojo-0.16 by JAMADAM https://metacpan.org/release/JAMADAM/WWW-Crawler-Mojo-0.16
01:00 jontaylor joined #mojo
01:04 jberger Grinnz_++ if you hadn't said your exact response I would have
01:06 sri anyone know what happend to the signature op?
01:16 jberger I think I'm going to write a response and I'm not even going to mention perl
01:24 jberger http://blogs.perl.org/users/joel_berger/2016/01/on-the-semantic-naming-of-things.html
01:25 sri thanks, now i'm hungry
01:26 jberger me too
01:29 mattp jberger: your post is wrong
01:29 jberger you may feel free to disagree
01:29 jberger but demonstrably people are and continue to be confused
01:30 jberger so what does that tell you
01:30 mattp actually, I misread. I take that back :)
01:30 jberger hehe
01:30 mattp its still a wishywashy grey area though. who is to say what p6 is or isnt other than lwall himself
01:31 jberger mattp: and I have been one who on occaison has taken a pretty harsh tone about p6 and its development cycle with regards to p5
01:31 jberger oh, it is certainly his right to do it
01:31 jberger I just had had hopes that he would change his mind at the last moment
01:31 jberger because it is confusing
01:32 mattp camelia would have been a natural progression from the logo
01:32 jberger and other notable things like perl(5) can never semantically release a more moderate breaking version
01:32 jberger the feature pragma is now all we have forever
01:33 zivester joined #mojo
01:34 jberger Zoffix complains in the comments about how there is a cult of backwards compatibility and how even Moose/Mouse/Moo/Mew feel bolt on
01:34 jberger well it has to be a cult of backwards compatibility because we can never semantically signal that we are making a breaking change
01:35 jberger strict by default, signatures by default, a class keyword by default
01:36 jberger none of these can happen because they have to be backwards compatible with perl 5 by name
01:36 jberger and when you have to scope something huge by a feature pragma it makes development harder
01:36 jberger especially for things that need to be core and thus cannot be prototyped on cpan (Devel::Declare is the only reason signatures were even possible)
01:38 jberger </rant>
01:45 Grinnz jberger, i'm actually not as concerned about that part. they've been making good use of the "22" etc as the "major breaking version", the need for backcompat far predated perl 5
01:45 Grinnz if they actually *did* break backcompat i'm not sure it would be worth calling it perl anymore
02:01 jontaylor joined #mojo
02:11 jberger Ummmm point me
02:13 Grinnz see "incompatible changes" sections in various perldeltas
02:14 Grinnz usually the removal of something deprecated, or similar
02:17 jberger I was commenting on "if they actually *did* break backcompat i'm not sure it would be worth calling it perl anymore"
02:18 Grinnz then i have no idea what that meant lol
02:20 jberger I'm saying that you have fallen into the same mindset
02:21 Grinnz what mindset?
02:21 jberger that perl backcompat is part of perl
02:21 Grinnz i'm just saying it historically has been
02:21 Grinnz since before perl 5
02:22 jberger well its possible that I'm arguing a fallacy that's true
02:22 genio no backcompat breaking changes happened between 1 and 5?
02:22 jberger but I don't think that being denied a major version number has helped anyone think boldly about features that aren't easily "feature" scoped
02:23 Grinnz people don't have a lot of expectations of perl, but one of those expectations is that anything called "perl" will run their sysadmin 3000 line script from 1995
02:23 jberger and that's a rather strange expectation to have, relative to other languages
02:23 Grinnz perl is a rather strange language :P
02:23 Grinnz in terms of circumstances, at least
02:23 jberger I'm not even arguing that its wrong
02:24 jberger I'm just suggesting a possible reasoning for the canonizing of that philosophy
02:24 jberger I just want strict by default
02:24 Grinnz indeed
02:24 jberger that's all I've wanted since I started with perl
02:24 genio Grinnz: I think it's arguable that part of the reason for that mentality is that it's been held hostage at v5 for 16+ years
02:25 Grinnz like i've said elsewhere; let's make a new perl, that's just perl 5 without the suck
02:25 Grinnz there aren't enough forks after all :P
02:25 jberger I hate having to start any beginner with 'now the first thing you do is type "use strict; use warnings"'
02:25 jberger genio: that's the point I'm making
02:26 Grinnz perhaps, both feed into the other
02:26 mattp jberger: im not sure what you are hoping for. if any significant core change broke a majority of cpan p5 would be dead in the water
02:26 jberger yes, it would now be so
02:27 jberger 16 years ago (or lets say 12) would it have been as certain?
02:27 genio but had breaking changes been occuring for the last 16 years, cpan wouldn't be in quite such a bad state as people would be updating their stuff more often
02:27 meredith my thing with "but backward compatibility" has always kinda been why is perl an exception to dependency management
02:27 jberger meredith: it has its virtues to be sure
02:27 meredith yeah i'm not sayin go wild by any means
02:28 Grinnz let me tell you, updating JS libs is much more exciting
02:28 jberger although it has allowed lots of people to expect extremely modern code to run on 5.6
02:28 jberger and effort wasted on doing so
02:28 * Grinnz still hasn't figured out what OS is actually running 5.6 somewhere
02:28 Grinnz 5.8 is of course on all the RHEL5 boxes still out there
02:28 jberger and literally all I'm asking is "if you have some ancient horrible perl code and you want it to run on perl version X, you have to write "no strict" at the top now
02:29 mattp jberger: I didn't even know perl 6 years ago, let alone 12. I can't offer much there other than I don't think time machines exist :)
02:29 mattp who and what is that helping, realistically?
02:30 jberger ... or else don't upgrade perl (they aren't anyway)
02:30 jberger mattp: seriously?
02:30 Grinnz people who want perl to be more attractive to newcomers
02:30 jberger every beginner who doesn't do it and finds a difficult to use language
02:30 jberger sane defaults are mostly for beginners
02:31 jberger experienced users can tweak the defaults to their preferences because they know how
02:31 Grinnz there's everyone's opinionated Modern::Perl clone of course, but 'strict' and 'warnings' are "canon"
02:31 jberger for everyone but tchrist, sure
02:31 jberger (I think it was him)
02:33 sri can we for a second appreciate that "use strict" has been far more widely adopted in perl than in javascript? :)
02:33 Grinnz heh
02:33 genio http://imgur.com/gallery/JfgNK6d  # we need some weeeeeeee
02:34 Grinnz after finding out how scoping works (or doesn't) in javascript, i try to leave thinking about it to the frontend devs on the team :P
02:34 meredith i'm pretty happy about 'let'
02:34 genio me too
02:35 genio Although I detest the word "transpile"
02:35 Grinnz "transpile"?
02:35 jberger genio: oooh yeah, that word is so icky
02:35 jberger sri++
02:35 Grinnz is that their word for compiling text to other text or something, at a guess?
02:35 jberger genio: I agree https://www.youtube.com/watch?v=eWM2joNb9NE
02:36 genio Grinnz: You can write your code using ES6, but since no browsers really support it yet, you have to use Babel to transpile it back to old JS
02:36 meredith other code into simpler JS
02:36 Grinnz ahh, that
02:36 Grinnz it is pretty tricky when your production environment is *every browser on the planet*
02:37 genio jberger: just... wow.
02:37 meredith and yeah js's 'use strict' is surrounded by people telling you to "be careful with the scope of that thing"
02:37 Grinnz hah
02:38 Grinnz also, that guy (from the video)'s face appears to be an emoticon
02:39 jberger he has some really creative stuff too
02:39 jberger https://www.youtube.com/watch?v=aZND9dApFKU
02:39 jberger raps that don't contain certain vowels etc
02:40 jberger genio: I know of much more ... wow than that
02:40 jberger almost all of these come via tempire of course
02:41 genio jberger: heh. a whole section of the web that I'm apparently unfamiliar with
02:41 jberger that's why we have tempire
02:42 jberger if you value all things holy, don't click on this ... https://www.youtube.com/watch?v=iq_d8VSM0nw
02:46 jberger ^^ that I definitely blame tempire for
02:46 genio hahahaha   http://img.memecdn.com/nailed-it_o_201328.jpg  That guy is soooo pitch perfect
02:46 jberger I found a cover where real singers perform it
02:46 jberger and it actually sounds quite good, except you can then understand the lyrics
02:48 Grinnz the thumbs up/thumbs down ratio on that video is amusing
02:48 genio ok, I really need to quit clicking "next post" on imgur
02:49 Grinnz it's an incredibly addicting site :P
02:49 Grinnz you can use the arrow keys by the way. you didnt hear it from me
02:50 genio Grinnz++ # holy crap!
02:51 Grinnz and the enter key zooms. :P
02:52 jberger so I got to clicking through youtube
02:52 Grinnz oh youtube has a whole slew of them
02:53 jberger Keira Knightly was the decoy Amidala?
02:53 jberger https://www.youtube.com/watch?v=ZowEZKWmEVo
02:53 jberger I had no idea
02:53 Grinnz huh
02:54 jberger http://www.quickmeme.com/img/74/7467c78954470032f3ea7e25252bc89019062ff4287a41d134a4998f6b22db7e.jpg
02:54 jberger I mean, for the love of gods don't go back and watch episode 1 for that reason
02:54 Grinnz lol
02:54 Grinnz I wasn't planning on it but now that you mention it... nope
02:55 jberger we just did actually
02:55 Grinnz haha
02:55 jberger we sprinted through the whole series in numerical order
02:55 jberger it actually made ep 3 rather palatable
02:55 jberger (meaning 1 and 2 made 3 palatable
02:55 Grinnz I should watch 4-6 though, while i dont care for star wars in general i really havent seen them in probably 15 years
02:55 jberger )
02:56 jberger I've heard people advocate for watching them as 4,5,2,3,6 and presumably 7 now
02:56 Grinnz yeah there was a blog or something about that order lol
02:56 jberger but I've now heard another which is just skip 1 and 2 completely
02:57 jberger 3 contains all you need for anakin's story
02:57 jberger and its the least terrible
02:57 genio I have only seen 7 as a terrible pirated version.  I should really go see it sometime
02:58 jberger it was fun and very much in the spirit of 4-6
02:58 jberger the story doesn't hold up to much scrutiny and there are some flaws but overall thumbs up
03:00 genio Well, I'm off to go binge watch some more Doc Martin and pass out.
03:01 sri episode 7 is much better than the last 3
03:30 witch joined #mojo
03:54 noganex joined #mojo
04:24 c--__ joined #mojo
05:06 Adura joined #mojo
05:07 melo joined #mojo
05:11 jontaylor joined #mojo
05:13 inokenty-w joined #mojo
05:23 melo1 joined #mojo
05:37 melo2 joined #mojo
05:44 melo1 joined #mojo
07:19 kes joined #mojo
07:20 dod joined #mojo
07:26 dod joined #mojo
07:34 McA joined #mojo
07:35 lsm joined #mojo
07:36 berov joined #mojo
07:49 osfabibisi joined #mojo
08:08 Vandal joined #mojo
08:33 trone joined #mojo
08:33 AndrewIsh joined #mojo
08:34 punter joined #mojo
09:09 sue joined #mojo
09:11 berov joined #mojo
10:20 jontaylor joined #mojo
10:58 bpmedley joined #mojo
11:07 vanHoesel1 joined #mojo
11:55 asarch joined #mojo
11:56 vanHoesel1 joined #mojo
12:01 vanHoesel2 joined #mojo
12:16 bzero Hello. How to redirect to absolute url? $self->url_for->base . $self->url_for('name') ?
12:17 vanHoesel1 joined #mojo
12:19 nic bzero: something like $self->redirect_to($self->url_for(...)->to_abs)
12:20 bzero to_abs! Thank you, nic!
12:21 batman bzero: why do you need the absolute url?
12:30 kaare joined #mojo
12:33 vanHoesel1 joined #mojo
12:36 ajr_ joined #mojo
12:42 vanHoesel1 joined #mojo
12:47 neilhwatson joined #mojo
12:54 vanHoesel1 joined #mojo
13:17 bzero batman: To send in external place.
13:29 batman bzero: i can't see a case where you need an absolute url in a "Location" header :/
13:30 vanHoesel1 joined #mojo
13:58 vanHoesel1 joined #mojo
14:07 vicash hello. i have asked a few questions in the last few days and gotten good answers. Now i've arrived at the meat of my problem. I am replacing a C++ GUI with a Perl Web UI that invokes C++ commandline programs on demand across a cluster. What is the best practice for doing a fork/exec( ) using Mojo ? Is there an example or doc somewhere I can read ? Thanks.
14:21 batman vicash: i would suggest using either https://metacpan.org/pod/Mojo::IOLoop::ReadWriteFork or https://metacpan.org/pod/Mojo::IOLoop::ForkCall
14:22 batman depends on what you want reported back to the mojo application.
14:22 vicash thanks batman, i will look at those.
14:22 vicash yes I have to figure out how to send back results from the child application to the parent mojo controller too, need some reading
14:22 batman you might also look at a different design, where you create minion tasks and simply avoid calling the applications from your mojo app
14:22 vicash batman: please elaborate on what you mean by minion tasks
14:23 batman https://metacpan.org/pod/Minion
14:23 * vicash has never heard of Minion... looks...
14:23 nicomen basically using a job server that runs independently of the web server
14:23 vicash interesting that's really what i need actually..
14:23 nic with that, also look at Minion::Notifier and Mercury
14:24 vicash cool thanks !!
14:24 nic and please report back on how it goes
14:25 vicash nic yes I will. Minion looks awesome
14:34 zivester joined #mojo
15:33 melo joined #mojo
15:34 jberger http://blogs.perl.org/users/joel_berger/2016/01/on-the-semantic-naming-of-things.html#comment-1657354
15:35 GabrielVieira joined #mojo
15:37 jason_ joined #mojo
15:38 jason_ Looking for advice. Trying to trim spaces from the beginning and end of some form inputs before I use the validator on them... something like $v->required('foo')->like(qr{...}); but I want to trim it before hand ($foo =~ s/^\s+//; $foo =~ s/\s+$//;)
15:38 jason_ How can I trim things between $v->required() and $v->required()->like()
15:41 nicomen jberger++
15:42 jason_ I can't imagine this is a rare thing to do...?
15:46 sh4 joined #mojo
15:51 melo joined #mojo
15:51 sri jason_: haha, i made a proposal for validation filters a few months back, but there was not enough interest
15:52 jason_ Wait so you can't do this? How is Mojo even viable?
15:52 jason_ Does no one strip their form inputs?
15:53 jason_ Please tell me they add JS to their forms and pre-submit strip them... LOL
15:55 nicomen they might be using other standard form validation modules?
15:56 nicomen or a simple before handler to fix up all args
15:58 genio or manually validating fields, or ...
15:58 nicomen or, trimming might be performed closer to a model, where it needs to be somewhat washed anyway
15:58 nicomen you would want to be able to do Person->add( name => "   Some Name " ) and trimming happening at that level for instance
15:59 sri then your validation might not pass
15:59 sri ->equal_to('whatever')
16:00 sri does not accept "   whatever   "
16:01 jberger jason_: I have to admit that I personally haven't used mojo's validation layer
16:01 nicomen true that, I was just pointing out that Mojo can be viable because his expectation of some behaviour isn't necessarily as critical as he thought
16:01 jberger and I haven't heard much chatter about it
16:01 jberger it would be nice to get real-world experiences and improve it where needed
16:01 nicomen also, perhaps something like a Sanitizer layer is what you should do before validating
16:02 jason_ So there are 10 workarounds and that's ok as the status quo. Got it.
16:02 sri funny thing is, looking through the chat log i see proposals from me, bpmedley and batman for validation filters
16:03 nicomen jason_: I think, nevertheless, any filters should be easy to lift, or be optional, as it might be more surprising if the data was magically modified by default
16:03 sri nicomen: every single proposal did that
16:03 jason_ Hilarious. Thanks for the insight LOL
16:03 jason_ left #mojo
16:03 Grinnz_ didn't seem like that was going to be very productive after his first response
16:04 nicomen wow, I thought I was being nice and friendly and constructive...
16:04 sri true
16:04 vicash soon you'll see a talk in a big conference making fun of Mojo not doing something ;)
16:04 mspo what does rails do?
16:04 Grinnz_ "it doesn't do this one feature exactly as i want it to! completely useless framework!"
16:05 sri now i want to drop the topic simply because of his behavior
16:05 sri not sure that's good for mojolicious though
16:05 * sri shrugs
16:05 nicomen yeah, better just conclude on a +1 to be able to filter
16:06 genio Yea, I'm not sure why he thinks that because there isn't a validation layer as he thinks of it that people can't validate input.
16:06 Grinnz_ curious where he got his expectations from
16:07 nicomen he probably was frustrated up front, and not giving him an easy solution didn't help
16:07 mspo use taint
16:07 Grinnz_ i mean, he probably had used some other framework in a language that had that feature, otherwise why would he expect it
16:07 nicomen a oneliner before_dispatch would probably have helped him
16:09 Grinnz_ he wasn't looking for easy solutions, he was looking for a builtin method
16:09 Grinnz_ he made that clear
16:09 nicomen right right
16:09 vicash in theory, how would "trim()" on a utf8 string even work ?
16:09 mspo but how can you know how to validate his forms?
16:10 Grinnz_ vicash: validation is done on decoded parameters...
16:10 genio I have personally found almost all validation layers in frameworks to be annoying and in the way.
16:10 nicomen vicash: not sure what you mean, are you thinking of deciding what kind of whitespace characters should be stripped?
16:10 vicash yes nicomen: that was my question..
16:11 Grinnz_ i don't see how that's relevant
16:11 sri for the record, i think this was my proposal http://pastie.org/9420422 6 months ago
16:11 jberger I'm in favor of some filter handling, I can't comment on what features are useful since I'm not up on the usage, but yes it seems like trim is a very reasonable use case
16:11 nicomen vicash: not sure what the best way would be, but I would probably use a regex in utf8 mode and trust whatever \s is
16:11 vicash ok
16:11 bwf https://metacpan.org/pod/Mojolicious::Plugin::ValidateTiny
16:12 nicomen sri: that looks quite nice?
16:13 sri i remember lb really wanted it, and then bpmedley and batman came up with slightly different proposals, and things derailed somehow
16:14 bpmedley sri : From memory, people are using different solutions and don't necessarily want to update their code.
16:15 sri not sure i like my patch anymore anyway, it touches the output
16:16 lb _o/
16:16 sri hmm, but i guess it has to work that way
16:16 sri \o
16:20 PryMar56 joined #mojo
16:20 sri ah, i see what went wrong, batman ended up voting -1 on it
16:22 sri and then i ended up not linking the proposal anymore either
16:22 sri http://irclog.perlgeek.de/mojo/2015-06-26
16:28 sri not sure why it ever filtered input
16:40 zivester joined #mojo
16:54 sri allright, another try
16:54 sri new patch for validation filters https://gist.github.com/anonymous/4d35e5b89675f0b1aae1
16:54 sri marcus, jberger, batman, tempire, crab: votes?
16:54 * jberger reads
16:58 jberger it looks good to me, but I don't consider myself an authoritative vote
16:58 jberger batman: I'd really like to hear your comments
16:58 jberger seeing as you voted -1 before
16:59 sri note that i have no idea why it modified input and output before
16:59 sri didn't even test for that
16:59 sri this one only modifies the output
17:00 jberger if sri and batman both +1 then I'm +1 as well
17:03 sri i'm +1
17:03 sri think i just got annoyed last time
17:13 binlei joined #mojo
17:14 binlei hello, anyone oneline?
17:14 * sri hides behind jberger
17:14 bpmedley binlei : Howdy
17:14 * batman is not sure.
17:15 jberger perl -E 'say "hello binlei"' # oneline
17:15 batman but i'm not in a position to vote now.
17:15 binlei I am using IOLoop::Client to send and receive TCP packet
17:15 * batman is out drinking beer
17:15 batman *bbl*
17:15 Grinnz_ /m # treat as multiple lines
17:15 binlei I use stream->write to send and event listen to read to read packet
17:15 * sri wonders if lb still cares about validation filters
17:16 binlei It’s strange that one response is received in two read event
17:17 Grinnz_ what are you using it to communicate with?
17:17 binlei I am writing kafka client
17:17 binlei I need to communicate with kafka
17:17 sri tcp is a stream-oriented protocol
17:18 binlei How do I make sure one response is received in one event?
17:18 sri you can't
17:18 jberger I don't understand the question
17:19 sri he wants udp semantics from tcp
17:19 binlei what can I do?
17:19 binlei How can I deal with this situation?
17:20 lb sri: i do, but the project we needed it for is almost done ;)
17:20 jberger binlei: your message arrives in two chunks?
17:20 sri binlei: you use a stream-oriented parser
17:20 sri binlei: like Protocol::Redis for redis
17:21 binlei jberger: yes, my message arrives in two chunks
17:21 binlei I think
17:21 sri lb: i take that as a +1 vote
17:21 jberger binlei: can you just append the message to a buffer?
17:22 jberger and then try to figure out if you have a complete message or not?
17:22 jberger its a pretty blunt-force mechanism
17:22 jberger but it works for most cases
17:22 jberger and if you don't have a stream-oriented parser already
17:22 sri there's an example in the repo that does that
17:22 sri https://github.com/kraih/mojo/blob/master/examples/connect-proxy.pl
17:24 jberger binlei: here's an example from ForkCall: https://github.com/jberger/Mojo-IOLoop-ForkCall/blob/master/lib/Mojo/IOLoop/ForkCall.pm#L79
17:24 jberger it has the advantage of knowing that the message is over when the stream is closed
17:24 jberger but it makes it a very simple example
17:24 binlei thanks for all the advices
17:24 binlei I would read all of them. thanks very much
17:25 binlei since it’s 1:24 am in China, I would go to sleep now.  Have a nice day.
17:25 jberger binlei: sleep well
17:26 good_news_everyon joined #mojo
17:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/398cac135dae214ba22c2d88f1a7123525077eef
17:26 good_news_everyon mojo/master 398cac1 Sebastian Riedel: add support for validation filters
17:26 good_news_everyon left #mojo
17:26 sri i've not decided yet if it stays
17:26 binlei joined #mojo
17:26 neilhwatson joined #mojo
17:26 ajr_ joined #mojo
17:33 good_news_everyon joined #mojo
17:33 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/9dd46a1f44c217fd6add0c9a3733903bde04e8ae
17:33 good_news_everyon mojo/master 9dd46a1 Sebastian Riedel: fix typo in example
17:33 good_news_everyon left #mojo
17:34 good_news_everyon joined #mojo
17:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/279a77af9dd11b0c868307182581cba423f1f9fa
17:34 good_news_everyon mojo/master 279a77a Sebastian Riedel: another filter example
17:34 good_news_everyon left #mojo
17:40 dod joined #mojo
17:48 hummeleBop joined #mojo
17:50 disputin joined #mojo
18:06 tyldis Is AnyEvent::RabbitMQ the best async alternative for Mojo?
18:06 Grinnz_ i don't understand the question
18:07 tyldis (for RabbitMQ interaction within a Mojo app)
18:07 Grinnz_ ah
18:08 Grinnz_ don't know how you'd define "best". it should work natively if the Mojo app is using the EV backend. there's also Net::Async::AMQP, using the IO::Async loop which has a Mojo backend
18:08 Grinnz_ there's also an IO::Async backend for mojo, etc etc
18:09 Grinnz_ (i have no personal experience with either MQ module, just those are the ones i know of)
18:10 tyldis Yeah, I'm kinda batteling myself over pure AMQP aproach or the native RabbitMQ-route. The RabbitMQ specific ones allow for more advanced interaction
18:11 tyldis Like defining exchanges, routes and queues
18:13 tyldis Oh, it does support most of that in Net::Async::AMQP. The name had me fooled
18:16 sri oh, i've been invited to stickermule \o/
18:16 Grinnz_ yeah. i checked it does mention RabbitMQ at least heh
18:23 lucifer hi
18:24 disputin joined #mojo
18:35 GabrielVieira joined #mojo
18:39 disputin joined #mojo
18:42 sri hmm, stickermule only accepts adobe formats :o
18:42 sri good thing i've recently switched to affinity designer
19:02 PopeFelix How do I get to a Mojo::Message from a Mojo::Transaction?
19:02 PopeFelix I'm trying to detect when the content length has exceeded the maximum message size.
19:03 bpmedley PopeFelix : $tx->req  Will give you the Mojo::Message::Request
19:04 PopeFelix bpmedley, that'll do it. thanks.
19:04 bpmedley PopeFelix : $tx->req->max_message_size ?
19:04 PopeFelix yeah
19:08 mad_hatter joined #mojo
19:08 mad_hatter Is there a way to edit Mojolicious::Plugin::Config in a full mojo app? Like if I wanted to change the default port hypnotoad listen on?
19:09 bpmedley mad_hatter : Without actually using a config file?
19:09 preaction sounds like you want to use a config file
19:09 mad_hatter Yes exactly like myapp.conf
19:09 bpmedley mad_hatter : http://mojolicious.org/perldoc/Mojolicious/Plugin/Config#default
19:10 mad_hatter I'm just not sure where that would fit in the directory structure of the application
19:10 bpmedley mad_hatter : Path to configuration file, absolute or relative to the application home directory, defaults to the value of the MOJO_CONFIG environment variable or $moniker.conf in the application home directory.
19:10 preaction it shouldn't, at all, because you shouldn't be doing it. what reason do you have for doing it in exactly this way?
19:10 bpmedley mad_hatter : http://mojolicious.org/perldoc/Mojolicious/Plugin/Config#file
19:11 mad_hatter Hahah i just want to make hypnotoad listen on 3000 instead of 8080 I dunno how to do that. docs say I need to do something with a config file
19:12 bpmedley mad_hatter : Which part of what I mentioned doesn't make sense?
19:12 Grinnz_ mad_hatter: $app->config(listen => [...]); the Config/JSONConfig plugin is one way to set this using a file instead of in startup
19:13 jberger tyldis: I didn't have a good option for RabbitMQ on mojo
19:13 Grinnz_ well, two ways, i guess :P
19:13 jberger I wrote most of it on my own (using one of the modules where possible)
19:13 Grinnz_ sorry, $app->config(hypnotoad => {listen => [...]})
19:17 jberger tyldis: https://gist.github.com/jberger/9c8398a75e2706d90bb4
19:17 jberger that's what I wrote
19:21 mad_hatter thanks Grinnz_, preaction and bpmedley :) I got it working now
19:25 disputin joined #mojo
19:41 tyldis jberger: Thanks, I'll keep that in mind :)
19:42 tyldis Hadn't seen Crixa before
19:44 jberger its not my absolute favorite
19:44 jberger but it was better than the others
19:46 tyldis Handcrufting stuff in Net::AMQP::RabbitMQ right now, which is very tedious
19:53 sri making stickers is hard, not sure where to go with colors https://imgur.com/QtbLsA3
19:54 sri the white outline makes white clouds look very boring
19:54 genio I have always been terrible with graphics.
19:55 jberger what does that look like inverted
19:55 jberger so the outline is gray and the inside is white
19:55 sri not good
20:02 jberger tyldis: if nothing else, seeing how Crixa used the lower level stuff was better documentation than I could find for the lower level stuff
20:03 tyldis The whole RabbitMQ experience can be mind boggeling. It all seems so simple until you dive into it - and the number of way to achieve the same result doesn't really help ;)
20:04 tyldis For someone like myself you get caught overengineering
20:23 sri jberger: just for the record :) https://imgur.com/OSithQF
20:24 jberger I wouldn't hate that on say my macbook cover
20:24 sri lol
20:32 bwf make the "dots" on the "i" and "j" into clouds
20:35 mad_hatter joined #mojo
20:42 jberger that would be nice if we were in middle school
20:42 _dave_ Is Mojo::Base compatable with packages that use Sub::Exporter?
20:42 jberger bwf: sorry, that was just too tempting
20:43 _dave_ sri: make the circular cloud into a jagged one like an electric spark and I bet you'll like it better
20:43 sri bwf: little boring if it's the same cloud https://imgur.com/wHwM510
20:45 bwf I was thinking you could keep the larger cloud as well.  I will stay out of the way.  http://imgur.com/7O2FM6I
20:46 Grinnz_ _dave_: don't see why not. Mojo::Base doesn't affect exporting at all
20:46 _dave_ there's an "import" method in Mojo::Base
20:46 Grinnz_ ah right, that might conflict
20:46 _dave_ and in the class I have there's an import method that gets composed into an upper package
20:47 _dave_ so how would I call both? I'm fairly sure they wont step on each other
20:47 _dave_ and if they do...well that's my issue ;)
20:47 _dave_ $self->SUPER doesn't seem appropriate
20:47 jberger bwf: I was just trying to be funny (and badly) your suggestions are welcome of course
20:48 Grinnz_ _dave_: SUPER probably wouldnt work because it won't re-export the pragmas to the caller
20:50 Grinnz_ you know, https://metacpan.org/pod/Call::From might actually be useful here
20:50 Grinnz_ i noticed this was recently released
20:50 Grinnz_ not sure how to go about untangling the import mess specifically though...
20:53 _dave_ that's interesting, not sure I really know how it works or what the edge case subtle "I have to know guts of perl" issues are
20:54 Grinnz_ https://metacpan.org/pod/Call::From#Numeric-Call-Levels is basically how you'd be using it. since you're calling other import methods, but you want to appear to be whoever is importing you in the first place
20:54 _dave_ the trick is I'm two deep in packages by the time I get to the code that uses Sub::Exporter
20:55 sawtooth joined #mojo
20:56 Grinnz_ oh and actually the pragma imports would work, it's the function imports like 'has' that need the spoofed caller to export to the right package
20:56 _dave_ pragma imports?
20:56 Grinnz_ strict->import, etc
20:56 _dave_ I bet Sub::Exporter doesn't use that
20:56 Grinnz_ Mojo::Base does
20:59 Grinnz_ also, i may be overthinking things.
20:59 _dave_ I know I am ;)
21:00 _dave_ Ah I see: $_->import for qw(strict warnings utf8);
21:00 _dave_ but that's inside a sub called import ;)
21:01 Grinnz_ right; chaining those works fine since they're lexical pragmas, which is how calling it like that in sub import works to begin with
21:01 _dave_ there's a Mojo::Base::XS?
21:02 Grinnz_ sounds familiar. no idea if it's any good
21:02 Grinnz_ test failures don't look promising :/
21:03 batman jberger: it's so strange you don't use Mojolicious::Validator :(
21:03 Kogurr joined #mojo
21:04 cpan_mojo Swagger2-0.69 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.69
21:04 Kogurr joined #mojo
21:04 Grinnz_ personally i'm just used to quick validation checks when needed after reading request params
21:05 Grinnz_ i want to try it sometime though
21:05 Grinnz_ but i guess i've been bitten a few times by overzealous validators that aren't properly tailored to what i actually want to check
21:12 sri leaning in a different direction now https://imgur.com/LmjXG6L
21:14 batman sri: i like the last sticker the most
21:16 sri me too, just gotta figure out the details
21:16 batman https://gist.github.com/anonymous/4d35e5b89675f0b1aae1#file-filter-diff-L105 <-- could this be die() if you give it an "invalid" $filter name?
21:17 batman hm.... maybe not very mojolicious to die :)
21:18 sri seems reasonable
21:18 sri ->check could do the same
21:21 melo1 joined #mojo
21:21 jberger I like that sticker
21:21 batman +1 on https://github.com/kraih/mojo/commit/398cac135dae214ba22c2d88f1a7123525077eef
21:22 jberger I'd also like a cloud and crossbones too
21:22 * jberger is wearing that shirt today as it happens
21:22 jberger batman: it would only be the request that dies
21:23 batman jberger: what do you mean?
21:24 jberger "hm.... maybe not very mojolicious to die :)"
21:25 batman jberger: what i meant is that there's not many mojo function/methods that die.
21:26 batman sri: the comment about "die" is... not super important to me, but it might stop me from making stupid typos.
21:27 batman not sure if there's a case where i want it to return... unless i have $filtername = $c->param("filter"); $v->required("foo")->filter($filtername); maybe :)
21:27 jberger I don't imagine you would want your validation (and thus request) to continue if you were filtering incorrectly
21:27 jberger and presumably since its a die it is something you would catch in development quite quickly
21:27 Grinnz_ it's similar to other instances of croaking when a method is called incorrectly...
21:28 batman jberger: yeah. that's my argument as well... but it's also something your test suite should pick up (the typo)
21:28 preaction what's the right way to test controllers in isolation? or should i not try to do that?
21:28 batman preaction: i only test them through Test::Mojo and an actual request
21:29 preaction right, but to load the controller and give it routing, i have to wrap it in an app, no?
21:29 Grinnz_ for routing, yeah...
21:29 Grinnz_ but is that really "in isolation"?
21:29 Grinnz_ that seems like a standard Test::Mojo to me
21:30 melo joined #mojo
21:30 preaction fair point. i'm also likely planning for an absurd case of changing my routing, which i have, so far, never actually done ever
21:31 Grinnz_ heh
21:31 Grinnz_ I have occasionally but usually while writing the tests for said routes just after making them :P
21:32 batman preaction: that's why you name your routes.
21:32 preaction yeah, during dev, sure. but once dev is complete and maintenance (and thus feature creep) takes over and it becomes harder and harder to change routing, there's less benefit and more rish
21:32 batman sorry. nevermind my last comment :(
21:32 preaction batman: of course, but Test::Mojo requires i use route... unless i use url_for maybe
21:32 batman sri: so this time around, i'm +1 on the filter() patch :)
21:32 * batman gets some sleep
21:34 Grinnz_ there's no way to stick placeholder values in a url_for anyway, is there?
21:35 Grinnz_ perhaps i should look a the actual docs for it, which is in M::Controller
21:35 jberger Grinnz_: sure
21:35 jberger $c->url_for('route_name', key => $value, other_key => $other_value)
21:36 Grinnz_ ahhh it uses https://metacpan.org/pod/Mojolicious::Routes::Match#path_for
21:36 Grinnz_ nice
21:36 jberger Grinnz_ levels up
21:36 sri you wouldn't believe how much trial and error went into url_for and path_for
21:37 Grinnz_ would be cool to have another example showing placeholder insertion for url_for :D
21:38 Grinnz_ https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Routing.pod#Named-routes does show it though, thats good
21:41 Grinnz_ i can believe it, that's a very DWIM method
21:54 melo joined #mojo
22:08 punter joined #mojo
22:11 orev joined #mojo
22:28 neilhwatson joined #mojo
22:33 cpan_mojo Test-Clustericious-Blocking-0.02 by PLICEASE https://metacpan.org/release/PLICEASE/Test-Clustericious-Blocking-0.02
22:37 melo joined #mojo
22:46 sri slightly different variation of the previous sticker https://imgur.com/yPcRA2O
22:47 bpmedley sri : Perhaps a rainbow instead of the nighttime?
22:47 jberger <3
22:54 sri bpmedley: maybe a second variant
22:59 bd sri: add some drop shadow to the text to create depth with the cloud?
22:59 bd or a black outline
23:01 melo joined #mojo
23:03 sri bpmedley: rainbow is not bad, but nightsky is better https://imgur.com/XuzPEaZ
23:04 bpmedley Hrmm.  Night sky is more mysterious and magical.
23:05 sri bd: not sure i like shadows on a sticker
23:05 bd sri: maybe just en extra black outline around the white outline around the text
23:06 sri that would get cut off on the actual sticker
23:16 bpmedley http://bmedley.org/mojo_comet.png <-- A fun comet?
23:18 sri haha
23:19 sri bd: we can also just move the cloud a little https://imgur.com/2Am7xUv
23:20 disputin joined #mojo
23:23 sri (the sticker won't really be that big)
23:23 bpmedley http://bmedley.org/mojo_smiley.png
23:24 sri ;p
23:27 Grinnz_ hahah
23:28 sri not sure which placement is better https://imgur.com/MAyIqeK
23:31 pink_mist I think I prefer https://imgur.com/2Am7xUv
23:40 jberger I like the circle being under the word
23:40 jberger but I don't like how close that makes the word to the could
23:40 jberger cloud
23:47 melo joined #mojo
23:59 binlei joined #mojo

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