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

IRC log for #mojo, 2014-01-19

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

All times shown according to UTC.

Time Nick Message
00:01 jberger The world's perception of Perl is that it is dead and gone, it won't get better until we get a cool new release with some long awaited features, and a new version number
00:03 jberger as soon as true function signatures make core, we should turn on strict (and warnings, please) by default, enable all features and call it Perl 7 (removing some cruft along the way would be ok too)
00:07 jberger I ported this: http://charlieharvey.org.uk/page/scaling_twitrss_me_with_cloudflare_and_stuff
00:07 jberger to mojolicious: https://github.com/jberger/twitrssme
00:19 jberger sri: a second argument to j?
00:19 jberger sub j { my ($d, $die_on_error) = @_; ... }
00:20 jberger just a thought, most of the best of both worlds, with no breakage
00:21 sri you think that's pretty?
00:24 jberger not especially, but we get asked this so **** often there is obviously demand
00:27 bpmedley jberger: What about issue 568?  Is it open or closed?
00:28 bpmedley Sorry, I had to step a way for a bit
01:01 sri jberger: and we will do it in 5.0
01:08 * sri would still like a way to modify node types other than tags in Mojo::DOM... text, processing instructions, comments... and so on
01:08 sri jquery doesn't really have that either
01:09 sri nodeType constants are pretty classy :D http://api.jquery.com/contents/
01:09 Adura Yes, just like jquery.
01:11 sri i actually proposed a patch once (forgot to include Node.pm...) http://pastie.org/8222537
01:12 sri what bugs me a little is that we have raw and text node types, which is an implementation detail... exposing it kinda sucks
01:19 sri hmm, actually i think i can get rid of raw nodes
01:19 sri :)
01:19 yko joined #mojo
01:24 bzero joined #mojo
01:29 yko joined #mojo
01:33 sri hmm, quite a bit more code... not really worth it
01:35 mire joined #mojo
01:35 bzero joined #mojo
01:53 sri yea, going nowhere again :S
02:01 jberger portable version of my previous code: https://github.com/jberger/twitrssme/blob/master/twitter_rss_portable.pl
02:21 yko joined #mojo
02:30 bzero joined #mojo
02:36 ka2u joined #mojo
02:38 klapperl_ joined #mojo
03:16 D4RK-PH0ENiX joined #mojo
03:41 D4RK-PH0ENiX joined #mojo
04:03 gryphon joined #mojo
04:07 ka2u joined #mojo
04:09 preflex_ joined #mojo
04:27 d4rkie_ joined #mojo
04:44 sri here's the most complete patch yet for Mojo::DOM::Node support http://pastie.org/8646927
04:44 * sri pokes jberger, crab and tempire
04:45 sri guess marcus has convos trouble :o
04:46 sri the idea is pretty simple, you can access all the special nodes now directly and remove them if you like
04:46 sri text, cdata, raw text, processing instructions, comments and doctypes
04:47 sri upside, you can extract more information, and filter out comments
04:48 sri downside, it's more code, and exposes certain internals, that i'm not sure anymore i care about
04:48 sri those internals being the names of node types
04:48 sri tag, root, text, raw, cdata, comment, pi, doctype
04:49 sri perhaps a case of "fuck it, we'll never change those names anyway"
04:50 sri they exist in this form for like 3 years
04:51 sri perhaps worth a look, $dom->node as getter name for the type... can't think of a better name
04:51 sri from jQuery... "this.nodeType === 3"
04:52 sri at least it's better than that ;p
04:52 sri http://api.jquery.com/contents/
04:52 sri btw.
04:53 sri $dom->find('*')->each(sub { $_->contents->grep(sub { $_->node eq 'comment' })->remove })
04:53 sri i think that's how you remove all comments
04:55 sri $dom->find('*')->contents->flatten->grep(sub { $_->node eq 'comment' })->remove
04:55 sri that should work too actually
04:56 sri yes confirmed :)
04:58 crab hi
04:58 purl salut, crab.
04:59 crab reading patch
05:00 sri i'm still adding more tests, otherwise it's mostly done
05:01 jberger sri I like the concept, I've hacked similar things for non-cpan code on occasion :o
05:02 jberger I'm not in a great position for code review right now
05:02 jberger I'll give `er a read in the morning
05:02 sri don't need too much feedback on implementation, more on api and naming
05:05 * jberger wonders if sri used `get diff | mojo nopaste pastie`?
05:06 jberger git
05:06 ka2u joined #mojo
05:06 avb joined #mojo
05:08 jberger might need -l
05:08 avb hello. how to embed the Mojolicious websocket server to appication?
05:08 jberger git diff | mojo nopaste pastie -l diff
05:09 jberger avb websockets are included at no extra charge
05:10 jberger gnite all
05:10 jberger o.
05:10 jberger (^^ was waving but fell forward)
05:12 sri nn ;p
05:46 sri http://pastie.org/8647016 # most complete patch yet
05:46 sri crab: don't leave me hanging!
05:47 sri implementation wise i think the only real question one could ask if we want to change the internal structure of the DOM tree, like add references to the parent element for text nodes and friends
05:48 sri *+is
05:50 avb left #mojo
05:50 sri but considering that they can't be nested there aren't too many advantages... besides merging the parent/tree attributes of Mojo::DOM::Node
05:50 sri downsides, breaking the tree structure, increased memory usage
05:57 crab sri: patch looks ok to me
06:11 good_news_everyone joined #mojo
06:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/3VVHvA
06:11 good_news_everyone mojo/master 4845b78 Sebastian Riedel: added Mojo::DOM::Node
06:11 good_news_everyone left #mojo
06:11 sri then lets try it :)
06:22 ka2u joined #mojo
06:27 sri this has been a bit of a pet peeve of mine
06:28 sri jberger, crab, marcus, tempire: reviews still appreciated
06:28 sri or anyone else
06:28 purl it has been said that anyone else is welcome to answer also :P
06:28 sri !
06:38 good_news_everyone joined #mojo
06:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6FCyjw
06:38 good_news_everyone mojo/master 8e44b05 Sebastian Riedel: documentation tweak
06:38 good_news_everyone left #mojo
06:56 Vandal joined #mojo
07:04 bzero joined #mojo
07:07 yko joined #mojo
07:07 ka2u joined #mojo
07:21 ka2u joined #mojo
07:55 abra joined #mojo
08:04 bpmedley sri: Should Mojo::DOM::_nodes be modified to use Mojo::DOM::Node?
08:13 dod joined #mojo
08:13 dod joined #mojo
08:21 irq_ joined #mojo
08:33 dod joined #mojo
08:34 hummeleBop joined #mojo
08:53 ka2u joined #mojo
09:05 bpmedley sri: Doesn't the Node package allows for cool stuf like: $dom->at('p')->contents->grep(sub { $_[0]->node eq "text" })->[0][0]->value?  How could you easily get the text value(s) in your test data html without Node.pm?
09:08 bpmedley $dom->at('p')->contents->grep(sub { $_[0]->node eq "text" })->[0]->value;     <-- Sorry, sb that.
09:23 crab can we now say that mojo is node compatible?
09:25 basiliscos joined #mojo
09:31 voegelas joined #mojo
09:41 ka2u joined #mojo
09:59 trone joined #mojo
10:12 hummeleBop joined #mojo
10:41 dvinciguerra joined #mojo
10:56 odc joined #mojo
11:05 ka2u joined #mojo
11:23 dpetrov_ joined #mojo
11:31 mire joined #mojo
11:41 dsteinbrunner joined #mojo
11:50 denisboyun joined #mojo
12:19 ka2u joined #mojo
12:20 irq_ joined #mojo
12:34 sh4 joined #mojo
13:03 D4RK-PH0ENiX joined #mojo
13:24 D4RK-PH0ENiX joined #mojo
13:30 ka2u joined #mojo
13:46 rem_lex|pivo joined #mojo
14:00 mire joined #mojo
14:31 jberger sri++ looks good
14:40 marcus joined #mojo
14:56 zivester joined #mojo
15:01 jberger_ joined #mojo
15:02 jberger_ o/ from convos (again)
15:08 jberger marcus/batman, I'm not seeing gravatars
15:08 batman jberger: https://github.com/Nordaaker/convos/issues/24 # working on it :)
15:09 jberger oh ok
15:09 jberger :-)
15:09 jberger sorry, should have looked
15:09 batman yes.
15:09 batman but i still like you ;)
15:09 jberger awww, shucks
15:10 batman "shucks" ?
15:10 batman need to land https://github.com/Nordaaker/convos/tree/0.4rc1 before #24 :/
15:10 * jberger looks
15:10 jberger btw, batman have you have a chance to try https://github.com/jberger/Mojo-IOLoop-ForkCall/tree/nochild
15:11 batman been too much partying (and work) this weekend
15:11 jberger thats ok
15:11 batman nope. but i don't use the *original* either, so i'm pretty sure i can't find any bugs...
15:12 batman i messed up the release management system on friday at work... fixed it now :)
15:12 batman life is good again.
15:12 jberger :D
15:12 jberger anyway, it was your bug report: https://github.com/jberger/Mojo-IOLoop-ForkCall/issues/2
15:12 batman if one thing shouldn't brake, its the release system :)
15:13 batman jberger: ah! crap. my bad :(
15:13 batman will try to look at it after dinner.
15:13 jberger no hurry
15:13 jberger seriously
15:13 purl is that for real?
15:13 jberger purl srsly
15:13 purl I'm totally serial
15:14 batman hehe. ok :)
15:14 batman but it should be quick enough for me to test.
15:14 batman i think i need to start using fc at work this week
15:14 batman got someone who loves calling scripts instead of writing modules :P
15:15 jberger would that someone be you? :-P
15:15 batman no.
15:16 batman have i made such a bad impression..? :)
15:16 * jberger notices https://github.com/jhthorsen/snippets/tree/master/bin
15:16 jberger but otherwise, no
15:16 batman hehe, good :)
15:17 * jberger hands batman a beer
15:17 batman die ETOOMUCHBEERTHISWEEKEND;
15:17 jberger hahaha
15:17 batman anyhow... got to get some dinner. *bbl*
15:17 jberger eval { /me hands batman a beer } or /me hands batman a coke
15:18 batman oooh! me need coke.
15:39 * jberger considers releasing the nochild branch to cpan
15:40 jberger I don't see any benefit to keeping Child.pm since the tests pass without it
15:44 asarch joined #mojo
15:46 jberger batman, fyi, I have merged that branch back to master
15:48 good_news_everyone joined #mojo
15:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/uic-YQ
15:48 good_news_everyone mojo/master 6491250 Sebastian Riedel: more node tests
15:48 good_news_everyone left #mojo
15:50 * tempire likes the Mojo::DOM addition.
15:54 * jberger releases Mojo::IOLoop::ForkCall sans Child.pm
15:59 bpmedley /opt/perl -C7 -Iblib/lib -Mojo -E 'g("news.yahoo.com")->dom->find("p")->contents->grep(sub { $_[0]->node eq "text" })->each(sub { say($_, "\n") })'
15:59 bpmedley Cool stuff.. :)
16:08 good_news_everyone joined #mojo
16:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/GuonsQ
16:08 good_news_everyone mojo/master 194c5f6 Sebastian Riedel: small optimizations
16:08 good_news_everyone left #mojo
16:09 jberger sri: what are the prospects of using the node system to build xml from a data structure directly?
16:10 sri none
16:11 jberger k
16:11 jberger cool, facebook mirrors cpan: http://mirror.facebook.net/
16:13 * sri hates modules that generate xml from data structures
16:14 jberger its easy enough to do with templates
16:20 denisboyun joined #mojo
16:21 sri only thing worse is tring to parse xml into a data structure ;p
16:25 sri bpmedley: perl -Mojo -E 'say g("news.yahoo.com")->dom->find("p")->text->join("\n\n")'
16:27 bpmedley Will that find both text and cdata?
16:40 amirite_ joined #mojo
16:45 sri text methods are chainsaws, coments is a scalpel
16:46 sri fun things you couldn't do before
16:46 sri perl -Mojo -E 'say g("www.reddit.com")->dom->find("*")->contents->flatten->grep(sub { $_->node eq "comment" })'
16:50 sri s/coment/contents/
16:52 sri or
16:52 sri perl -Mojo -E 'say g("www.perl.org")->dom->contents->grep(sub { $_->node eq "doctype" })'
16:53 bpmedley I wonder if a shortcut for $_->node eq "type" is desired?
16:53 sri i don't expect that to be too commonly used
16:56 sri my main motivation for making it work was to be able to filter out comments from user submitted html :)
16:57 sri with ->strip and $node->remove Mojo::DOM can now do all the usual html sanitization stuff
17:24 asarch joined #mojo
17:24 rem_lex joined #mojo
17:28 sri so, i guess nobody really cares that "raw" is not really a nodeType in browsers
17:28 sri it's used here https://github.com/kraih/mojo/blob/master/lib/Mojo/DOM/HTML.pm#L129
17:29 sri for <script> and <style> content
17:29 sri raw nodes are extracted as is, no escaping/unescaping
17:35 sri just wanted to mention it, since once this stuff is released it will be pretty hard to change the DOM tree structure
17:41 jberger no, I think that sounds fine
17:41 jberger this is not a browser
17:48 good_news_everyone joined #mojo
17:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xSKClQ
17:48 good_news_everyone mojo/master c3415ea Sebastian Riedel: fixed XML semantics bug in Mojo::DOM::HTML
17:48 good_news_everyone left #mojo
18:16 btyler joined #mojo
18:26 good_news_everyone joined #mojo
18:26 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ccPsaw
18:26 good_news_everyone mojo/master ba0ed6f Sebastian Riedel: no double negation
18:26 good_news_everyone left #mojo
18:56 dvinciguerra joined #mojo
19:12 preflex joined #mojo
19:52 mire joined #mojo
20:17 preflex joined #mojo
20:35 lukep joined #mojo
20:39 dsteinbrunner joined #mojo
21:02 dsteinbrunner joined #mojo
21:23 good_news_everyone joined #mojo
21:23 good_news_everyone [mojo] kraih deleted livelog at a8bb214: http://git.io/BC1FKg
21:23 good_news_everyone left #mojo
21:30 * jberger is writing non-blocking post part 3, topic: portability, example: my port of http://charlieharvey.org.uk/page/scaling_twitrss_me_with_cloudflare_and_stuff
21:33 sri NO SPOILERS!
21:33 purl The butler did it.
21:36 jberger purl did it!
21:36 purl of course I did, jberger, you were such a pussy!
21:36 sri purl: botsnack!
21:36 purl :)
22:00 bpmedley_ joined #mojo
22:23 tempire__ joined #mojo
22:23 tempire__ jberger: you should put a link to the part 2 in part 1, part 3 in part 2, etc
22:25 jberger thanks tempire__, already there
22:26 tempire__ I didn't see it; only links to the previous article.
22:27 jberger ?
22:27 jberger I JUST posted
22:27 jberger http://blogs.perl.org/users/joel_berger/2014/01/writing-non-blocking-applications-with-mojolicious-part-3.html
22:27 jberger were you looking at part2
22:27 tempire__ I'm saying, if I come across part 1 in a google search, I have no idea where part 2 is.
22:28 jberger OH
22:28 jberger yes, I should do that now
22:28 jberger good idea
22:28 jberger sorry, I was only thinking of back-linking to the previous, but forward links are a good idea
22:34 jberger tempire__++
22:35 jberger footer links added, both forward and back to part 1 on each entry
22:37 tempire__ cool
22:42 jberger https://twitter.com/joelaberger/status/425035230123016193
22:49 bpmedley jberger: It's a good article.  Could it be made better by moving your rationale to the beginning?  A lot of people like to know why they are reading something very quickly.  I see the rationale for the non-blocking in paragraph 4.
22:49 * jberger looks
22:51 jberger bpmedley, I see your point, but I'm not sure how to improve it
22:51 jberger I make A case for non-blocking in the 1st p
22:52 bpmedley Possibly move the 2nd sentence in paragraph 4 to the last sentence in paragraph 1.
22:52 jberger in the 2nd I hint at the problem to be solved in this case, portability
22:52 bpmedley That way, you have: Part 1... Part 2... Part 3.
22:52 * jberger considers
22:54 jberger bpmedley, I think the problem is that you see the thesis being in p 4
22:54 jberger but it really is in p2
22:55 jberger "with a little care in construction, you can build your application so that it will run correctly on any supported server and the non-blocking benefits will be evident where possible."
22:55 bpmedley I see.  I did mis-read it.
22:59 jberger bpmedley, I tweaked the 2nd paragraph to highlight the thesis a little more
22:59 jberger does that help?
23:00 bpmedley Yes, it does.  Sometimes you need to need to tell the reader what they're reading... ;)
23:02 jberger I agree
23:02 jberger but as always, when you are the author it is hard to read it with fresh eyes
23:02 jberger thanks
23:03 bpmedley Totally understood.  It was an attempt at humor.  :)
23:03 jberger bpmedley, when I first started publishing in academia, I would get mad at the reviewers for their comments, because they obviously didn't get it, and their comments were invalid
23:04 bpmedley That's a frustation.
23:04 jberger my advisor taught me that in that case it is our job to improve their understanding, either way their comments are valid
23:05 jberger an important lesson that I keep using, almost daily
23:05 bpmedley When I tried my hand at master's school my advisor played with his hearing aid, I took the wrong classes, ran out of money, and am in huge debt.
23:05 jberger :-(
23:06 * jberger suspects he had a near-optimal graduate school experience, judging from the stories of others
23:06 D4RK-PH0ENiX joined #mojo
23:08 bpmedley I'm glad our univeristy system has one datum point.   ;)
23:18 ka2u joined #mojo
23:18 mire_ joined #mojo
23:21 btyler jberger: I might have a cached version, but just in case - typo on the first line "non-blockging"
23:47 marcus2 joined #mojo
23:56 good_news_everyone joined #mojo
23:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/m10EPA
23:56 good_news_everyone mojo/master 6ed2fc2 Sebastian Riedel: renamed value method to content
23:56 good_news_everyone left #mojo

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