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

IRC log for #mojo, 2014-07-25

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

All times shown according to UTC.

Time Nick Message
00:00 jb360 joined #mojo
00:01 powerman joined #mojo
00:03 powerman Is it possible to get undef from Mojo::IOLoop->stream($c->tx->connection) in usual controller?
00:04 powerman no async code involved, just usual $r->any('/', sub { my $c = shift; … })
00:06 powerman here is report I get: http://www.cpantesters.org/cpan/report/f35ca462-11c0-11e4-96d0-07f06dfca90a
00:06 powerman and here is the code: https://metacpan.org/source/POWERMAN/Mojolicious-Plugin-JSONRPC2-1.1.0/lib/Mojolicious/Plugin/JSONRPC2.pm#L61
00:07 powerman any idea how/why this may happens?
00:08 powerman this is only failed test from ~300, so I suppose something may be wrong with test environment or mojolicious
00:14 woz joined #mojo
00:19 jberger_ hadfl: better to ensure that it doesn't fork until the event loop is running
00:19 jberger_ it was a design decision that I had been toying with for a while
00:20 jberger_ if there are any major concerns, the sooner, the better
00:20 jberger_ I could still be talked out of it for now
00:20 hadfl well not a concern but why not keeping it simple. if you want to delay the fork you will create it in a timer callback anyway
00:20 disputin joined #mojo
00:21 jberger_ the original design was a direct-ish port of AnyEvent::Util::fork_call, but as I understand the horror better, I've been tweaking it to my own purposes
00:22 jberger_ using delay rather than timer is because it doesn't have the same cycle-inducing storage
00:22 hadfl well the module is very nice and compact
00:22 hadfl like it
00:22 jberger_ I've been working on some error handling issues too, but I don't think they will go out with the next release
00:23 hadfl well the only concern is, that after run returned, the pid is not present immediately
00:23 hadfl don't know if that can cause an issue though
00:24 jberger_ right, but it is not present because it hasn't forked yet
00:24 jberger_ so I don't see any issue there
00:24 hadfl yeah your right
00:24 hadfl well then no concerns from my side
00:25 hadfl thanks for the fast fix
00:25 jberger_ \o/
00:41 jberger_ I'm thinking about adding an explicit error event
00:42 jberger_ in which case, a small change in behavior is that deserialize errors would be sent to that event and not to the callback
00:42 jberger_ callback error slot would only be for errors in the child
00:44 hadfl fair enough
00:45 jberger_ it would also break 100% drop-in replacement for AE's fork_call
00:47 hadfl well that's up to you to decide. I'm happy as long as i can run more than one fork in parallel and get pids
00:47 hadfl and that's the case now
00:47 jberger_ hadfl: are you also oetiker?
00:47 hadfl no. but we work together on the tool where we use ForkCall
00:52 jberger_ this would be the patch for that
00:52 jberger_ https://github.com/jberger/Mojo-IOLoop-ForkCall/compare/error_event
00:53 jberger_ I wonder if I should waitpid once at the top, rather than in two possible places?
00:54 jberger_ well while I think about it, I will release the patch you guys need
00:55 hadfl thanks
01:00 hadfl you could do a: return if waitpid($child, WNOHANG) <= 0;
01:01 hadfl instead of return unless $$ == $parent;
01:02 jberger_ hmmmmm, you think so?
01:02 hadfl yeah.
01:03 jberger_ with enough children being created and dying, couldn't that accidentally succeed incorrectly sometimes?
01:04 hadfl a good question. i don't think so but can't prove it. if you don't feel comfortable w/ it. don't do it
01:04 jberger_ anyway, https://metacpan.org/release/JBERGER/Mojo-IOLoop-ForkCall-0.12
01:05 hadfl thank you
01:05 jberger_ no problem
01:05 jberger_ this module is turning into my white whale
01:05 hadfl will run tests tomorrow. getting late
01:06 laouji joined #mojo
01:06 jberger_ in case of troubles, I will be out of town for almost two weeks
01:07 jberger_ so in case of troubles, submit pull requests and I will try my very best to comply when I return
01:07 hadfl i don't think there will be any other issues
01:08 hadfl have been testing since 2 days
01:08 hadfl but with temporary fixes we did
01:09 jberger_ if you wouldn't mind, could you look at the error_event branch too and let me know
01:09 jberger_ (later, cause as you said, its getting late)
01:09 hadfl concerning non-blocking waitpid. i think you are right. if there would be a lot of forks and dying forks it could lead to issues...
01:10 jberger_ my motivation is mostly that if your callback dies, it gets caught by the loop via the stream object, which isn't at all nice
01:10 hadfl will check it tmrw
01:10 hadfl good night
01:10 jberger_ o/
01:15 woz joined #mojo
01:50 klapperl_ joined #mojo
02:17 woz joined #mojo
02:53 btyler joined #mojo
02:59 neyasov________ joined #mojo
03:17 woz joined #mojo
03:38 chankey joined #mojo
03:42 gatitskiy joined #mojo
03:52 disputin joined #mojo
03:52 gatitskiy joined #mojo
03:55 basic6 joined #mojo
04:01 gatitskiy joined #mojo
04:09 sujithm joined #mojo
04:20 woz joined #mojo
04:52 KCL joined #mojo
05:06 laouji joined #mojo
05:07 laouji joined #mojo
05:21 woz joined #mojo
05:33 gatitskiy joined #mojo
05:42 gatitskiy joined #mojo
06:13 elik joined #mojo
06:15 dotandimet joined #mojo
06:23 woz joined #mojo
06:42 dod joined #mojo
06:47 _eugen joined #mojo
06:51 mattastrophe joined #mojo
06:58 gatitskiy joined #mojo
06:59 gatitskiy joined #mojo
07:04 sugar_ joined #mojo
07:05 * batman wonder if the heat has killed #mojo ...
07:19 dotan joined #mojo
07:21 rawler joined #mojo
07:25 woz joined #mojo
07:28 edestler joined #mojo
07:28 trone joined #mojo
07:37 Vandal joined #mojo
07:40 dexteruk_ joined #mojo
07:47 dotan joined #mojo
07:48 mire joined #mojo
07:50 mattastrophe joined #mojo
07:52 basiliscos joined #mojo
08:05 denis_boyun joined #mojo
08:14 good_news_everyon joined #mojo
08:14 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/TngqiA
08:14 good_news_everyon mojo/master 88740b5 Andrey Khozov: Fixed typo in proxy doc
08:14 good_news_everyon mojo/master 1924f63 Sebastian Riedel: Merge pull request #654 from avkhozov/proxy_doc...
08:14 good_news_everyon left #mojo
08:19 gatitskiy joined #mojo
08:25 fhelmber_ joined #mojo
08:25 dotan joined #mojo
08:25 sri finally raining here \o/
08:27 woz joined #mojo
08:36 gatitskiy joined #mojo
08:36 batman :)
08:39 gatitskiy joined #mojo
08:54 mire joined #mojo
09:06 woz joined #mojo
09:23 blacklight joined #mojo
09:24 blacklight hi, i'm following the guide on http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook to start a websocket server. everything works fine as long as i use http. anyway from the guide it's not clear how to explicitly use ssl on server side, is this possible?
09:26 batman blacklight: are you testing your code with morbo?
09:27 batman what does your --listen say?
09:28 blacklight batman: i'm just working on this sample: http://pastebin.com/00QKZdxd, all i need is that this kind of server uses https instead of plain http
09:28 batman but how do you execute the code..?
09:28 blacklight perl script.pl daemon
09:29 batman then try --listen https://*:3000
09:32 blacklight batman: it doesn't seem to be working...i get Listening at "https://*:3000" but when i try to establish a websocket connection through chrome console, var socket = new WebSocket('wss://myhost:3000/');, simply nothing happens and i cannot write anything on that socket
09:32 blacklight everything works fine instead if i specify --listen http://*:3000
09:34 batman what does the server say? could there be a bug in the js instead of the server setup?
09:35 batman also, why do you want to test with ssl...? https vs http doesn't have anything to do with your code
09:36 blacklight i need the websocket server to use ssl, since the websocket server will be queried by an https page, and chrome will block any websocket which doesn't use ssl
09:36 blacklight when i do --listen https://*:3000 all the server outputs is the following:
09:36 blacklight [Fri Jul 25 11:35:06 2014] [info] Listening at "https://*:3000".
09:36 blacklight Server available at https://127.0.0.1:3000.
09:36 blacklight then i create the websocket from the client this way: var socket = new WebSocket('wss://fmanganiello-off.dev.booking.com:3000/');
09:37 blacklight but nothing prompts on the server side
09:37 batman are you able to get any other pages from the server?
09:37 blacklight the server only has a simple service associated to '/'
09:38 blacklight and for testing it i'm using the dev console of chrome, latest version
09:39 batman maybe you need to accept the cert first
09:40 batman try just http://localhost/ in your browser. maybe you get prompted to accept the default mojo cert
09:41 blacklight oh, that was the issue :) once accepted the certificate everything works fine
09:41 blacklight how can i manually specify a certificate to mojo?
09:42 batman https://metacpan.org/pod/Mojo::Server::Daemon#listen
09:47 sri hmmm
09:47 sri guess i might just give Mango basic replica set support
09:47 batman blacklight: do you get the doc?
09:48 sri this is basically it https://github.com/kraih/mango/commit/d46eefa41878b322001df267420f64ad57cb1a16
09:53 sri that makes basic failover work
09:53 sri as it happens i'm working with a replica set at the moment -.-
09:54 sri might leave it untested so i can remove it again if it doesn't work out
09:54 sujithm joined #mojo
09:54 sri reading from secondary nodes is where it gets really hard... not even going to try that
09:57 pudgetta joined #mojo
09:58 noganex joined #mojo
09:59 hadfl joined #mojo
10:08 blacklight batman: how do i use a daemon object, i.e. how do i associate it to my server app?
10:10 batman i don't get the question
10:10 woz joined #mojo
10:11 logioniz joined #mojo
10:12 blacklight batman: in other words, would $daemon->run replace app->start, or should they somehow interact?
10:13 batman could you rather explain what you do and what doesn't work
10:13 batman ?
10:18 blacklight batman: i mean, i need to completely rewrite the script to match this design, the websocket '/' call, the $c->on(...) for managing events, nothing is the same by using this approach, is it correct?
10:19 batman no. why would the application logic be any different when you use ssl..?
10:19 batman by the way: "script", "design" and "it" is not very specific, so it's almost impossible to answer correctly
10:21 blacklight ok, explaining better, compare the example here: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#WebSocket_web_service and the example here: https://metacpan.org/pod/Mojo::Server::Daemon#SYNOPSIS
10:21 blacklight i've created a server using the former approach, and the latter seems to have a complete different syntax
10:22 blacklight my question is: is it possible to use ssl + custom certificates using the same syntax/approach in the first link?
10:22 blacklight i.e. using pure Mojolicious::Lite
10:23 batman yes!
10:23 batman did you see the documentation i sent you? it describes which format the --listen option can take
10:23 laouji joined #mojo
10:24 batman don't be confused that it describes an attribute in a module. it's (almost) the same. daemon --listen http://*:3000 --listen https://localhost:500?key=/path/to/key.cert....
10:25 batman if it sounds complicated, then you're probably overthinking the problem. "complicated" is not very mojolicious-like :)
10:27 batman and if it doesn't work with the key= and cert= then you have maybe switched the files. (that's what i always do...)
10:28 blacklight ohhhh ok got it now - so if i want to use a custom certificate/key i just have to specify something like --listen https://*:3000?cert=/x/server.crt&key=/y/server.key, without having to follow the same approach (daemon-like instead of mojolicious lite) used in that piece of documentation, is it correct?
10:28 batman not sure about that last part, but the first is correct (before comma)
10:28 batman just try it :)
10:28 blacklight ok thanks ^^
10:29 laouji joined #mojo
10:31 logioniz Hi mojo men!
10:31 logioniz I think that mojo validation look something like this:
10:31 logioniz $validation->required('param1', 'custom error1')->
10:31 logioniz filter('trim')->filter('my filter')->
10:31 logioniz size(2,3, 'custom error2')->in([qw/many many words/], 'custom error3')->my_validator(..);
10:31 logioniz }
10:31 logioniz So, for more comfortable work i think need make this:
10:31 logioniz 1) Add opportunity for developer add custom errors to validator. Add custom error to required.
10:31 batman logioniz: don't paste
10:31 logioniz 2) After required and optional must apply filters
10:31 batman ever.
10:31 logioniz 3) After filters must apply validators
10:31 logioniz In current version Mojolicious i have opportunity add filter,
10:31 logioniz but i must to know some internal structure of validation (Chnage hashes $validation->{input}, $validation->{output}). It is right?
10:31 logioniz And i haven't got opportunity to specify custom errors..
10:31 logioniz Custom errors is important part
10:31 logioniz
10:32 logioniz whats wrong?
10:32 purl but it feels so right
10:32 batman sri: how do we handle this?
10:32 batman convos doesn't have ignore :(
10:32 sri with a stern warning, followed by ban the second time
10:32 batman ok.
10:32 batman logioniz: got it?
10:32 purl Magic. Got it.
10:34 logioniz Don't understand. I may be banned if I put a lot of text?
10:34 batman not if you're superfast at typing...
10:34 batman but you can't paste. because it's really annoying.
10:35 logioniz Ok, sorry.
10:36 batman you're probably cross posting as well
10:37 logioniz You see what I wrote to you?
10:37 logioniz all my text message?
10:38 sri i saw a pasted wall of text and ignored it
10:39 sri use a paste site
10:39 batman +1
10:39 purl 1
10:40 sri ideally, make a gist and format your proposal properly
10:41 logioniz http://pastebin.com/25AAeK8u
10:43 sri those specific points have all been discussed before here
10:43 blacklight left #mojo
10:43 * batman is tired
10:44 batman re-installing ubuntu shouldn't be necessarily :/
10:44 sri error messages are a huge problem, because of i18n... never gonna happen in core
10:44 mishantil batman: Borked your install?
10:45 sri think i actually proposed that exact version of ->filter('trim'), but there was not much support for it
10:45 logioniz So, you You will not to consider this issue again?
10:45 geira joined #mojo
10:45 sri what do you mean with "consider"?
10:45 batman mishantil: could be. sometimes i think i have to use upgrade-manager (gui) and not "apt" to be safe :/
10:45 logioniz discuss
10:46 * batman missed out on filter('trim')
10:46 mishantil batman: Every time I've used the upgrade-manager for ubuntu there has been some kind of screw-up. Especially if used close to the relase of new version.
10:46 mishantil batman: I'm seriously considering going back to stock debian.
10:46 sri personally, i will probably not, unless you can prove that there is wider interest in the community or you find another core dev to champion your proposal
10:47 batman i do filter('trim') "manually" at work all the time, since people are copy/pasting from everywhere and "\n", "\t" and " " gets part of the paste :/
10:47 batman mishantil: hehe... i'm not considering debian. no idea how that can be any better.
10:48 sri logioniz: if there's a patch i will certainly vote
10:48 neilhwatson joined #mojo
10:48 sri but like i said, error messages do not have a chance to get my vote
10:48 batman is metacpan slow..? i think it's getting slower and slower...
10:49 mishantil batman: It is _much_ better tested. Really a world of difference. Too many big changed happen in Ubuntu close to realease, without proper testing.
10:49 mishantil s/changed/changes/
10:49 logioniz why?
10:49 sri ->filter('trim') may get a +1 from me... if it gets enough support in the community
10:50 sri logioniz: i18n
10:50 logioniz understand
10:50 batman mishantil: how can that be? isn't ubuntu debian++
10:50 batman how often is debian released? and can i get unity with debian?
10:51 * batman really like unity
10:51 mishantil batman: It is debian underneath it all yes, but there are a whole lot of changes they apply, and different sets of package versions that are considered stable.
10:51 mishantil "stable" ubuntu feels like experimental debian.
10:51 logioniz sri: But it is significant part that because I write here
10:52 batman ok. well... debian stable used to feel like linux 1999 :p
10:52 logioniz So, i understand problem.
10:52 mishantil batman: But yes, you can essentially get the same packages for debian as you can on ubuntu.
10:52 neyasov________ joined #mojo
10:53 batman ok
10:53 mishantil batman: and yes, Debian is behind Ubuntu wrt versions, so some things must be pulled from backports etc.
10:53 mishantil Debian is really minted to be a _stable_ os.
10:54 batman booooring! ;)
10:54 mishantil Hehe. *oldfart*
10:55 mishantil I use Ubuntu for desktop / laptop-use and is normally work pretty well. There is a reason I've kept it. :) However, suddenly there are some things that bite. Which I have yet to experience on Debian.
10:58 logioniz sri: So, but may be you add opportunity to easy embed localized message for those who what to use i18n?)
11:02 batman mishantil: yeah. the good thing is that it usually just works. and really well.
11:02 batman but it's almost as windows now. not sure if that's a good thing :)
11:04 sri logioniz: if you have a rock solid proposal that just works feel free to present it, but i will certainly not work on it, i've tried and failed
11:04 sri it may or may not pass the voting process
11:05 sri what you've shown us so far is at best incomplete, so there is not much else i can say
11:05 batman logioniz: i can try to iron out the rough edges if you make an initial proposal. same goes for "trim"
11:06 batman proposal = a "working" patch (with or without tests)
11:08 geira joined #mojo
11:09 logioniz I'm afraid to add my code to such cool project. I still have not grown. But i think to do this.
11:11 batman that's why i said i could iron out the rough edges for you :=
11:11 batman :)
11:12 batman *bbl*
11:13 logioniz I think that to do it (pull request). But there is another point that I want to consider.
11:15 woz joined #mojo
11:22 logioniz Often i have this situation: Site validate user data. After validate i have parameters in $validation structure which have errors. So i must to make redirect on initial page with errors parameters. This can be done by putting the errors in $c->flash. But cookies are limited. So need to add mechanism to pass it through db. So, is should there be a mechanism in Mojolicious framework or not?
11:23 logioniz Or developer must do it in all projects?
11:26 jberger_ o/ heading to Hawaii, might not be around for a while
11:26 logioniz I mean to redirect on previous page to generate error for user.
11:31 moritz logioniz: it's easier if you set it up a bit differently
11:31 moritz logioniz: you let the user submit the page to the same action that generated the form, and simply show it again if validation failed. If validation was successful, redirect to the next page
11:32 mishantil jberger_: Enjoy Hawaii.
11:32 moritz logioniz: that lets you put the validation error in the stash, not the flash
11:34 logioniz Yes, exists this variant. But it is terribly. I attempt to do it and have a page which have WRONG url and i can't press F5 on this page, because it is unpredictable behavior)
11:36 sri jberger_: have fun o/
11:36 logioniz Ohh, i understand you correct
11:36 logioniz No, not understand)
11:36 moritz with that scheme, if you press F5, you simply get the same form again, without validation information
11:38 logioniz No, when you pass F5, you send POST query (not GET) on other url.
11:39 gatitskiy joined #mojo
11:39 logioniz Or i understand you incorrect.
11:39 moritz logioniz: not to the other URL
11:39 moritz logioniz: you send the request to the *current* URL
11:39 moritz let's make an example
11:40 moritz two connected pages, first creates a user account, second lets you enter some data
11:40 moritz so you have the URLs /newaccount and /userdata (the names suck, doesn't matter)
11:40 moritz so on page /newaccount, you show the form for creating an account
11:41 moritz and if the user submits, you send it to /newaccount too
11:41 moritz so, /newaccount does two things:
11:41 moritz 1) checks if it was a POST request. If yes, validate; if validation was successfull, store stuff in the DB, and redirect to /userdata
11:41 Ptolemarch joined #mojo
11:42 moritz 2) if it was a GET request, or a POST with validation failed, it shows the form for a new account
11:42 moritz so, if the user presses F5 at any step, she always submits to /userdata, so never to the wrong URL
11:42 moritz logioniz: clear?
11:42 purl well, clear is everywhere now
11:42 logioniz understand
11:43 logioniz but F5 send POST (not GET ) on /newaccound, isn't it?
11:43 moritz yes. What's the problem with that?
11:43 moritz then you do the validation again, and it'll fail again
11:44 logioniz User get browser alert, isn't it?
11:44 moritz (if it hadn't failed, the user would have been redirected to a different URL, and couldn't reload the page at the old URL)
11:44 moritz yes
11:44 logioniz It is not true)
11:44 moritz ah, if you want to avoid that, you do have to redirect, but you can redirect to the same URL
11:44 moritz and then you have to use the flash again
11:45 moritz (or do the whole form submission with AJAX in the background, then you have no reload troubles)
11:46 Kripton joined #mojo
11:47 logioniz flash - is problem, because limited)
11:47 logioniz AJAX - may be.
11:47 moritz then don't redirect
11:48 moritz it's much easier to program without the redirect
11:53 logioniz Can't understand 1-st case (not AJAX). Why not do redirect with subbition data in cookies?
11:55 logioniz *submition
11:56 neyasov________ joined #mojo
11:57 logioniz Why not do redirect with data in cookies?
11:59 logioniz I understand that AJAX - not good, becuase data need to check again when send full query! And if thay have error need to do redirect)
12:03 neyasov_________ joined #mojo
12:04 logioniz So i can't see better decision of this problem than use db to store intermediate data (with TTL Indexes in mongo)
12:05 d4rkie joined #mojo
12:07 logioniz sri: what do you think about this?
12:10 sujithm joined #mojo
12:16 logioniz So, i think that only i have this problem) So, thanks for some helps.
12:17 woz joined #mojo
12:28 neyasov__________ joined #mojo
12:33 hummeleBop joined #mojo
12:42 good_news_everyon joined #mojo
12:42 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/-lnV5w
12:42 good_news_everyon mojo/master 288c2a0 Sebastian Riedel: improved is_readable performance in Mojo::Reactor
12:42 good_news_everyon left #mojo
12:42 sri sooo much faster, no idea why i've not made that optimization before
12:48 odc i'm trying to understand this vec() thing...
12:48 lb (that could use a comment)
12:49 neyasov__________ joined #mojo
12:49 sri it's an idiom from perldoc -f select
12:49 lb that's a fine comment ;)
12:49 odc oh
12:52 lb sri: but will that work on windows?
12:53 mattastrophe joined #mojo
12:53 sri why wouldn't it?
12:54 lb because of perlport: "select  Only implemented on sockets. (Win32, VMS)"
12:55 sri i doubt poll works much better on windows
13:03 odc https://metacpan.org/source/GBARR/IO-1.25/t/io_poll.t#L43
13:03 odc looks like you're right
13:03 sri haha
13:05 hummeleBop joined #mojo
13:06 hummeleBop joined #mojo
13:10 batman logioniz: pressing F5 will do the same thing over again. It will NOT change POST to GET or the other way around.
13:11 batman In case of POST, the user gets a warning. It is what the user expect.
13:11 batman If you don't want that, post using AJAX
13:15 KindOne joined #mojo
13:15 batman Being clever is almost never clever.
13:18 logioniz batman: Yes,  "do the same thing over again". No, "NOT change POST to GET", because previous request was POST (not GET), so browswe send previous POST request with previous data.
13:20 logioniz So, can't understand conclusion of this issue.
13:21 moritz the conclusion is: if you care about that browser popup, use AJAX. If not, do what I described earlier.
13:23 woz joined #mojo
13:24 logioniz So, i true understand you, that i must to do redirect using javascript on client  when using AJAX?)
13:26 moritz if you follow the classical JS-enhanced HTML pages workflow, yes
13:26 moritz you could also create one of them new-style single-page apps, then you wouldn't
13:27 disputin joined #mojo
13:28 logioniz Yes, it is should work, but is so difficult for simple issue)
13:28 logioniz Thanks
13:28 moritz well, the higher your standards are, the more difficult it gets
13:29 moritz it's always like that :-)
13:29 _WildPikachu_ joined #mojo
13:32 logioniz I can't believe  that validation must use AJAX, why not more easy) I think that it is not normal.
13:32 logioniz Thanks all)
13:33 powerman left #mojo
13:34 sri if something feels like it's way too hard, maybe you're doing it wrong
13:47 marty_ joined #mojo
13:53 jb360 joined #mojo
13:54 neyasov__________ joined #mojo
14:04 sh4 joined #mojo
14:10 marty joined #mojo
14:18 ryozi joined #mojo
14:24 woz joined #mojo
14:38 disputin joined #mojo
15:05 lb joined #mojo
15:13 btyler joined #mojo
15:17 gatitskiy joined #mojo
15:18 gatitski_ joined #mojo
15:22 sri http://pastie.org/9420383 # here's a patch for how validation filters could work
15:22 * sri pokes batman, jberger, tempire, marcus and crab
15:29 woz joined #mojo
15:37 sri http://pastie.org/9420422 # some more tweaks
15:54 marcus1 joined #mojo
16:02 babl joined #mojo
16:04 babl joined #mojo
16:05 denis_boyun joined #mojo
16:08 denis_boyun joined #mojo
16:11 gatitskiy joined #mojo
16:11 sri *crickets*
16:15 allan joined #mojo
16:15 babl left #mojo
16:20 sri actually not sure i like it myself... gonna put it off the table now
16:21 marcus1 i hate those damn crickets too
16:30 mst_ joined #mojo
16:30 disputin joined #mojo
16:33 mire joined #mojo
16:35 woz joined #mojo
16:52 KCL_ joined #mojo
17:05 Kripton joined #mojo
17:06 sugar_ joined #mojo
17:08 mire joined #mojo
17:13 gatitskiy joined #mojo
17:17 D4RK-PH0ENiX joined #mojo
17:20 berov joined #mojo
17:27 dod joined #mojo
17:32 gatitskiy joined #mojo
17:38 zivester joined #mojo
17:40 woz joined #mojo
17:49 gatitskiy joined #mojo
17:57 lipizzan joined #mojo
17:58 gatitskiy joined #mojo
18:09 gatitskiy joined #mojo
18:25 basiliscos joined #mojo
18:26 shadowpaste "lipizzan" at 217.168.150.38 pasted "{ "results" : [ { "address_com" (63 lines) at http://paste.scsys.co.uk/409547
18:27 lipizzan using Mojo::Useragent and parsing into a json result, what's the syntax to extract an array element from the hash result? I'm trying to fetch the "geometry->location->lat & lon" from this json:  http://paste.scsys.co.uk/409547
18:28 btyler joined #mojo
18:34 lipizzan I can't get further into the result than...  my $rslt = $ua->get($url)->res->json->{results};
18:40 go|dfish lipizzan: you can use a JSON pointer. try: $ua->get($url)->res->json('/results/0/geometry/location')
18:43 woz joined #mojo
18:44 lipizzan go|dfish: That's freaking AWESOME!!  Is a json pointer unique syntax to mojo::*, or is that a convention used elsewhere as well?
18:45 go|dfish "Mojo::JSON::Pointer is a relaxed implementation of RFC 6901."
18:45 sri http://mojolicio.us/perldoc/Mojo/JSON/Pointer#DESCRIPTION
18:45 sri :)
18:46 lipizzan thanks for making things as easy as they should be! Yee-Haaaah.
18:54 batman sri: first impression: shift->Mojolicious::Renderer::_add <-- not a big fan of those kinds of method calls. feels wrong.
18:55 batman second impression: sorry, but i need to get back to it tomorrow. got company coming over :/
18:55 sri batman: proposal is off the table, i don't like it anymore
18:55 batman ah! ok :)
18:55 batman i might review it anyway, hehe
18:56 sri batman: that kind of method call already exists elsewhere
18:56 sri https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L314
18:56 sri stuff like the stash
19:37 neyasov__________ joined #mojo
19:45 r0b3rt joined #mojo
19:46 woz joined #mojo
19:49 neyasov joined #mojo
20:08 disputin joined #mojo
20:10 * sri untangles the mango internals
20:13 neyasov_ joined #mojo
20:18 basiliscos joined #mojo
20:20 sri failover working is kinda neat, i can run the whole test suite against secondaries and it will just figure out the current primary
20:20 sri worth the 5 lines of code
20:20 marty joined #mojo
20:21 sri reading from secondaries would require separate read and write pools i guess
20:24 good_news_everyon joined #mojo
20:24 good_news_everyon [mojo] kraih tagged v5.18 at b4967f4: http://git.io/-IHoew
20:24 good_news_everyon left #mojo
20:25 good_news_everyon joined #mojo
20:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/wLzSzg
20:25 good_news_everyon mojo/master 5cd1890 Sebastian Riedel: bump version
20:25 good_news_everyon left #mojo
20:25 sri i need that is_readable optimization for mango performance :D
20:31 basic6_ joined #mojo
20:40 babl joined #mojo
20:47 woz joined #mojo
20:56 neilhwatson joined #mojo
21:08 KCL joined #mojo
21:27 mire joined #mojo
21:35 disputin joined #mojo
21:49 woz joined #mojo
22:22 mattastrophe joined #mojo
22:39 disputin joined #mojo
22:51 woz joined #mojo
23:45 phillipadsmith I feel like I've read some decent write-ups / scanned some helpful code for extending Mojolicious::Command in an app, but can't seem to Google my way back there. Any pointers?
23:48 phillipadsmith Had a typo in my search on CPAN
23:48 phillipadsmith (never mind) :)
23:52 woz joined #mojo

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