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

IRC log for #mojo, 2017-03-09

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

All times shown according to UTC.

Time Nick Message
00:11 sugar_ joined #mojo
01:08 aborazmeh joined #mojo
01:12 stryx` joined #mojo
02:16 howitdo joined #mojo
03:04 asarch joined #mojo
03:05 kaare_ joined #mojo
03:12 noganex joined #mojo
03:15 kaare_ joined #mojo
04:01 Janos hey there, is there a simple way to make a route case insensitive in a mojo lite app ?
04:10 kaare joined #mojo
05:04 dboehmer_ joined #mojo
05:12 inokenty-w joined #mojo
06:30 Snelius joined #mojo
06:51 Snelius joined #mojo
07:01 dod joined #mojo
07:06 irqq joined #mojo
07:24 kivilahtio joined #mojo
07:24 Grinnz_ joined #mojo
07:24 bjakubski_ joined #mojo
07:24 jnap_ joined #mojo
07:24 phillipadsmith_ joined #mojo
07:24 dustinm` joined #mojo
07:24 odc_ joined #mojo
07:24 sri_ joined #mojo
07:24 chansen_ joined #mojo
07:24 dod1 joined #mojo
07:25 TBSliver joined #mojo
07:47 AndrewIsh joined #mojo
07:55 ashimema joined #mojo
08:13 noganex joined #mojo
08:27 noganex_ joined #mojo
08:28 trone joined #mojo
08:38 noganex joined #mojo
08:40 rshadow joined #mojo
08:47 sugar_ joined #mojo
08:48 rshadow joined #mojo
09:08 sugar_ joined #mojo
09:19 foursixnine sri, About contributing :) it's on the list... once i get a nice download example
09:20 sri foursixnine: well, for the cookbook it doesn't have to be fancy, in fact it should be just a few lines
09:21 sri foursixnine: if you want to make a fancy console app with progress bar take a look at Term::ProgressBar
09:21 dod joined #mojo
09:23 foursixnine_ joined #mojo
09:24 * foursixnine_ really needs to remove hexchat and go back to good ol' weechat
09:25 sri <3 irccloud
09:25 sri wish i could use it for suse irc too
09:26 foursixnine_ Me too!... i was also taking a look to matrix, which might do the job too... but meh... looks like nothing is perfect
09:28 dod joined #mojo
09:30 noganex joined #mojo
09:57 dod joined #mojo
10:02 sugar_ joined #mojo
10:06 lluad_ joined #mojo
10:34 mib_dhmpnj joined #mojo
10:40 noganex_ joined #mojo
10:43 noganex joined #mojo
10:47 irqq joined #mojo
11:03 kes joined #mojo
11:05 gregf_ joined #mojo
11:37 jabberwok joined #mojo
11:46 sri look at that jan dubois is now at suse :)
11:50 sri wonder if there are more old school activestate people joining us from hpe
11:59 elik_ joined #mojo
12:04 * foursixnine would love to se a fork of komodo xD
12:17 aborazmeh joined #mojo
13:26 noganex_ joined #mojo
13:30 stryx` joined #mojo
13:49 sugar_ joined #mojo
13:51 Janos joined #mojo
14:03 sri we have a Mojo::DOM bug, if someone is looking for an interesting task https://github.com/kraih/mojo/issues/1069
14:04 sri might even require a new Mojo::Util function for decoding only entities ending in a semicolon
14:05 sri (i won't get around to hacking on it anytime soon, so needs volunteers)
14:21 sugar_ joined #mojo
14:38 Pyritic joined #mojo
14:40 rshadow joined #mojo
14:41 asarch joined #mojo
14:47 stryx` joined #mojo
14:47 tchaves joined #mojo
14:51 gryphon joined #mojo
15:01 genio sri: Sorry, I was gone for the past couple of days after asking due to eye surgery.
15:02 genio https://github.com/libwww-perl/URI/blob/master/lib/URI.pm#L301   What Mojo::URL does along with ->path->canonicalize    seems at a glance very similar to this.
15:06 sugar_ joined #mojo
15:08 genio I'll read through https://tools.ietf.org/html/rfc6596 for a while before asking dumb questions any further
15:19 gizmomathboy joined #mojo
15:24 Pyritic joined #mojo
15:44 tchaves joined #mojo
15:45 tchaves1 joined #mojo
16:01 Peppard joined #mojo
16:02 PryMar56 joined #mojo
16:07 mcsnolte joined #mojo
16:23 tudorconstantin would this fix be good for #1069? https://github.com/tudorconstantin/mojo/commit/0608981298418a7987bdcdebbe3cad3ca7b99159
16:28 robert joined #mojo
16:31 rwh21 joined #mojo
16:32 sh14 joined #mojo
16:34 rwh21 Hi.  I wonder if someone would be able to give me some advice on using Mojo::IOLoop::Stream.   If I write to a stream, and the write buffer is full, what happens?  Is an error emitted?
16:39 sri tudorconstantin: what's the performance cost?
16:39 purl hmmm... the performance cost is *HUGE*
16:40 rshadow joined #mojo
16:41 jberger just from a stylistic standpoint, you wouldn't actually use that string as a boolean would you?
16:45 tudorconstantin what adds the performance penalty? the extra param sent to html_escape?
16:47 tudorconstantin jberger: that's what I was really worried about - the styling, I didn't even imagined there would be performance issues
16:47 jberger tudorconstantin: the performance is in checking the "if" condition when that gets called a lot
16:48 tudorconstantin styling related to the string used as boolean, to the extra parameter instead of a different function as sri suggested and to the copy/pasting of the regex that searches for entities
16:48 jberger to check I'd assume that you could just run the old html_unescape code a bunch of times (see ojo.pm's n function) and then compare it with the same check on your branch
16:51 sri as a benchmark i always parse the actual html5 spec html file
16:52 sri https://html.spec.whatwg.org
16:54 sri re style, yes, there's a few things, like the comment not replicating the style around it
16:54 sri or the empty line between the tests
16:54 sri or the lack of a test case in t/mojo/util.t
16:55 sri honestly, i just didn't take 'strict semicolon at the end of entity' as a boolean serious, just assumed you wanted to illustrate the fix
16:56 sri we also use a .perltidyrc
16:56 tudorconstantin regarding the comments in the tests: wouldn't it be useful to relate parts of the code to the issues that generated them?
16:56 sri that will fix the obvious style differences
16:57 sri tudorconstantin: perhaps, it's not how we do it though, issues are mentioned in commit messages
16:57 tudorconstantin oh, I see
16:59 tudorconstantin ok, I'll try to bring fix's style to the project's standards
17:00 tudorconstantin most probably by tomorrow - I hope it's not too late
17:09 tudorconstantin so, the performance test looked like this perl -Ilib -Mojo -E 'my $p = g("https://html.spec.whatwg.org"); n( sub { b($p->body)->html_unescape }, 500 );'
17:11 tudorconstantin that is for the code with my modifications and the results are these:
17:11 tudorconstantin 13.8636 wallclock secs (13.04 usr +  0.80 sys = 13.84 CPU) @ 36.13/s (n=500)
17:11 tudorconstantin while the results for the upstream version, the one without the if are these:
17:12 tudorconstantin 13.9565 wallclock secs (13.14 usr +  0.79 sys = 13.93 CPU) @ 35.89/s (n=500)
17:12 sri that's not a good benchmark at all
17:13 tudorconstantin that's what I was thinking too, because it looks like the if increases the performance
17:13 sugar_ joined #mojo
17:14 sri that's absolutely horrible tbh
17:14 sri the b() alone makes it worthless
17:14 sri then you slurp data from disk because the spec is so large with the ->body
17:16 howitdo joined #mojo
17:16 sri perl -Ilib -Mojo -E 'my $html = g("https://html.spec.whatwg.org")->body; n { Mojo::Util::html_unescape $html } 50'
17:17 sri and then you want to compare the real world implications
17:17 sri perl -Ilib -Mojo -E 'my $html = g("https://html.spec.whatwg.org")->body; n { Mojo::DOM->new($html) }'
17:19 sri tudorconstantin: looks like you also didn't real the bug report
17:19 sri because your fix is wrong
17:20 sri don't focus on his example, focus on the html spec
17:21 sri there are conditions attached to the behavior
17:21 tudorconstantin I've read it, but I didn't understood all the references to the html specs, so I followed your suggestion, to add the option to escape the entities that end with ;
17:21 sri s/real/read/
17:22 tudorconstantin and indeed, the extra if increases the execution time with 2.84% for 500 executions (with sri's oneliner - aka, the good one)
17:23 sri you misunderstood
17:23 sri i want a html_attr_unescape that works according to spec
17:23 sri and is fast and as small as possible
17:24 tudorconstantin I see
17:24 sugar_ joined #mojo
17:24 tudorconstantin I'm not sure whether I'm able to implement one in a decent amount of time
17:25 gryphon joined #mojo
17:31 sri honestly seems pretty trivial
17:34 sri s/&(?:\#((?:[0-9]{1,7}|x[0-9a-fA-F]{1,6}));|(\w+(?:;|[A-Za-z0-9]|=)))/_decode($1, $2)/ge
17:34 sri something like that should already satisfy the spec
17:35 tudorconstantin haha, for you maybe - I'm just reading the specs from https://html.spec.whatwg.org/#character-reference-state and the last thing it seems is trivial
17:35 sri you just have to find the spec compliance test cases
17:36 prg joined #mojo
17:37 irqq joined #mojo
17:37 sri the language of those specs can be a bit hard to understand at first
17:38 jberger they make me go cross eyed most of the time ;-P
17:38 sri but in the end it's usually just something tiny
17:38 sri my solution is wrong though
17:39 * jberger is about to become very friendly with the IPMI/redfish specs :o
17:39 sri since you're not supposed to catch the followup chars
17:41 dod joined #mojo
17:42 sri right, the rules is that it is not an entity if the entitiy does not end in a semicolon, and the next char is an alphanumeric or equal sign
17:42 sri put that in a regex and you're good
17:43 jberger negative lookahead assertion?
17:43 sri exactly
17:46 tudorconstantin would these be a the complete test cases? https://chromium.googlesource.com/external/github.com/dart-lang/html/+/master/test/data/tokenizer/namedEntities.test
17:46 sri no, i mean all the cases covered here (with and without semicolon, with and without  alphanumeric/equal)
17:47 sri test cases for every single entity is pretty hardcore
17:48 sri those should be in t/mojo/util.t, like the other special case tests there
17:50 sri btw. just so there are no misunderstandings, when i said it's trivial i didn't mean it in a conescending way... just that most people imagine problems to be much bigger than they are based on the convoluted language of those specs
17:51 * sri got the regex wrong too
17:51 sri it's a little puzzle
17:52 tudorconstantin oh, don't worry, I don't get offended when somebody considers a thing easy and I don't
17:53 tudorconstantin I've worked with junior developers who knew some parts of the project better than I did and I often asked them about issues I had in those parts
17:53 sri s/&(?:\#((?:[0-9]{1,7}|x[0-9a-fA-F]{1,6}));|(\w+(?:;|(?![A-Za-z0-9]|=))))/_decode($1, $2)/ge
17:54 sri is it something like that?
17:55 sri i keep forgetting the rules for lookaheads
18:19 sri oh, actually the whole approach is wrong :)
18:21 sri and it is in fact a hard problem
18:22 sri because Mojo::Util::_decode needs to be rewritten without giving up too much performance
18:22 genio sri: well, it seems that URI's ->canonical() does funny things with some odd URLs anyway. :/
18:23 genio https://github.com/libwww-perl/libwww-perl/issues/123
18:26 tudorconstantin the tests from here are ... interesting: https://chromium.googlesource.com/external/github.com/dart-lang/html/+/master/test/data/tokenizer
18:26 tudorconstantin look into test3.test and test4.test
18:31 rshadow joined #mojo
18:35 sri hmm, i suppose it might actually be worth ignoring the special case from the spec :o
18:37 stryx` joined #mojo
18:40 rshadow joined #mojo
18:46 sri https://gist.github.com/anonymous/0aa6bf7fe373a2df36bd38800bca7aeb
18:49 mroy joined #mojo
18:50 sri browsers do follow the spec though
18:50 mroy Greetings all. Logged in to fyi on an issue posted at perlmonks. Re: http://www.perlmonks.org/?node_id=1184024
18:51 tyldis jberger: Redfish looks neat. Is it widely adopted?
18:52 jberger tyldis: seems to be widely available, the question is how much of the spec has each vendor/model implemented
18:52 jberger we talked to supermicro and they seemed pretty confident that they had most of the read side implemented
18:53 jberger we haven't evaluated dell as much yet
18:53 jberger (those are our two major server vendors)
18:53 tyldis Okay. Noticed super coming up a lot in my Google search
18:54 jberger mroy: thanks for the ping
18:54 mroy you're welcome jberger
18:54 prg joined #mojo
18:56 sri suppose this does follow the spec https://gist.github.com/anonymous/cd1a08ca0919e43ebfaa81e760e06676
18:57 sri not going to finish it though, if someone else wants to take over
18:57 jberger I feel like I had seen that same comment about windows stalling, but now I don't remember where
18:57 Grinnz jberger: https://github.com/kraih/mojo/issues/1068
18:57 jberger ah, right
19:30 sugar_ joined #mojo
19:42 irqq_ joined #mojo
19:52 sugar_ joined #mojo
20:09 tchaves joined #mojo
20:12 tchaves1 joined #mojo
20:17 good_news_everyon joined #mojo
20:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vyVvf
20:17 good_news_everyon mojo/master 852a71a Sebastian Riedel: fix unescaping of HTML5 attribute values in Mojo::DOM::HTML (closes #1069)
20:17 good_news_everyon left #mojo
20:32 itaipu joined #mojo
20:34 rshadow joined #mojo
20:42 rshadow joined #mojo
20:55 prg joined #mojo
20:57 Janos joined #mojo
21:12 sugar_ joined #mojo
21:33 sugar_ joined #mojo
21:44 prg joined #mojo
21:54 orev joined #mojo
21:59 sri so yea, it happened https://twitter.com/kraih/status/839958739499229185
21:59 Grinnz hah
22:00 jberger hahahaha
22:00 purl LOLCON 4 reached.
22:18 marty joined #mojo
22:34 kes joined #mojo
22:43 sri btw. in case someone here is interested, we just had a little discussion over in #perl about making expand configurable in Mojo::Pg
22:44 sri think i want to do that
22:44 sri $pg->expanders(some_pg_type => sub {...})
22:44 sri with json/jsonb being default
22:44 sri then you could add your own for datetime and the like
23:04 sugar_ joined #mojo
23:47 sri and here's a fun roundtrip problem for those still awake perl -Mojo -E 'say x(qq{<a href="http://example.com?f&ltoo=bar"></a>})'
23:48 sri how should we handle escaping of attributes?
23:49 sri (i think it's fine, but worth reviewing)

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