Camelia, the Perl 6 bug

IRC log for #mojo, 2011-04-12

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

All times shown according to UTC.

Time Nick Message
01:01 vel left #mojo
01:47 MisterHatt hey guys, getting an error I can't pin down that is probably due to me doing something really stupid, Can't use string ("Comsew::Main") as a HASH ref while "strict refs" in use at /usr/share/perl5/site_perl​/Mojolicious/Controller.pm line 699
01:47 MisterHatt line in question holding nothing but $self->{stash} ||= {}; so I've got absolutely no idea
01:48 MisterHatt any help as always is appreciated
01:49 daviddelikat joined #mojo
01:52 daviddelikat1 left #mojo
04:02 tempire left #mojo
04:06 Alias left #mojo
04:36 perlrocks Twitter: "If Muzu Mojolicious! Debugging is not well" (ja) --brain_apple http://twitter.com/brain_app​le/status/57663248752840705
04:58 jamesw joined #mojo
05:10 crab joined #mojo
05:10 crab hi.
05:12 crab i'm running my app under hypnotoad. apart from 127.0.0.1:3000, where it's configured to listen, i have open ports like this:
05:12 crab tcp        0      0 0.0.0.0:36078           0.0.0.0:*               LISTEN      15818/mpl
05:12 crab one per app process (minus one, which is listening to 3000). i assume this is some hypnotoad communicate-with-workers mechanism.
05:13 crab but why in the name of merlin's beard are they not bound to 127.0.0.1 but 0.0.0.0?
05:34 arpadszasz joined #mojo
05:45 kaare joined #mojo
05:53 AmeliePoulain joined #mojo
06:02 ysyrota joined #mojo
06:26 koban` joined #mojo
06:32 Christian joined #mojo
06:32 Christian morning
06:48 perlrocks Twitter: "@ HULKtheBIGGEST Mojolicious called Perl framework, Web application technology I am learning. Because a relatively new technology, the amount of information is hard to 少Nakutsu ^ ^;" (ja) --brain_apple http://twitter.com/brain_app​le/status/57696594019102720
07:05 breaker313 joined #mojo
07:14 fhelmber_ joined #mojo
07:15 fhelmber_ left #mojo
07:15 fhelmbe__ joined #mojo
07:31 breaker313_ joined #mojo
07:32 breaker313 left #mojo
07:32 breaker313__ joined #mojo
07:34 breaker313_ left #mojo
07:39 su-bzero joined #mojo
07:46 breaker313__ left #mojo
07:47 cosmincx joined #mojo
08:02 breaker313 joined #mojo
08:08 crab hi christian. how is your pet mojo project going? have you won over any of your k0w-orkers yet?
08:10 breaker313_ joined #mojo
08:10 Christian going fine :) have two other projects with mojo ;) it make so much fun with mojo and what do you mean with 'k0w-orkers'
08:11 moritz cow-orkers = co-workers
08:12 breaker313 left #mojo
08:13 Christian thx moritz
08:14 Christian and yes i won ;)
08:15 yko Christian: what kind of competition it was?
08:19 koban` left #mojo
08:26 sri crab: if you're using the poll mainloop then it's just the workaround listen socket
08:28 Christian yko, a battle of man against machine ;)
08:31 cosmincx left #mojo
08:31 cosmincx joined #mojo
08:53 marc [A
09:04 spleenjack joined #mojo
09:08 GitHub163 joined #mojo
09:08 GitHub163 mojo: master Sebastian Riedel * 7225f2b (1 files in 1 dirs): cleanup - http://bit.ly/hz49MJ
09:08 GitHub163 left #mojo
09:08 sri crab: it's local now
09:21 GitHub67 joined #mojo
09:21 GitHub67 mojo: master Sebastian Riedel * a40233e (1 files in 1 dirs): removed dummy listen socket - http://bit.ly/h8hyDz
09:21 GitHub67 left #mojo
09:21 sri crab: and now it's gone :)
09:22 crab whee.
09:22 crab guess it's time to try an in-place upgrade with hypnotoad!
09:22 sri it could cause side effects though, so it needs testing
09:23 sri and for some reason it does
09:23 sri one test hangs
09:26 sri hmm, and i have no idea why
09:30 tardisx sri: I don't think https://github.com/kraih/mo​jo/wiki/Mojolicious-and-POE works like it should. POE::Kernel->run_one_timeslice blocks until the next piece of work is ready. So if the next event is seconds/minutes into the future, the web server will block until then.
09:30 sri tardisx: too bad
09:30 tardisx I've asked about it in #poe (for a nonblocking alternative, or how to detect 'work due' but no response yet
09:31 tardisx I look at it, and all the python cherrypy self-contained apps and think ... mmmmm
09:32 tardisx POE + Mojo seems like a good mix... but maybe you have Secret Plans :-P
09:32 sri no idea why poe would block... makes no sense for an event loop
09:33 sri mojo + any sane event loop should be a good mix
09:33 moritz 1) patch poe
09:34 moritz 2) ???
09:34 purl i think 2) is great.
09:34 moritz 3) profit
09:34 jamesw it is selecting on the added filehandles i think
09:34 sri but without a timeout?
09:35 jamesw sure with a timeout, but still not one that is aware of the Mojo loop
09:35 shurex joined #mojo
09:35 sri if there is a timeout you can surely set it to 0
09:37 jamesw its a timeout in the POE::Loop::Whatever code i imagine
09:37 jamesw it bases it on timers and other pending events i imagine
09:38 jamesw s/i imagine//
09:38 shurex1 left #mojo
09:39 jamesw adding a timer would lower the timeout
09:39 GitHub126 joined #mojo
09:39 GitHub126 mojo: master Sebastian Riedel * 3176611 (1 files in 1 dirs): add dummy listen socket again - http://bit.ly/gX4sYQ
09:39 GitHub126 left #mojo
09:40 tardisx I can work around it by making sure the event queue is full on the POE side
09:40 sri crab: dummy handle makes tls tests block for some reason, feel free to investigate
09:40 tardisx so it always has work to do 'soon'
09:41 tardisx but that seems pretty dumb
09:41 jamesw same thing happens with AnyEvent->one_event
09:41 tardisx though a test showed fairly minimal CPU usage
09:41 sri at least EV has non blocking alternative
09:42 jamesw you could dup your filehandles and add them to a wheel
09:42 sri *+a
09:44 sri tardisx: why are you jealous of cherrypy again?
09:45 tardisx oh I'm not, but there are some good self-contained apps that use it, but do a lot of background 'stuff'. like sickbeard, sabnzb and so forth. the background 'stuff' is maybe easier in python?
09:45 tardisx POE would make that sort of thing a lot more accessible from a perl web app
09:47 sri mojo is very similar to cherrypy
09:48 jamesw time for a POE::Loop::Mojo?
09:48 sri s0va has written one for anyevent
09:50 jamesw yeah, i think making POE use Mojo would be better than trying to shoehorn the POE loop into Mojo
09:50 jamesw *use Mojo's loop
09:50 sri agreed
09:51 sri everything is possible though
09:51 stephan48 maybe a wrapper for both ways?
09:51 stephan48 cause maybe in one case mojo-in-poe has advantages and in other poe-in-mojo?
09:52 sri poe on mojo is a lot easier
09:53 sri for now at least, i wouldn't mind patches to make the other way around easier
09:55 koban` joined #mojo
09:55 koban` left #mojo
09:56 koban` joined #mojo
09:57 sri still a bit disappointed with poe about the one_time_slice thing
09:57 sri blocking is just wrong
09:59 jamesw perhaps its only if you use the ::Select loop?
10:01 tardisx I have looked at it a little, but that code just scares me :-)
10:03 koban` left #mojo
10:03 abra left #mojo
10:05 tardisx I'll file a bug
10:07 crab sri: i USR2'ed hypnotoad, and the sockets magically became 127.0.0.1s! excellent.
10:15 abra joined #mojo
10:16 tardisx done
10:20 metaperl left #mojo
10:23 breaker313_ left #mojo
10:23 koban` joined #mojo
10:32 koban` left #mojo
10:37 koban joined #mojo
10:45 shurex1 joined #mojo
10:49 shurex left #mojo
10:49 AmeliePoulain left #mojo
10:50 AmeliePoulain joined #mojo
10:55 shurex1 left #mojo
10:55 shurex joined #mojo
11:13 shurex1 joined #mojo
11:17 shurex left #mojo
11:24 baton8 left #mojo
11:24 shurex joined #mojo
11:28 shurex1 left #mojo
11:36 abra left #mojo
11:37 shurex left #mojo
11:51 yegor left #mojo
11:52 yegor joined #mojo
11:52 GitHub88 joined #mojo
11:52 GitHub88 mojo: master Sebastian Riedel * bfc3b7a (3 files in 3 dirs): improved Mojo::DOM text extraction - http://bit.ly/eyhYTI
11:52 GitHub88 left #mojo
11:53 sri please test!
11:53 sri this can make scraping a lot more fun, or break tests
11:54 sri it was one of the most frequently requested features, so i want to at least give it a try
12:00 perlrocks Twitter: "Not sure about this change, it could make web scraping with #mojolicious a lot more fun, feedback appreciated. http://t.co/Q0URNnU #perl" --kraih http://twitter.com/kraih/status/57775104196743168
12:09 diegok sri: $content =~ s/^\s*\n+\s*//; shouldn't replace with a space instead of empty string?.. or maybe I just miss the point...
12:09 sri why would it?
12:10 sri (see tests)
12:11 sri if multiple text pieces are concatenated there will be a space added in between
12:12 sri but most of the time you don't want leading and trailing whitespace at all
12:12 sri more test cases welcome btw
12:13 sri i'd like to make as many as possible just work
12:13 diegok sri, not always. In html you can just add \n and also work for a space...
12:13 sri ?
12:13 diegok like: <div>hello\nsri</div>
12:13 diegok will become hellosri
12:14 diegok instead of "hello sri"
12:14 sri have you tested that?
12:14 diegok noup :)
12:14 sri you better should before arguing ;p
12:15 diegok ok, just saw your code... but I will... you're right :)
12:15 bc5042 joined #mojo
12:16 janus left #mojo
12:16 janus joined #mojo
12:17 sri hello\nsri is actually completely unaffected by trimming
12:17 sri (currently)
12:18 koban left #mojo
12:19 koban joined #mojo
12:19 bc5042 if i setup a bridge, and then setup route through that bridge, but with a condition (by ->over()) i get that the condition is always first, and then the bridge action. is it possible to set different order?
12:20 sri conditions are part of the routing process
12:20 sri just like the path
12:20 sri so it is not possible
12:20 elb0w left #mojo
12:21 bc5042 ok, thanks, it is not what i wanted to hear, but ok ;)
12:21 koban left #mojo
12:22 bc5042 i like the conditions beacause they are parametrized, bridges arent
12:24 sri i don't think using application logic that way would be a good idea
12:25 diegok sri: yup, know I understand I was missing the point :)
12:25 sri diegok: but i'm going to add the feature too now
12:25 diegok sri: nice :)
12:33 GitHub95 joined #mojo
12:33 GitHub95 mojo: master Sebastian Riedel * 392b113 (2 files in 2 dirs): improved Mojo::DOM whitespace trimming - http://bit.ly/gGkTh3
12:33 GitHub95 left #mojo
12:34 sri ok, that should do the trick
12:34 yko sri++ # i didn't tested that but looks very good
12:34 sri :)
12:39 daviddelikat1 joined #mojo
12:42 daviddelikat left #mojo
12:46 sri bc5042: you could do stuff like that with a shortcut though
12:47 sri have a shortcut that puts a bridge with coderef in between
12:47 sri and build your own little routing dsl
12:48 sri http://mojolicio.us/perldoc?Mojo​licious/Guides/Routing#Shortcuts
12:49 koban joined #mojo
12:55 bc5042 sri: nice, thx for advice
12:56 sri it's not exactly what you wanted, but imo more pretty
12:56 Akron joined #mojo
12:56 bc5042 i'll give it a try
12:57 dekimsey left #mojo
13:02 dekimsey joined #mojo
13:13 perlrocks Twitter: "i love web scraping with #mojolicious , but should i replace my libxml+regexp parser?" --oroce http://twitter.com/oroce/status/57793432286007296
13:15 yko ^^ he shouldnt :)
13:16 yko Mojo::DOM is great with small tasks. but when you need to go through 100K of pages 500Kb each....
13:22 sri hmmm
13:22 sri could it be the Mojo::DOM is faster than HTML::TreeBuilder now?
13:23 sri if i'm not totally wrong almost twice as fast parsing
13:24 sri tested with the boingboing real world screwed up html
13:25 sri 130k file
13:25 sri dom: 11/s
13:25 sri tb: 6/s
13:26 mattastrophe left #mojo
13:28 yko sri: i didn't benchmarked it for a long time. but if i was not wrong about a half year ago - DOM was faster than TreeBuilder even those times
13:28 yko but you should consider i'm often wrong
13:28 sri aren;t we all? :)
13:28 yko http://korshak.name/ra/awlwrong.png  yeah
13:28 moritz .oO( my opinions my change, but not the fact that I'm right )
13:29 bc5042 sri: thx again for advice, it works great for me
13:29 sri \o/
13:30 sri shortcuts really deserve more attention
13:30 moritz and better documentation :-)
13:30 bc5042 yea! :)
13:30 sri that's basically what i meant ;p
13:31 yko hmm. looks like my clients are quite happy with mojolicious app for their intranet
13:32 sri bit scary that Mojo::DOM can be so much faster, treebuilder uses an xs parser
13:32 yko mb bottleneck is not parsing, but accessing elements?
13:32 elb0w joined #mojo
13:33 yko or parsing is faster also?
13:33 sri i don't know where the bottlenecks are
13:34 sri and what is mb?
13:34 purl mb is scary
13:34 yko whatever, DOM is builtin in mojolicious and not slower. if it works better with broken html now that's great
13:34 yko maybe :D
13:35 yko when i need really fast parsing i use pure regexp, cut off everything i don't need and (if i still need) parse rest with DOM
13:36 spleenjack left #mojo
13:36 sri text manipulation always amazes me in perl, no other language can do it that well
13:36 sri in python and ruby text is quickly the bottleneck
13:36 elb0w yeah
13:37 elb0w Why do people like ruby so much?
13:37 yko i was missing C &text[pos] stuff (i maybe forget right syntax even)
13:37 sri blocks and OO
13:37 yko bu then i found pos() and \G and everything get it's place
13:40 yko nevermind, i never was really familar with C
13:45 sri hmmm
13:45 sri wanted to try HTML::TreeBuilder::LibXML too, but it dies
13:47 perlrocks Twitter: "The simple things that make us remember, Mojolicious and DBIx:: Class:: Schema, Moose begin" (ja) --shinobi310 http://twitter.com/shinobi3​10/status/57802078373937152
13:49 AmeliePoulain left #mojo
13:58 koban left #mojo
13:58 kaare left #mojo
13:58 spleenjack joined #mojo
14:16 arpadszasz left #mojo
14:46 perlrocks Twitter: "@ryanstenhouse @voretaq7 there are other ways to  install #Mojolicious that one is just cool :-)" --AFreshOne http://twitter.com/AFreshOn​e/status/57816942874075136
14:48 arpadszasz joined #mojo
14:49 Christian it is time again
14:49 kaare joined #mojo
14:50 Christian nice evening to you all
14:50 * moritz waves
14:52 Christian left #mojo
15:01 cosmincx left #mojo
15:01 ok22 joined #mojo
15:13 perlrocks Twitter: "Much has been understood Mojolicious" (ja) --brain_apple http://twitter.com/brain_app​le/status/57823620591915008
15:15 yko is 'b' available as helper in ep?
15:16 sri try!
15:17 yko -_-
15:18 yko perl -Mojo -e 'a->b("ok?")->say'
15:18 yko looks like no...
15:22 sri wrong oneliner
15:24 yko perl -Mojo -e 'print a->url_for("wrong oneliner?")'
15:24 sri perl -Mojo -e 'a("/" => {inline => "<%= b(12345)->b64_encode %>"})->start' get /
15:24 sri it's not a helper, but there
15:24 yko ah... damn.
15:24 yko thank you much
15:25 sri all Mojo::Template templates have the function, because it affects escaping
15:26 sri http://mojolicio.us/perldoc​?Mojo/Template#DESCRIPTION
15:26 yko damn.... :-[
15:30 arpadszasz left #mojo
15:41 * sri yawns
16:02 ysyrota left #mojo
16:52 gabb cloudfoundry indeed looks nice sri
16:52 sri not much to see yet
16:54 gabb well, if they offer the micro instance soon for local testing and are open source, its a good start compared to others out there
16:54 gabb plus I am grinding Spring atm anyway, so it suits me fine :P
16:55 gabb but fuck me, verbosity++
17:01 snearch joined #mojo
17:10 mohan_ joined #mojo
17:25 Akron left #mojo
17:33 uniejo joined #mojo
17:38 snearch left #mojo
17:43 stephen left #mojo
17:44 spleenjack left #mojo
17:54 fhelmbe__ left #mojo
18:11 stephen joined #mojo
19:22 TheCritic joined #mojo
19:41 TheCritic left #mojo
20:02 sri oh, cool experiment :)
20:02 sri making ua requests inside a lite app look blocking with Coro
20:02 sri it's actually quite simple
20:07 elb0w lmao
20:07 elb0w I hate these guys in #php so much I literally sit in the channel to answer off topic questions
20:07 moritz why don't you just /leave ?
20:08 elb0w Entertains me
20:08 elb0w like the worst channel on freenode
20:11 sri https://gist.github.com/916283
20:11 sri that's the old school blocking subrequest
20:12 sri https://gist.github.com/916285
20:12 sri and the coro version
20:13 elb0w minor improvement
20:13 elb0w :P
20:14 sri it's all about latency
20:14 sri everything is non blocking, but looks blocking
20:19 perlrocks Twitter: "Using coroutines in #mojolicious to make non-blocking APIs look blocking is really fun, wish this was built into #perl. http://t.co/DrU2RpH" --kraih http://twitter.com/kraih/status/57900687744450560
20:23 sri that could actually be a plugin
20:23 sri plugin 'coroify';
20:23 elb0w do it
20:23 sri i suck at maintaining plugins
20:24 elb0w man paypal sucks
20:24 sri hypnotoad with coro is hot
20:24 elb0w I havent used coro much
20:28 sri well, there are not that many use cases for it
20:28 sri but taking the callbacks out of non-blocking APIs is one of them
20:34 sri really cool, this even works for my mongodb client :D
20:34 sri i just make the plugin reuse the ua ioloop and inherit the on_tick event
20:34 moritz are you talking about mlehmann's Coro?
20:34 moritz or your own coroutines?
20:34 sri mlehmanns
20:34 sri see gist
20:35 sri i've always been a fan of Coro
20:35 * moritz hates the Argument "00" isn't numeric in subtraction (-) at /home/moritz/perl5//perls/perl-5.12.2/​lib/site_perl/5.12.2/Mojo/Exception.pm line 179
20:35 sri but it's a heavy xs prereq :(
20:35 moritz (completely unrelated
20:35 moritz )
20:36 sri moritz: i'm still waiting for a test case
20:36 moritz sri: I know, hasn't been easy to reproduce so far
20:37 moritz sri: I could provide a test case which makes you install a postgres database and about 50 additional modules from CPAN :-)
20:37 kaare left #mojo
20:37 sri moritz: think i'll pass ;p
20:38 moritz sri: thought so :-)
20:41 moritz the backtrace I get with Carp::Always looks pretty scary
20:42 sri the big question is how does \0\0 gets assigned to $line
20:42 sri *-s
20:42 sri it's mostly a regex based assignment with (\d+)
20:43 sri my first guess would be the actual stacktrace, not the regex parser
20:45 moritz http://nopaste.snit.ch/40176 I don't think it'll help without the code, but maybe you have a ray of inspiration :-)
20:47 sri kinda funny how Coro doesn't even use real threads
20:49 * moritz -> sleep
20:49 sri moritz->cede()
20:50 sri sri->async()
20:55 ok22 left #mojo
21:19 perlrocks Twitter: "@ Fuksito example, Mojolicious is a distribution, which contains many modules - http://search.cpan.org/ ~ kraih /." (ru) --koorchik http://twitter.com/koorchi​k/status/57915689872273408
23:14 tempire joined #mojo
23:47 alnewkirk-away joined #mojo

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