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

IRC log for #mojo, 2014-11-29

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

All times shown according to UTC.

Time Nick Message
00:05 Grinnz so elixir is like a faster ruby?
00:05 * Grinnz obviously ignorant of such things
00:05 bpmedley joined #mojo
00:08 callumgare joined #mojo
00:30 sri it's a ruby-ish erlang
00:54 Grinnz havent used erlang, so that means nothing to me :D
00:56 Grinnz good for concurrency, eh
01:15 bpmedley joined #mojo
01:49 woz joined #mojo
02:00 absolut_todd joined #mojo
02:09 klapperl joined #mojo
02:16 jberger sri: just saw the josetteorama article
02:16 jberger not a big fan of Nonblocking io eh?
02:16 sri that shouldn't be a big surprise ;p
02:17 jberger coroutines are ... well ... coming soon?
02:17 sri i like blocking io and threads more
02:18 sri coroutines don't really solve the problems
02:19 jberger certainly blocking io and threads are easier to conceptualize, at least superficially
02:19 sri you can't really avoid non-blocking io for super high concurrency, but you can hide it behind threads
02:20 sri so, i guess my favorite architecture is separate thread pools for io and real work
02:21 sri with a blocking api hiding all the details
02:21 sri you see that in java
02:22 jberger I guess I can see that being easy
02:22 jberger nonblocking is fine once you get the hang of it though
02:22 * jberger likes the challenge
02:22 sri actually, the erlang vm works that way
02:23 sri it only does non-blocking io, but all the details are hidden in the vm
02:23 jberger I have been meaning to learn more about erlang
02:24 sri learn elixir then
02:24 * sri can't stand the prolog syntax
02:25 sri http://elixir-lang.org/
02:28 bpmedley joined #mojo
02:37 zivester joined #mojo
03:02 tbushell left #mojo
03:17 meshl joined #mojo
03:21 bpmedley joined #mojo
03:24 sri actually some interesting stuff in the phoenix guides https://github.com/lancehalvorsen/phoenix-guides
03:26 davido_lt joined #mojo
03:28 sri love the pipe operator of elixir
03:29 sri foo() |> bar('baz') |> baz('yada')
03:29 sri is basically baz(bar(foo(), 'baz'), 'yada')
03:32 preaction i keep thinking that using | for bitwise or is a waste
03:33 sri perl6 actually has a pipe operator
03:33 sri ==>
03:33 preaction but i'd rather have: map { $_ * 2 } @items | grep { $_ / 4 } | @out
03:33 preaction yeah ==> and <== are nice
03:34 sri @data ==> grep { $_ % 2 };
03:34 preaction all the bitwise ops are kind of a waste, really, for all the modern use of bits...
03:35 sri i want to agree, but i actually use them every now and then :S
03:35 preaction one of the teams in my office made an ETL that works primarily through overloading the | operator in python
03:36 preaction have them as different operators, like *| and *& and *^ (* being the "bitwise operator prefix")
03:36 * sri nods
03:37 preaction and their overloaded pipe operator builds a graph and then allows you to throw data at it, or listens for incoming data from an event-driven subscription. the syntax is awesome (though the platform they built it on is one of the seven circles of programmer hell)
03:38 preaction not python. python'd be fine. we (the bank) built something... dark... something... not of this earth...
03:38 woz joined #mojo
03:39 preaction i wonder if jberger's framework benchmarks could be run on various perl versions to see the performance differences
03:39 preaction 5.21 has had some people stepping up with performance enhancements
03:41 sri i think the real optimizations for 5.21 are still to come
03:42 preaction oleg pronin, i think, is building up to something awesome, yeah
03:45 sri the original patch made a catalyst app like 20% faster afair
03:46 sri hope it wasn't just catalyst being stupid with NEXT/SUPER ;p
03:46 sri cheaper method calls could be pretty big for mojolicious too
03:48 sri a regex jit would be cool
03:48 preaction that'd be interesting, and relevant for a lot of things
03:48 sri pcre has it i believe
03:51 jberger preaction: we delved too deep, you know what we found in the mines
03:52 jberger a demon from the second age
03:52 sri the bottleneck in Mojo::DOM::HTML is actually the regex engine now :o
03:52 sri (if a regex wizard wants to take a look)
04:00 fhelmberger joined #mojo
04:20 jberger it was my last day at the bank as it happens
04:21 jberger next week I start at the new job
04:21 jberger \o/
04:21 preaction woo!
04:21 preaction more time to work on mojolicious!
04:21 jberger absolutely!
04:21 purl Rather.
04:22 jberger sadly I get to spend less time with preaction
04:22 jberger though it's not like my boss left me much time to mingle as it was
04:29 basic6_ joined #mojo
05:27 woz joined #mojo
05:47 Gedge joined #mojo
06:23 rem_lex|pivo joined #mojo
07:16 woz joined #mojo
07:18 dparry joined #mojo
07:47 Vandal joined #mojo
08:05 jamesaxl joined #mojo
08:12 meshl joined #mojo
08:29 ryozi joined #mojo
08:46 Eke- joined #mojo
09:05 woz joined #mojo
09:06 irq joined #mojo
09:11 basiliscos joined #mojo
09:13 basiliscos joined #mojo
09:20 sugar joined #mojo
09:26 sugar_ joined #mojo
10:02 amon joined #mojo
11:14 denis_boyun joined #mojo
11:29 rem_lex| joined #mojo
11:39 dod joined #mojo
11:55 alnewkirk joined #mojo
12:24 * sri yawns
12:28 absolut_todd joined #mojo
12:29 irq_ joined #mojo
12:43 woz joined #mojo
13:34 bowtie_ joined #mojo
13:37 denis_boyun joined #mojo
13:44 bwf_ joined #mojo
13:51 AndroUser2 joined #mojo
14:02 AndroUser2 joined #mojo
14:11 denis_boyun joined #mojo
14:19 * jberger yaws
14:20 AndroUser2 joined #mojo
14:28 sh4 joined #mojo
14:29 woz joined #mojo
14:29 * crab adjusts jberger's course
14:34 dparry joined #mojo
14:56 dod joined #mojo
14:59 sri we should have more serious security issues, that makes linux dists update their mojolicious packages :)
15:00 jberger sri: did they all bump after wantarray?
15:00 sri some at least
15:01 sri haha, debian stable still uses 2.98
15:01 jberger oh gods
15:12 Eke- joined #mojo
15:28 Eke- joined #mojo
15:35 woz joined #mojo
16:11 romel joined #mojo
16:24 romel hello everyone. i have a problem with file upload. $self->req->upload('my_file') is empty for some reason. there's very simple form with one input of 'file' type and submit button
16:25 disputin joined #mojo
16:25 romel oh never mind, i've found the reason :)
17:01 disputin joined #mojo
17:35 davido_lt joined #mojo
17:39 woz joined #mojo
18:02 bpmedley joined #mojo
18:07 irq joined #mojo
18:12 preaction jberger: remember that thing I showed yesterday? I reproduced it using Test::Mojo...
18:12 disputin joined #mojo
18:13 jberger preaction: still has the problems?
18:13 jberger if so, gist it and I will take a look
18:13 preaction oh. snap. because i was still asking Test::Mojo to connect to http://127.0.0.1:$port
18:13 jberger hahaha, nice
18:13 preaction maybe, still trying to determine the boundaries of this new failure
18:14 * jberger finds himself working on this: https://github.com/jberger/Module-MetaMerger
18:14 preaction but it shouldn't have responded, because i had stopped the IOLoop and stopped the da... i did _not_ stop the daemon, i only stopped the IOLoop!
18:14 jberger its like https://github.com/jberger/Module-ResourcesFromPod, only not batshit crazy
18:15 asarch joined #mojo
18:16 jberger though I am thinkin bout extracting the pod list to perl hash (or HoH) to an Acme:: module just for the fun of it
18:18 preaction yeah, that was it. i was still asking $t->get_ok( "http://127.0.0.1:$port" ), and it responded once because the daemon was still listening and didn't have to go async for anything
18:19 jberger with the right set of declared heuristics I could probably parse a pod list to a more generic perl data structure
18:19 dod1 joined #mojo
18:20 preaction i'm less enthused about that idea now. those heuristics will be ugly, and one person won't like the way they look in their pod so they will just rewrite your thing anyway
18:22 jberger preaction: I mean for an Acme:: module, i'm not going to release that for its original purpose
18:22 jberger preaction++ # fixing his test problem
18:22 preaction ahh
18:23 dod1 joined #mojo
18:23 jberger jberger: "its like https://github.com/jberger/Module-ResourcesFromPod, only not batshit crazy"
18:23 preaction the /*placeholder is optional, isn't it?
18:23 jberger preaction: only completely optional if you give it a default
18:24 jberger any '/*placeholder' => { placeholder => '' } => ...
18:24 Grinnz sri, fedora is on 5.49 at least..
18:30 meshl joined #mojo
18:32 preaction https://gist.github.com/preaction/b318fe0674b9e65a632e#file-mojoapp-t-L38 <- why is this route not working? the last test gives me a 404
18:33 preaction but if i explicitly switch $base with what it says it is ("/nonroot"), it works. so it has to be something i'm not expecting in $base
18:36 tempire joined #mojo
18:36 preaction ... because $base is a Mojo::Path object, not a string. if i explicitly stringify "$base", it works
18:37 jberger ah, yep
18:37 preaction which is why the "/nonroot/index.html" route works. the concat operator stringifies $base
18:37 jberger actually, you could use Mojo::Path for building these routes
18:37 jberger might be kinda fun
18:37 preaction which explains some of the other things i've been seeing when treating that as a string
18:38 jberger especially with postderef: push $path->parts->@*, $index
18:39 preaction i do want to stop redirecting to "index.html" and start serving it directly as everything else on the planet does
18:42 jberger unless (stash 'placeholder') { return $c->render('index') }
18:42 jberger $c->stash('placeholder')
18:43 jberger in other news, this is why deep dependency chains can be bad, and why I dislike dzil, all in one article: http://blog.nu42.com/2014/11/fixing-hard-coded-file-path-in-test-in.html
18:44 preaction but i need to see if they've requested a "directory" and then append "/index.html", so there's a little bit of work involved yet
18:44 sri in other dependency news... looks like we are still super green http://www.cpantesters.org/distro/M/Mojolicious.html?oncpan=1&amp;distmat=1&amp;version=5.67
18:45 jberger preaction: if $c->tx->req->url->path->trailing_slash
18:45 preaction even if the user didn't put a trailing slash?
18:46 jberger oh, you have a directory-type thing
18:46 jberger rather than just nesting on top of another resource
18:46 jberger hmmmm, yeah, thats a little more work
18:46 preaction they're static files i need to serve
18:47 jberger statocles makes my mind hurt
18:47 preaction and if a directory is requested, it is assumed that index.html will be served
18:47 preaction it's not that bad :p
18:47 jberger preaction++
18:47 sri there's no plugin for that kinda stuff yet?
18:48 preaction that.. is a good idea. i should check. if not, sounds like an opportunity
18:49 sri Mojolicious::Static has a rather rich API these days, i think you could even make it a before_routes hook that checks if an index.html file exists
18:50 denis_boyun joined #mojo
18:50 sri if (my $asset = $app->static->file('/some/relative/index.html')) { ... }
18:51 sri $app->static->serve_asset($c, $asset);
18:51 sri you just have to protect from directory traversal attacks yourself
18:52 sri which is a little bit of copypasta
18:53 sri oh wait, you don't event need to use the ugly api :)
18:53 preaction i was going to say "but this is just for local testing of a site before static deployment", but then i thought "what if someone uses it in a way i don't intend, what's the harm in protecting them"
18:53 sri we made it a helper ;p
18:53 sri http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#reply-asset
18:54 berov joined #mojo
18:55 sri actually that seems worthy of an example
18:55 preaction okay, so i grab the asset: my $asset = $app->static->file( $untainted_path ); and then serve it: $c->reply->asset( $asset );
18:55 Adura joined #mojo
18:56 berov How to prevent templates to be cached while developing a mojo app? I am using morbo but when I have <% include 'foo' %> foo is not changed on the next request even if I edit it.
18:57 sri morbo
18:58 berov I use morbo
18:58 berov but my included templates do not change after editing
18:59 berov hm... not always :S
19:00 good_news_everyon joined #mojo
19:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/6G1BfQ
19:00 good_news_everyon mojo/master cfbb272 Sebastian Riedel: added example for serving a static file only if it exists
19:00 good_news_everyon left #mojo
19:01 preaction every time i focus on one of my projects, i always open more tickets than i close...
19:02 noganex joined #mojo
19:02 preaction in last week, opened 10 tickets, closed 6
19:05 good_news_everyon joined #mojo
19:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/0T4EJA
19:05 good_news_everyon mojo/master b279513 Sebastian Riedel: mention that the file method can return undef
19:05 good_news_everyon left #mojo
19:21 good_news_everyon joined #mojo
19:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FFgUFw
19:21 good_news_everyon mojo/master ea988d6 Sebastian Riedel: fixed typo in example
19:21 good_news_everyon left #mojo
19:23 romel is it possible to assign stuff to req->params and then access it via req->params->to_hash ?
19:28 sri should work, i but don't think it's a supported feature
19:40 lipizzan joined #mojo
19:54 basiliscos joined #mojo
20:10 * sri loves that you can have multiple functions with the same name in elixir
20:22 franzkafka joined #mojo
20:22 franzkafka Hey jberger, just wanted to let you know that Mojo::URLQueue is bugged out, has issues, doesn't work 100%.
20:25 sri franzkafka: is that the kind of bug report you want for your code as well?
20:29 sri purl: doesn't work
20:29 purl Look buddy, doesn't work is a strong statement. Does it sit on the couch all day? Is it making faces at you? Does it want more money? Is it screwing your partner? Please be specific!
20:31 absolut__ joined #mojo
20:37 jberger franzkafka: if you recall, we discussed at length that in order to release it, it would need hardening
20:37 jberger but as sri said, that message contains no useful information, so I can't comment
20:38 woz joined #mojo
21:00 AndroUser2 joined #mojo
21:02 meshl joined #mojo
21:02 mattastrophe joined #mojo
21:06 mattastrophe joined #mojo
21:12 Grinnz sri, your json.t is failing for me, probably something in perl 5.10.1, let me paste the error
21:14 Grinnz http://ur1.ca/ixn47
21:16 Grinnz my Test::More is up to date, supposedly
21:17 meshl joined #mojo
21:17 Grinnz if i replace true and false with true() and false(), it works
21:17 Grinnz on those two lines
21:30 Eke- joined #mojo
21:36 franzkafka Sorry guys, had something happen right after typing that :D
21:37 franzkafka Anyway, jberger, I tested the script to download ~2000 pages. The queue contained all the pages, but it only downloaded 337 of them.
21:38 franzkafka jberger, I notice that the script skips things quite often, but not entirely sure why. I'm still trying to figure that part out.
21:38 franzkafka If I can figure it out, I will post a Gist.
21:39 franzkafka So, request_time defaults to 0 if not set, thus waiting indefinitely. Therefore, it can't be that it's timing out.
21:40 franzkafka Also, jberger, it's been sitting on the couch all day, making faces at me, asking for money, and I even caught it sleeping with my wife.
21:43 sugar__ joined #mojo
21:55 jberger franzkafka: what concurrency limit are you setting
21:55 jberger ?
21:55 jberger and do you have Net::DNS::Native installed?
21:59 berov joined #mojo
21:59 berov1 joined #mojo
22:02 franzkafka Here's an example: http://paste.scsys.co.uk/448645
22:02 franzkafka Interesting, Net::DNS::Native was not installed. Was that necessary?
22:03 franzkafka Concurrency limit is 4.
22:04 jberger did mobygames ban you?
22:04 jberger spiders are not smiled on if you are not invited (and not paying attention to robots.txt)
22:05 jberger NDN is useful in higher concurrency setups, with 4 you probably don't need it
22:07 franzkafka jberger, I am doing this for mobygames. My IP address is whitelisted.
22:07 jberger ah, much better then
22:07 franzkafka Hrm, OK. I am going to work on error reporting, so I have some traceability as to why things are being skipped/missed.
22:08 berov joined #mojo
22:08 jberger I see that you still have the "Processing" log message, how much have you modified it from its original version
22:08 jberger ?
22:08 jberger the on process callback wasn't especially generic IIRC
22:09 franzkafka Here it is now
22:10 franzkafka http://paste.scsys.co.uk/448653
22:10 jberger franzkafka: we had a few users pumping tons of urls through that script, actually when testing NDN integration
22:10 franzkafka jberger, and they're not running into issues?
22:10 jberger nope
22:10 franzkafka jberger, I need to talk to the sys admin and see what httpd logs on the server side are saying.
22:10 jberger and some hosts were intentionally bad
22:11 jberger do you start with all those links or you expect to get them by the time you are done crawling?
22:11 franzkafka OK, that's really interesting. I don't know what's going on then. But I think it's not getting 200 status for some reason. What I know is that it's bailing before the "Processing $url" line.
22:11 sri "say $tx->error" is bullshit
22:13 franzkafka jberger, I start with all the links I want to crawl.
22:13 franzkafka sri, where's an example of error checking? I didn't see one.
22:15 franzkafka if say $tx->error is bullshit, then how exactly do I figure out what the fuck went wrong?
22:16 franzkafka Ah, found it. The example is under success, which seems very logical.
22:17 franzkafka jberger, if others are pumping tons of urls and having no issue, then my assumption is that there's an issue on mobygames. However, the scrapy scraper works perfectly. I dunno, I need to investigate though,
22:18 jberger franzkafka: there could be all kinds of reasons, my queue hasn't been released to CPAN because I haven't had the time or inclination to harden it to the point that I am confident
22:18 franzkafka jberger, it's pretty damned awesome nonetheless. I think the issue is with something I have changed, doing, whatever.
22:18 jberger but if you don't get to "Processing" then something else is wrong
22:19 jberger franzkafka: just for giggles, install NDN and up the concurrency to say 50
22:20 franzkafka jberger, alright done. I will start testing in a bit and let you know the results.
22:20 franzkafka Thanks jberger
22:20 AndroUser2 joined #mojo
22:21 jberger also, there is no guarantee of order (other than a url won't finish before it starts obviously)
22:21 jberger if I were to cpanify it, I would add an error event (and maybe a non-fatal event like failed)
22:22 jberger will be out for a few hours
22:22 jberger I will check the backlog later
22:24 good_news_everyon joined #mojo
22:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/jq7cKA
22:24 good_news_everyon mojo/master 39dffc8 Sebastian Riedel: added another example for error method
22:24 good_news_everyon left #mojo
22:27 woz joined #mojo
22:44 marty joined #mojo
22:52 good_news_everyon joined #mojo
22:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/R0TYLw
22:52 good_news_everyon mojo/master 7877860 Sebastian Riedel: added examples for different transaction errors
22:52 good_news_everyon left #mojo
23:03 Grinnz https://github.com/Grinnz/Mojo-JSON-MaybeXS
23:04 Grinnz going to test it on a modern perl now...
23:05 Grinnz also i need to make the pod look less stupid
23:27 Grinnz alright this is weird... on perl 5.18 i get this http://ur1.ca/ixo26
23:30 Grinnz sri, why do the true and false methods of Mojo::JSON have empty prototypes?
23:31 mattastrophe joined #mojo
23:44 Grinnz it looks like this was just added in 5.66
23:47 Grinnz yep, if i downgrade to 5.65 theres no warnings
23:52 Grinnz aha, i can add a prototype to the anonymous subs as well, if needed
23:54 Grinnz hrm, there's no $VERSION in Mojo::JSON i can use, though
23:56 Grinnz (it's not perl 5.18 specific btw, my 5.10.1 just had mojo 5.65 installed)

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