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

IRC log for #mojo, 2016-04-03

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

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:04 woz joined #mojo
00:34 asarch joined #mojo
00:38 tchaves1 joined #mojo
00:45 tchaves1 joined #mojo
00:51 tchaves joined #mojo
01:00 jontaylor joined #mojo
01:32 tchaves joined #mojo
02:06 woz joined #mojo
02:41 noganex_ joined #mojo
03:03 lb joined #mojo
03:17 tchaves1 joined #mojo
03:21 kaare joined #mojo
03:22 tchaves joined #mojo
03:23 tchaves joined #mojo
04:00 tchaves joined #mojo
04:08 woz joined #mojo
04:29 tchaves joined #mojo
04:42 tchaves joined #mojo
04:51 tchaves1 joined #mojo
05:27 disputin joined #mojo
06:00 woz joined #mojo
07:02 woz joined #mojo
07:37 cpan_mojo Qiniu-0.06 by FUKAI https://metacpan.org/release/FUKAI/Qiniu-0.06
07:47 dod joined #mojo
07:52 dod joined #mojo
08:13 Vandal joined #mojo
08:25 woz joined #mojo
08:27 woz_ joined #mojo
08:41 marty joined #mojo
08:43 diegok joined #mojo
09:05 pink_mist http://www.pcworld.com/article/3050466/hardware/eat-your-heart-out-quad-cores-intel-just-dropped-a-22-core-cpu-on-us-boom.html
09:06 pink_mist if you add hyperthreading to that, that means 44 concurrent threads :D
09:35 eseyman joined #mojo
09:35 Adura Download porn 44 times faster!
10:03 batman not sure if that's something you can say Adura...
10:09 Adura Oh please...
10:19 woz joined #mojo
10:54 marcus Adura: let's keep it pg-13 around here.
10:58 ribasushi marcus: stating the obvious, but what you actually want is G-rating, PG-13 is something else ( https://en.wikipedia.org/wiki/Motion_picture_rating_system#United_States )
10:59 woz joined #mojo
10:59 Adura Better strip all the Futurama references from the code, then. ;)
11:04 pink_mist Adura: please read the code of conduct listed in the topic
11:05 Adura I'm not seeing what I said as violating it.
11:16 odc Adura, i feel your pain
11:16 Adura I can see if I said someone specifically does porn...
11:17 Adura But, no. Just a Simpsons/Futurama-level joke.
11:51 woz joined #mojo
12:10 woz joined #mojo
12:25 VVelox batman or bpmedley : I forget which of you pointed me to Mojo::IPLoop::ReadWriteFork, but thanks...  here is a example showing streaming using FFmpeg::Stream::Helper http://pastebin.com/h551wyMc
12:34 batman VVelox: cool. it's my module... not sure who pointed you to it though :)
12:35 VVelox hmm... interesting... Mojo::Reactor::EV: I/O watcher failed: Can't call method "res" on an undefined value at /usr/local/lib/perl5/site_perl/Mojolicious/Controller.pm line 222, <DATA> line 57.
12:36 batman VVelox: i don't think you need to put $fork into stash, since you close over the variable inside "finish"
12:36 batman "since you could just"
12:37 batman VVelox: but i think you need Scalar::Util::weaken($self) before $fork->on(read => sub { ...})
12:37 VVelox basically just followed your little example thing
12:37 VVelox thanks
12:37 VVelox shall look into it more
12:37 asarch joined #mojo
12:37 batman and then just do $fork->on(read => sub { $self and $self->write_chunk($_[1]) });
12:38 VVelox hmm... also it appears that for some reason firefox is truncating the video
12:38 VVelox wget shows it being fetched nicely though
12:38 batman what do you mean about "truncating" ?
12:39 batman $fork->start(program => $command); is safer if you do something like $fork->start(program => "ffmpeg", program_args => [$file]);
12:39 batman iirc
12:39 batman been a while since i've used the module, hehe
12:40 VVelox Firefox only appears to work up to a bit past 4 minutes. Giving it time to finish loading more and seeing what happens.
12:40 VVelox Ohh? Why is that?
12:40 batman or... i'm using it almost every day, but i don't look at the code that often...
12:40 batman why is what..? are you referring to my "safer" comment?
12:41 batman passing on just one argument to exec() is unsafe: https://metacpan.org/source/JHTHORSEN/Mojo-IOLoop-ReadWriteFork-0.17/lib/Mojo/IOLoop/ReadWriteFork.pm#L286
12:41 bpmedley VVelox : Cool stuff.
12:42 batman but you need just one argument if you're doing stuff like "ffmeg ... 2>/dev/null"
12:42 VVelox FFmpeg::Stream::Helper sets -loglevel to quiet by default.
12:43 VVelox with that said, just uploaded 0.0.1 of that
12:48 jberger VVelox: in the main method do my $tx = $self->tx
12:49 jberger And then in the finish handler do: undef $tx
12:50 jberger That should keep a strong reference to the transaction
12:57 VVelox 5~5~5~
13:03 VVelox nice
13:03 VVelox seeing how that goes
13:06 VVelox nope, putting my $tx = $self->tx in the main method and then undef $tx in the bit that kills it appears to not of done anything
13:08 VVelox curiously the bigger issue appears to be firefox
13:08 VVelox it appears to stop fetching data after a bit and ffmpeg connection is then killed
13:20 tencendur joined #mojo
13:21 jberger Does write work better than write_chunk?
13:23 woz joined #mojo
13:26 VVelox Sweet. Can tell you shortly. Also trying to disable proxy as well incase something funny is happening there.
13:28 VVelox nope
13:28 VVelox no change
13:31 VVelox hmm... consistently dies in the nearly the same place... seeing what tcpdump says now
13:32 VVelox yeah, firefox is not sucking it down fast enought
13:32 bpmedley VVelox : Are you getting a timeout?
13:35 VVelox bpmedley: Firefox will suck it down rather quick and nice and then it eventually stops doing it.... just bunch of small packets back and forth
13:36 bpmedley What OS are you on?
13:36 VVelox FreeBSD 10 stable
13:36 lluad joined #mojo
13:36 bpmedley Sorry, I don't know that one.. are there other browsers you can test with for a reference point?
13:37 VVelox just going to see what a few do in a windows VM here later
13:37 VVelox I know it is not a script problem as wget will fetch it perfectly fine. :/
13:38 bpmedley It's difficult to go from 90% done towards 99% done.  You're doing well.
13:39 VVelox okay... I have an idea what is going on...
13:39 VVelox Firefox stops buffering as soon as I push the play button.
13:40 VVelox this time I let it sit on the page a lot longer instead of pushing play practically immediately... this time it got past the point it was constantly dieing on
13:44 VVelox and thanks
14:28 marcus Adura: the quotes were stripped quite a while ago.
14:30 Adura Guess it's just some names now, then.
14:31 marcus Not sure if Morbo is G or PG #dooom
14:31 marcus And frankly I'd rather not find out. :-/
14:32 Adura May have to change it if the next plague starts in Italy.
14:47 eseyman joined #mojo
14:48 woz joined #mojo
15:03 dod joined #mojo
15:09 woz joined #mojo
15:12 masv3971 joined #mojo
15:16 dvinciguerra joined #mojo
15:18 jberger marcus: they were stripped for a while but i thought they came back
15:21 jberger Look the quotes aren't the issue. Adura made a joke that was propbably not appropriate for the channel, but was not far enough over the line that any punishment is required
15:21 jberger Someone spoke up, we moved on
15:22 jberger The system isn't supposed to be punitive just supposed to keep the room comfortable for everyone
15:22 Adura I did find the level of response kind of odd.
15:22 jberger Adura: please don't push it
15:23 jberger Our code of conduct does mention sexualized jokes
15:23 jberger So you were on the border line
15:31 sri jberger: for me it's not about the joke, but Adura;s response to being told a joke was inappropriate
15:32 jberger Indeed
15:32 sri i actually just typed
15:32 sri "adura" into the irclog search
15:33 sri and it's pretty much all bad jokes
15:33 Adura If I keep getting highlighted, I will respond. Like I said, I didn't see it to be a CoC violation. "bad jokes", your opinion.
15:34 sri indeed, the "bad" part is my opinion
15:36 jberger The code of conduct makes it clear that the project does not want sexual content in our community
15:36 sri Adura: my point is that i'd like to see you be constructive more
15:37 jberger Bad has nothing to do with it
15:38 Adura My interpretation differs, saying "porn" isn't inherently sexualized content.
15:38 sri i mean, we all make bad jokes every now and then, but when it gets pointed out that it was inappropriate you say "sorry, not my intention" and move on
15:38 jberger Right
15:41 mdom I need to make a controller accessable via two different paths : $r->get('/foo')->to('#foo'
15:41 mdom *mrg*
15:41 mdom Sorry, Backspace and Enter are too close on my laptop
15:42 jberger It is the ' that always does me in
15:42 thowe mdom, oo, oo, I think I can help with that!  *rubs hands together*
15:42 mdom I need to make a controller accessable via two different paths : $r->get('/foo')->to('foo#bar') and $r->under('/api')->get('foo)->to('foo#bar') ...
15:42 mdom thowe: :)
15:43 thowe er, so far I don't see a problem...
15:43 mdom I mean, it's not hard to write some generator for that myself, but i thought maybe there's a neat trick in mojolicious... :)
15:43 sri to be clear, the CoC is intentionally vague and leaves a lot of room for compromises
15:43 sri note how you didn't even get a formal warning
15:43 Adura As for constructive... I can't guarantee anyone will find what I say constructive, even if it was my intent.
15:44 Adura I know vagueness is great for covering one's ass.
15:44 batman Adura: your response was very disrespectful. to me it was worse than the original comment.
15:44 mdom thowe: It's not only one route and i want to save the typing ... :) Basically i have 20 routes and i want them to be accessable via two base paths
15:44 * mdom hopes he makes sense
15:44 batman a *normal* response would be something like "sorry, i will keep quiet" or something like that
15:45 Adura I didn't want to type out as much as I have had to up till now.
15:48 thowe mdom, I thought I could help by showing you how to name a route, but I don't know of a shortcut for what you suggest.  Why do you need the different paths?  Can't you have a path with an argument to get the same result?  This design seems anti-intuative to me
15:49 jberger mdom: You want to generate /foo and /api/foo at the same time?
15:49 thowe or, rather, different format or content negotiation?
15:49 jberger Look into adding a router shortcut if so
15:51 * sri goes back to playing borderlands, to see inappropriate jokes in the appropriate environment
15:52 jberger Hehe
15:52 Adura Now those are bad jokes.
15:53 woz joined #mojo
15:54 vicash left #mojo
15:54 eseyman joined #mojo
15:54 thowe mdom, did you find what jberger is talking about?  http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Shortcuts
15:54 mdom jberger: Mhh, i had taken a look at routes shortcut but dismissed the idea as i have two routes i want to add routes to
15:54 thowe If the routes you want to generate have the same (or similar enough) patterns, that might be what you want.
15:55 mdom But sure, i can add a shortcut for $r and add the route to $api inside it
15:55 mdom *argl* Maybe i just post some code and don't try to explain it in words... :)
15:56 melo joined #mojo
16:02 mdom http://fpaste.scsys.co.uk/509443
16:02 mdom And $r is just my $r = $self->routes;
16:03 jberger mdom: do you know about the built in content negotiation system?
16:03 mdom So, i should add a shortcut for $r and then add it to $r and $api inside the sub
16:03 jberger You don't need :format
16:03 mdom Yeah, i using :format for it
16:04 mdom I have to provide a api that wants /api/{plain,json,...}
16:04 jberger Your choice
16:04 jberger Seems a little odd to me, but it's your api
16:05 thowe are all the shortcust you want to create like the "api" one?  Same pattern?
16:05 mdom Not really, i'm implementing http://twtxt.readthedocs.org/en/stable/user/registry.html
16:05 mdom thowe: Yeah
16:06 jberger Mojo already supports adding .json or .txt or the like
16:07 jberger Or ?format= or an accept header
16:07 mdom jberger: I know ... and i want to provide exactly that as an alternative to the "official" api ...
16:07 jberger OK
16:07 mdom So, i have to provide /api/json/users, but also want to make it accessable under /users.json
16:08 thowe mdom, I'm the worst person to get advice from, but it does look like you can do that with add_shortcut...
16:09 mdom thowe: Yeah, i'll try that. Thanks!
16:11 thowe mdom, You may just want to set up your base $r first, then have your shortcut sub create the "under" paths from the name.  Unless I'm missing something.
16:16 mdom Okay, http://fpaste.scsys.co.uk/509446 seems to be working fine
16:17 thowe Can you edit that?  I would be interested to see the output from the routes argument to see what it generated.
16:26 thowe mdom, Can you show me what routes you get generated by that?  Just curious to see.
16:29 melo joined #mojo
16:32 eseyman joined #mojo
17:18 sawtooth joined #mojo
17:37 bpmedley FYI, s1037989's cloud9 (c9.io) is amazing and works well with Perl and Mojolicious
17:43 bpmedley I can literally run a daemon server via the perl debugger and interactively process a request.. :)
17:43 bpmedley http://bmedley.org/mojolicious_cloud_9.png
17:45 batman bpmedley: s1037989 is using that while developing convos :)
17:46 bpmedley batman++
17:46 bpmedley s1037989++
17:50 mdom thowe: Sorry, wife and kid returned ... http://paste.scsys.co.uk/509452
18:00 umask001 joined #mojo
18:20 Kripton joined #mojo
18:20 nicomen Did anyone experience this before: Prototype mismatch: sub Mojo::JSON::true: none vs () at /usr/share/perl5/Mojo/Util.pm line 131. # seems to be related to the use of Mojo::JSON::MaybeXS
18:23 woz joined #mojo
18:25 mattp_ nicomen: what version of mojo? latest uses () for true as well
18:29 nicomen it seems to be a quite old mojo here, and a newer resolved it
18:30 nicomen ;)
18:40 woz joined #mojo
18:41 tchaves joined #mojo
19:14 vicash joined #mojo
19:16 PryMar56 joined #mojo
19:18 vicash1 joined #mojo
20:22 woz joined #mojo
20:39 csson joined #mojo
20:39 asarch joined #mojo
20:54 woz joined #mojo
21:04 nicomen joined #mojo
21:33 thowe bpmedley++
21:34 thowe bpmedley, Thank you!  I now have some clue what's going on with these callbacks and loops and things!
21:35 VVelox So yeah, been poking at it more and it appears that Firefox does it across platforms and IE hates it all together. Going to be trying chrome shortly.
21:48 VVelox And Chrome appears to suck it down nicely, but can't handle pausing...
21:58 VVelox so yeah, from what I can tell, it appears that the video tag really is not streaming friendly with some sort of js involved
21:58 bpmedley https://github.com/brianmed/ForkAndGo <-- Anyone have time to review the plugin and example app?  How do things look from a logical perspective?  Also, there're a few hacks that need improvement; however, the code seems to work under daemon, prefork, hypnotoad launching and restarting.. :)
22:00 bpmedley What the example app does is auto launch a minion worker and tcp echo server.
22:29 * VVelox does the hammer dance in cellebration.
22:29 VVelox fixed it
22:30 jberger VVelox: what was the problem?
22:32 VVelox firefox does not handle preload="auto" properly and needs it set to "none" for streams
22:34 jberger Interesting
22:35 jberger bpmedley: I'm not sure what I'm liking at there
22:35 jberger I'm assuming that is for starting minion?
22:35 jberger Two immediate fears
22:36 jberger I don't know that inspecting @ARGV is supported in a plugin
22:36 VVelox not sure what chrome or IE are doing yet, but assume it is similar
22:36 jberger Though you may have no choice, I'd have to think about it more
22:37 jberger Second, forking in a loop is almost certainly going to cause problems
22:38 jberger Maybe you could last() at the end of the child code?
22:39 jberger Also I'm not sure why you start the loop yourself
22:39 jberger That seems wrong
22:53 dvinciguerra joined #mojo
22:55 dvinciguerra_ joined #mojo
22:59 VVelox jberger: well, actually I take that back, firefox gets farther before it dies
23:00 jberger VVelox: did you try changing from write_chunk to write?
23:00 VVelox yeah
23:00 jberger ok
23:00 jberger it was just a wild shot
23:01 woz joined #mojo
23:02 jberger VVelox: do you handle "Accept Ranges" header?
23:02 jberger I wonder if the connection times out and it tries to start another one from a later point
23:03 jberger this for example: http://stackoverflow.com/q/24976123/468327
23:06 bpmedley jberger : Thanks for looking!  Let me read over what you wrote.
23:09 bpmedley jberger : Sorry for the lack of context, the plugin's goal is to allow the user to run callbacks in separate process on startup.  For example, your Fork helper could be used to launch minion.
23:10 bpmedley Inspecting @ARGV is probably a hack.  Not sure of the best approach.
23:16 VVelox jberger: nope, not currently
23:17 VVelox but yeah, will have to look into that there
23:17 VVelox thanks
23:26 tchaves joined #mojo

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