Camelia, the Perl 6 bug

IRC log for #mojo, 2011-10-11

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

All times shown according to UTC.

Time Nick Message
00:00 driller_work duh, of course it works like that...
01:44 xaka joined #mojo
01:55 tempire hmm
01:55 tempire there's a rails cast about implementing stripe.
01:55 tempire hell, if those topics are fair game, there's no end to mojocast topics.
01:55 tempire makes sense, though, whatever makes it easy for people to do stuff.
01:57 PerlNinja well you did one for authentication that was pretty nice, more like that would be cool, even things like the above about serving up PDF files, maybe some things about "how to do chunked sends" .. etc.
02:29 MojoGuest461 joined #mojo
02:29 MojoGuest461 From: http://news.ycombinator.com/item?id=1277067 (23 hits)
02:42 crab what is a stripe?
02:42 purl a stripe is 2D, strip is generally 3D
02:42 MojoGuest461 hai
02:42 MojoGuest461 /whois mojoguest461
02:43 MojoGuest461 doh
02:44 hai /server
02:44 hai how do you do commands on this thing :)
02:45 crab you have to say "computer, do as i command!" and then type the command.
02:45 hai "Computar... hello, computar?"
02:45 hai "Try the keyboard..."
02:45 hai "Ahhhh... Tha keyboard..."
02:45 hai /me cracks nuckles.
02:45 hai jej.
02:49 hai can't find a decent web irc client.. well, the freenode one is decent, but it won't let you connect to efnet.
02:51 hai i wonder if you could port ircii to a chrome extension :)
02:53 tempire crab: https://stripe.com/
03:37 sri tempire: i can imagine those "closer to real world" topic might even be the most popular in the end
03:41 sri s0va: i'm not interested in problems, just solutions
03:44 tempire true enough.
03:45 tempire it will be great to get through all the basic topics, and then package up a series: 'learn web app programming in x many minutes'
03:45 tempire s/many//
04:02 MojoGuest775 joined #mojo
04:03 batman joined #mojo
04:10 metaperl is a mojolicioius book planned?
04:19 sri not that i'm aware of
04:39 tempire if oreilly sponsors a book, I got dibs on choosing the animal
04:41 tempire how did the catalyst book happen?
04:41 driller_work is there a way to change the 'this page has not been unboxed yet' template?
04:43 tempire driller_work: look at stdout or the log when the unboxed page comes up
04:46 driller_work thanks
04:47 tempire the sub links for mojolicious on google are different, but they make sense
04:48 tempire better than before
04:48 purl better than before is better than nothing I suppose.
04:50 sri all i know is that there was an offer from apress for a catalyst book
04:52 tempire so someone needs to do some smoozing, or just get lucky.
04:53 sri i know the person who got the offer had contacts
04:54 sri that was 3-4 years before the actual book happened though
04:55 tempire so, operation bookilicious:
04:56 crab tempire: the authors don't choose the animal, o'reilly does
04:56 tempire 1) expand mojolicious user base by 2^n, where n is the awesomeness of ponycorns
04:57 tempire crab: but I claimed dibs
04:57 tempire it's too late
04:57 tempire 2) get an offer
04:57 tempire 3) complain about how no one makes money writing tech books
04:57 tempire 4) profit!
04:57 sri actually, catalyst was about this size when we got the offer
04:58 tempire where there any other frameworks at the time, though?
04:58 tempire *were
04:58 sri of course
04:58 crab a mojolicious book sounds like it would become obsolete while it was being written
04:58 sri all the classics
04:58 sri mod_perl was still hot, Mason, Cgi::App, Maypole
04:59 tempire crab: I used to think that, but it's unlikely the basics will become so obsolete as to become irrelevant, I think, within the next two years.
04:59 sri crab: not like the screencasts are becoming obsolete
04:59 tempire yeah, that's my frame of reference.
04:59 crab the basics would make a very thin book
05:00 sri things that change are usually rather advanced, like switching from callbacks to events now
05:00 tempire thin, but on the order of the mongodb books
05:00 sri take a look at all the latest oreilly books
05:00 sri they have like 50 pages
05:00 crab actually, many of the problems (i've seen) people have with mojolicious are really problems with not knowing perl very well
05:00 sri sinatra book has 70 or so
05:01 * sri nods at crab, we could use more perl teachers hanging out here :)
05:02 crab i find it really annoying, though i suppose it's unkind
05:02 tempire the nature of n00bdom is annoyance.
05:03 sri only a very small minority knows perl very well
05:08 cfedde tech book sales have fallen through the floor.  We need to make programming hard again so people have to buy books.
05:09 tempire that's not the solution - the solution is to ban all the blogs
05:10 tempire and access to free information
05:10 tempire stealing our jobs and women
05:10 cfedde outlaw all technology except that which is sold by SCO!
05:10 tempire like those no good screencasts
05:11 tempire or like a wise-man once said: http://boingboing.net/2011/10/08/wipo-boss-th​e-web-would-have-been-better-if-it-was-patent​ed-and-its-users-had-to-pay-license-fees.html
05:13 GitHub192 joined #mojo
05:13 GitHub192 [mojo] kraih pushed 1 new commit to master: http://git.io/oVwHkg
05:13 GitHub192 [mojo/master] fixed small memory leak in Mojolicious - Sebastian Riedel
05:13 GitHub192 left #mojo
05:22 sri i hate fighting with weaken
05:23 sri here's an example for what events now look like btw.
05:23 sri https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/websocket_lite_app.t#L68
05:28 GitHub53 joined #mojo
05:28 GitHub53 [mojo] kraih pushed 1 new commit to master: http://git.io/vJtVOA
05:28 GitHub53 [mojo/master] better WebSocket event test - Sebastian Riedel
05:28 GitHub53 left #mojo
05:28 sri that looks better
05:57 Eugene joined #mojo
06:16 GitHub151 joined #mojo
06:16 GitHub151 [mojo] kraih pushed 1 new commit to master: http://git.io/qJ04yA
06:16 GitHub151 [mojo/master] fixed a few warnings - Sebastian Riedel
06:16 GitHub151 left #mojo
06:21 cosmincx joined #mojo
06:59 sri interesting
07:00 sri the on_finish fix recently was damn expensive
07:01 MojoGuest768 joined #mojo
07:01 MojoGuest768 From: http://news.ycombinator.com/item?id=1277067 (24 hits)
07:01 sri we could gain about 200 rps in micro benchmarks if we didn't guarantee on_finish to be emitted after the last byte has been actually written
07:03 MojoGuest768 left #mojo
07:03 MojoGuest768 joined #mojo
07:03 MojoGuest768 From: http://news.ycombinator.com/item?id=1277067 (25 hits)
07:03 MojoGuest768 left #mojo
07:04 marcus sri: Sounds like a good optimization
07:04 sri does it really?
07:05 judofyr joined #mojo
07:05 marcus sri: dunno. Guess that would mean on_finish could be called as a success even if the request failed?
07:06 sri nono, you're misunderstanding
07:06 sri on_finish always triggers anyway
07:06 sri we just giarantee that it is begin called as late as possible
07:06 sri argh
07:06 * sri needs coffee
07:06 purl Then go make some, you lazy bum.
07:07 sri :/
07:08 sri without this guarantee what could happen is that on_finish would be called after the last byte has been passed to the ioloop, but is not yet written
07:08 batman joined #mojo
07:08 Vandal joined #mojo
07:09 judofyr events are hard, let's go shopping
07:11 sri !
07:15 sri hmm
07:15 sri no tests break if i make that little optimization
07:17 sri now it gets really weird
07:17 sri even with all the callback to event changes everything becomes faster than ever before
07:21 marcus :-o
07:21 marcus This changes everything?
07:21 sri ;p
07:21 sri from 1550 to 1800 rps
07:22 sugar joined #mojo
07:22 judofyr not bad
07:23 GitHub20 joined #mojo
07:23 GitHub20 [mojo] kraih pushed 1 new commit to master: http://git.io/ACFDcw
07:23 GitHub20 [mojo/master] improved performance of all built in servers significantly - Sebastian Riedel
07:23 GitHub20 left #mojo
07:24 sri even one less line of code :D
07:28 sri not much value in the on_finish after bytes are written guarantee anyway, since we don't know how long the bytes will sit in the kernel send buffer
07:29 marcus yeah
07:29 marcus or in the proxy server in front of your web server :)
07:58 koban joined #mojo
08:01 s0va sri: i know that you're not interested in problems :)
08:01 s0va but you have one :)
08:03 s0va from what i see, there
08:03 s0va eh... i think that there is somethin with EV one_tick implementation. whatever.
08:07 sri s0va: nope, i don't
08:09 sri personally i'm not interested in magical coro modules, and if someone is i'm willing to accept patches, therefore i don't have a problem
08:26 spleenjack joined #mojo
08:37 AmeliePoulain joined #mojo
08:40 regueifa joined #mojo
08:48 MojoGuest922 joined #mojo
09:25 marcus I'm more interested in magical unicorns
09:25 marcus with unibrows
09:27 sri seconded
09:39 MojoGuest468 joined #mojo
09:39 MojoGuest468 From: http://www.google.fr/#sclient=psy-ab&h​l=fr&source=hp&q=websockets+demo&a​mp;pbx=1&oq=websockets+demo&aq=f&a​mp;aqi=g1&aql=&gs_sm=e&gs_upl=​584l4247l0l4477l15l10l0l3l3l1l206l1528l2.7.1l13l0&bav=on.2,or.r_gc.r_pw.,cf.os​b&fp=13bc1229be54d8bf&biw=1600&bih=755 (1 hits)
09:42 perlrocks Twitter: "Overview of Perl-Mojolicious / - http://t.co/9ddhYg7T http://t.co/01qpX9i4" (ja) --wPerlnews http://twitter.com/wPerlnew​s/status/123694846543265792
09:44 ysyrota joined #mojo
09:48 cosmincx joined #mojo
09:55 mcrz joined #mojo
10:28 DaniBunny joined #mojo
10:28 DaniBunny left #mojo
10:32 GitHub109 joined #mojo
10:32 GitHub109 [mojo] kraih pushed 1 new commit to master: http://git.io/xKOn2A
10:32 GitHub109 [mojo/master] replaced one_tick method in Mojo::IOWatcher with start and stop methods - Sebastian Riedel
10:32 GitHub109 left #mojo
10:33 sri that should make adding new backends easier
10:50 GitHub48 joined #mojo
10:50 GitHub48 [mojo] kraih pushed 1 new commit to master: http://git.io/UcpjMA
10:50 GitHub48 [mojo/master] improved documentation - Sebastian Riedel
10:50 GitHub48 left #mojo
11:11 cosmincx joined #mojo
11:21 fhelmber_ joined #mojo
11:21 Alias joined #mojo
11:23 judofyr sri: btw, sorry for dragging you into refcounting-debate :)
11:24 sri no problem, lets hope it helps at least
11:26 batman joined #mojo
11:32 d4rkie joined #mojo
11:45 GitHub66 joined #mojo
11:45 GitHub66 [mojo] kraih pushed 1 new commit to master: http://git.io/9Nr22Q
11:45 GitHub66 [mojo/master] better event emitter example - Sebastian Riedel
11:45 GitHub66 left #mojo
11:46 sri http://mojolicio.us/perldoc​/Mojo/EventEmitter#SYNOPSIS
11:46 sri that should be pretty clear
12:25 Vandal how can I check if there is excisted a tag on current level of Mojo::DOM?
12:44 judofyr sri: can Devel::Cycle find cycles within XS-code?
12:45 MojoGuest819 joined #mojo
12:45 MojoGuest819 From: http://www.google.de/#sclient=psy-ab&h​l=de&source=hp&q=websockets+demo&a​mp;pbx=1&oq=websockets+demo&aq=f&a​mp;aqi=g1&aql=&gs_sm=e&gs_upl=​491l3430l0l3719l15l8l0l5l5l0l196l1070l2.6l12l0&bav=on.2,or.r_gc.r_pw.,cf.osb​&fp=17de975489b73ad8&biw=1139&bih=800 (1 hits)
12:46 sri judofyr: only the perl side of it
12:47 judofyr sri: but is it possible that an XS holds a Perl variable that Devel::Cycle can't find?
12:47 sri no idea, wouldn't be surprised though
13:15 spleenjack1 joined #mojo
13:19 MojoGuest320 joined #mojo
13:19 MojoGuest320 From: http://www.google.co.uk/search?q=irc+web+socket​&ie=utf-8&oe=utf-8&aq=t&rls=org​.mozilla:en-US:unofficial&client=firefox-a (1 hits)
13:44 regueifa joined #mojo
13:58 noganex_ joined #mojo
14:10 tabbi joined #mojo
14:19 driller joined #mojo
14:31 metaperl joined #mojo
14:32 metaperl|2 joined #mojo
14:41 MojoGuest153 joined #mojo
14:41 MojoGuest153 From: http://www.google.co.uk/search?q=mirc+websocket​s&ie=utf-8&oe=utf-8&aq=t&rls=or​g.mozilla:en-US:unofficial&client=firefox-a (1 hits)
14:59 perlrocks Twitter: "A few examples for how you'll be able to use the new event api to extend #mojolicious 2.0. :) http://t.co/eJa8ghPx #perl" --kraih http://twitter.com/kraih/status/123774745845043200
15:01 MojoGuest848 joined #mojo
15:01 MojoGuest848 From: http://xantus.tumblr.com/page/2 (1 hits)
15:05 marty hmmm.  sri.  Is there a typo in the example you just posted.   It looks to me like the test for JSON should be != instead of =~
15:05 sri huh?
15:05 sri it parses the content
15:05 marty if $res->headers->content_type =~ /json/i && !defined($res->json);
15:06 marty I'm probably not getting it.  so maybe no typo
15:06 sri !defined($res->json) is the real test
15:06 marty Ahhh, ok.  sorry,. my bad
15:10 GabrielVieira joined #mojo
15:10 Akron joined #mojo
15:11 GabrielVieira Hi there, there is somehow Mojolicious::Lite outputs a content the time it's created instead of calling render? e.g. I'm processing many log files and I want to output in the page which log file is been processed in that time. in real time. Did I make myself clear? :)
15:12 Akron Vandal: Your question is a bit unspecific. If you mean: Is there a child node, you can test with ->at('*').
15:12 metaperl joined #mojo
15:19 Vandal Akron, more specific: I need to know Is there a tag <a></a> inside current block
15:20 judofyr Vandal: ->at('a') ?
15:20 Akron Vandal: Check for if ($dom->at('a')) { ... };
15:21 Vandal thank you
15:42 perlrocks Twitter: "The event api of course works just the same on the server side and can even be used in plugins. ;) http://t.co/0j67O2nb #perl #mojolicious" --kraih http://twitter.com/kraih/status/123785529916534784
15:46 perlrocks Twitter: "@kraih release early, release often is good? :D They do have a point though, I keep Mojolicious at 1.80-something on my app boxes :)" --perlninja http://twitter.com/perlninj​a/status/123786563451764737
15:47 kaare joined #mojo
15:48 xaka joined #mojo
15:48 batman joined #mojo
16:08 GitHub71 joined #mojo
16:08 GitHub71 [mojo] kraih pushed 1 new commit to master: http://git.io/HDPvUg
16:08 GitHub71 [mojo/master] fixed transaction builder - Sebastian Riedel
16:08 GitHub71 left #mojo
16:15 sromanov joined #mojo
16:16 Foxcool joined #mojo
16:20 marcus sri: you wrote https://metacpan.org/module/DBIx::Migration?
16:20 grim_fandango joined #mojo
16:21 sri a very very very long time ago
16:23 marcus sri: does it work ? :)
16:24 * sri shakes the magic 8 ball
16:24 marcus Prospect looks bleak
16:24 sri "Outlook not so good"
16:24 purl "Outlook not so good" is probably one of dngnand's favorite TPJ covers.
16:25 marcus Most likely.
16:25 purl I doubt it
16:26 marcus hmm, maybe https://metacpan.org/module/migraine, it's maintained by Opera :)
16:26 marcus too bad it's YAML
16:28 marcus cosimo: y u no use config::any ? :)
16:30 marcus interesting, it doesn't have a changes file, and last updated in 2009. Maybe better to use sri's after all
16:31 sri heh, it's not mine
16:32 sri back then it was just a fun idea, i never really used it and gave it away soon after the first release
16:32 marcus drolsky has one too - https://metacpan.org/module/Pg::DatabaseManager
16:32 crab marcus: how can i set per-session expires?
16:32 marcus crab: You can set expires in the session, can't you?
16:33 marcus sri: Back me up on this one :)
16:33 * sri backs marcus up
16:33 marcus http://mojolicio.us/perldoc/Mojoli​cious/Guides/Growing#State_keeping
16:33 marcus is the only place I've found it documented, strangely.
16:34 crab you mean $self->session(expires => 1) means "expires in 1 second"?
16:34 marcus sri: Might want to mention this under default expiration in ::Sessions
16:34 marcus crab: yup
16:34 crab !
16:34 sri it doesn't even have tests as far as i can see
16:34 sri so it doesn't exist as far as i'm concerned
16:34 crab that's pretty undocumented.
16:35 marcus sri: you've documented it in the growing guide tho :)
16:35 marcus documentation > tests with regards to feature existence, imo
16:35 sri that's only 50% of the requirement for being a feature ;p
16:35 sri documentation + test or it's not a feature
16:35 marcus sri: there's no way an end user will check for tests to see if a user exists..
16:36 marcus if a feature...
16:36 sri documentation can have bugs too
16:36 sri heck, if i would be bound by documentation i would just stop writing
16:37 crab marcus: it's very unclear to me how to use it, there's nothing to say whether "1" is the "time in the past", or a delta, or what
16:37 crab i'd have to read the code, and that's... umm, very scary
16:37 marcus sri: sure, but if a feature works and it's documented, it's fair for a user to expect that to exist, and to be deprecated in a normal fashion
16:38 marcus (if it is to be removed)
16:38 sri marcus: i very much disagree
16:38 marcus :o
16:38 crab in fact i always thought of setting expires => 1 in the session to be a flag
16:38 marcus sri: You can't expect end users to check your test suite before using features!
16:38 marcus that's draconian
16:39 sri i sometimes write documentation when i'm designing something, to get a feel for it
16:39 marcus sri: so put 'experimental' in there
16:39 crab sri: so because you didn't write tests for ->session(expires => 1), you would feel it ok to change that behaviour even though the guides show that as the way to implement logout?
16:39 marcus and it's all fair game
16:39 sri and parts might get forgotten
16:39 sri crab: yes i would
16:39 * marcus thinks sri needs to take his meds
16:39 crab scary
16:40 sri everything without tests is fair game
16:40 marcus very scary
16:41 sri make it less scary and contribute tests ;)
16:41 marcus eh that doesn't make that policy less scary
16:41 marcus http://mojolicio.us/perldoc/Mojoli​cious/Guides/Growing#State_keeping
16:41 marcus typo btw
16:42 crab lib/Mojo/Cookie/Response.pm:  $self->{expires} = Mojo::Date->new($self->{expires})
16:42 crab marcus: looks like it's not a delta then
16:42 marcus crab: looks like it's an epoch
16:42 crab it's 1, interpreted as seconds since epoch, so it's a "time in the past"
16:42 crab yeah
16:42 sri marcus: without this policy i know i would mostly stop documenting
16:44 marcus sri: will make it hard for people to use your new features I suppose :p
16:44 sri i consider that a good thing
16:45 * marcus is upgrading his ios devices to ios5 GM today
16:46 crab sri: is there anything in mojo already that parses things like '+10s'?
16:46 marcus interesting that default_expiration is relative to now, while expires is relative to 1970
16:46 sri crab: no
16:46 crab marcus; indeed
16:47 crab i found out one of the reasons why some browsers reject my cookies
16:47 sri see, it doesn't even work right
16:47 marcus crab: you can calculate epoch using Mojo::Date tho
16:47 sri expires should work like default_...
16:47 crab the systems in question have the right time set, but in a wildly wrong timezone, so they think the cookie (with the default expiration time of 1 hour that i set) had already expired long ago.
16:48 sri umm
16:48 sri only valid timezone is gmt
16:48 marcus sri: I know I have an app that depends on this, since you pointed me at these docs the last time.
16:48 crab currently to work around this i have changed my default expiration to 24hrs, but that's suboptimal. i'd rather detect the problem and increase the expiry time for that session alone
16:48 marcus I was thinking of that. We should get rid of all timezones but GMT.
16:48 sri marcus: it can't stay the same, inconsistent
16:49 crab sri: if the system has the time set in the wrong zone, then its idea of what the gmt time is now is also wrong
16:49 sri epoch argument needs to be seconds from now
16:49 marcus sri: I honestly agree that's better
16:50 crab the cookie itself uses GMT, but the browser interprets it wrong
16:50 crab and just discards the cookie
16:50 marcus sri: there are tests tho
16:50 marcus 2144:% $self->session(expires => 1) if $headers->header('X-Flash2');
16:50 marcus :p
16:51 crab (or did you mean "only valid timezone is gmt" as a general philosophical statement, like erik naggum? :-)
16:53 D4RK-PH0ENiX joined #mojo
16:53 crab i feel an urgent desire to store a persistent state variable named expires"
16:57 sri marcus: :S
16:58 crab sri/marcus: i don't necessarily agree with you about that
16:58 crab the default is a default expiration _period_. it makes no sense for it to be an epoch time.
16:58 crab whereas it may make sense to want to set a specific expiration _time_ for a single session.
16:59 marcus I suggest adding another key to set relative
16:59 marcus session(expiration=>6400)
16:59 sri crab: it's an expiration date
16:59 marcus and let expires be absolute value still
16:59 sri crab: relevant spec http://curl.haxx.se/rfc/cookie_spec.html
17:00 crab either another key, like expires_in or expires_after, or accept expires => "${num}s" as a delta instead of a time
17:01 crab sri: yes, but if you're saying that to disagree with me, then you've understood me as saying something i didn't mean to
17:01 crab what i mean is that the argument to default_expiration() must be an interval, not an absolute time
17:02 crab while it makes sense to set the "expires" value of a cookie either using an absolute time or a delta
17:02 * sri doesn't follow
17:02 crab <sri> marcus: it can't stay the same, inconsistent
17:02 crab what did you mean there?
17:02 sri doesn't matter anymore, it has tests
17:03 crab i read it to mean that you think ->session(expires => 1) should be interpreted as "in 1s from now" rather than "at t=1s"
17:03 sri that's what i meant
17:04 sri i would be in favor of deprecating expires for expiration, which would be relative
17:04 crab what i was trying to say is that there is no inconsistency.
17:04 sri due to the name difference?
17:05 sri ok, now i get it :)
17:05 crab no, because default_expiration() sets a period. it doesn't make ANY sense for it to be an absolute epoch time. but the expires flag can meaningfully be... ah
17:05 crab yeah, good.
17:06 sri actually
17:06 sri i think there's a reason
17:06 crab sri: why deprecate? just add expiration (though i'd think expires_after personally, that's hardly worth arguing about)
17:06 sri we let expires roundtrip to keep the expiration date the same
17:06 * sri scratches head
17:07 crab not sure i understand. we keep extending the expiration date on every request, right?
17:07 * sri looks
17:07 crab expires => 1 is a (very) special case
17:08 sri yes we do
17:09 sri it's even documented ;p
17:12 crab so what do you think we should do?
17:13 crab i can achieve everything i want by finding the current epoch time, adding 24*86400 to it, and setting that as the expires value for a given session (and letting that be extended by the default_expiration() on each request)
17:13 sri it's tested and documented, so it stays as a feature
17:14 tabbi left #mojo
17:14 sri how we should improve it i'm not sure either
17:14 crab sri: fine. what we can do is add a way to specify relative expires.
17:14 sri i'll start with a note for the default_expiration attribute
17:14 crab but i'd suggest we wait until more than one person (me, so far) needs to do it and complains
17:14 crab before doing anything about that
17:15 sri more documentation should be step 1 imo
17:16 crab yes. it would be good to explain explicitly that expires => 1 is interpreted as a date spec.
17:16 crab i can't believe i didn't realise that all this time.
17:17 crab (i never really thought about it, just glossed over it as a flag)
17:18 sri i also don't think it's inconsistent anymore
17:18 sri would time - 1 be a better example?
17:19 crab sri: it would explain more, but in practice it would not work as well
17:19 crab because clock skew between client and server of >1s can be assumed to be the usual case
17:20 crab and the intent of setting expires => 1 is to make the session go away, bang. does that make sense?
17:20 sri right
17:21 crab i think one example somewhere that shows expires => time+86400 or so would be sufficient
17:28 diegok sri: 2.0 works perfect on my pre-events code and also works using the new event api -> https://gist.github.com/1274441
17:29 sri diegok: great :)
17:31 d4rkie joined #mojo
17:32 GitHub19 joined #mojo
17:32 GitHub19 [mojo] kraih pushed 1 new commit to master: http://git.io/-bCMQw
17:32 GitHub19 [mojo/master] improved session documentation - Sebastian Riedel
17:32 GitHub19 left #mojo
17:32 crab diegok: that is a neat little piece of code
17:32 sri crab: that should cover it
17:32 crab diegok: i'll remember it for sometime when i need it
17:33 crab it's lovely how straightforward some of these things are to do with mojo
17:33 marcus sri: looks good
17:34 crab looks fine (but note that expires => "Sun, 06 Nov 2012 08:49:37 GMT" would also work ;-)
17:34 sri wait
17:34 sri wasn't there a typo?
17:35 Vandal I want render template in to file. Is it possible by standard features?
17:35 crab (i don't think there's a burning need to mention that in documentation though ;-)
17:35 crab sri: marcus saw a typo, i didn't
17:35 crab vandal: vandal: ->render_partial and print to a filehandle
17:36 crab oops, one too many vandals.
17:36 Vandal crab, wich part of is it?
17:36 Vandal crab, wich part of man is it?
17:36 sri marcus: i don't see a typo
17:37 crab Vandal: Mojolicious::Guides::Rendering, search for "partial
17:37 crab Vandal: it just returns the rendered template output as a string, which you can then write to a file or whatever.
17:38 Vandal crab, oh, I've miss that. Thank you.
17:39 crab you're welcome.
17:39 sri i think i decided to use epoch seconds for expires because deleting a session would be more common than a custom value
17:40 * sri should write this stuff down
17:42 sri really not a fan of the whole +1m thing btw.
17:46 crab agreed. i was just enumerating possibilities.
17:46 crab and agreed about the common use case too.
17:47 sri https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/upload_stream_lite_app.t # crazy event example
17:47 sri that one double dispatches
17:47 noganex joined #mojo
17:47 marcus sri: two upper case letters?
17:48 sri once after the headers and another time after the body has arrived
17:48 sri marcus: ?
17:48 marcus http://nordaaker.com/docs/skitch/Mojolicious__​Guides__Growing_-_Growing-20111011-184138.jpg
17:48 sri hehe
17:49 sri intentional
17:49 sri REST
17:49 marcus aha
17:49 marcus a bit dense today :)
17:49 * crab struggles to understand $example
17:50 sri mojolicious dispatching is now an event named "request"
17:50 crab ah. now i get it.
17:50 sri it's rather crazy
17:51 crab sri: does the hook emitting the event suppress the normal dispatching?
17:51 sri nope
17:51 sri second dispatching is normal
17:52 sri but if your response object has a response code it will of course skip the dispatchers
17:53 sri it's insane how powerful those events are :)
17:57 perlrocks Twitter: "Here's another cool event api example by @freekey. http://t.co/WPbMSgtA #perl #mojolicious" --kraih http://twitter.com/kraih/status/123819477879111680
17:59 sri diegok: btw. you might want to set $tx->res->content->auto_upgrade(0);
17:59 sri it prevents automatic multipart parsing
17:59 sri (also new)
18:00 sri not as important on the client side, but still :)
18:02 sri only use case would be multipart xhr i guess
18:02 crab if there's an unparsed multipart response with one gzip-encoded part, the g-de-ziper will do the wrong thing, won't it?
18:02 sri yes
18:02 diegok crab: I'm using it, but it doesn't support multipart responses and will slurp long responses into memory :-)
18:02 sri multipart is a collection of single content objects
18:02 xaka mojo boss, what do you think about raising an exception when somebody tries to access to req->json, but request is GET or doesn't contain json data (post form, ...)?
18:03 crab xaka: but if ($r->json) { ... } is nice.
18:04 sri you also have to consider wrong content types
18:04 sri main use case are quick hacks
18:04 sri if you're serious you'd have your own instance and check the actual error message
18:04 crab yeah
18:05 xaka yeah, i dont mind to do it, but i need common solution, i mean i dont want to do the same checks in every method. I'd like to override "json" method or like this
18:08 sri make a helper?
18:08 xaka like "ugly_json"? req->ugly_json? hm...it' idea
18:09 crab what's so ugly about it?
18:10 crab (but it wouldn't be req->, it would be just ugly_json if you made it a helper)
18:11 sri oh, io5 day is today!
18:11 * sri completely missed it
18:18 marcus sri: it's not in itunes yet it seems
18:18 marcus I installed from the GM
18:19 omega tomorrow
18:19 purl o/~ the sun will come out.. tomorrow.. o/~ or the National Day of Slayer, and the National Emo Kid Beatdown day, by http://www.nationaldayofslayer.org/ and http://community.livejourna​l.com/wtf_inc/2805832.html or tomorrow and tomorrow and tomorrow creeps in this petty pace or mañana or free for all or another day or the name of the pitcher
18:19 omega ios5 that is
18:19 omega itunes 10.5 today
18:19 omega or so I've heard
18:21 tempire regarding https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/upload_stream_lite_app.t...
18:21 tempire the emitted event 'request'…does it change the behavior of the example at all?
18:22 diegok sri: but setting auto_upgrade(1) it will still fail, right?
18:22 * diegok never saw/used multipart responses
18:22 sri tempire: what doesn't change the behavior? :)
18:23 sri it triggers a second dispatch cycle
18:23 tempire oh, so /upload is called twice on one request?
18:25 tempire yes, it seems so.
18:25 tempire interesting
18:26 sri first time right before the content arrives
18:26 sri it's real upload streaming, without buffering the whole content
18:27 tempire ah right, because after_build_tx is before /upload.
18:27 sri you could upload directly into a database for example
18:27 * tempire bonks himself on the head
18:27 tempire that is super neat
18:28 tempire would make progress bars easy too
18:28 sri super easy, i have a test for those too :)
18:29 crab i was JUST thinking that you could use this to implement a progress indicator
18:29 sri https://github.com/kraih/mojo/blob/mast​er/t/mojolicious/upload_lite_app.t#L21
18:29 tempire I'm pretty sure I saw that test yesterday
18:29 tempire yeah
18:29 sri older example
18:33 Eugene joined #mojo
18:35 sromanov joined #mojo
18:38 andrefs joined #mojo
18:51 amoore joined #mojo
18:58 rhaen redis is just awesome for some things.
18:58 rhaen really. cool and fast
18:58 rhaen but would you like to store 30gb of image files in it?
19:01 sri redis is basically a global namespace for data structures shared between multiple servers
19:01 sri not a real database
19:01 sromanov joined #mojo
19:02 rhaen yes, and that might be pretty awesome in terms of speed
19:06 rhaen is that mojox driver still usable?
19:18 batman joined #mojo
19:29 trone_ joined #mojo
19:32 mike_ joined #mojo
19:55 batman joined #mojo
19:58 batman left #mojo
20:05 sri marcus: btw. "it's not a feature without a test and documentation" has always been in there http://mojolicio.us/perldoc/Mojolic​ious/Guides/CodingGuidelines#RULES
20:10 batman joined #mojo
20:11 sri damn, this season of dexter is boring
20:23 sri i would be really surprised though if something in the guides wouldn't have tests, considering how crazy about TDD i've become :)
20:24 sugar joined #mojo
20:41 abra joined #mojo
20:55 sri i love those new events, wonder which ones to add next :)
20:57 sri kinda would like to move the body event from content to message layer
20:59 sri it should become the most commonly used one
20:59 batman joined #mojo
21:01 sri another question is if ->on_* methods should be deprecated in favor of using ->on exclusively
21:14 GitHub167 joined #mojo
21:14 GitHub167 [mojo] kraih pushed 1 new commit to master: http://git.io/BaZK8g
21:14 GitHub167 [mojo/master] added experimental on_body method to Mojo::Message - Sebastian Riedel
21:14 GitHub167 left #mojo
21:15 sri not the most pretty solution, but necessary imo
21:18 GitHub80 joined #mojo
21:18 GitHub80 [mojo] kraih pushed 1 new commit to master: http://git.io/evjI6A
21:18 GitHub80 [mojo/master] mark body events as experimental - Sebastian Riedel
21:18 GitHub80 left #mojo
21:26 andrefs joined #mojo
21:40 perlite joined #mojo
21:56 jmmills sri, is that a commit relating to the streaming upload stuff we chatted about a while ago?
21:56 jmmills the on_body stuff?
21:56 sri jmmills: it's a lot more than that
21:57 sri https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/upload_stream_lite_app.t
21:57 sri here's a streaming upload example though
22:07 sri argh, with the last two commits i screwed up
22:07 jmmills sri, okay so lemme see if I'm getting this right, the body even takes a code ref and runs that as the body is being read from stream
22:07 jmmills I'
22:08 jmmills I'm not sure exactly what the on_body stuff in after_build_tx is doing
22:08 sri ok, then better stay away from all this for now
22:08 sri it's experimental and might explode unless you know exactly what you're doing
22:09 jmmills yeah, I don't know mojo guts that well yet
22:10 jmmills but I'm still curious about doing a mogilefs/gridfs front end example
22:24 jwang joined #mojo
22:34 GitHub115 joined #mojo
22:34 GitHub115 [mojo] kraih pushed 1 new commit to master: http://git.io/6C0gvA
22:34 GitHub115 [mojo/master] removed on_body method from Mojo::Message again - Sebastian Riedel
22:34 GitHub115 left #mojo
22:35 sri no more proxy events
22:36 GitHub23 joined #mojo
22:36 GitHub23 [mojo] kraih pushed 1 new commit to master: http://git.io/upw8xA
22:36 GitHub23 [mojo/master] fixed typo - Sebastian Riedel
22:36 GitHub23 left #mojo
22:38 jmmills sri, what bot are you using for github btw?
22:38 sri it's just github
22:40 jmmills sorry, the github bot
22:41 jmmills i.e. notifications of commits
22:42 sri yes,github does that
22:42 jmmills ah, heh
22:48 metaperl joined #mojo
22:56 perlrocks Twitter: "MCPC] [Mojolicious:: Lite is to move together and I AnyEvent putting the EV: In short, MCPC: Google Chrome Web ... http://t.co/xtl4TC8z" (ja) --yorozu_yaji http://twitter.com/yorozu_ya​ji/status/123894667954765825
23:05 jmmills I'm thinking I might write a new perl irc bot and embed mojo in it
23:06 jmmills I want something to replace work$ nagios notification/utility bot that's written in perl rather than ruby
23:06 jmmills and a web interface to control/access it
23:31 metaperl i got approved for activestate stackato
23:32 metaperl will investigate some time later, like a year from now... over and out

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