Camelia, the Perl 6 bug

IRC log for #mojo, 2011-08-04

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

All times shown according to UTC.

Time Nick Message
00:58 Koven is now known as Kovensky
01:18 tempire woah!
01:19 tempire lion time machine backs up even when the external hard drive is not connected
01:19 tempire I guess that makes sense, that's how versions works
01:19 tempire but still
01:19 tempire hoorah!
01:24 xaka left #mojo
01:31 Alias_ joined #mojo
01:40 xaka joined #mojo
02:16 mmcleric left #mojo
02:16 mmcleric joined #mojo
03:14 mattp joined #mojo
04:06 hide left #mojo
04:06 hide joined #mojo
04:08 kaare joined #mojo
04:26 jwang joined #mojo
04:37 jwang left #mojo
04:57 kitt joined #mojo
05:13 koban joined #mojo
05:14 baton8 left #mojo
05:27 preflex_ joined #mojo
05:31 preflex left #mojo
05:50 marcus gooood morning
05:50 Foxcool left #mojo
06:29 _sri good morning sunshines
06:41 AmeliePoulain joined #mojo
06:49 stephan48 good morning
06:49 purl For you maybe.
06:55 crab me too.
06:56 cosmincx joined #mojo
07:07 kitt left #mojo
07:09 marcus $secretary++ # tea
07:13 cosmincx left #mojo
07:15 sromanov joined #mojo
07:26 cosmincx joined #mojo
07:37 plu marcus: you made it! :)
07:37 plu (having a secretary)
07:39 baton8 joined #mojo
07:40 marcus actually she's our receptionist.
07:40 marcus and we get paid to have her working for us for three months :)
07:40 marcus but it's still pretty great!
07:47 Foxcool joined #mojo
07:50 arthas joined #mojo
07:50 nickl joined #mojo
08:03 _sri pancakes for breakfast, life is good :)
08:03 _sri but enjoy your tea over there ;p
08:04 perlrocks Twitter: "I wrote the first in the MVC assigned exercises using Perl & Mojolicious. Really easy to understand and code that have separate View. Personally, I wish but in the MC + V. clicktx:: Directory http://t.co/97LThu0" (ja) --clicktx http://twitter.com/clicktx​/status/99027867790360576
08:09 arne joined #mojo
08:09 judofyr joined #mojo
08:09 plu :)
08:13 _sri ohoh, viking invasion
08:14 cosmincx left #mojo
08:18 judofyr _sri: any reason why UserAgent::get returns itself as the first parameter in the callback?
08:18 judofyr s/why//
08:20 _sri to make memory leaks harder
08:20 _sri perl uses ref counting
08:21 _sri so if you used $ua from outside the callback you'd automatically have a circular reference
08:21 judofyr Perl doesn't handle circular references?
08:21 _sri nope
08:21 judofyr woah
08:21 _sri we have to use weaken and tell the interpreter about them
08:21 _sri (lower the ref count manually)
08:21 judofyr that's … weak :)
08:22 _sri well, it's ref counting garbage collection
08:22 judofyr sure, but you usually combine ref counting with a cycle collector too
08:22 _sri no stop the world latency though ;p
08:24 nickl hi, in mojo, is it usual to expose the model to both controller and templates, or better to expose only to controller and then pass selected data to the templates?
08:24 nickl i'm using dbic if that has any bearing
08:25 _sri i'd go with making queries in the controller and passing resultsets to the template
08:25 nickl ok, that fits with what i'm doing already, thanks :)
08:27 cosmincx joined #mojo
08:27 judofyr _sri: Age-Oriented Concurrent Garbage Collection by Petrank describes a GC which has pause times at 2ms :)
08:28 judofyr which also handles cycles
08:31 judofyr and I believe David Bacon has described some pretty cool GC research at IBM
08:32 judofyr but for a high-level language I'd rather take a little less performance and fewer memory leaks
08:33 marcus judofyr: in practice weakening cycles isn't that hard, and there's tools to track them down.
08:33 marcus but yeah, not having them would be better :)
08:37 sromanov left #mojo
08:43 crab marcus: why do you get paid to have a receptionist?
08:43 _sri yea :)
08:44 marcus crab: it's an employment program. She has a 3 month practice place.
08:44 _sri the topic garbage collection actually doesn't come up often
08:44 _sri most perl folks seem to be ok with it
08:44 marcus crab: and the state employment agency pays us to have her.
08:47 _sri neat/me wonders what parrot uses for garbage collection these days
08:47 _sri *-neat
08:48 _sri multiple i guess
08:49 xaka left #mojo
08:50 marcus _sri: gc would be a nice thing for perl5.16 to fix tho.
08:50 _sri naah
08:50 _sri exceptions and mop first
08:51 mhi mop? XXX-oriented programming?
08:51 marcus mhi: meta object
08:51 mhi Ooh. Okay. :)
08:52 judofyr it's all meta these days
08:52 marcus judofyr: moose is actually sugar for Class::MOP
08:52 spleenjack joined #mojo
08:52 nickl is this http://pastie.org/2318753 a good way to expose my dbic schema to all my controllers?
08:53 _sri https://github.com/stevan/p5-mop​/blob/master/proposal/p5-mop.md
08:53 _sri good proposal
08:54 _sri nickl: does dbic handle fork transparently?
08:54 nickl i have no idea :S
08:54 judofyr Perl: "Syntax is like violence. If it doesn't solve your problem, you're not using enough of it.
08:54 judofyr "
08:54 _sri well, if it does that would be a good way
08:59 nickl _sri: from what I can see there  is no need to worry about forking with dbic
08:59 nickl _sri: if it is an issue is there a better approach?
09:00 * _sri bricks judofyr
09:00 _sri nickl: no need to worry if there's no issue :)
09:01 nickl _sri: yep, I'll go with it until theres a problem
09:01 _sri you could lazy initialize an attribute… just ask if there's a problem
09:01 nickl sure, thanks
09:02 * _sri just noticed that he doesn't know any ruby jokes :(
09:02 judofyr _sri: performance is a quite good joke i Ruby ;)
09:03 _sri ;p
09:03 judofyr that reminds me of the guy who had ":sex" on his t-shirt. that's "sex symbol" in the Ruby world…
09:04 judofyr everyone else reads it as "colon sex" :P
09:04 _sri lol
09:05 kaare left #mojo
09:05 kaare joined #mojo
09:05 _sri Ruby: "Your foot is ready to be shot in roughly five minutes."
09:05 alnewkirk nickl, thats the way its done in Dancer :}
09:05 alnewkirk and, yes, I would recommend doing it that way
09:06 judofyr _sri: what are your thoughts on package names: should they be descriptive (like, HTTP::Framework) or just vaguely nonsense (Mojolicious)? :)
09:06 _sri alnewkirk: not true, in dancer it would be global, our helpers are local to the app instance ;)
09:07 _sri judofyr: i'm all for nonsense!
09:08 nickl alnewkirk: cheer, iit seems like the simplest approach
09:08 _sri the problem i have with descriptive names is that they discourage diversity
09:08 alnewkirk _sri, true to a point, in Dancer::Plugin::DBIC its local to the plugin instance so ...
09:09 alnewkirk use Digisoraus;
09:09 judofyr _sri: yeah, I agree. but I'm coming from Ruby where Thin, Unicorn and Mongrel are web servers :P
09:10 judofyr and Passenger
09:10 purl Passenger is now most definitely dead.. totally, absolutely.. undoubtably dead.. Dead dead dead dead dead.. Gonna stay dead..
09:10 _sri mojolicious has Morbo and Hypnotoad bundled :D
09:10 judofyr purl: Phusion Passenger, you silly bot
09:10 purl judofyr: sorry...
09:10 alnewkirk Mojolicious++
09:10 _sri ALL GLORY TO THE HYPNOTOAD!
09:11 judofyr Hypnotoad++
09:12 alnewkirk _sri, in an app im writing I've written a mailer script which currently does a while(sleep 5) { ... } but I get the feeling theres a better way to do it
09:12 _sri alnewkirk: the dbic plugin registers a keyword that gets stored in a singleton, it is global
09:12 judofyr _sri: then I'll name this Solr-client for SolarBeam :D
09:12 alnewkirk maybe using IOLoop
09:12 alnewkirk goal is .. I like it to startup and shutdown with the server
09:13 alnewkirk _sri, .. now look what you did sukria/Dancer/issues/613
09:13 _sri alnewkirk: https://github.com/sukria/Dancer/b​lob/devel/lib/Dancer/Plugin.pm#L21 # doesn't get more global
09:15 alnewkirk _sri yes but technically speaking, D::P::DBIC is not responsible for what Dancer::Plugin does with it, or Dancer ... and as far as the plugin itself is concerned, the schemas are cached local to the package
09:17 _sri alnewkirk: that's a singleton too
09:19 judofyr Perl question: "$self->status == 0". quickest/best way to get it work when status is undef (that is, it should return false then)
09:21 _sri eq?
09:21 purl eq is higher that tight and/or
09:22 mfridh_ joined #mojo
09:22 Fried_ joined #mojo
09:22 gabb_ joined #mojo
09:22 trcjr_ joined #mojo
09:22 elb0w_ joined #mojo
09:22 alnewkirk left #mojo
09:22 Fried left #mojo
09:22 Trelane left #mojo
09:22 edenc left #mojo
09:22 minimalist left #mojo
09:23 trcjr left #mojo
09:23 elb0w left #mojo
09:23 gabb left #mojo
09:23 minimalist joined #mojo
09:23 alnewkirk joined #mojo
09:23 Trelane joined #mojo
09:25 edenc joined #mojo
09:25 mfridh left #mojo
09:27 _sri marcus: how is chocolat btw?
09:27 arne _sri: Alpha
09:28 judofyr very alpha
09:28 marcus full of bees!
09:28 _sri ah, it looked kinda usable in the screenshots i saw so far
09:29 marcus it's usable
09:29 marcus I guess
09:29 judofyr well, it's more usable than TextEdit
09:29 judofyr (for editing code)
09:29 * alnewkirk is writing Mojojitsu
09:30 * marcus installs a new alpha
09:30 marcus _sri: want an invite?
09:30 _sri of course i do!
09:32 _sri marcus++
09:33 marcus judofyr++
09:33 judofyr _sri++
09:33 judofyr oh no! it's a cycle!
09:33 marcus lovefest!
09:33 marcus now we're leaking karma :-/
09:33 marcus I prefer sinfest, tbh
09:33 judofyr I'm not quite sure if that's good or bad…
09:33 judofyr (leaking karma)
09:34 marcus http://www.sinfest.net/arc​hive_page.php?comicID=3984
09:34 _sri judofyr++
09:37 * arne feels left outside.
09:37 arne Alone.
09:38 judofyr Forever.
09:38 purl forever is a mighty long time
09:38 judofyr for (@ever) { $self->alone() }
09:40 MisterHatt anyone compared the mojo ua to lwp's?
09:40 _sri i see what you meant with alpha
09:41 judofyr Chocolalpha
09:41 _sri MisterHatt: mojo ua is non-blocking
09:42 MisterHatt _sri: other than that?
09:43 _sri that's the big philosophical difference everything else is based one
09:43 * MisterHatt needs to submit a file to one site, get the link returned, and submit that link to another site, so non-blocking is probably good
09:44 _sri does not sound like a non-blocking task
09:44 MisterHatt _sri: I have 50+ files to UL preferably within the space of a minute, so doing them concurrently would be nice
09:44 _sri don't misunderstand me though, we do blocking too
09:44 MisterHatt yeah I know
09:44 _sri ah, ok, that's something else
09:45 MisterHatt at first I thought I wanted blocking so I wasn't sure which was better, but when I realised speed/time constraints, figured non-blocking would be good as long as I could map the second process proeprly
09:45 _sri you benefit most from non-blocking when latency is involved
09:45 MisterHatt as in, extract returned links as they come in, and upload them correctly
09:45 MisterHatt how so?
09:47 _sri handling latency parallel is a lot better than handling it sequential, think about it :)
09:47 MisterHatt I'm not entirely sure what you meant by latency tho
09:48 _sri if you're uploading over a low latency connection you might use bandwidth more efficienlty doing it sequential
09:49 _sri connection latency
09:49 MisterHatt ah ok, now I get it
09:49 _sri most internet hosts are slow
09:50 MisterHatt so given that I do have fairly high latency to second site, but the first is in the same DC, would non-blocking be a benefit?
09:50 Alias_ Unless the latency of a single element is massively greater than the others
09:51 _sri hard to say, best to benchmark if it matters
09:51 MisterHatt I guess
09:51 _sri but generally if you have a lan connection i'd go sequential
09:52 MisterHatt basically need to just have a subroutine or callback for each file and process each concurrently while still doing the diff parts of each file in order :S
09:52 MisterHatt nah, servers are all in datacentres, not running on my home machine
09:54 _sri i think you'll like the trigger example i just added
09:54 Alias_ left #mojo
09:54 MisterHatt in the mojo ua module?
09:54 _sri http://mojolicio.us/perldoc/Mojolicious/G​uides/Cookbook#Parallel_Blocking_Requests
09:54 MisterHatt oh nice
09:54 MisterHatt "parallel blocking" sounds like what I need
09:54 _sri *emulated*
09:54 * MisterHatt goes have a read, thanks
09:55 _sri it uses a feature that's only in the github version though
09:55 MisterHatt I only need it for one script, can just pull from github
09:55 MisterHatt need to do this on the hour as quickly as possible, was just gonna throw in crontab
09:56 _sri i'm sure you'll like the streaming upload example above too
09:57 MisterHatt aha, I do need to setup a streaming video server for dynamic containers, but that probably isnt relevant to this kind of streaming
09:57 MisterHatt well it is a little bit, but not much
09:58 _sri streaming video is usually range requests i think, we do that out of the box ;p
09:59 _sri real web servers do it more efficiently though
09:59 MisterHatt yeah, was gonna just use adobe/apple hls and rtmp for it, but streaming upload from ip cameras is handy
10:02 MisterHatt ah that trigger example is perfect, thanks _sri
10:08 judofyr _sri: I'm thinking about writing a Mojolicious-plugin to handle parallel requests: http://pastie.org/private/yexcggvniygmdsm5rygja the first $self->parallol() will run render_later, and when all the callbacks are done, it will run render()
10:12 _sri judofyr: not a bad solution
10:14 _sri https://github.com/kraih/mojo/pull/193 # thoughts?
10:15 _sri the second example seems just wrong
10:16 _sri how could "http://kraih.com/index.html" with a base of "http://kraih.com/a/" result in the relative url "../index.html"?
10:20 _sri marcus: why did you set the channel mode to +si? Oo
10:24 judofyr marcus: he probably tried to set it +sri :D
10:25 judofyr isn't +i invite only? :S
10:26 _sri ye, it's +secret and +invite
10:26 mhi Yup. I think i and n don't make much sense for this channel. :>
10:26 mhi -n +s
10:27 _sri doesn't make any sense at all, i bet he fell asleep on the keyboard or so :)
10:27 _sri and i'm powerless atm :S
10:27 _sri maybe he's taking over :o
10:30 judofyr _sri: is there a way to specify the default args to the render()? so Parallol can simply call render() internally, but you uses render_later_with(something => 'bar') to change the render options…
10:31 _sri everything in the stash gets passed to render
10:31 _sri $self->stash(text => 'FOO!'); $self->render; is pretty much equal to $self->render(text => 'FOO!')
10:31 judofyr I'm thinking about changing rendering options (like, the template name etc)
10:32 judofyr oh
10:33 _sri there are a few small differences, like how a before_render hook might react, but those generally don't matter
10:33 judofyr excellent!
10:33 * purl zwooshes
10:33 judofyr then I can Parallol for the lolz!
10:35 marcus _sri: sorry, tried /m sri_ …. in textual
10:35 judofyr woah, I was actually right o_O
10:35 _sri haha
10:36 marcus used to irssi...
10:44 judofyr _sri: how do I create a per-request-wide variable in a plugin?
10:45 judofyr _sri: also, just tell me to GTFO if I become too noisy
10:45 judofyr hooks!
10:45 judofyr I think before_dispatch is what I want
10:46 _sri it is
10:48 judofyr hm… so how do I add a variable/accessor to a Perl object on-the-run?
10:48 judofyr wait, it's just a hash?
10:48 judofyr is it idiomatic or idiotic to add a new value to the $self-hash?
10:55 marcus judofyr: typically you set up an acessor
10:55 marcus judofyr: you can do $self->attr('foo');
10:55 judofyr ah
11:14 judofyr too bad $self->some_attr++ doesn't work :/
11:24 judofyr _sri: if I have "$ua->get(…, sub {}); $ua->get(…, sub {})", it's not possible for the first callback to be called *before* the last $ua->get, right? the whole method must return before a callback is invoked?
11:26 _sri correct
11:26 _sri or actually, maybe :)
11:27 _sri there could be some exception case that fires right away
11:27 _sri but i don't think so
11:33 judofyr _sri: is there a hook for when the controller is finished executing? (assuming render_later has been called)
11:35 _sri http://mojolicio.us/perldoc/Mojolicious#hook
11:41 judofyr _sri: but after_dispatch/before_render doesn't run when I call render_later
11:42 _sri that's correct, since render_later only delays rendering
11:42 judofyr I want a hook for after the action is executed
11:43 _sri like… your action? :)
11:43 judofyr in my plugin, I want to do shit after *each* action :)
11:43 judofyr so I don't have to write "$self->parallol" at the end of each action
11:45 _sri there is no such hook, what shit do you want to do?
11:47 _sri if there's a sensible use case we could add after_routes_dispatch or so
11:48 judofyr _sri: http://pastie.org/private/jfrmuhdjvma0e9fkpi1za. Parallol maintains a counter of how many requests are pending. if the first $ua->get returns *right* away, that counter will be at 0 and it thinks that all the requests are done.
11:49 _sri ok, that shouldn't happen
11:49 judofyr _sri: well, you did say "maybe" :P
11:49 _sri i'm quite sure it can't happen ;p
11:49 judofyr like, 100% sure? :P
11:50 marcus 99 problems but the bitch aint one.
11:50 judofyr anyway, my use case for after_action (or whatever) would be to start the counter at 1 and then decrement it after action
11:51 _sri lets say i'm 100% sure :)
11:51 judofyr so the whole action becomes one big "callback" from Parallol's point of view
11:51 _sri if not it's a bug
11:52 judofyr good
11:53 _sri looking through the code, i think only missing IO::Socket::SSL module error could trigger the callback immediately
11:54 Alias_ joined #mojo
11:55 _sri interesting problem
11:55 purl it has been said that interesting problem is trying to not make it path-centric
11:59 _sri will fix it
12:00 judofyr _sri: thanks!
12:00 judofyr _sri: did I mention that I love you? :)
12:01 * _sri faints
12:01 judofyr learning Perl becomes *much* easier when you have IRC
12:04 Alias_ Which is why we're building IRC into our editor :)
12:05 _sri yo dawg, i hear you like editors, so we built an editor into your editor so you can edit while you edit!
12:06 _sri well, i guess emacs has been there before
12:06 jamesw emacs has been everywhere
12:08 perlrocks Twitter: "Marcus Ramberg's Mojolicious presentation: http://slidesha.re/fSWMJg It's the new LWP with even more awesomeness." --briandfoy_perl http://twitter.com/briandfoy_​perl/status/99089254625447936
12:25 GitHub106 joined #mojo
12:25 GitHub106 [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/51​579c8aa11bd59db912bbb6bcb0026bf1a724db
12:25 GitHub106 [mojo/master] fixed a few small bugs in Mojo::URL - Sebastian Riedel
12:25 GitHub106 left #mojo
12:36 judofyr _sri: https://github.com/judofyr/parallol
12:40 GitHub24 joined #mojo
12:40 GitHub24 [mojo] kraih pushed 1 new commit to master: https://github.com/kraih/mojo/commit/12​8ad485983fb066e66095f8e77615fd162e19aa
12:40 GitHub24 [mojo/master] added experimental defer method to Mojo::IOLoop - Sebastian Riedel
12:40 GitHub24 left #mojo
12:43 _sri judofyr: my head still spins a bit from the url bug above, but looks good
12:51 _sri judofyr: it's a little uncommon to add an accessor for private attributes
12:51 judofyr _sri: what's common then? access the hash internally?
12:51 _sri $self->{paralloling}
12:51 _sri ye
12:51 judofyr _sri: cool
12:52 judofyr _sri: what about the parallol_done-thingie. it looks kinda weird with "sub sub { render } }"…
12:53 _sri looks also like a leak
12:54 judofyr oh?
12:54 judofyr damn ref counting :/
12:54 _sri use Scalar::Util 'weaken';
12:55 _sri i don't quite get why you use the double sub
12:55 judofyr _sri: because if I use a single one, it will be executed when I run $self->parallol_done
12:56 _sri oh, now i get it
12:58 _sri that's ok then
12:59 _sri maybe call it on_parallol or so
12:59 SmokeMachine joined #mojo
13:00 _sri damn, you've picked some really complicated shit for learning perl
13:00 _sri most long timer perlers would have trouble with that :)
13:03 judofyr _sri: better: https://github.com/judofyr/parallol/blob/​master/lib/Mojolicious/Plugin/Parallol.pm ?
13:04 judofyr or does the nested sub in the parallol-helper also cause a leak? :/
13:05 _sri possibly ;p
13:05 _sri $self->on_parallol->($self)
13:05 _sri i think that looks better than &
13:05 _sri saem for $callback
13:05 judofyr ah
13:05 judofyr didn't knew that
13:06 judofyr it's this kind of knowledge that you never get out of a book
13:07 judofyr _sri: fixed
13:07 _sri looks good
13:07 _sri judofyr++
13:08 judofyr wo-hoo!
13:08 judofyr do I get a badge or something?
13:09 judofyr _sri: the Camping framework got both badges and uniforms!
13:09 judofyr https://github.com/camping/camping/​blob/master/extras/images/badge.gif
13:09 judofyr https://github.com/camping/camping/b​lob/master/extras/images/uniform.png
13:10 _sri lol
13:11 judofyr _sri: how can I test for mem leaks?
13:11 _sri i tend to use Devel::Cycle
13:12 _sri find_cycle $self;
13:13 judofyr so if I do that in the bottom of my action, it should tell me any cycles?
13:14 _sri ye
13:14 judofyr 4 cycles
13:15 judofyr yeah, seems to be the callback to UserAgent
13:16 judofyr _sri: so what should I weaken?
13:16 judofyr "weaken $self" inside the sub?
13:17 judofyr nah
13:18 MisterHatt _sri: does mojo::cokiejar support writing/reading cookie from a file on disc? for use in such events where a script is called from cron rather than being part of a persistant webapp
13:18 _sri MisterHatt: nope
13:18 _sri judofyr: outside
13:19 _sri in the helper most likely
13:19 _sri also make sure it's not a leak in mojolicious, i've fixed some yesterday :)
13:20 MisterHatt http::cookiejar it is then, awesome
13:20 _sri it's like whac a mole, they keep popping up every now and then :)
13:20 judofyr _sri: yay! still two cycles though
13:21 MisterHatt now to figure out having a nonblocking foreach loop call 2 subroutines in order...
13:21 MisterHatt fun times :V
13:21 _sri non-blocking is hard… lets go shopping
13:22 MisterHatt just trying to wrap my head around logic
13:22 MisterHatt I have a list of files, I have a sub to upload them and return a string which gets passed to the second sub which submits it
13:23 MisterHatt need o run that process on the files in parallel, but the subs need to be called in order for each one
13:23 MisterHatt also need to pass some metadata to the upload form...
13:24 judofyr _sri: here's the two cycles left: http://pastie.org/private/tk0vw9jkwo3n8bcj8k2cq
13:24 judofyr I have two calls, so it's probably just one weaken() I need
13:24 _sri judofyr: "mojo version"?
13:25 judofyr Mojolicious (1.68, Smiling Face With Sunglasses)
13:25 _sri just upgrade, it's fixed in 1.69 :)
13:25 _sri that was a core leak
13:26 MisterHatt _sri: able to throw me a hint on how to do this easily?
13:26 MisterHatt I think my brain is in meltdown, was up all night on call andthen heavy day at work :/
13:27 _sri MisterHatt: everythign you ned to know should be in the cookbook
13:27 MisterHatt well the mojo specific stuff is
13:27 MisterHatt it's the calling subroutines in a nonblocking way on a loop that I'm not getting...
13:27 * _sri is melting too
13:27 judofyr _sri: wo-hoo! no leaks!
13:27 _sri \o/
13:27 MisterHatt oh right, it's summer in the north lands...
13:28 _sri someone turn the damn sun off...
13:28 _sri wow, chocolat actually has a neat bundle editor
13:29 MisterHatt chocolat?
13:29 judofyr chocolatapp.com
13:31 MisterHatt ah
13:32 judofyr _sri: what editor do you use?
13:32 _sri textmate and vim
13:33 MisterHatt textmate <3
13:33 MisterHatt between textmate and yorufukuro, I have reason to use a mac
13:35 _sri damn, that twitter client looks horrible
13:38 _sri on the mac i still use the official one
13:39 judofyr _sri: does Mojo::UserAgent use keep-alive connections?
13:39 _sri ye
13:39 MisterHatt _sri: I like it, but I read tiwtter in a half dozen languages so it helps with that
13:39 MisterHatt tweetbot isnt bad either I guess
13:39 judofyr I just use twitter.com
13:42 SmokeMachine left #mojo
13:43 judofyr _sri: you've done some Ruby?
13:48 _sri indeed
13:48 judofyr what do you think about it?
13:48 _sri perl with new cloth
13:50 _sri one thing i really missed was fun oneliners
13:50 judofyr _sri: we have fun 4kb-ers instead: https://github.com/camping/camp​ing/blob/master/lib/camping.rb
13:51 _sri :)
13:54 AmeliePoulain left #mojo
13:55 _sri i actually like both languages, perl and ruby, both have their own charm
13:55 bpaluch Hey sri any idea how well your websockets interface holds up with a lot of connected users? I was thinking of writing a websockets one side, sip on the other side application.
13:56 judofyr _sri: how's the quality of the Perl 5 source code?
13:56 _sri bpaluch: don't know yet
13:57 _sri judofyr: better than mri last i looked, not seen the 1.9 code yet though
13:58 judofyr heh, MRI isn't very nice
13:58 _sri rubinius beats both of course
13:58 judofyr rbx is one sweet codebase
13:59 perlrocks Twitter: "I guess I definitely should check #Mojolicious one. #perl" --adriensebbane http://twitter.com/adriensebb​ane/status/99117129206480896
13:59 judofyr but rubyscript is the new awesomeness of course
13:59 judofyr (it's my Ruby implementation in JS)
13:59 _sri haha
14:00 _sri i actually always wanted to write a perl subset to js compiler
14:01 marcus left #mojo
14:02 judofyr that sounds kinda wicked
14:04 marcus joined #mojo
14:04 _sri we are leaking chan ops
14:06 judofyr _sri: is (!defined $foo && !defined $bar) the same as !($foo && $bar) ?
14:06 judofyr aka. is it safe to drop the "defined"
14:10 ph1g joined #mojo
14:29 judofyr left #mojo
14:33 ph1g left #mojo
14:36 d4rkie left #mojo
14:36 MisterHatt hmm, possible to add headers (like pseudo cookies) to useragnet without touching the transaction object?
14:36 d4rkie joined #mojo
14:41 koban left #mojo
14:43 cosmincx left #mojo
14:43 cosmincx joined #mojo
14:45 Christian joined #mojo
14:45 Christian left #mojo
14:49 Foxcool left #mojo
14:54 ndiewald joined #mojo
14:59 cosmincx left #mojo
15:06 elb0w_ _sri: I need a Mojo::STOMP to save me from this
15:06 elb0w_ lets go
15:06 elb0w_ I expect it next update
15:17 xaka joined #mojo
15:27 _sri MisterHatt: it's all over the ua pod
15:27 _sri elb0w_: no ;p
15:29 elb0w_ fuck mn
15:29 elb0w_ man
15:29 elb0w_ AnyEvent::STOMP doesnt work, Net::Stomp doesnt timeout
15:29 elb0w_ im bout to cry
15:29 elb0w_ or use Java
15:35 perlrocks Twitter: "Mojolicious 1.70 by SRI - http://metacpan.org/release/SRI/Mojolicious-1.70/" (ms) --cpan_new http://twitter.com/cpan_ne​w/status/99141473034977281
15:35 xaka left #mojo
15:37 _sri https://metacpan.org/module/Mojolicious # damn, they lost all +1s :(
15:38 perlrocks Twitter: "#metacpan losing all +1s is really unfortunate. http://t.co/7DnvOn4 #perl #mojolicious" --kraih http://twitter.com/kraih/status/99142219012907008
15:39 elb0w_ wow imagine a package so versatile it could even talk to ActiveMQ Brokers
15:39 elb0w_ that would be amazing
15:39 elb0w_ if only someone would make such a thing
15:43 perlrocks Twitter: "Is hard to grasp that the scaffolding Mojolicious initial debugging. Especially about something trivial. But because it may not yet familiar. Notice the misspelling of a name for the package, and stack trace are gorgeous Nasan to mean anything like that." (ja) --hwatattama http://twitter.com/hwatatta​ma/status/99143441161793537
15:47 xaka joined #mojo
15:55 ndiewald left #mojo
16:02 crab what is stomp?
16:02 purl stomp is, like, http://stomp.codehaus.org/ or Net::Stomp or Streaming Text Orientated Messaging Protocol
16:02 marty left #mojo
16:03 marty joined #mojo
16:07 amoore joined #mojo
16:07 elb0w_ woot
16:07 * elb0w_ is programming asynchronously
16:07 elb0w_ bout to drive my co-workers nuts with event programming
16:09 metaperl joined #mojo
16:13 marty left #mojo
16:20 marty joined #mojo
16:31 ajgb left #mojo
16:36 esskar left #mojo
16:36 _sri hmm, i think the next major release will be 2.0
16:37 _sri so much progress since 1.0
16:38 elb0w_ which one has stomp? :o
16:39 crab sri: i suppose it'll cause all sorts of "too many releases, too fast" complaints.
16:41 nickl left #mojo
16:41 _sri sleep 24966000; $mojo->release('2.0');
16:41 _sri ?
16:41 _sri :)
16:41 crab :-)
16:49 amoore left #mojo
17:03 judofyr joined #mojo
17:05 crab sri: for cron jobs that need to use the same database and logfile etc. that my mojo app uses, it's right and proper to use MyApp; $app = MyApp->new; $conf = $app->plugin(config=>...); etc, right?
17:06 _sri you could do that
17:06 _sri but there's a better way
17:06 stephan48 which one?
17:06 _sri http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#Embedding
17:08 crab hmm.
17:08 _sri my $config = $app->defaults->{config};
17:09 crab i do a lot of work in startup() that is superfluous in my cronjob, even though startup time is not really a concern (though it might be for cli utilities).
17:09 _sri startup is triggered by ->new anyway
17:09 crab oh
17:10 _sri you could use a special mode
17:10 _sri to disable heavy work on startup
17:11 crab makes sense.
17:11 purl somebody said makes sense was http://xrl.us/bjq3kq
17:11 judofyr left #mojo
17:20 tabbi joined #mojo
17:20 tabbi left #mojo
17:21 nickl joined #mojo
17:21 xaka sri, just for my information, why do you use weaken so often, especially for $self, i read about weaken but can't understand what the problem it solves in case of some peaces of mojo code
17:22 _sri xaka: google for perl and circular references
17:23 _sri can't really think of a good link atm
17:25 xaka it's something related to GC/GD (global destroy) and order of DESTROY calls, the only what i know now :)
17:27 _sri ye, it's GC related, a problem with reference counting
17:33 _sri my $a = {}; my $b = $a->{b} = {}; $b->{a} = $a;
17:33 _sri perl can't garbage collect that on its own
17:33 nickl left #mojo
17:33 _sri even if it goes out of scope the memory doesn't get free'd
17:34 spleenjack left #mojo
17:35 _sri it gets more complicated when callbacks are involved
17:38 crab how come you're _sri?
17:39 _sri crab: you've overtaken the channel
17:39 crab overtaken?
17:39 * _sri is mortal now :(
17:39 crab oh. heh.
17:40 _sri is now known as sri
17:40 sri \o/
17:40 crab when you don't have ops, you grow a tail?
17:40 sri ye :/
17:46 arthas left #mojo
17:50 arthas joined #mojo
17:57 crab hum. ->load_app() takes only a quarter of a second. i guess i'll just use it, and not bother lightweight-ing
17:59 nickl joined #mojo
18:07 crab it's nice that Mojo::Base's new never fails, so i can ->new->load_app(...)
18:08 perlrocks Twitter: "cpanminus to update #Catalyst and #Mojolicious FTW. #perl" --ssoriche http://twitter.com/ssorich​e/status/99179809971777536
18:11 ph1g joined #mojo
18:42 xaka hm, i've gotten a strange recurring behaviour. in simple test i do "$t->ua->ioloop->iowatcher->recurring(1 => sub {print time()})", then i do "$t->ua->ioloop->iowatcher->one_tick(1)" and few requests like a "hello world". It prints 1312483336 twice
18:42 xaka not 1312483336 and 1312483337, but double 1312483336
18:45 xaka without HTTP requests it shows the time only once
18:47 arthas left #mojo
18:51 xaka oh, i think i know why it happens, IOWatcher uses simple "time" which presssion is seconds, but test runs faster. Looks it should use "time" from Time::HiRes core module. I'll to change it and test how it works
18:52 xaka IOWatcher imports only usleep from Time::HiRes
18:59 sromanov joined #mojo
19:02 batman joined #mojo
19:03 batman hi
19:03 batman i'm just starting on my first mojo app and i have some questions/feedback about mojo-template
19:03 batman is it difficult to make the if/else/... less perlish?
19:04 batman like <% if $foo %>....<% else %>...<% end %> ?
19:05 xaka one more strange stuff, one_tick(1) runs 2 seconds, not 1 second, i've imported hires time and it shows 1312484627.01883 as start time and 1312484629.06597 as finish time. Without one_tick it shows very close to each other values up to 1 number after '.'
19:07 nickl left #mojo
19:22 xaka ok, nvm, i've updated to the 1.70 (i had 1.64) and problem is fixed
19:50 crab batman: maybe you should look at the TT (template toolkit) renderer plugin
19:51 batman i've looked at it, but i really like mojo-template so i don't see any reason to change back to tt...
19:51 batman (even though i'm used to tt)
19:52 batman but i just saw that i could do "% if(...) {" instead of "<% if(...) { %>" which makes it less clunky
20:02 nickl joined #mojo
20:13 tabbi joined #mojo
20:13 tabbi left #mojo
20:31 nickl left #mojo
20:42 metaperl_ joined #mojo
20:42 tempire Well.  Full time job with 58, mason, and an eventual plan to move to dancer.
20:42 tempire hmm
20:43 xaka 58? what the 58?
20:43 bosphorus joined #mojo
20:44 tempire I think maybe I've moved past the desire for full time.
20:45 tempire 5.8
20:45 Fried_ left #mojo
20:45 marcus batman: did you lookk at the blocks?
20:45 metaperl left #mojo
20:46 batman yes, but i don't see how it's related...
20:46 batman you mean <% my $block = .... ?
20:55 DaTa sri: still using textmate?
20:56 DaTa sri: as i can see, all mojolicous files end with a newline, how did you solved that problem: http://lists.macromates.com/tex​tmate/2007-November/023291.html ?
21:01 metaperl_ left #mojo
21:02 perlrocks Twitter: "Got my invitation to #Stackato from @ActiveState So one more reason to finish a test app in #Perl with #Mojolicious" --reneeb_perl http://twitter.com/reneeb_pe​rl/status/99223728226959360
21:09 marcus batman: just though maybe you could do if ($foo) begin … end else begin … end
21:09 marcus batman: not sure if it'd work...
21:10 marcus guess not, since begin just returns the subref
21:19 batman i got so many newbie questions... like: link_to('route-name', { key => 42 }) # this create "/foo/key/42" the first time and "/foo/key/42/key/42" after the first link is followed
21:19 ph1g left #mojo
21:20 batman is there something wrong with my routes or the usage of link_to() in my template?
21:20 batman and i'm guessing *wrong* is probably relative here...
21:21 batman so... what i'm trying to is to have the same template, with the link_to ... statement in it and but having /foo/key/42 generated each time the same link is clicked
21:27 sromanov left #mojo
21:28 perlrocks Twitter: "@reneeb_perl Awesome! Make sure to enter the App contest: http://bit.ly/r5w1BM #Stackato #Perl #Mojolicious" --ActiveState http://twitter.com/ActiveSta​te/status/99230212574814210
21:39 kaare left #mojo
21:50 perlite_ joined #mojo
21:54 perlite left #mojo
21:54 perlite_ is now known as perlite
22:27 bosphorus left #mojo
23:29 perlrocks Twitter: "Perhaps because of the compatibility with the Mojolicious, also loom, DBIx:: What went wrong how to implement Connector." (ja) --clicktx http://twitter.com/clicktx​/status/99260786370818049

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