Camelia, the Perl 6 bug

IRC log for #mojo, 2012-09-26

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

All times shown according to UTC.

Time Nick Message
00:23 pertze_ joined #mojo
00:49 Britzel joined #mojo
00:53 zivester joined #mojo
01:02 Akron joined #mojo
01:16 abra joined #mojo
01:33 laouji joined #mojo
01:54 d4rkie joined #mojo
02:05 Foxcool joined #mojo
02:24 Britzel joined #mojo
02:28 Britzel_ joined #mojo
02:36 noganex_ joined #mojo
02:50 gryphon joined #mojo
03:41 Leandr joined #mojo
03:59 Foxcool joined #mojo
04:21 Foxcool_ joined #mojo
04:50 tempire excellent.
04:50 purl excellent. are there any japan-natives lurking in here?
04:50 tempire more mojo commands are popping up
05:32 laouji joined #mojo
05:34 l3l1p joined #mojo
05:57 spleenjack joined #mojo
06:01 tolid_air joined #mojo
06:19 tempire jetstrap is pretty neat
06:28 AmeliePoulain joined #mojo
06:44 bpmedley_ joined #mojo
06:44 mandreacchio_ joined #mojo
06:44 rem_lex|pivo joined #mojo
06:45 d4rkie joined #mojo
06:45 perlite joined #mojo
06:46 edenc joined #mojo
06:46 diegok joined #mojo
06:47 yko joined #mojo
06:47 hide joined #mojo
06:48 nicomen joined #mojo
06:48 Kwa joined #mojo
06:53 fhelmber_ joined #mojo
06:56 arthas joined #mojo
07:08 rem_lex| joined #mojo
07:15 spleenjack joined #mojo
07:19 batman joined #mojo
07:28 pertze joined #mojo
07:28 pertze joined #mojo
07:28 Vandal joined #mojo
07:33 batman joined #mojo
07:41 laouji joined #mojo
08:00 arthas joined #mojo
08:03 pau4o joined #mojo
08:12 mandreacchio_ joined #mojo
08:12 rem_lex|pivo joined #mojo
08:13 spleenjack1 joined #mojo
08:13 noganex joined #mojo
08:14 perlite joined #mojo
08:17 ladnaV joined #mojo
08:17 graf joined #mojo
08:17 dminus joined #mojo
08:17 Foxcool_ joined #mojo
08:17 zivester joined #mojo
08:17 phillipadsmith joined #mojo
08:17 chansen joined #mojo
08:17 kitt_vl joined #mojo
08:17 stephan48 joined #mojo
08:17 dbr joined #mojo
08:17 human39 joined #mojo
08:17 al joined #mojo
08:17 bobkare joined #mojo
08:17 nuba joined #mojo
08:28 daxim joined #mojo
08:56 Foxcool joined #mojo
09:05 mire joined #mojo
09:07 davido joined #mojo
09:27 cosmincx joined #mojo
09:49 baton8 joined #mojo
10:21 Lucas1 joined #mojo
10:27 ryozi joined #mojo
10:31 JiYu any known reason why a plugin needs to be more then 3 character?
10:31 JiYu e.g. a plugin called "iOS" can not be loaded, but renamed it to "Apple" works...
10:31 Adurah Does "ios" work?
10:35 Foxcool joined #mojo
11:02 Foxcool joined #mojo
11:07 asarch joined #mojo
11:12 sunson joined #mojo
11:25 nour anyone use elasticsearch
11:40 mandreacchio joined #mojo
11:43 Foxcool joined #mojo
12:19 mire joined #mojo
12:21 zpmorgan joined #mojo
12:24 chinaXing joined #mojo
12:32 chinaXing joined #mojo
12:38 JiYu Adurah, no
12:39 JiYu Adurah, as well "xxx" is not working
12:42 sri plugins have to start with an uppercase character
12:42 JiYu aaa :)
12:43 sri the limit is historical, since we allow plugins to be loaded in snakecase form
12:43 sri plugin 'foo_bar';
12:43 sri which is equivalent to Mojolicious::Plugin::FooBar
12:49 JiYu okay
12:49 gryphon joined #mojo
12:52 JiYu any suggesting how to implement recurring jobs? e.g. I want that a sub will be executed every 10 minutes (kind of backend service)
13:00 JiYu ahh nice .)
13:00 JiYu Mojo::IOLoop->recurring(5 => sub { say 'Hi' });
13:11 zpmorgan batman,
13:11 purl batman, is there any real cost associated with creating new Redis connections?
13:12 zpmorgan have you had any trouble with redis timeouts?
13:17 inokenty joined #mojo
13:17 bluescreen joined #mojo
13:22 jnap joined #mojo
13:29 zpmorgan marcus, batman, https://gist.github.com/3788038
13:30 zpmorgan before calling connect, there apparently are no stream ids, so timeout doesn't do anything
13:34 zpmorgan oh, durr, there was no ioloop, I guess
13:35 marcus \o/
13:35 JiYu is it not possible to get $self in a IOLoop->recurring? -> https://rt.fm/pd2
13:38 zpmorgan marcus, I don't get it. there's an ioloop singleton after connecting, but no stream with the id $self->{_connection}
13:39 marcus zpmorgan: but it's not running, is it?
13:40 dpetrov_ joined #mojo
13:40 zpmorgan no. does it have to be running to have a stream & set a timeout?
13:41 marcus zpmorgan: yes. nothing happens until the loop is running.
13:47 sri kind of feels like we are bringing event loops to the masses :)
13:48 marcus the dirty unwashed ones
13:58 Jason_ joined #mojo
14:02 Htbaa joined #mojo
14:04 * sri wonders why the most common problem is still the start of the event loop
14:05 sri almost all examples contain that part now
14:14 arpadszasz joined #mojo
14:19 ObseLeTe joined #mojo
14:22 Leandr joined #mojo
14:22 nic diegok: I'm wondering whether SpawnRedisServer.pm should have an END {} to shutdown the server?
14:23 diegok nic: I should replace it for https://metacpan.org/module/Test::RedisServer
14:24 diegok nic: but I know it shutdown the server
14:24 nic a ran a bundle of tests yesterday; came in today to find a really big log file and a bundle of running redis servers :)
14:24 diegok nic: I'm already using Test::RedisServer on the mojo plugin
14:25 diegok nic: then it's not doing it :-/
14:25 diegok nic: strange... I know I looked at this...
14:26 diegok nic: still, I'll replace it for that test module if you don't do it before :)
14:27 nic diegok: is the github repo uptodate?
14:27 diegok sure
14:28 diegok if you send me a pull request and tests still pass I will release ipso facto
14:28 diegok ;)
14:28 nic k
14:29 diegok nic: I need it to be uptodate as dzil use it for the release proccess.
14:31 diegok nic: next week I plan to implement BLPOP to replace polling
14:31 venomo joined #mojo
14:31 venomo hi. how to change User-Agent in Test::Mojo ?
14:34 knshaum joined #mojo
14:34 Coff joined #mojo
14:35 Coff There is nothing wrong with combining hypnotoad and memcache right?
14:35 Coff Specifically, would all workers see the same stuff or would there be some strange process-limitations prohibiting this?
14:36 Jason___ joined #mojo
14:39 marcus Coff: should be fine.
14:39 purl Your capacity planning skills suck.
14:39 * marcus stabs purl
14:39 purl SURPRISE! HYDRAULIC LINE! HALUGAHALGALUGHALGLAGULAHLAUGLGU!
14:40 Coff Marcus: excellent. Thanks.
14:44 zpmorgan any go players here? This weekend I made a realtime mojolicious go server
14:51 chansen joined #mojo
14:52 phillipadsmith joined #mojo
14:56 chinaXing left #mojo
15:00 d4rkie joined #mojo
15:00 Ulti joined #mojo
15:13 phillipadsmith joined #mojo
15:14 labrown joined #mojo
15:24 l3l1p joined #mojo
15:32 pau4o left #mojo
15:32 chansen joined #mojo
15:32 phillipadsmith joined #mojo
15:36 bluescreen joined #mojo
15:47 Lucas1 joined #mojo
15:55 xaka joined #mojo
16:12 xaka we will be having Mojolicious meetup here in sillicon valley on Oct 04, hurray!!!
16:18 Lucas1 joined #mojo
16:19 mire joined #mojo
16:31 jzawodn joined #mojo
17:04 xaka joined #mojo
17:06 vishwanathms joined #mojo
17:06 vishwanathms_ joined #mojo
18:35 abra joined #mojo
18:40 buu Hey, I'm doing something like $div->all_text; from Mojo::DOM and it's almost perfect, but I'd really like the alt-text of the images included in the text returned, anyone have any super clever ways?
18:58 buu I just need to emulate all_text really
19:13 andrefs joined #mojo
19:16 ObseLeTe joined #mojo
19:17 batman joined #mojo
19:42 buu Fine, be afk
19:42 buu See if I care
19:45 baton8 joined #mojo
20:03 xaka joined #mojo
20:07 buu marcus: ping =]
20:07 marcus Buu: waß?
20:07 buu Oh, hi
20:08 buu marcus: Any idea how I can extract the text + alt text from images inside $dom_node ?
20:08 buu Where $dom_node is like <div><img alt="">foo bar text <img alt=""> so on</div>
20:08 marcus Uhm foo bar text is not inside the image.
20:09 marcus The alt text is ->{alt}
20:09 buu marcus: Right right, but what I want to generate is: "alttext foo bar text alttest2 so on"
20:09 buu where alttext is the alt="alttext" sorrt
20:09 buu *Sorry
20:10 buu I'm having some difficulties explaining things =[
20:10 marcus Seems hard.
20:10 buu I was hoping to avoid reimplementing the all_text method
20:11 buu Is there any method like the html-tree ->children method that gives me both 'tags' and 'text nodes'?
20:13 sri should be possible just using children, text_before, text and text_after
20:13 buu sri: You mean use children to find an img then get the text before and after?
20:14 sri didn't you say you want *all* text?
20:14 sri how could that possibly work only with img tags? Oo
20:15 buu Sorry let me give you example?
20:15 sri i don't have much time i'm afraid
20:16 buu http://pastebin.com/xu0LXkzb
20:16 buu sri: I want all the *text* plus the alt-text in the embedded images
20:16 buu Like a screen reader?
20:17 sri sure, that can be done with the methods i mentioned above, you just walk the whole tag tree and their surrounding text
20:17 sri *+grab
20:18 buu So basically, use ->children to recurse down, then if I find an img tag, get before + after
20:18 buu If I don't just call ->text on it?
20:18 sri no, you get before/after/text for every text, depending on if they are the first, last or a tag in the middle
20:19 sri and depending on if they have children
20:19 sri it's not simple, it can't be, just possible
20:19 sri s/text/tag/
20:20 buu Oh
20:20 buu Is there someway to tell if it's first or last?
20:21 sri $e eq $children->[0]?
20:21 buu Oh, ok.
20:21 buu Right, thanks.
20:21 sri i dunno really
20:21 buu And children is only child tags.
20:21 buu sri: This would be much easier with text nodes as children!
20:22 sri $e->tree eq $children->[0]->tree maybe
20:22 sri buu: you're welcome to propose a pretty api
20:22 sri everything i could come up sucked
20:23 sri not like this is a common use case, so it would have to be extremely pretty to be accepted
20:25 sri buu: please open a ticket when you have a proposal
20:27 dpetrov_ that seems to get you the result but looks ugly http://paste.scsys.co.uk/208525
20:27 sri and remember, we can't break backwards compatibility without a deprecation path before 4.0
20:27 buu dpetrov_: I can live with ugly!
20:27 buu sri: I'm not sure about backwards compat, but just a thing that returned text nodes and tag nodes as one list would do what I meant
20:28 buu Like treebuilder does
20:28 dpetrov_ as sri suggested using text_before/after
20:28 buu dpetrov_: You're kind of scary..
20:28 sri buu: i believe that would suck in Mojo::DOM
20:28 sri but it's hard to say without a real proposal *hint hint*
20:29 buu Heh. I'll put it on my todo list for 2018
20:32 buu That before/after works surprisingly well
20:32 buu I assumed it would duplicate some of the text
20:35 sri i actually wouldn't mind implementing a new api, someone just has to make a sensible proposal
21:11 zivester joined #mojo
21:21 sri hmm
21:21 sri just added a little example to the scraping recipe... but it doesn't really fit in
21:21 sri https://gist.github.com/3790657
21:22 sri i somehow doubt actual text objects would make it easier
21:33 lukep joined #mojo
21:39 good_news_everyone joined #mojo
21:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/hdYMRg
21:39 good_news_everyone [mojo/master] added more advanced scraping example - Sebastian Riedel
21:39 good_news_everyone left #mojo
21:40 sri http://mojolicio.us/perldoc/Mojoli​cious/Guides/Cookbook#Web_scraping
21:40 buu Hurray!
21:40 sri does that kill the simplicity of the recipe?
21:41 buu I'm of the theory that the documentation needs to be much less simple..
21:43 good_news_everyone joined #mojo
21:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/npY7rw
21:43 good_news_everyone [mojo/master] fixed small bug in scraping recipe - Sebastian Riedel
21:43 good_news_everyone left #mojo
21:47 sri if it's too complex it will only scare away beginners, we've been there
21:47 sri but i guess it's ok for the cookbook to target a little more advanced users
21:56 davido joined #mojo
21:57 sri tempire: what do you think?
21:57 purl I think sri should try flossing more often!
21:57 sri :(
22:01 ObseLeTe DBIx is compatible with perl v5.12.4?
22:05 davido Why don't you look at the smoke tests and find out?
22:07 mandreacchio joined #mojo
22:09 buu DBIx::Class is a pretty awful name
22:09 buu But I wish people would stop abbreviating it incorrectly
22:13 davido I agree.  I think we discussed this yesterday as well.  No point repeating ourselves if nobody's listening.
22:14 sri CDBI had it easier there :)
22:17 vervain joined #mojo
22:51 tempire what was it before?
22:52 tempire also, do you know what the dots represent here: https://img.skitch.com/20120927​-q6h9qkdyf8bjmgi5tdj8crx6cp.jpg
22:52 sri tempire: the same without the last block
22:52 * tempire accidentally a dot
22:53 * sri has no idea
22:53 tempire it's apparently a feature that makes it appear behind every layer.
22:55 tempire the cookbook example is confusing.
22:55 sri :/
22:55 tempire it's a cookbook, so I think it's ok to have more complicated stuff, but maybe rename the all_text sub
22:55 sri to?
22:55 purl it has been said that to is Tonga Islands
22:56 sri the point of naming it all_text was to show that it was basically a reimplementation of ->all_text
22:57 buu That part made sense to me..
22:57 buu But you aren't doing the exact same thing as all_text, perhaps either do the exact same thing or all_text_plus_images =]
22:57 tempire it makes sense, but it also assumes I'm not looking for some other connection.
22:58 tempire if I'm reading the cookbook 'cause I don't understand, I'm going to first ask myself why I wouldn't just use all_text, and then think, I must be missing something.
22:58 tempire it took me 15 seconds to come to the conclusion that I wasn't.
22:58 sri so all_text_and_images?
22:59 sri or text_and_images
22:59 tempire text_and_images makes sense to me
22:59 tempire and a comment that says, "If you want more than just the text, you can recurse through the children manually"
23:00 sri that's not the kind of comment style we use elsewhere
23:02 tempire Recurse through the children manually to get more than just text
23:03 tempire the wording doesn't matter so much as long as there's an something explicitly differentiating it from the all_text
23:03 sri that sounds good
23:04 good_news_everyone joined #mojo
23:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/aCnHgA
23:04 good_news_everyone [mojo/master] tweaked web scraping example a little - Sebastian Riedel
23:04 good_news_everyone left #mojo
23:50 good_news_everyone joined #mojo
23:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/vSFPCg
23:50 good_news_everyone [mojo/master] better html_escape tests - Sebastian Riedel
23:50 good_news_everyone left #mojo
23:58 jnap joined #mojo
23:59 mandreacchio joined #mojo

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