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

IRC log for #mojo, 2016-05-31

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

All times shown according to UTC.

Time Nick Message
00:04 dhg joined #mojo
00:35 dhg joined #mojo
00:43 garu joined #mojo
01:21 janus joined #mojo
01:57 ronsavage joined #mojo
01:57 ronsavage left #mojo
02:44 noganex_ joined #mojo
04:04 inokenty-w joined #mojo
04:43 mpapec1 joined #mojo
04:43 Adura joined #mojo
05:22 eseyman joined #mojo
05:36 dod joined #mojo
05:41 dod joined #mojo
05:43 mpapec joined #mojo
05:44 mpapec1 left #mojo
06:00 dod joined #mojo
06:11 che-quest joined #mojo
06:13 che-quest hi guys, my patch for Mojolicious::Plugin::OAuth2 https://github.com/marcusramberg/Mojolicious-Plugin-OAuth2/compare/master...mche:master
06:45 ivi joined #mojo
07:15 andrew_ joined #mojo
07:19 trone joined #mojo
07:22 Vandal joined #mojo
07:57 sri heh https://twitter.com/AFresh1/status/737430433948803072
08:24 che-quest batman have made dicovery for me: $app->$cb
08:24 che-quest how it work?
08:25 ivi joined #mojo
08:35 vytas joined #mojo
08:37 marcus sri: "NOTE: This is still in-progress, and may change substantially as development progresses." - maybe when that goes away? :)
08:37 * coolo is lost with the tag helper.
08:38 coolo how can I have a conditional selected without having to put this in a duplicated if?
08:38 coolo %= tag option => (data => { needle => $needle->{name} } ) => (selected => $needle->{selected} ? 'selected' : '') => $needle->{title}
08:38 coolo this will give me not what I expected as it gives "selected='selected'" for the right one and "selected" for the other - which is invalid HTML5
08:38 coolo but the proper way would be to have selected => undef for one
08:38 coolo but how would I express that?
08:40 coolo I figure this is more a perl question than a mojo question, but still I'm lost
08:43 * coolo should talk aloud more often - http://paste.opensuse.org/62899077
08:43 coolo thanks for listening so greatly
08:44 Lee https://www.youtube.com/watch?v=bf9d7rSf_Ks
08:45 coolo mine is green actually and on my desk :)
08:45 coolo my colleagues are tired of me explaining only 80% of the problem and then running away and gave me one ;)
08:56 anparker che-quest: http://perldoc.perl.org/perlobj.html#Subroutine-References-as-Methods
09:00 sri great, now ups screwed me over
09:01 sri tracking app said delivery of the macbook was tomorrow, but now i have a note in the mailbox saying delivery failed :(
09:02 marcus sri: you can probably pick it up somewhere then
09:02 osfabibisi joined #mojo
09:02 sri no indication on the note and no number to call
09:04 marcus good old ups
09:05 sri fantastic, ups website says delivery options are restricted and pickup is not possible
09:11 trone joined #mojo
09:11 sri with my luck it will get stolen next
09:36 dhg joined #mojo
09:56 Jonis sri: call them
09:57 mpapec batman: re: http://irclog.perlgeek.de/mojo/2016-05-29#i_12565682
09:57 mpapec this now work as expected,
09:57 mpapec https://gist.github.com/mpapec/50c34c73ee22050bd41ec91b07fb7846/revisions
10:02 osfabibisi joined #mojo
10:21 kaare joined #mojo
10:56 dvinciguerra joined #mojo
10:59 punter joined #mojo
11:02 tchaves joined #mojo
11:10 Kripton joined #mojo
11:43 vytas joined #mojo
12:04 tyldis I want to log the return body of a request. Any easy aproach?
12:05 tyldis preferably a generic way, as Swagger2 is in the middle of it
12:08 tyldis Ah, hooks!
12:13 tyldis I love Mojo :)
12:13 itaipu joined #mojo
12:22 bpmedley tyldis: i have some example code i can give you after work; perhaps we can compare and contrast
12:23 tyldis bpmedley: Thanks, but it was your snippet on bitbucket that came up through Google and solved it for me :)
12:24 tyldis I need to keep the json going to and from an API (and subsequency dumping it into postgresql for potential querying later)
12:25 tyldis So it looks liek I can get it by using before_dispatch and after_dispatch, possible after_render
12:26 dmanto joined #mojo
12:28 bpmedley https://gist.github.com/brianmed/8f45afa95a63bd8f00c3cd5d57f6cf11
12:28 bpmedley ^^ I use an under tyldis
12:32 tyldis bpmedley: I need to log the response as well. I figured under was better for stuff like authentication, while the hooks provided the better raw material for just logging?
12:34 bpmedley tyldis: i dont know how to log the response
12:39 batman mpapec: cool :)
12:42 batman tyldis: just override the render_swagger helper if you only want to log swagger responses
12:42 batman (unless you do something custom)
12:46 tyldis Hmm, might be even easier
12:47 gizmomathboy joined #mojo
12:48 batman tyldis: the code inside render_swagger is very simple. the reason for this is that it should be easy to replace :)
12:52 tyldis Yeah. And the controller is there aswell, meaning I have the whole request and response in one simple go
12:52 tyldis Though, I basicly got the same with a hook
12:53 mpapec what are the benefits of logging via emit?
12:53 mpapec https://metacpan.org/source/SRI/Mojolicious-6.62/lib/Mojo/Log.pm#L54
12:54 mpapec and what is the impact of LOCK_EX?
12:54 mpapec https://metacpan.org/source/SRI/Mojolicious-6.62/lib/Mojo/Log.pm#L30
12:55 itaipu joined #mojo
12:55 mpapec also, since writing to file is blocking, does it make sense to syslog via UDP?
12:55 ramortegui joined #mojo
12:56 mpapec tcp/udp
13:11 Zen joined #mojo
13:12 Zen Hi
13:13 Zen I am trying to add SSL support to hypnotoad, added the following to my startup subroutine: "    $self->secrets(['secret']);"
13:13 Zen $self->config(hypnotoad => {listen => ['http://*:8081?cert=/opt/ssl/ca.crt&key=/opt/ssl/ca.key']});
13:14 Zen it does react to http but not to https, am I doing something wrong or am I forgetting to do something else before this works?
13:15 batman Zen: you have "http", while you need "https" in the url
13:15 Zen oh nooo
13:15 Zen I have been trying little changes and stuff but I completely overlooked this part
13:16 batman :)
13:16 Zen it's working now, thanks alot batman :D
13:16 batman you're very welcome Zen :)
13:19 dmanto left #mojo
13:38 dmanto joined #mojo
13:39 dmanto hi guys
13:40 dmanto I'm trying to install Mojo::Phantom
13:40 dmanto but cannot get tests passed :(
13:41 dmanto filled an issue at github
13:42 dmanto https://github.com/jberger/Mojo-Phantom/issues/10
13:53 punter joined #mojo
14:04 kaare_ joined #mojo
14:05 Adurah joined #mojo
14:08 jberger tyldis: you might consider the "finish" event of the transaction, assuming it is emitted late enough, though I think it should be
14:08 jberger mpapec: it is useful to log via an event because then you can attach multiple listeners to it, say to log to an external service as well as locally
14:09 jberger the exclusive lock is because other processes might be trying to log to the same file
14:09 jberger dmanto: looking now
14:14 jberger dmanto: it tests correctly for me
14:16 jberger then again I'm using ubuntu, not mate, older, and an older phantomjs
14:24 orev joined #mojo
14:26 dmanto jberger: mmm maybe older phantomjs. I'm using last one 2.1.1
14:27 punter joined #mojo
14:27 jberger I'm trying to figure out how to install that to my older ubuntu
14:27 jberger the repos don't have it and their download url gives a 403 when I try to download using wget
14:27 jberger :(
14:28 dmanto jberger: well exactly that happened to me, it seems that older versions were discontinuated
14:29 dmanto jberger: I use to install it without problem. I remember I use at least 2.0
14:31 dmanto jberger:I was looking at the tests that don't pass
14:31 jberger as usual, changing the user agent string worked
14:31 jberger gah, I hate when sites do that
14:33 jberger dmanto: passes with 2.1.1 also
14:33 jberger could be the mate OS?
14:33 jberger it looks to me like it is ignoring the exit command
14:34 jberger from the log you posted
14:34 dmanto jberger: in exception.t test, what is the meaning of the side error test?
14:34 jberger "javascript side"
14:34 jberger an exception that occurs in the javascript
14:35 dmanto jberger: I dont understand this test. Seems that is expecting that if you have an error inside page.evaluate
14:35 dmanto jberger: it will not go through the following block
14:36 dmanto jberger: but the page.evaluate() is sandboxed
14:37 jberger I set the error handlers in a way that it should do that
14:37 kaare_ joined #mojo
14:37 jberger https://github.com/jberger/Mojo-Phantom/blob/master/lib/Mojo/Phantom.pm#L44-L57 + line 80
14:38 dmanto jberger: ahh I didn't get that part
14:39 jberger can you try with MOJO_PHANTOM_DEBUG=1
14:39 dmanto jberger: I couldn't make that error handler work
14:39 jberger we should see if the CORE::die message actually gets sent
14:40 jberger dmanto: did you build the phantom binary yourself or did you use a pre-built linux binary?
14:40 jberger also are you actually using a pi?
14:40 dmanto jberger: pre built I guess, sudo apt-get phantomjs
14:41 plicease jberger: I updated the description on Mojo::Phantom #8 I think it addresses the issue we discussed a few weeks back regarding perl.note not being defined when not using the test class
14:41 jberger I'm going to venture to guess that you are using a precompiled linux-based binary on a pi, and I'm guessing that the longjmp that is the exception handler isn't actually correct
14:41 plicease er role.
14:41 dmanto how do I paste the result with debug?
14:41 jberger dmanto: ?
14:41 jberger plicease: ok, will look
14:42 jberger I haven't had much time for phantom since we last discussed
14:42 plicease (also #9 would be very helpful for us at $work)
14:42 dmanto jberger: MOJO_PHANTOM_DEBUG=1 cpanm Mojo::Phantom
14:43 jberger dmanto: yes, that is what you should run, though --test-only is sufficient
14:46 jberger plicease: the hardest thing about #9 is that I check for a phantomjs binary at installation (mostly to keep cpantesters at bay)
14:46 plicease I don't see a problem.
14:46 plicease you still need phantomjs for casperjs to work.
14:46 jberger ah
14:46 jberger ok
14:47 jberger I don't know anything about casperjs
14:47 plicease easiest to think of it as a superset of phantomjs
14:48 jberger but that it still comes with a binary named phantomjs surprises me
14:48 plicease you have to install both actually.
14:49 jberger I guess I'll need to look at it to understand, but I trust you know what you are talking about
14:49 jberger I still think that it is going to be problematic though
14:50 plicease i'm not sure i understand why.
14:50 jberger I think someone is going to have phantomjs in a non-standard place, see that it can be run from an alternate path and need to specify it at install time to the Build.PL doesn't bail out
14:50 jberger "but I can use ->exe to set the path, why do I need it in $PATH during installation?"
14:51 jberger but we can wait until that happens I suppose
14:51 jberger I think most people will leave the exe alone
14:52 kaare_ joined #mojo
14:52 plicease I think this can be easily documented, and it is a legitimate useful feature.
14:53 jberger sure
14:55 dmanto jberger:result should be at the issue now
15:00 jberger plicease: oh I see in the graph that you were just adding another commit
15:00 jberger oops
15:00 plicease np.
15:01 plicease just documenting the need for phantomjs to be in the path
15:01 plicease it might be more appropriate putting that in any install documentation if you have that.
15:01 plicease but it doesn't hurt to have it in both places.
15:04 jberger I just cherry picked it
15:04 dmanto jberger:sorry I closed the issue by mistake, now reopened and the result with MOJO_PHANTOM_DEBUG is there
15:10 jberger clearly the error handler is not being invoked
15:10 jberger but I don't know how to replicate not having such a system
15:10 jberger plicease: I suppose I ought to merge up #3 and cut a release
15:11 jberger of course #3 is fairly mangled by conflict at this point
15:12 jberger I forget if we ever came to a happy resolution of #6
15:14 jberger oh right, #3 hangs for me ...
15:14 jberger blast
15:14 jberger I really need to get back to $work
15:16 dotan joined #mojo
15:20 jabberwok joined #mojo
15:21 jberger sri: re https://github.com/kraih/mojo/issues/965 we could check for -e $path before this line: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Command.pm#L80
15:21 jberger if we care
15:22 jberger I'm of two minds because this is a simple utility
15:22 jberger but then again, it is a utility for beginners
15:22 jberger personally I would expect it to overwrite the previously generated files
15:22 jberger but making it safer wouldn't be very hard either
15:31 jabberwok Do I read the docs right that the session cookies created as $c->session('foo') will not have an attached domain, in other words that a session will not carry between a domain and its subdomains?
15:35 jabberwok ahh, Mojolicious::Sessions has attribute 'cookie_domain'  (nothing like asking a question to poke self into finding answer)
15:38 dotan jberger: it does report if a directory exists, I think write_file should have that check.
15:40 jberger dotan: ah interesting, that is true
15:43 dotan also, if we're talking about helping beginners, maybe the generator can issue a warning for https://github.com/kraih/mojo/issues/892
15:43 dotan (although I'm not sure if that will be helpful or confusing :( )
15:44 preaction how could it warn? it's doing what you told it to do
15:44 preaction it doesn't know that isn't what you want
15:59 dmanto jberger:is the repo version, confirmed
16:00 dmanto sudo apt-get remove phantomjs
16:01 dmanto and then just downloaded the binary package for debian 64 bits at phantomjs.org
16:02 dmanto now passes tests and installs ok
16:02 pink_mist so it's a problem with the ubuntu package it seems?
16:04 dmanto yes it seems that
16:05 kaare_ joined #mojo
16:06 pink_mist then open an issue on their bugtracker maybe? =)
16:09 dmanto yes I think I should
16:10 dmanto I'd like to get a test javascript file that shows the problem though
16:27 itaipu joined #mojo
16:30 PryMar56 joined #mojo
16:39 dmanto jberger, pink_mist: this javascript test passed with the right phantomjs binary and fails with the one apt-get downloaded:
16:40 dmanto http://mibpaste.com/nnNC0M
16:56 jberger dmanto: interesting
16:56 jberger thanks
16:57 jberger all you should need to demo the problem is to write an error handler that does something, attach it to a page context, then invoke a nonexistant function
16:57 jberger just like the test does
16:57 jberger but you can ignore most of the other architecture
17:28 disputin joined #mojo
17:38 disputin joined #mojo
17:39 tyldis jberger: I now have at least 10 ways to accomplish this. And they are all better than my coworker's idea to have logging statements before every callback... And thanks to everyone for their suggestions :)
17:40 dod joined #mojo
18:12 itaipu joined #mojo
18:19 dhg joined #mojo
18:34 dmanto jberger: I commented in the isssue (#10), added the test script above, and closed it
18:35 jberger dmanto: I saw that, thanks
18:35 dmanto thank you very much for your support
18:35 jberger I expect that the fact that you are on a r-pi is the deeper issue
18:35 jberger that somehow the debian binary package doesn't work on that architecture
18:36 jberger but if that's true then I don't know why the binary on the phantomjs site does work
18:36 jberger sigh
18:36 jberger anyway, I'm happy we tracked it down as much as we did
18:36 jberger did you file a bug on debian's repo?
18:36 dmanto what do you mean r-pi
18:36 jberger raspberry-pi?
18:36 dmanto raspberry pi??
18:36 dmanto ah
18:36 jberger isn't that what mate is for?
18:36 dmanto no
18:37 dmanto it's just ubuntu
18:37 dmanto but nice
18:37 jberger oh ok, I thought it was specific to pi, but now I see that it is just a supported platform (prominently mentioned)
18:37 dmanto it is very nice indeed
18:43 dmanto just to clarify, I'm using an Intel 64 bits platform
18:46 dmanto and I also don't understand why the binary package downloaded from phantomjs.org works fine and the one from the repo doesn't
19:08 pink_mist jberger: the only thing that separates ubuntu mate from ubuntu proper is it uses mate (the forked gnome 2) as desktop environment instead of whatever proper ubuntu uses these days
19:21 kivilahtio joined #mojo
19:51 Bean joined #mojo
19:52 disputin joined #mojo
20:25 zivester joined #mojo
20:31 dmanto jberger, pink_mist: I filed a bug at launchpad.net, I guess it is the right place...
20:31 dmanto https://bugs.launchpad.net/ubuntu/+source/phantomjs/+bug/1587634
20:39 punter joined #mojo
21:30 sri oh wow, now there's leaked photos confirming the oled touch strip on the new macbook pro :o
21:30 preaction oooooh
21:30 sri http://www.cultofmac.com/430982/spy-photos-all-but-confirm-2016-macbook-pros-oled-touchpad/
21:30 preaction so you're saying wait on the new macbook then
21:31 preaction i suppose if i control what's up there, and not the current app controls it, then it's a great idea
21:32 sri i'd never get a first gen mac
21:32 sri especially considering my recent problems with the second gen -.-
21:32 preaction i got the first-rev retina, and it turned out fine
21:33 sri looks like a very think oled strip, i really thought they'd go more bold
21:35 sri curious if that oled strip will turn into a trend other vendors copy
21:37 sri didn't expect for them to get rid of magsafe though
21:38 preaction yeah. still not pleased with no magsafe...
21:38 preaction maybe they think people will spend more time unplugged now?
21:39 sri possibly, and there's already 3rd party magsafe usb-c cables you could use
21:39 sri https://griffintechnology.com/us/breaksafe-magnetic-usb-c-power-cable
21:41 jabberwok future advert typos:  ON SALE, OILED RETINAS.
21:43 Kripton joined #mojo
21:44 sri guess the timing makes sense, they gotta present those new oled strip apis at wwdc
21:46 sri crazy how similar those dimensions are to the lenovo http://core0.staticworld.net/images/article/2014/04/lenovocarbonx1_5-100258974-orig.jpg
21:47 sri i expected something more like a second screen, gameboy ds style :)
21:48 sri or even physical keys with individual oled displays :o
21:49 preaction screen where the touchpad is would be interesting indeed
21:54 sri wonder where the escape key went
21:54 sri if that's on the touch strip it's gonna suck
21:55 jberger wow
21:55 jberger that would be really insane
21:55 jberger no vim user would get one
21:56 preaction maybe they replaced capslock?
21:57 dmanto joined #mojo
22:00 sri usb-c adapter makers rejoice
22:21 haarg i had been worried about the move away from magsafe, but if it means i don't need to buy a new adapter every year i think i'll be happy
22:22 preaction i haven't had any trouble since mid-2000s when it about burned down my apartment
22:23 haarg the cable just dissolves over time for me
22:23 preaction the thin one from the brick? yeah... it does seem kind of fragile
22:24 haarg yeah.  i have like 10 wall<->brick cables because i keep having to replace the other part.
22:25 haarg current cable is 2/3 duct tape
22:25 preaction wow
22:26 haarg it's not like i'm doing anything unusual with the cable.  i'm not wrapping it up or even moving it.  the cable itself just seems to dissolve from contact to the air.
22:27 sri Oo
22:27 preaction that's kind of weird... pets maybe?
22:27 preaction can't be the power, that's what the brick's for... nah, no idea. you're cursed man
22:27 haarg i have a cat, but she doesn't chew on things like that.
22:28 sri you living in a volcano or so?
22:28 sri some sort of evil lair?
22:28 haarg well, i live here.  so maybe yes?
22:35 jberger I never use their flip out cable wrap holder
22:36 jberger It is too sharp and too narrow (turning radius too tight)
22:36 sri usb-c power brick doesn't have those
22:36 jberger Probably for the best
22:37 sri it has a usb-c port, and the cable is separate

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