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

IRC log for #mojo, 2016-06-26

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

All times shown according to UTC.

Time Nick Message
00:03 user_7801 I just checked only the string behind af: is affected.      <af:Ortsteil> goes to <af:ortsteil> with $tx->res->dom. Anything else is same.
00:05 user_7801 and soap:, ns3:    anything with colon in front
00:06 user_7801 well, and outrecord too it doesnt have a colon.
00:06 user_7801 *confusing*
00:06 user_7801 do you think it's a normal behaviour?
00:31 tchaves joined #mojo
00:35 tchaves joined #mojo
00:39 bpmedley user_7801: I can find case rules for XML Elements and XML Attributes; I do not see case rules for NCName and QName.
00:40 bpmedley http://stackoverflow.com/questions/1631396/what-is-an-xsncname-type-and-when-should-it-be-used <-- This is the best that I've found, and I don't see character case for the LocalPart / NCName..
00:52 nicomen user_7801: $ perl -wle 'use Mojo::DOM; my $a = "<a:B>c</a:B>"; my $html = Mojo::DOM->new()->parse($a); my $xml = Mojo::DOM->new()->xml(1)->parse($a); print join "\n", ($html, $xml)'
00:52 nicomen <a:b>c</a:b>
00:52 nicomen <a:B>c</a:B>
00:58 nicomen and
00:58 nicomen $ perl -wle 'use Mojo::DOM; my $a = "<a:B>c<d>e</d></a:B>"; my $html = Mojo::DOM->new()->parse($a); my $xml = Mojo::DOM->new()->xml(1)->parse($a); print "html:" . $html->at("b d"); print "xml:" . $xml->at("B d");'
00:58 nicomen html:<d>e</d>
00:58 nicomen xml:<d>e</d>
01:00 cuechan joined #mojo
01:02 nicomen I couldn't get ->at("a\:B d") to work though
01:27 leoj joined #mojo
01:28 leoj heyhey, is there a quick way to check if child after ForkCall?
01:35 tchaves1 joined #mojo
01:43 leoj like, if the currently executing code is within the forked child?
02:01 leoj joined #mojo
02:15 noganex_ joined #mojo
02:15 user_7801 Thanks for your answers.
02:16 user_7801 I assume it's a normal then
02:20 kaare joined #mojo
02:21 nicomen user_7801: I think the main issue here is that yo don't use ->xml(1) for your DOM object when parsing xml?
02:23 user_7801 hold on, let me try it
02:23 user_7801 i just came back
02:31 user_7801 nicomen: yeah, that's right xml(0) prints small and xml(1) as sent from the server :)
02:32 nicomen that's what I tried to show with my first example
02:41 user_7801 is there a way to have it set from $tx->res->dom->?
02:42 user_7801 I can load $tx->res->body into Mojo::DOM, but SOAP::Deserializer->deserialize($dom) will fail to parse from then.
02:42 user_7801 or i just use mojo parser functionality
02:44 user_7801 but in Mojo::DOM doesn't have something like xpath('//Item/...')
02:56 user_7801 Ok, I solved it!
02:56 user_7801 my $dom = Mojo::DOM->new->xml(1)->parse($tx->res->text);
02:56 user_7801 my $som = SOAP::Deserializer->deserialize($dom);
02:56 user_7801 print $som->valueof('//NameItem/Anrede');
02:56 user_7801 ->text was required instead of ->body
02:57 sri why convert it to a Mojo::DOM object?
02:59 user_7801 $tx->res->dom is xml(0). It will print parts of the SOAP response small, causing xpath to fail. see: http://nopaste.linux-dev.org/?1119062
02:59 sri umm
02:59 user_7801 isn't it so?
02:59 sri my $som = SOAP::Deserializer->deserialize($tx->res->text)
03:01 user_7801 lol. I see now.
03:01 user_7801 you're right of course :)
03:04 jberger leoj: I'm confused, are you worried that code is being called in the wrong process?
03:05 jberger if so print $$ before forking which is then the parent pid, use the spawn event to print the pid of the child and then wherever you are worried print $$ to see which one you are in
03:05 jberger you can even stored the parent pid in a variable and close over it in the child code
03:06 jberger my $parent = $$; $fc->run(sub{ die "WAT" if $parent == $$; }, ... );
03:07 leoj haha, "WAT", that's sorta what I'm getting at.
03:08 leoj I'll have to play with it; thanks for the tip jberger
03:09 jberger honestly it shouldn't happen, I've taken some care to prevent that kind of thing
03:09 jberger if you find something funky, please report it
03:10 leoj hmm, well the point is to communicate between parent and child using STDERR and STDOUT
03:10 jberger leoj: if that is what you want, you might be better using Mojo::IOLoop::ReadWriteFork
03:10 leoj orly never seen that yet
03:11 jberger ForkCall is intended more as a "fire, wait, collect result" mechanism
03:11 leoj yea, Mojo::IOLoop::ReadWriteFork looks sexy
03:12 jberger I mean, I'm biased but I think ForkCall is kinda sexy too, just a different kind of sexy :-P
03:17 leoj jberger: Does this cover forking of self?
03:17 jberger ?
03:18 jberger the child callback doesn't get the forkcall instance
03:18 jberger that said, you could easily close over it or pass it in
03:19 jberger also note that the ioloop is reset inside the child process
03:23 leoj Sorry, I'm not a Perl programmer and just getting my nose wet. This is the issue I'm trying to solve: https://github.com/oetiker/znapzend/pull/221
03:23 jberger this is some pretty heavy stuff for a non-perl programmer
03:23 * jberger reads
03:25 jberger forkcall does not provide a read event
03:25 jberger it only has a callback when the child process completes
03:26 jberger it is passed an error if an error occurred or else undef and then if no error it is passed any results of the forked code block (serialized, transmitted and deserialized)
03:26 sri omg
03:26 sri my macbook might not have broken hardware after all
03:27 jberger almost all of the work should be done behind the scenes for the case of a fire and wait for a result, a simple "unblock" of a long running code block
03:27 jberger sri: excellent!!
03:27 sri i just trusted the internet recovery image the macbook loads automatically
03:28 sri just to make sure i just zeroed out the whole ssd drive, created an installer usb stick, and it actually installs now
03:29 jberger leoj: I can't understand what that PR is trying to do
03:29 jberger can you fill me in?
03:29 leoj jberger: needs to feed in results of child into parent real time so parent can batch send emails about errors/warnings with ZFS backup
03:30 sri did it because i saw someone complain about how shit the el capitan disk utility is
03:30 sri turns out, it's pretty shit
03:31 jberger leoj: you could open another IO::Pipely before forking and use it to send information back to the parent
03:32 jberger IO::Pipely is a cross platform analog to a process pipe
03:32 jberger I don't know if you need to support windows, Mojo::IOLoop::ForkCall attempts to as much as the perl interpreter allows it to :s
03:32 jberger and so it uses IO::Pipely
03:33 bpmedley leoj: Have you seen Minion?  Would a job queue be helpful?
03:33 jberger bpmedley: this is for znapzend for which an external job queue would be asking a lot I think (IIUC)
03:35 jkrizansky joined #mojo
03:36 sri jberger: and it looks like it crashed again -.-
03:37 bpmedley leoj: znapzend appears that it can run a script after backup: post_znap_cmd, is that correct?
03:38 jberger leoj: I have commented (rather blindly still) in that PR
03:38 jberger I hope it summarizes the general case
03:39 lluad joined #mojo
03:42 leoj jberger: thanks that does well! bpmedley: not sure, but more concerned with errors as they arise because could be a very long running process and may be done over ssh/mbuffer
03:42 leoj (if I understand znapzend correctly)
03:44 bpmedley leoj: Perhaps you could set --logto to a known file location and parse that as needed?
03:50 leoj Currently (disregarding my PR) znapzend supports logging to file or syslog. My first inclination was to write a daemon of my won that monitored the log output and sent me emails, but I wanted to make it part of znapzend core like that functionality is core to smartctl and ZFS Event Daemon. I didn't realize (think about) the fact that znapzend forks itself for each job until I was in the weeds. I think at
03:50 leoj this point it has become an academic challenge to use pipes.
03:52 jberger good luck!
03:53 lluad joined #mojo
03:54 jberger sri: :'(
04:00 sri yea, only restored the normal recovery partition, but crashed installing os x
04:03 leoj jberger: thanks! :)
04:05 leoj sri: Apple replaced the logic board of my Macbook for free because it was permanently corrupting my hard drives (after paying to replace them). Turns out the MBPr I have was one of the first batch, that had documented recall that Genius bar didn't know about until I called corporate and got a senior tech.
04:07 sri this macbook is 3 weeks old
04:07 leoj I agree the El Cap Disk Utility is a regression, with the removal of disk burning. Now you have to go to finder menu bar to burn a disk (not intuitive).
04:13 sri wish i had bought the old rMBP
04:20 user_7801 lmao. my provider (telekom) hijacks the DNS. Always $tx->success.
04:37 emakarov joined #mojo
05:31 jberger apple's arrogance starts at calling their tech support counter "the genius bar", it all goes downhill from there
05:34 sri yea, that's the thing with apple, they got way too arrogant
05:35 sri they are shipping those butterfly keyboards already even though they can't provide good quality consistently
05:37 sri don't have high hopes for the next macbook pro
05:37 sri they're just going to do something stupid again with it
05:40 sri support from apple was much better this time around though, got escalated to the next level right away and there is a specific person assigned to the case of whom i have the email address and phone number
05:41 sri but i'm ready to be serverely disappointed by the local 3rd party service provider tomorrow
05:59 * jberger crosses his fingers
06:16 dod joined #mojo
06:22 dod joined #mojo
07:35 ilbot2 joined #mojo
07:35 Topic for #mojo is now 🍻 cheers | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
07:46 punter joined #mojo
08:52 kes joined #mojo
10:13 jkrizansky joined #mojo
10:46 ribasushi_ joined #mojo
10:55 ribasushi joined #mojo
11:13 jkrizansky joined #mojo
11:27 mishanti1 Very much looking orward to upgrading to a recent mojo-version. So many cool new things.
11:37 Kripton joined #mojo
11:50 kid51 joined #mojo
11:54 leoj joined #mojo
12:44 asarch joined #mojo
12:50 bpmedley mishanti1: What version are you at?
12:54 mishanti1 bpmedley: 3.97
12:54 mishanti1 So, it'll be good to get to the current one.
12:58 pink_mist that might prove a lot of work :P
12:58 pink_mist good luck
12:59 good_news_everyon joined #mojo
12:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voHtf
12:59 good_news_everyon mojo/master b71327d Sebastian Riedel: Merge pull request #976 from kraih/zero_length_header_value...
12:59 good_news_everyon left #mojo
13:00 mishanti1 pink_mist: Thanks. :) Been working on test coverage for a while. Once at 100% I'm authorizing the upgrade.
13:00 mishanti1 Does take some time though.
13:01 bpmedley mishanti1: Is it a large app?
13:01 * sri doesn't trust a test coverage of over 95%
13:03 mishanti1 bpmedley: Well, I have nothing to compare it to (banana for scale?). Currently 25539 lines of perl code. And in addition to that we have some html, javascript etc.
13:03 bpmedley Nice!! I that mostly Modern Perl?
13:04 mishanti1 bpmedley: Should run on anything above 5.14.4, and should for the most part follow modern conventions.
13:18 cuechan joined #mojo
13:43 dod joined #mojo
14:01 user_7801 joined #mojo
14:02 user_7801 http://nopaste.linux-dev.org/?1119068
14:02 user_7801 that's the fastest way to execute synchronized, right?
14:06 zivester joined #mojo
14:16 bpmedley user_7801: One question, when do you want "nothing to see" rendered?  Before the first GET request, after the last GET request, or some other time?
14:17 dod joined #mojo
14:18 user_7801 After the last. I guess I have to move it inside $self->delay() on the bottom and add $self->render_later?
14:20 bpmedley user_7801: One possibility is using http://mojolicious.org/perldoc/Mojo/IOLoop/Delay#wait
14:21 bpmedley http://mojolicious.org/perldoc/Mojo/UserAgent see the Concurrent non-blocking requests (synchronized with a delay) comment?
14:25 user_7801 I see
14:25 user_7801 $delay->on(finish => sub {   my ($delay, @args) = @_;   ... });
14:25 user_7801 I think this will just do what i want.
14:25 vicash joined #mojo
14:26 user_7801 Render 'nothing to see' once all get requests are completed.
14:26 bpmedley Cool, when you get it working would link your final code?
14:29 user_7801 Yeah, I'm just unsure if i need to to wait for this event?
14:29 user_7801 http://nopaste.linux-dev.org/?1119071
14:29 user_7801 i made a small modification
14:30 user_7801 and now it render 'nothing to see' when all requests are finished?
14:36 bpmedley user_7801: Cool, one thing you might like is this: my $self = shift->render_later;
14:37 user_7801 yep :) i have added it already
14:41 punter joined #mojo
14:41 user_7801 $delay->on(finish => sub { $self->app->log->debug('Finished!'); });
14:43 user_7801 it's seems to get executed once $self->delay(); is completely done.
14:45 user_7801 You can see here: http://nopaste.linux-dev.org/?1119072
14:45 user_7801 finish is executed after $self->render
14:46 pink_mist it comes as a surprise to you that $delay->on(finish) gets executed once the $delay has finished??
14:46 user_7801 no it doesn't actually, but if you use it the first time (like me today) - you might want to figure out what really happens :)
14:48 bpmedley user_7801: http://mojolicious.org/perldoc/Mojo/IOLoop/Delay#finish <-- Are you familiar with Mojo::EventEmitter?
14:51 user_7801 i'm gonna read about it, thx.
14:51 user_7801 i'm new to this anway
14:51 user_7801 i'm trying to understand the things and not just c/p into my editor
14:52 vicash joined #mojo
15:01 cuechan_ joined #mojo
15:13 leoj joined #mojo
15:15 kaare joined #mojo
15:15 dod joined #mojo
15:36 leoj joined #mojo
15:48 jabberwok Can websocket 'send' be unbuffered, or flushed? Adapted cookbook example; Not sure why all the message appear at once instead of when delay callbacks happen.  https://gist.github.com/lindleyw/581f4a8758373cff5eea97060205fc6b
15:53 dotan Watching Gabor talk about mojolicious' reputation as "a moving target", he says that it's stabilized in recent years. A calming message, just in time for version 7 and it's breaking changes... ;-P
16:13 sri jabberwok: $c->send('whatever' => $delay->begin)
16:14 sri dotan: drama queen
16:23 dotan sri: pot, kettle
16:26 jabberwok sri: Thanks! updated my example and it works as desired now. tres bueno.
16:30 marty joined #mojo
16:57 jberger There aren't very many breaking changes (so far) in 7
16:59 sri most boring breaking changes ever
17:00 jberger But again this just means mojo is so good that it doesn't need changing \o/
17:00 pink_mist our little mojo is becoming mature software!
17:00 jberger Awwwww
17:00 jberger They grow up so fast
17:10 jberger Also being so far west is strange because there is so much to catch up on when i wake up
17:38 zivester joined #mojo
17:49 Grinnz joined #mojo
18:02 Grinnz joined #mojo
18:36 thowe What's the best vim syntax project for Mojo?  embeeded perl doesn't appear to be included in vim-perl/vim-perl on Github
18:38 jberger there is mojo.vim
18:40 jberger https://github.com/jberger/dotfiles/blob/master/.vimrc#L28
18:40 thowe Awesome.  Thanks!
18:46 thowe Oh, yeah.  That's sooo much better.
18:46 thowe jberger++
18:51 lluad joined #mojo
18:54 thowe somehow it didn't occur to me to search for a mojo specific project, I have no excuse
18:56 jkrizansky joined #mojo
18:56 jberger Glad it works for you
18:56 jberger Also i can't recommend VAM strongly enough if you need a vimrc deep management tool
18:57 thowe I don't know if I need one.  Not something I've considered.  My vim usage is probably rudimentary, but I'm interested in improvement.  What, exactly, does VAM manage?
18:58 thowe I'm curious how having different stuff installed that might be for the same things get's worked out...  Is that part of it?
18:59 thowe I think I have some syntax files on here from petdance(?), but the mojo stuff appears to have done the right thing when installing on top of that, I think
19:02 tchaves joined #mojo
19:03 thowe is this the vim-addon-manager?
19:04 thowe ah, I needed but to scroll down a bit...
19:08 pink_mist (or up)
19:48 leoj jberger: Regarding ReadWriteFork, how to store child PID in parent without a "spawn" event?
19:49 simcop2387 joined #mojo
19:49 simcop2387 Does anyone have any thoughts on Mojolicious::Plugin::Blogspam? e.g. does it work well or is there a better way?
19:52 leoj jberger: Docs mention `$int = $self->pid;` "Holds the child process ID." but I don't understand the context. In my code I am trying `my $rwf = Mojo::IOLoop::ReadWriteFork->new; $rwf->start()` but is seems `$rwf->pid` is an "uninitialized value".
19:57 mpapec if I understand correctly sub signatures are no longer experimetal
19:58 mpapec sri: is it possible to enable them in https://metacpan.org/source/Mojo::Base ?
19:58 mpapec warnings->unimport("experimental::signatures"); feature->import("signatures");
19:59 mpapec and curious why https://metacpan.org/source/Mojo::Base#L100
19:59 mpapec why not $self->$cb(@_);
20:00 pink_mist because that doesn't put $self in $_
20:00 mpapec pink_mist: ah, so $cb looks for $_?
20:01 pink_mist it's supposed to have $self available in $_ yes ... but whether it does or not depends on the one writing it
20:01 thowe I think they are still experimental until next release(?)  Maybe I heard wrong.
20:02 thowe still, I don't think they are going anywhere or changing...
20:03 mpapec thowe: I think someone mentioned that @yapc
20:03 mpapec can't find in perldoc though
20:04 pink_mist http://perldoc.perl.org/perlexperiment.html still lists subroutine signatures as experimental
20:04 pink_mist if they were at yapc, they may be talking about the dev branch
20:05 mpapec pink_mist: I'll look for YT video
20:11 thowe mpapec, I was ay YAPC too, did we meet?  I'm the guy with the beard who doesn't know anything and is just happy to be there.
20:12 thowe From Bend
20:12 pink_mist thowe: sounds like me, except I wasn't there :P
20:15 mpapec thowe: unfortunately I wasn't there :)
20:15 mpapec what are your impressions from Orlando?
20:17 mpapec I've watched most of it at youtube, and I'm surprised how many talks were there
20:23 thowe sorry, had to leave the room...
20:23 thowe I think every experience is unique, but I had a very good time.
20:24 thowe Since it was my second conference, I was more willing to put myself out there.  It made a difference.  I asked more questions, met more people, and went to the pull request thing.
20:25 thowe I also, last minute, decided to go to Damien COnway's functional Perl Programming class, which was very good.
20:26 thowe The help that jberger, preaction, and um, a guy whose name I can't remember and isn't here right now gave me a good start on being able to follow it pretty well.
20:26 thowe I shoul dhave put another comma above for readability...
20:28 thowe There appears to be a 100% positive attitude about Perl 6 across the board.
20:28 thowe I wish I ran into some Mojo people.
20:29 thowe As it was, I talked it up to a number of folks who seemed to want to default to Dancer.
20:30 thowe I was actually pleasantly surprised with how much I really do seem to know about a few topics that were helpful to others, like DBIC.
20:31 thowe mpapec, does any of that answer your question?  Or were you atulayy asking about the city?
20:31 thowe er actually
20:32 kid511 joined #mojo
20:37 Grinnz yes, the signatures feature is still experimental
20:42 thowe mpapec, you asked about talks, I think.  There were a couple of talks I had a hard time following due to lack of context or just delivery, but overall we had some really good speakers.
20:43 thowe I always enjoy RJBS, and he was just as good as always.  I had never seen Damien Conway before, but he's really just awesome.  He is great at keeping the audience right there with him and is presentation skills are just incredible.  Maybe the best speaker I have ever seen.
20:45 thowe Steve Nolte was good.  The guy talking about Erlang was good....  I was completely lost in the MOP talk.  One of the keynote speakers didn't do it for me.
20:48 mpapec thowe: nice!
20:48 mpapec last time I've checked func. prog. it was from http://hop.perl.plover.com/
20:49 kid51 joined #mojo
20:49 mpapec I was lost after half of the book :)\
20:50 thowe The class really laid it out methodically along with rationale and really greate examples.  It seems so conceptually simple now, but I guess that's what makes a great class.
20:50 thowe Oh, yeah, I totally want to read that now.
20:51 thowe Conway described Higher Order functions as those functions that take functions as arguments and return functions.
20:51 thowe IIRC
20:51 mpapec Conway is great speaker, I'm not surprised they managed to convince him to land in Orlando
20:52 thowe he did an impromptu talk as well about his VIM setup, which was pretty cool.
20:52 thowe The video came out well, which is a good thing because it was packed to the door.
20:53 mpapec are you talking about his keynote?
20:53 mpapec or some other talk
20:54 thowe https://www.youtube.com/watch?v=9u6O0dLuqhI  <- this one
20:54 * mpapec watching video
20:54 thowe Someone was supposed to do an Emacs talk or something, but he couldn't be there.
20:54 mpapec :D
20:56 mpapec I can only imagine full audience of Emacs crowd listening to Vim talk ;)\
21:00 Riviera they'd be full of pity
21:09 thowe bpmedley was the other name I couldn't remember before.  He spent some time with me explaining a few things that made it so I wasn't starting from scratch in the Functional class...  Felt bad I couldn't remember at first.
21:10 thowe I just hope the guy who was going to give the Emacs talk doesn't feel slighted.
22:36 punter joined #mojo
22:36 leoj joined #mojo
23:09 marty joined #mojo

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