Camelia, the Perl 6 bug

IRC log for #mojo, 2013-08-09

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

All times shown according to UTC.

Time Nick Message
00:08 asarch joined #mojo
00:31 bzero joined #mojo
00:33 dqw \
00:47 shmuel joined #mojo
01:10 buu ///
01:36 * LV looks at that talk...
01:57 Meiermann joined #mojo
01:58 d4rkie joined #mojo
02:43 asarch joined #mojo
02:46 czchen joined #mojo
02:47 d4rkie joined #mojo
03:36 KindTwo joined #mojo
03:36 basic6 joined #mojo
03:36 preflex joined #mojo
03:38 dvinciguerra joined #mojo
04:01 rem_lex| joined #mojo
04:13 dqw joined #mojo
04:35 KindOne joined #mojo
05:05 dvinciguerra_ joined #mojo
05:28 amirite i just wrote moose method modifiers before/after/around as javascript handles, too bad i don't blog
05:55 crab what is a javascript handle?
05:57 Meiermann joined #mojo
06:00 Britzel joined #mojo
06:08 hummeleBop joined #mojo
06:09 hummeleBop Hello there, is there a way to share variables (hash, scalar,..) between hypnotoad workers ?
06:22 crab read-only or read-write?
06:22 hummeleBop both ?
06:23 hummeleBop In some cases, i have to use read only variables.
06:23 denis_boyun joined #mojo
06:24 buu Hypnotoad workers are separate processes right?
06:25 hummeleBop Yes
06:25 hummeleBop Interprocess communication is the way?
06:26 Adura joined #mojo
06:28 buu hummeleBop: Yes.. but why not something like memcache?
06:30 hummeleBop I am searching for the most effective way :)
06:31 hummeleBop Do you suggest to use Cache::Memcached::Fast module ?
06:33 hummeleBop What do you think about IPC::SharedMem  ?
06:34 buu I'm not terribly familiar with it but I recall sharedmem modules having some serious drawbacks
06:35 dpetrov_ joined #mojo
06:37 zibi joined #mojo
06:41 rem_lex joined #mojo
06:52 dod joined #mojo
07:07 dod joined #mojo
07:25 amirite_ joined #mojo
07:30 amirite joined #mojo
07:43 basiliscos joined #mojo
08:11 arthas joined #mojo
08:16 KindTwo joined #mojo
08:19 Vandal joined #mojo
08:29 Mike-PerlRecruiter_ joined #mojo
08:32 marcus joined #mojo
08:32 wsri joined #mojo
08:32 batman joined #mojo
08:33 KindOne joined #mojo
08:38 maxhq joined #mojo
08:38 trone joined #mojo
08:38 mire_ joined #mojo
08:44 basiliscos joined #mojo
08:46 yakudza joined #mojo
08:58 zacts joined #mojo
09:23 KindTwo joined #mojo
09:30 denisboyun joined #mojo
09:43 bowtie_ joined #mojo
09:59 nic hummeleBop: Is redis an option (with Mojo::Redis)?
10:01 basiliscos joined #mojo
10:02 hummeleBop thx nic
10:03 nic personally I think that's the most fun option, should give performance competitive with memcache, but also supports richer functionality should you need it later
10:04 hummeleBop Yes you're right
10:17 quickstart joined #mojo
10:17 quickstart can I simply pass a $c->req object to a UA to 'proxy' the req?
10:18 dbolser can I simply pass a $c->req object to a UA to 'proxy' the req?
10:18 * dbolser tries...
10:21 dbolser or I could just pass on the URL... prolly cleaner...
10:42 dod joined #mojo
10:47 dqw joined #mojo
11:03 mire_ joined #mojo
11:08 Meiermann joined #mojo
11:32 ver joined #mojo
11:42 ver joined #mojo
11:57 rem_lex|pivo joined #mojo
12:06 dqw joined #mojo
12:17 Meiermann joined #mojo
12:21 amirite is anyone aware of something like a pod writer
12:24 * sri wonders what a Mojo::DOM method that removes comments and processing instructions should be called
12:24 amirite stripper
12:30 nic ->defluff
12:32 jast 'strip' is nice because of the tool of the same name that removes debugging symbols
12:33 sri strip is already taken
12:35 nic ->optimize
12:35 nic ->leanify
12:35 nic ->stan
12:40 amirite_ joined #mojo
12:46 amirite joined #mojo
12:47 dbolser OK, weird question but... Some client calls HEAD on a certain page, and I want to proxy (pass on) that request to another server. I use a Mojo::UA to call head on a re-written URL, but what should I return?
12:48 dbolser Currently all I know is $self->render, but I'm thinking... is that going to actually pass on the right headers?
12:50 dbolser https://gist.github.com/db​olser/4c7f479916a3e81b790d
12:50 dbolser can I call something as simple as '$c->render($tx)'?
12:56 amirite_ joined #mojo
12:59 nic dbolser: you might get something useful out of http://larig.wordpress.com/2012/08​/01/a-mini-proxy-via-mojolicious/
12:59 dbolser nic: ty
13:00 * nic reverse-proxies the thanks to xaka
13:01 nic be aware that a year is a long time in rainbow country, so it might have cobwebs
13:01 sri http://pastie.org/8221696 # not sure if something like this should be in core ($dom->scrub)
13:01 dbolser nic what is tx in that example? is that the incoming request transaction?
13:02 nic dbolser: look at examples in the cookbook and UserAgent docn; they almost all mention tx
13:03 dbolser nic: from the ua, it's clear, but this is in the daemon
13:03 dbolser so I'm not sure
13:03 dbolser also, there are too many commas in that example ! ;-)
13:03 dbolser I'm lost
13:03 nic it's the same
13:04 nic tx is a Transaction managing req + res
13:04 dbolser nic: one is incoming and one is returned?
13:04 good_news_everyone joined #mojo
13:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XoMcTQ
13:04 good_news_everyone mojo/master cf1d423 Sebastian Riedel: small optimizations
13:04 good_news_everyone left #mojo
13:05 dbolser nic: that example is too cryptic for em
13:05 dbolser me
13:05 dbolser where does something get rendered?
13:05 sri that patch was bad...
13:05 nic I can see 2 commas
13:05 sri http://pastie.org/8221703 # here's one with only ->scrub
13:06 dbolser nic: I'm counting =>s also
13:09 dbolser to put this example into words, it seems to be handling an incoming request by grabbing the request tx, rewriting the host and scheme, passing that request tx to a ua, taking the resulting tx and passing that back to the request tx and calling resume?
13:13 sri marcus, tempire, jberger, crab: thoughts on ->scrub?
13:14 dbolser nic: lets assume I can construct the request URL
13:15 dbolser how do I pass the UAs results back in response to the ping request?
13:15 dbolser I don't follow the way resume is used in a sub as an arg to the ua->start method
13:17 nic dbolser: Sounds like it's an unhelpful example; don't let it slow you down
13:17 dbolser hehe... gives me some clues though
13:17 dbolser I'm jsut confused by all the chained method calls, setters, etc.
13:17 dbolser $self->tx->res( $tx->res )->resume
13:18 nic fraid I've got to go; got 113 million rows to delete from a busy db (rogue php saboteur)
13:18 dbolser nice
13:18 dbolser thanks for hints
13:22 * sri thinks ->scrub could be rather useful for cleaning up user input and web scraping results
13:23 asarch joined #mojo
13:23 dbolser nic: actually, I think that's it :-)
13:23 nic \o/
13:24 dbolser :D
13:25 nic remember to post your example so I can confuse the next person who asks :)
13:25 sri or perhaps we need a generic way for dealing with nodes that are not tags :S
13:26 sri aside from ->tree
13:27 sri most of the time though, i think i might just want all of those things gone (comments, processing instructions and document type declarations)
13:31 dbolser nic: ok, here it is: https://gist.github.com/db​olser/4c7f479916a3e81b790d but I'm seeing some errors still
13:32 dbolser it looks for this template for some reason: solrcollectionXadminping.html.ep
13:34 dbolser [Fri Aug  9 14:34:17 2013] [debug] Template "solrcollectionXadminping.html.ep" not found.
13:36 nic I'm guessing you need to stop auto-rendering
13:38 nic $self->rendered(200)?
13:41 dbolser I'll do it later ;-)
13:41 dbolser $self->render_later;
13:41 dbolser how do I avoid calling that in every route? i.e. $c->render_later... do I just create a controller that all routes then use?
13:42 dbolser setting that in each route fixed the problem :-)
13:51 denis_boyun joined #mojo
13:57 gryphon joined #mojo
14:07 sri no opinions on ->scrub?
14:11 maxhq joined #mojo
14:27 D4RK-PH0ENiX joined #mojo
14:42 bluescreen joined #mojo
14:46 jzawodn joined #mojo
14:51 dbolser ->scrub->behind->ears?
14:52 sri i'll take that as a sign that nobody cares
15:08 ryozi joined #mojo
15:16 * tempire likes scrub
15:16 tempire though I can't think of time when I'd use it.
15:17 tempire but it's small and unobtrusive enough that it's got my vote.
15:29 sri perhaps worth thinking about better ways to get the same functionality with a more general purpose api
15:30 * sri considered adding a Mojo::DOM::Node layer, since everything else than elements is only exposed through $dom->tree
15:31 sri $dom->at('foo')->nodes->each(sub { $_->remove if $_->is_text && $_->content =~ /^\s*$/ })
15:32 sri but then you would want ->previous/->next methods on node objects... and when you mix in elements things get a bit messy
15:32 amirite joined #mojo
15:33 sri use case would be to filter text for example
15:34 sri trim whitespace between elements
15:36 * sri shrugs
15:36 sri it's not like this stuff is impossible... you can always dig into $dom->tree, but maybe there's an elegant way to expose it on a higher level
15:38 amirite_ joined #mojo
15:43 hummeleBop Hello there, is there a way to disable timeout for websocket on hypnotoad?
15:50 amirite joined #mojo
15:56 salparadise joined #mojo
15:57 btyler joined #mojo
16:00 amirite_ joined #mojo
16:02 sh4 joined #mojo
16:05 amirite joined #mojo
16:10 amirite_ joined #mojo
16:14 dbolser left #mojo
16:15 amirite joined #mojo
16:17 sri tempire: btw. the original idea was to sanitize user submitted html with Mojo::DOM->new($html)->scrub->find(':n​ot(b):not(i):not(p)')->pluck('strip')
16:17 sri to remove comments, processing instructions, doctypes and all tags other than b/i/p
16:18 sri but i suppose, only the tags really matter anyway
16:20 amirite_ joined #mojo
16:23 xaka joined #mojo
16:26 btyler_ joined #mojo
16:26 amirite joined #mojo
16:29 zibi joined #mojo
16:30 dod joined #mojo
16:31 amirite_ joined #mojo
16:31 Britzel joined #mojo
16:39 xaka joined #mojo
16:41 d4rkie joined #mojo
16:47 tempire this zero downtown morbo reload is awesome.
16:58 basiliscos joined #mojo
17:01 perl2012 joined #mojo
17:44 dvinciguerra_ joined #mojo
17:47 sri the implementation is also quite interesting
17:59 sri hmm, i suppose more advanced text node support could work like in jquery
17:59 sri $dom->contents
17:59 sri to get a mix of Mojo::DOM and Mojo::DOM::Node objects
18:00 btyler joined #mojo
18:01 sri Mojo::DOM::Node would only have ->remove and ->content methods for making changes, and a few methods to identify the type of node... ->is_element, ->is_text, ->is_cdata...
18:02 D4RK-PH0ENiX joined #mojo
18:02 sri jquery doesn't have navigation either... that would eliminate the ->revious/->next problem
18:03 sri this could work :)
18:19 d4rkie joined #mojo
18:35 bluescreen joined #mojo
18:36 bluescreen joined #mojo
18:37 bluescreen joined #mojo
18:38 bluescreen joined #mojo
18:59 sri tempire, marcus, jberger, crab: http://pastie.org/8222537 # REVIEW!
19:01 sri Akron: if you're watching, REVIEW! :)
19:01 sri the idea is to make all special node types editable, not just tags
19:03 rem_lex| joined #mojo
19:04 sri $dom->find('*')->map(sub { $_->content->each })->grep(sub { !$_->is_element })->pluck('remove')
19:04 sri remove everything that isn't a tag
19:08 sri perl -Ilib -Mojo -E 'say g("mojolicio.us")->dom->find("*")->map(sub { $_->contents->each })->grep(sub { !$_->is_element && $_->content =~ /^\s*$/ })->pluck('remove')->first->root'
19:08 sri remove all nodes that contain only whitespace
19:12 sri little unsure about the is_*methods
19:12 mire_ joined #mojo
19:12 sri but can't think of something better
19:13 sri need a way to differentiate between Mojo::DOM and Mojo::DOM::Node objects as well as different types of Mojo::DOM::Node objects (text, doctype, comment, pi...)
19:14 sri in jquery it's really silly :)
19:14 sri .nodeType == 3
19:14 sri you have to actually check a number!
19:15 sri nokogiri uses .cdata? .text? .comment?
19:17 PerlJam doesn't jquery have nicely named constants for those numbers though?
19:18 sri and that makes it a nice api?
19:18 PerlJam no, but it's a little less silly :)
19:18 sri http://api.jquery.com/contents/
19:18 sri if they exist documentation doesn't use them
19:22 espent joined #mojo
19:24 sri perhaps just ->node_type on Mojo::DOM and Mojo::DOM::Node
19:25 sri the !$_->is_element && $_->is_text double checks are not so nice
19:26 sri maybe ->is_node('text')
19:26 zibi joined #mojo
19:26 sri ->type is already used for the tag name... do i don't want confusion there
19:27 Mike-PerlRecruiter_ joined #mojo
19:32 sri http://pastie.org/8222603 # now with ->is_node()
19:40 amirite joined #mojo
19:41 basiliscos1 joined #mojo
19:47 punter joined #mojo
19:51 * sri is still on the edge about the whole thing
19:52 sri $dom->parse('<p>A<i>B</i>C</p>')->p->c​ontents->first->content('D')->parent;
19:52 sri "<p>D<i>B</i>C</p>"
19:52 sri being able to do that easily is neat though
19:54 sri what i still dislike a little is that there's a second object type now, before it was all just Mojo::DOM instances
19:58 r0b3rt XML::LibXML uses ->localname for the tag name
19:58 sri ewww
19:59 sri anyway... ->type is a given, we can't change that
19:59 sri only the new method names are up for discussion
20:04 PerlJam sri: fwiw, I like the is_node version better.
20:04 btyler joined #mojo
20:06 PerlJam what happens with ->is_node('goober')  ?  Is there some mechanism to communicate to the user the valid node names if they typo or otherwise screw up?
20:08 rem_lex|pivo joined #mojo
20:10 bluescreen joined #mojo
20:16 sh4|2 joined #mojo
20:40 amirite_ joined #mojo
20:50 sri http://pastie.org/8222805#123
20:50 sri still unsure if it's worth it
20:51 btyler_ joined #mojo
21:25 gryphon joined #mojo
21:47 zackiv31 joined #mojo
22:06 amirite joined #mojo
22:21 amirite_ joined #mojo
22:40 sri http://pastie.org/8223023 # oh well, here's the final patch i'm going to throw away now
22:43 amirite joined #mojo
22:44 good_news_everyone joined #mojo
22:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/pQPfvw
22:44 good_news_everyone mojo/master 80e5de0 Sebastian Riedel: a few more optimizations
22:44 good_news_everyone left #mojo
22:59 jberger joined #mojo
23:00 jberger I have to read more, but it has always seemed cute that all dom "nodes" are themselves dom objects
23:01 jberger That said, reading patches on the train is probably not the best for comprehension
23:03 jberger Btw Mojo is slowly making inroads at $work
23:03 jberger :-)
23:05 sri \o/
23:05 jberger Also my model later has non-blocking find_one
23:05 jberger Later?
23:06 * jberger is still having swipe type troubles
23:35 amirite_ joined #mojo
23:57 dvinciguerra_ joined #mojo
23:58 sh4 joined #mojo

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