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

IRC log for #mojo, 2016-04-06

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

All times shown according to UTC.

Time Nick Message
00:32 absolut_todd joined #mojo
00:43 schmooster joined #mojo
01:03 woz joined #mojo
01:03 Lee joined #mojo
01:08 meshl joined #mojo
01:13 bwf joined #mojo
01:25 yysachinyy joined #mojo
01:26 yysachinyy joined #mojo
01:37 dvinciguerra__ joined #mojo
01:40 jnbek joined #mojo
01:42 jnbek joined #mojo
01:48 ilbot2 joined #mojo
01:48 Topic for #mojo is now ūüćĽ cheers | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
01:50 disputin joined #mojo
02:14 bwf joined #mojo
02:20 asarch joined #mojo
02:38 noganex joined #mojo
02:43 jasanj joined #mojo
03:05 woz joined #mojo
03:10 tchaves joined #mojo
04:15 bwf joined #mojo
04:53 woz joined #mojo
05:34 melo joined #mojo
05:37 melo1 joined #mojo
05:48 dod joined #mojo
05:51 inokenty-w joined #mojo
05:52 dod joined #mojo
06:01 woz joined #mojo
06:16 bwf joined #mojo
06:28 salva joined #mojo
07:08 punter joined #mojo
07:32 AndrewIsh joined #mojo
07:44 trone joined #mojo
07:53 woz joined #mojo
08:02 trone joined #mojo
08:16 bwf joined #mojo
08:18 Vandal joined #mojo
08:19 woz joined #mojo
08:37 woz joined #mojo
08:41 ribasushi joined #mojo
08:44 woz joined #mojo
09:02 woz joined #mojo
09:05 osfabibisi joined #mojo
09:10 meshl joined #mojo
09:35 woz joined #mojo
10:14 melo joined #mojo
10:17 bwf joined #mojo
10:19 woz joined #mojo
10:19 woz joined #mojo
10:39 dvinciguerra__ joined #mojo
10:45 kaare joined #mojo
10:47 good_news_everyon joined #mojo
10:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vVVhK
10:47 good_news_everyon mojo/master 0a35b09 Sebastian Riedel: better explanation for redirect_to
10:47 good_news_everyon left #mojo
10:56 woz joined #mojo
11:01 tchaves joined #mojo
11:02 asarch joined #mojo
11:14 woz joined #mojo
11:31 jkramer joined #mojo
11:31 jkramer Ahoy!
11:31 jkramer Maybe I'm blind, but how do I set default headers in Mojo::UserAgent? I can only find the per-request headers in the manual
11:34 batman jkramer: $ua->on(start => sub { my ($ua, $tx) = $tx->req->headers->header(...) });
11:34 batman look at Mojo::Headers for more information about which headers you can set and how
11:35 jkramer Nice, thanks!
11:36 batman you're welcome
11:36 batman oops! my ($ua, $tx) = @_;
11:36 batman jberger: https://metacpan.org/pod/Mojo::UserAgent#start
11:44 sri node.js is such a mess https://snyk.io/blog/exploiting-buffer/
11:49 marcus sri: yay. npm is pretty hateful too.
11:51 sri seriously, i'm surprised people are not more angry about it
11:52 sri a default module system where all you need is a lawyer to take over any namespace you like
11:53 sri or even just the threat of a lawyer
12:00 woz joined #mojo
12:16 woz joined #mojo
12:18 bwf joined #mojo
12:19 bwf joined #mojo
13:02 jkramer left #mojo
13:14 marty joined #mojo
13:16 woz joined #mojo
13:17 woz joined #mojo
13:24 meredith i'm surprised how many people want to be angry about it
13:29 Adura They knew the risks?
13:30 batman meredith: why?
13:33 perlpilot anger is useful if it inspires people to fix the problem, but I don't know that anyone has been so inspired.
13:33 meredith i'd find it much more questionable for npm to take on the legal liability for random uploaders, that puts the resources of everyone on and using the platform at risk
13:34 meredith npm follows the law quite reasonably (under advice of counsel, incidentally) and great swaths of nerdfolk get upset.
13:34 sri meredith: you misunderstand, i wouldn't mind for them to retire the namespace, but instead they are just giving them to someone else
13:35 sri like, i could upload mojolicious.js to npm today, and tomorrow some lawyer demands the namespace from npm inc, and they would just hand it over
13:35 meredith quite a few directed harassment and abuse at the npm team.
13:36 sri to do whatever they like with it
13:36 meredith actually they'd engage both parties
13:36 meredith it's documented, i mean
13:36 meredith the policy and them acting on the policy
13:37 sri from what i've seen that's exactly what they did with kik
13:37 meredith they're interested in the health of their system, they'll make a plan if there's really no way to keep a module where it is, esp if it's got a lot of dependencies
13:38 batman something did go sideways in this case...
13:39 meredith the author of kik wasn't exactly cooperating
13:42 perlpilot meredith: I don't see how that's relevant to the actions of npm.
13:43 perlpilot also, it was merely the *threat* of legal action that caused them to hand it over.
13:44 meredith they own the trademark and at least two lawyers thought it a sound claim?
13:44 meredith like, what do you expect npm to do?
13:44 meredith what's the good fight? blow money they use to support npm?
13:47 mishanti1 Npm is basically a for-profit thing now, so it makes total sense that they do some cost-optimalizations.
13:47 woz joined #mojo
13:58 osfabibisi joined #mojo
14:02 woz joined #mojo
14:03 woz joined #mojo
14:08 bwf joined #mojo
14:09 nic perl -Mojo -E'a("/" => {inline => q{<%== my $x = 2; $x * $x %>}})->start' get / '#error'
14:10 nic It looks like I can't have assignments inside <%==  %>.  Am I understanding correctly?
14:10 preaction correct. use <% ... %> instead
14:11 nic cheers
14:11 nic What are the rules of what can go inside <%==  %> ?
14:12 sri meredith: so, for you it's ok that non-americans would be outright screwed?
14:12 preaction nic: an expression that yields a value. so, not a statement, and certainly not multiple statements
14:12 cpan_mojo Mojolicious-Plugin-AssetPack-1.01 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.01
14:13 nic preaction: thanks
14:16 nic lol, thought I could convert block->expression by using 'eval', but that gives...  nothing
14:17 sri nic: MOJO_TEMPLATE_DEBUG=1
14:17 nic ta
14:17 sri you'll see it
14:21 jberger sri: does this make any sense to you? https://github.com/jberger/Mojolicious-Plugin-ReplyTable/issues/3
14:22 jberger I just build an xls(x)? doc, have it write to an scalar "filehandle" and then render the result using the data stash key
14:22 sri makes no sense to me
14:23 jberger k thanks
14:24 cpan_mojo Mojolicious-Plugin-CGI-0.28 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-CGI-0.28
14:27 memowe joined #mojo
14:27 sri jberger: like perl -Mojo -E 'Mojo::Asset::Memory->new->add_chunk("x" x 131073)->get_chunk'
14:27 sri ?
14:27 jberger who knows?
14:29 jberger closed pending more info
14:29 jberger sri: thanks for looking
14:32 nic apologies for misinformation... wrapping the block in an eval works perfectly -- i was seeing "nothing" cos I still had '#error' at the end of my commandline :P
14:33 sri why eval and not just do?
14:33 nic oh, nice idea
14:33 nic (basically I'm trying to get a bit of horrible template (essentially a large switch stmt) more readable)
14:38 memowe o/
14:42 woz joined #mojo
14:44 jberger IIRC we tried adding do {} at one point
14:44 jberger I can't remember what happened though
14:44 preaction iirc that's when context problems started happening, which is when the scalar bit got added
14:48 nic fwiw I think it's good that it currently encourages people to stick to simple expressions
14:56 disputin joined #mojo
15:37 orev joined #mojo
15:41 berov joined #mojo
15:45 berov joined #mojo
15:47 berov left #mojo
15:48 jberger so who is schmoozer on imgur?
15:49 jberger schmooster
15:49 jberger ah, maybe the user on here called schmooster
15:49 jberger o/
15:50 mcsnolte joined #mojo
15:51 preaction and i didn't go jump on that thread or anything
15:53 berov joined #mojo
16:12 disputin joined #mojo
16:12 thowe_work just FYI, that issue that was driving me crazy yesterday appears to be some kind of javascript interpreter problem with Firefox.  I can't replicate with chromium, and I found an unrelated bit of js that might be what confuses it.
16:16 woz joined #mojo
16:23 woz joined #mojo
16:26 disputin joined #mojo
16:30 meshl joined #mojo
16:33 PryMar56 joined #mojo
16:35 disputin joined #mojo
16:36 jberger thowe_work: that's good to head
16:36 jberger hear
16:37 jberger I mean, its bad for firefox users I guess, but good that you found the issue
16:37 woz joined #mojo
16:40 thowe_work well, it's frustrating.  I was showing the guys at work because they didn't believe me.  Difficult to build a small example of it since it seems to exist because of some complexity.
16:41 thowe_work But I found a way to work around, and the fact that it doesn't trip up Chromium makes me think it isn't a blatant error on my part.  it still may be, but I'll pretend.
16:49 woz joined #mojo
17:00 Kripton joined #mojo
17:03 dvinciguerra__ joined #mojo
17:05 woz joined #mojo
17:19 berov left #mojo
17:20 woz joined #mojo
17:23 csson joined #mojo
17:33 disputin joined #mojo
17:43 woz joined #mojo
18:44 woz joined #mojo
18:58 schmooster jberger: yep ;)
18:58 schmooster hai
19:05 schmooster I'm pleased to hear that hiring of perl developers is still occurring around the world :)
19:13 lluad joined #mojo
19:15 jberger yessir
19:26 schmooster I'm guessing from preaction's statement that you're both at the same company?
19:28 jberger preaction contracts with us
19:36 jberger sri: hmmmm, so we have one qa stack that just runs the unit tests and now that minion+pg checks for a db version I don't know how to prevent it from dying when the plugin is loaded
20:08 thowe_work I normally use DBIC for my db access, but there are some functions I want to perform with Mojo::Pg.  Is there any reason I shouldn't use the the same database handle for those?
20:17 asarch joined #mojo
20:17 batman thowe_work: if you pass on $pg->db->dbh to DBIC then i don't think it will know how to reconnect if the $dbh goes dead
20:17 batman i would just use them side-by-side unless you have some crazy transactions you need to support
20:18 batman in that case it would probably be fine passing on the $dbh as well, since it wouldn't have time to "die"
20:18 thowe_work Yeah, these functions are rare deals, I think I should create and destroy the connection for each go.
20:19 batman you don't really have to. $pg->db makes sure that the $dbh is alive and the same goes for $schema->resultset("foo")->search;
20:19 batman but My::Schema->connect(sub { $dbh }) will not be so friends iirc
20:20 batman i could be wrong, but that's how it worked some time back...
20:22 batman haven't used dbic actively in a while...
20:24 mdom batman: So you're writing all your sql yourself? Or do you have any recommendation?
20:25 batman yeah, i do these days. but sometimes with helper functions
20:25 genio SQL::Abstract is good
20:25 batman so I'm either 1) writing the sql 2) using something like https://gist.github.com/jhthorsen/43ef9d8b11d4e76a253b
20:26 genio batman: SQL::Abstract that instead
20:26 batman i also wrote https://metacpan.org/pod/Mad::Mapper but i haven't found any use for it myself yet :/
20:28 mdom Yeah, i've seen Mad::Mapper, but it's in the weird space where i could use it for simple cases, but that's when i mostly write dql directly ... :/
20:28 batman genio: the thing is that when i need something more complex than that gist i just want to write the sql instead :/
20:28 batman mdom: indeed, hehe
20:28 genio if it's something too complex, I usually write a view to simplify the in-code query.
20:29 batman guess i'm not good at marketing my own modules, haha
20:29 genio but otherwise, I tend to use SQL::Abstract when I have lots of whatnot involved in deciding how the where clause should be built based on filters from the UI, etc.
20:30 * mdom needs to remember to use views more often
20:31 mdom Can i fatpack SQL::Abstract? /me checks
20:31 * batman wonder how the cpantesters report will look tomorrow
20:31 batman assetpack 1.0 was all red :/
20:33 mdom Okay, i give up: Why is Mojolicious::Command always required and not used?
20:49 woz joined #mojo
21:04 simcop2387 So I'm using Mojo::IOLoop and Mojo::IOLoop::Delay to do some stuff non-blocking, and the end result is that I have a file to send back to the client.  What's the sanest way to actually do that given a filename?
21:05 batman mdom: i don't get the question
21:06 batman simcop2387: https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#reply-asset
21:06 simcop2387 aha, i figured there had to be something
21:06 simcop2387 thanks, i'll take a look
21:34 meshl joined #mojo
21:53 simcop2387 batman: thanks, that worked but i then happened to figure out another way that avoids the temp file all together. D'oh
22:01 woz joined #mojo
22:07 sebbe joined #mojo
22:22 pink_mist simcop2387: might want to make sure that doesn't cause blocking while it's being sent
22:38 simcop2387 i'm getting the output from ::ReadWriteFork and using the events to do chunked writing back.  so i don't think it should be too bad even it does.  the main thing is the fetching from s3 and the actual conversion that'll take up the bulk of time
22:39 pink_mist right, chunked writing should make it work well
22:41 simcop2387 once i got the hang of it, using IOLoop::Delay is nice.  The steps I'm doing are fairly linear/unparallelizable but it makes doing it without blocking a lot nicer.
22:56 melo joined #mojo

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