Camelia, the Perl 6 bug

IRC log for #mojo, 2011-07-11

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

All times shown according to UTC.

Time Nick Message
00:06 Kulag left #mojo
00:06 Kulag joined #mojo
00:36 preflex left #mojo
00:39 preflex joined #mojo
01:24 Alias joined #mojo
02:26 D4RK-PH0ENiX left #mojo
02:26 d4rkie joined #mojo
02:33 josh left #mojo
03:34 crab sri: i can see from /last crab that you pokes me, but i don't know what for. ;-)
03:34 crab s/pokes/poked/
03:34 sri crab: your opinion on an already solved problem
03:35 sri Mojo::DOM got split into multiple modules
03:35 crab oh? /me looks
03:35 sri my first attempt sucked big time
03:36 sri but have found a good solution
03:36 crab what is it?
03:36 purl it's it!
03:37 sri https://github.com/kraih/mo​jo/tree/master/lib/Mojo/DOM
03:38 sri you could actually reuse the html parser and css selector implementation
03:38 sri very clean separation
03:38 sri only connection is the DOM tree structure
03:39 sri Mojo::DOM was previously a 1300 line module
03:39 crab i see. but this doesn't affect best practice for existing callers?
03:39 crab e.g. to parse html or xml responses?
03:39 sri now it is 3 x 400 lines + 1 x 100
03:40 sri absolutely nothing breaks
03:40 sri code is simply more maintainable
03:40 crab no, not breaks. i meant, should i be changing my code, even if i'm not forced to?
03:40 crab ah, ok.
03:40 crab sounds good.
03:41 sri from the user perspective nothning changes
03:41 sri but if you wanted to build your own html manipulation library you could now reuse our building blocks
03:43 * sri hates that nobody gets excited about more maintainable code
03:49 crab i don't get excited about much, really. but more maintainable code makes me pleased.
03:49 crab it's just hard to express that pleasure without sounding either presumptuous (since i'm not the one maintaining it) or fanboy-ish.
03:49 crab i was, however, thinking that being able to reuse the selector implementation might come in handy for something i want to do.
03:52 sri fair enough :)
04:35 sri think i'll do it again for Mojo::IOLoop
04:36 sri should really be 4 or 5 modules
05:30 crab Mojo::IOLoop::1, Mojo::IOLoop::2, ...
05:33 xaka left #mojo
05:43 Foxcool joined #mojo
05:47 sri yea, that's exactly what i'm doing
06:34 perlrocks Twitter: "@ I have a sample of that Mojolicious takimo Perl! After the automatic setting of the WP MySQL http://bit.ly/nyQlhW. ^ ^ I'm doing in http://bit.ly/pv1av0 in all Github flx" (ja) --kyoro353 http://twitter.com/kyoro35​3/status/90308016171270144
06:40 tabbi joined #mojo
06:40 tabbi left #mojo
06:55 fhelmber_ joined #mojo
07:04 arthas joined #mojo
07:05 arthas left #mojo
07:05 arthas joined #mojo
07:05 arthas left #mojo
07:06 arthas joined #mojo
07:11 Alias left #mojo
07:18 cosmincx joined #mojo
07:28 spleenjack joined #mojo
07:50 sugar joined #mojo
08:03 mattastrophe left #mojo
08:05 mattastrophe joined #mojo
08:31 sri i hate perl...
08:31 sri it is way too easy to add memory leaks
08:32 sri 20 circular references in 3 callbacks...damn
08:32 sri just 7 left i can't find...
08:53 kaare joined #mojo
08:55 spleenjack1 joined #mojo
08:59 spleenjack left #mojo
09:03 ajgb joined #mojo
09:04 abra left #mojo
09:14 abra joined #mojo
09:56 perlrocks Twitter: "Abhijit Menon-Sen: Serving static files with Mojolicious http://bit.ly/oKCLX9" --perlironman http://twitter.com/perlironm​an/status/90358736803217408
10:12 eugen left #mojo
10:25 Drossel joined #mojo
10:27 Kulag left #mojo
10:54 sugar left #mojo
10:57 sugar joined #mojo
10:57 mattastrophe left #mojo
11:01 eugen joined #mojo
11:25 eugen left #mojo
11:55 mattastrophe joined #mojo
12:23 nagual joined #mojo
12:30 arpadszasz joined #mojo
12:43 shonorio joined #mojo
12:44 abra left #mojo
13:04 metaperl joined #mojo
13:06 nagual людии
13:07 nagual сегодня что пятница ?
13:07 nagual :D
13:07 nagual где вы все
13:07 nagual :D
13:36 mattastrophe left #mojo
13:46 fhelmber_ left #mojo
13:50 fhelmber_ joined #mojo
13:53 shonorio_ joined #mojo
13:53 shonorio left #mojo
13:55 xaka joined #mojo
14:15 mattastrophe joined #mojo
14:36 depesz hmm ... i must have missed that in docs, and on wiki, so if you could just direct me to page/doc that's perfectly fine, i'll do the RTFM'ing - but how can I add DB access (normal DBI) to mojolicious app? what's the simplest/best approach?
14:41 Akron joined #mojo
14:44 xaka use startup method, define handler inside and use it in every controller
14:44 xaka *helper
14:45 xaka your helper can return connection to db or orm, depend on what u need inside controller
14:46 Akron depesz: https://github.com/kraih/mojo/wiki
14:46 amoore joined #mojo
14:47 xaka depesz: for an example in "startup" self->helper(db => sub { create and return connection here }); inside controller's action method: $self->db->query(...)
14:48 xaka depesz: http://mojolicio.us/perldoc/Mojolicious#startup + http://mojolicio.us/perldoc/Mojolicious#helper
14:51 depesz Akron: been there, as stated: "... missed ... on wiki..."
14:51 depesz xaka: checking, thanks.
14:52 Akron depesz: But there's a whole subsection on databases.
14:53 depesz Akron: I know. still - didn't want any specific of these, so I clicked on "Database support" and what I got wasn't useful
14:54 depesz mysql doc on the wiki also doesn't show how to use mysql dbi connection from within mojo.
14:54 Akron depesz: Oh - okay. Then check xaka's introduction and make it more useful! :)
14:54 depesz Akron: checked. makes sense.
14:54 depesz xaka: thanks.
15:02 crab hello depesz.
15:05 depesz hi crab
15:17 Akron depesz++
15:24 depesz why the ++?
15:26 Akron Positive feedback for your commitment to advance the wiki. That's what I read in your answer.
15:27 depesz hmm .. improving docs is an option, but first I'll need to do some actual coding.
15:30 Akron depesz: Sure.
15:32 amoore left #mojo
15:32 Kulag joined #mojo
15:34 Drossel left #mojo
15:37 xaka left #mojo
15:44 spleenjack1 left #mojo
15:51 xaka joined #mojo
15:59 non joined #mojo
16:00 non left #mojo
16:11 cosmincx left #mojo
16:15 cosmincx joined #mojo
16:16 cosmincx left #mojo
16:38 sugar left #mojo
17:05 arpadszasz left #mojo
17:14 Akron sri: Thanks for decoupling mojo::dom - but why not introducing mojo::dom::sax and using these events for mojo::dom::html?
17:14 alnewkirk joined #mojo
17:18 Akron However, I think it's a really good idea!
17:25 sri Akron: i actually started on sax, but it took too much time
17:25 sri didn't seem worth the trouble
17:25 sri after all we need to handle encoding for chunks and stuff, tricky stuff
17:27 Akron You may remember I decoupled it once without streaming aspects. ;) The bonus would be the ability to find things fast without the need for building a tree. For example to just get the meta stuff of a web site. But well ... having an xmpp thingy would be nice as well. ;)
17:28 Akron (I know I know - you totally disliked my approach ... :))
17:28 xaka he dislikes every approach :D
17:29 * xaka waiting for another one headshot...
17:31 Akron (Well, he had a point as it did not support streaming ... but I am quiet now - sri is aiming ...)
17:32 sri Akron: sax without chunked parsing is not an options
17:32 sri *-s
17:34 Akron Okay, then maybe you'll find time for SAX+chunked parsing, when it's colder outside and no beer is in the house. Oh ... creepy idea.
17:34 sri personally i'm not very interested in sax
17:34 sri but i would accept a good patch
17:41 xaka sri: when u say that - i always see the commit in 5-10 minutes which fixes an issue :) u really workacholic and i respect it ;)
17:48 marcus agree, sax without chunked is not very useful
18:01 chakram88 joined #mojo
18:02 xaka sri: it would be good to have a file/dir watcher functionallity in ioloop (or based on) so people could do many magic when files change
18:09 stephen left #mojo
18:10 sri xaka: disagree very much, that should never be core functionality
18:10 xaka it's the same feature as read/write/timer watching
18:10 sri it is not
18:11 xaka i know i know, u need the solution, not the problem ;)
18:11 sri io watchers and timers are fundamental features of an event loop
18:11 sri watching filea for changes is just an extension of those fundamental features
18:11 sri s/a/s/
18:12 amoore joined #mojo
18:13 sri file watchers will never be core
18:13 xaka it's not so big as ORM so it could be in a core instead of extension or plugin. Write plugin just for one function is not funny
18:14 sri doesn't matter how big it is
18:15 stephen joined #mojo
18:17 sri we don't adds tuff to core just because we can, there always has to be a good reason
18:36 sugar joined #mojo
18:46 elb0w Man someone needs to add a lib for Mojo that adds more than MojoX::Redis does
18:50 vel joined #mojo
18:53 alnewkirk left #mojo
18:57 sri woot
18:57 sri the websocket spec has passed last call and is now being proposed as a new standard
19:07 mattastrophe left #mojo
19:08 marcus sri: https://github.com/gdb/embedded-mongo
19:08 sri neat
19:19 elb0w finally
19:26 eugen_ joined #mojo
19:27 marcus sri: great news about websockets.
19:27 marcus sri: any idea if safari 5.1 supports the latest greatest?
19:28 marcus They just updated the webkit shipped with ios in beta3
19:28 sugar https://github.com/kraih/mojo/issues/178
19:28 sugar why it is not a bug?
19:32 Foxcool left #mojo
19:32 sri marcus: they will switch with firefox 6
19:32 marcus sri: what does firefox have to do with webkit?
19:32 sri ops
19:32 sri i read that as firefox 5
19:33 sri all versions of safari i know are draft 76
19:33 sri but i would be surprised if they let firefox get too far ahead
19:33 marcus 5.1 is nextgen
19:34 sri sugar: would you write "my $foo = if ($key) { "Name" }" in perl too?
19:36 sri no matter how you look at that, it makes no sense at all
19:37 marcus sri: that's the version that ships with lion.
19:38 sri not tried it yet, no idea
19:39 sri apple tends to be slow though, i would expect them to add support in some minor update ina few months
19:40 sri it's a good thing firefox makes the switch, puts pressure on the rest
19:40 sri chrome will follow quickly i bet
19:41 sri but i can understand their worries
19:41 sri the client side api spec is still not finished
19:41 tabbi joined #mojo
19:41 tabbi left #mojo
19:41 sri that's the reason they are still waiting
19:41 sri protocol spec has not changed much in months
19:52 mattastrophe joined #mojo
19:52 sugar sri: i understand, you right, but i suggest that this behavior should be fixed somewhere in documentation
19:53 metaperl left #mojo
19:54 sri sugar: where in the documentation does it say you can write broken perl?
19:55 sri "fixed" implies that there is something wrong in the documentation
19:55 sri if that's the case please send a pull request
19:57 sri quite funny, atm the only browsers that support the latest websocket protocol are firefox and internet explorer
19:57 sri webkit is behind
19:57 xaka what about "links" or "lynx"? :)
19:58 sri http://blogs.msdn.com/b/interoperab​ility/archive/2011/06/23/websockets​-prototype-gets-another-update.aspx
19:58 sri microsoft is actually quite good
20:00 sugar sri: my english is poor, and i lost some sense in yout words
20:02 sri http://www.cpantesters.org​/distro/M/Mojolicious.html # yay, supergreen
20:04 marcus sri: http://websocketstest.com/
20:05 sri marcus: not very spectacular
20:10 sri and now back to finding circular references :(
20:18 sri hah, and found... damn... how could i miss that one
20:19 xaka so, it's not so supergreen?
20:24 sri i'm working on a new ioloop, this has nothing to do with the current one
21:02 metaperl joined #mojo
21:13 sugar left #mojo
21:25 tempire sri: how are you identifying the existence of a particular number of circular references?
21:30 sri Devel::Cycle
21:30 purl Devel::Cycle is, like, full of shit
21:30 bosphorus joined #mojo
21:31 * sri hugs purl
21:31 * purl nibbles sri's elbow
21:31 amoore left #mojo
21:37 s0va joined #mojo
21:38 Kulag left #mojo
21:38 Kulag joined #mojo
21:38 s0va sri: is there a possibility to use JSON::XS in ->render_json ?
21:39 s0va $self->render_json({ success => 1 }} doesn't result in  { success: true }
21:39 vel left #mojo
21:39 sri umm
21:39 perlite_ joined #mojo
21:39 sri a) just make your own json rendering helper
21:39 sri b) that would be total bullshit
21:40 s0va could be bullshit, but i'm seeing this: (output: {"success":1,"error":null,"data":{"run_queue​":"1","memmax_mb":"0","currconns":"1","node"​:"k2","nbproc":"1","pid":"3200","uptime":"0d 2h04m16s","ulimit-n":"20013","uptime_sec":"7456","​tasks":"1","version":"1.5-dev6","release_date":"20​11\/04\/08","name":"HAProxy","process_num":"1","de​scription":"","pipesfree":"0","maxpipes":"0","maxs​ock":"20013","maxconn":"10000","pipesused":"0"}} )
21:40 sri no pasting into the channel!
21:40 alnewkirk|com wtmf
21:40 sri you should know by now
21:41 s0va code: $self->render_json({success => 1, error => undef, data => $data });
21:41 sri s0va: perldoc Mojo::JSON
21:41 s0va if you're trying to tell me to use mojo::json::true instead of 1, yeah, i've read that.
21:42 sri then i don't see your problem
21:42 s0va so, there is no way to "plug" original JSON module to render_json() method?
21:42 sri just don't use it
21:42 perlite left #mojo
21:42 perlite_ is now known as perlite
21:42 sri $self->render_my_json(...)
21:43 sri and be done with it
21:43 s0va yeah, i'll do that.
21:43 s0va thanks.
21:43 Akron Oh - failed a test (1.64) in Win7, 64-Bit, StrawberryPerl 5.12.2: 8/36 in iowatcher.t line 41. Is this known?
21:44 sri Akron: think i've seen it somewhere, but it's windows
21:45 sri doesn't matter if it's known, we have nobody to fix it atm :/
21:45 Akron So better skip it?
21:45 sri we'll see, it seems to pass on cpantersters
21:46 Kulag left #mojo
21:46 Kulag joined #mojo
21:49 s0va sri: psgi server implementation doesn't support delayed responses. i'll try to look into that.
21:51 alnewkirk|com unrelated, but im captivated  .. http://www.slideshare.net/padday/​the-real-life-social-network-v2/
21:51 sri s0va: not like it would gain us much
21:52 sri s0va: btw. a json encoder should never turn 1 into true, that's just wrong
21:52 s0va oh, so it should interpret it as integer 1?
21:52 sri yes
21:52 sri if it was defined as an interger
21:53 sri or string "1" if it was defined as a string
21:53 s0va i also tried: success => (1 == 1)
21:53 s0va converts to string :)
21:53 sri we use the magic bits to decide between string and integer
21:54 s0va i'll have to live with that.
21:54 sri Mojo::JSON->true should generally be good enough
21:54 sri considering perl has no equivalent native data type for true and false
22:11 sri the behavior is pretty much equivalent to JSON::XS, so i really don't understand your confusion
22:24 xantus[] I got mojo EV working btw
22:24 sri \o/
22:25 xantus[] we'll have to talk about signal watchers
22:25 sri can't we ignore them? :/
22:26 xantus[] probably
22:26 sri unless there's a really really good reason i think i would prefer that
22:27 xantus[] crab: sup
22:28 sri btw. crabs are quite tasty
22:30 xantus[] :)
22:30 * xantus[] throws crab in some boiling water
22:30 sri crab meat snadwiches are actually a local specialty around here :)
22:33 nagual sri: hi. how to enable "service avaliable" if cpu utilization 100%
22:33 kaare left #mojo
22:34 xantus[] sri: to handle the one loop, I used a timeout that calls unloop
22:34 xantus[] set timeout, call loop (blocks), timeout fires, unloop
22:34 nagual sri: no i see Template "..." not found.
22:35 sri nagual: a) i don't understand you b) asking me directly discourages everyone here who might actually understand you to answer
22:35 xantus[] I think this could be more efficient
22:35 * alnewkirk|com have never been more discouraged
22:37 nagual im testin myapp from ab -c 100 end see to many error 404
22:37 nagual how to enable "service avaliable" if cpu utilization 100%
22:37 chakram88 left #mojo
22:39 nagual now if cpu=100% users see 404 and 500 errors
22:40 nagual do you understand me ?
22:44 vel joined #mojo
22:44 xantus[] nagual: why would you want that?
22:45 xantus[] you really want to look at your load average as an indicator of load
22:45 xantus[] the  uptime command on linux
22:46 xantus[] which uses /proc/loadavg
22:46 xantus[] alnewkirk|com: ?
22:47 alnewkirk|com see backlog
22:49 nagual left #mojo
22:51 xantus[] the slideshare?
22:51 purl the slideshare is in need of being called slideshr or http://www.slideshare.net
22:52 alnewkirk|com xantus[], ?
22:52 purl it has been said that xantus[], is a low-balled pay around 80K ?
23:08 vel left #mojo
23:26 Akron left #mojo
23:27 vel joined #mojo
23:27 vel left #mojo
23:38 perlrocks Twitter: "@kraih Thanks for keeping an eye on the #websocket spec. Good to know #mojolicious is up to speed." --jamiepopkin http://twitter.com/jamiepopk​in/status/90565760203759616
23:55 xaka does anybody know what the changes in the latest websocket draft?

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