Camelia, the Perl 6 bug

IRC log for #mojo, 2011-12-02

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

All times shown according to UTC.

Time Nick Message
00:05 xaka oh, it's all about keep alive and user agent cache. Is there any way to disable keep alive temporarly?
00:13 j3nnn1 joined #mojo
00:24 gshank joined #mojo
00:36 ilbot2 joined #mojo
00:36 Topic for #mojo is now Mojolicious real-time web framework ♥ http://mojolicio.ushttp://irclog.perlgeek.de/mojo/todayhttp://dev.xantus.org
00:37 foomator joined #mojo
00:40 smpb joined #mojo
02:01 j3nnn1 joined #mojo
03:19 gshank joined #mojo
03:40 xaka joined #mojo
04:34 gshank joined #mojo
06:19 elb0w_ joined #mojo
06:19 Vandal joined #mojo
06:32 elb0w_ joined #mojo
06:35 koban joined #mojo
07:56 sugar joined #mojo
07:58 cosmincx joined #mojo
08:00 anaio joined #mojo
08:02 [1]alnewkirk joined #mojo
08:11 ysyrota joined #mojo
08:12 ysyrota morning
08:34 ysyrota how to pass parameters via Mojo::Test->put_ok() ? put_ok("/prices", { id => 3}) doesn't work...
08:37 ysyrota put_ok("/prices", "id=3") doesn't work too
08:39 smpb joined #mojo
08:46 batman joined #mojo
08:47 marcus good morning
08:47 purl For you maybe.
08:47 marcus hi ysyrota
08:48 ysyrota marcus: hi
08:48 marcus ysyrota: don't think you can do form posting with put
08:49 berov joined #mojo
08:50 marcus ysyrota: {id=>3} would set a header id:3 afaict
08:51 sri morning
08:51 marcus hej sr
08:51 marcus i
08:52 sri senior marcus
08:52 ysyrota shouldn't PUT allow to pass parameters in the message body?
08:52 marcus ysyrota: guess you would have to make a tx manually
08:59 ysyrota sri: would you like to add a method like Test::Mojo::put_form_ok() ?
09:00 sri ysyrota: no
09:00 ysyrota sri: it seems that workaround will be too complex
09:09 tempire ysyrota: for tests, just do a $t->ua->put, and examine the resulting txn
09:18 baton8 joined #mojo
09:44 Quai so, when I use Mojo::UA, and I allow for redirects, how can I find the last url the UA got?
09:46 stephan48 sri: thanks for forcing me to use perlbrew..
09:46 stephan48 debian lenny only 5.10.0
09:49 crab perlbrew is nice.
09:51 MojoGuest425 joined #mojo
09:51 MojoGuest425 From: http://news.ycombinator.com/item?id=1277067 (165 hits)
09:51 Quai (doh, $tx->rew->url)
09:51 Quai s/w/q/
09:54 ysyrota tempire: actually, the issue isn't in Test::Mojo->put_ok() but in UsearAgent->put(). put() doesn't allow to pass parameters
10:01 Andrei666 joined #mojo
10:07 j3nnn1 joined #mojo
10:15 sri stephan48: sure thing
10:19 tholen joined #mojo
10:22 judofyr joined #mojo
10:22 judofyr sri: why did url_escape change? :/
10:23 crab when and how did it change?
10:23 judofyr before it changed the string in-place
10:24 judofyr now it returns a new string
10:24 tempire ysyrota: you can probably use ua->build_tx
10:24 judofyr https://github.com/kraih/mojo/commit/e3​a6590f8f9fa305a6c3348f02fcadf70aaf378b
10:25 tempire delete, get, head, post, and put are all wrappers for build_tx
10:25 judofyr well, it was an EXPERIMENTAL module after all…
10:25 stephan48 crab: so howto make perlbrew use a specific perl only for one application?
10:26 tempire ysyrota: yeah, that should work.  it calls UserAgent::Transactor->tx, which assigns a body if it's there
10:26 crab i've never needed to do that, sorry.
10:27 * tempire glitters
10:27 spleenjack joined #mojo
10:28 Foxcool joined #mojo
10:40 sri judofyr: yes it did change
10:40 sri pretty much every function in that module changed
10:41 random joined #mojo
10:42 judofyr sri: I'm having an encoding problem, and I'm not 100% how encodings and shit work in Perl. I get data in JSON (UTF-8) that includes "Ø", however, after it's been passing through Mojo::JSON, then url_escape($thing) returns %D8 for "Ø"
10:42 judofyr while it should be a two-byte thingie
10:42 judofyr (because that's how Ø is represented in UTF-8)
10:43 judofyr if I unpack "C*" the response, I see that the Ø is encoded as (195, 152)
10:43 sri judofyr: maybe talk to marcus about it, perl unicode is an isanely huge topic
10:43 judofyr when I unpack "C*" the parsed thing, it returns 216
10:44 judofyr I'm not quite sure what's the "correct" representation should be
10:46 sri it's bytes vs chars, i really hate the topic
10:47 judofyr sri: can two strings have the same chars, but different bytes?
10:49 sri perl has great unicode support, maybe the best of all languages, but the topic is insane… tchrists summary is very good http://stackoverflow.com/a/6163129
10:50 judofyr sri: just wondering where my problem is: wrong encoding on the input JSON, Mojo::JSON creates strings with wrong encodings, or url_escape doesn't escape correctly
10:50 sri i don't know, and am not very keen on digging, sorry
10:50 judofyr k
10:52 sri but don't assume mojolicious does something wrong, our tests for this kind of stuff are very good
10:54 sri most common mistake is to pass something bytes when you want to pass chars
10:54 * sri goes to get waffles
10:56 foomator waffles rocks :)
10:57 marcus judofyr: http://98.245.80.27/tcpc/OSCON2011/index.html
10:59 sri unicode is hard, lets go shopping!
11:04 judofyr sri: is it intended that url_escape only works on bytes? e.g. url_escape("☃") returns "%2603"?
11:04 judofyr (because it's U+2603)
11:05 judofyr maybe it *must* work on bytes…
11:08 ysyrota sri: how to pass pass parameters in body using UserAgent->put() ?
11:15 crab ysyrota: PUT is not supposed to be used for paramters, it's supposed to have some entity
11:16 crab you're responsible for putting the entity body together
11:31 batman joined #mojo
11:33 ispy_ joined #mojo
11:35 mojobot28426 joined #mojo
11:39 kjeldahl joined #mojo
11:44 vervain joined #mojo
11:54 spleenjack1 joined #mojo
12:13 Psyche^ joined #mojo
12:32 cosimo joined #mojo
12:38 AmeliePoulain joined #mojo
13:00 noganex_ joined #mojo
13:17 elb0w sri: UserAgent takes HTTP::Request / Response?
13:21 j3nnn1 joined #mojo
13:31 batman joined #mojo
13:44 dch joined #mojo
13:57 jnap joined #mojo
14:06 batman joined #mojo
14:19 AmeliePoulain joined #mojo
14:33 koban left #mojo
14:37 metaperl joined #mojo
15:10 amoore joined #mojo
15:11 KayT3 joined #mojo
15:15 j3nnn1 joined #mojo
15:30 KayT3 joined #mojo
15:56 Andrei666 joined #mojo
15:57 Andrei666 hey guys...(and girls)
15:58 Andrei666 I have multiple controllers and actions
15:58 Andrei666 and in each actions I have variables with the same name....like $foo....but with different values in each action...
15:59 Andrei666 and I pass each controller's stash to a singleton
16:00 Andrei666 the thing is...when I render all those actions.. the I see the last value of $foo variable...instead of seeing different values..
16:00 Andrei666 could somebody...guide me...a little..
16:00 rwstauner joined #mojo
16:01 rwstauner i'm trying to use EventSource like sri's 2 blog posts, but i'm getting a 404 b/c my template is not found... do i need to add a render() call or something?
16:17 sri wonder if there is something wrong with perl 5.12.4 http://www.cpantesters.org/cpan/report​/53c86066-1c55-11e1-ad6f-a4df21bd1ff8
16:18 rwstauner i recently tried 5.15.5 and a bunch of stuff failed
16:18 sri dev releases are irrelevant
16:18 rwstauner i suppose
16:19 rwstauner i'm using 5.14.2
16:21 sri same
16:26 stephan48 i got a 5.12.4 on a deb lenny with perlbrew
16:26 stephan48 installing mojo worked
16:31 osprey_ left #mojo
16:31 osprey_ joined #mojo
16:36 crab dev releases are irrelevant?
16:41 rwstauner do i need to do something to initialize Mojo::IOLoop, or are the examples in those blog posts enough?
16:41 rwstauner i think my loop isn't running
16:41 sri crab: perl dev releases
16:43 crab are irrelevant?
16:50 vervain crab: Of course they are not irrelevant to everyone/all cases... but to evaluate the functionality of modules / tests they are.
16:52 vervain Well... even that's not strictly true... but... when testing against a dev release of perl don't be surprised with things go tits up... is what I think sri was getting at.
16:52 sri it is
16:57 vervain I'm still monkeying around with Lite and making demos...
16:58 vervain When I try to upload a file that is too big I get a connection reset error... how can I trap this kind of thing and do something better?
17:00 grim_fandango joined #mojo
17:17 kaare joined #mojo
17:21 rwstauner can i use Mojo::IOLoop when running under plackup?
17:21 sri no
17:21 rwstauner foo
17:21 purl bar
17:22 sri Mojo::IOLoop is a server feature, not framework
17:22 rwstauner ok, makes sense
17:22 purl i heard makes sense was http://xrl.us/bjq3kq
17:23 rwstauner so to use mojo::ioloop should i be running a reverse proxy to hypnotoad?
17:23 sri that's a common setup
17:23 rwstauner ok, thanks.  i'll have to give that a try
17:24 rwstauner nuts, then i'll lose my middleware
17:24 rwstauner hmm
17:36 simengangstad joined #mojo
17:38 kthakore Hello is using PGP 2-way (server v.s. client) and saving the client's private key in cookies (will be encrypted with username, so their password will decrypt on their machine) ... a viable way to have PGP logins?
17:55 kthakore Hello ... how does the x509 work in the IO::Loop::TLS for mojolicious?
17:55 kthakore I would like to use it encrypt user data in the database
17:55 kthakore where the client has a key on their machine
18:08 tempire elb0w: ::useragent has nothing to do with http::request/response modules
18:10 tempire vervain: http://mojolicio.us/perldoc/M​ojolicious/Lite#File_uploads
18:10 tempire note the env variable
18:16 dch joined #mojo
18:18 sri http://groups.google.com/group/mojolicio​us/browse_thread/thread/20354dfa86f20a33 # not sure if i should answer with a link to the FAQ answer for reporting bugs or just stay silent
18:19 sri little scary how often i tend towards staying silent these days… maybe i'm getting old :(
18:24 smpb joined #mojo
18:33 * sri goes to do stuff old people do
18:38 sri tempire: Y U STEALIN MAH THUNDER!?
18:39 * tempire tips his sheriff hat
18:40 tempire IM IN UR MAILS, KEEPIN PEACE
18:40 vervain @tempire: Exactly... and if you upload a file that is too big to that code the connection just drops... I'd like to provide a "it didn't work" message back to the client.
18:47 sri vervain: it's supposed to just work like that
18:47 sri untested as far as i can see though
18:48 sri never found a way to test it reliable
18:50 sri it's one of those "you give me a unit test and i'll make it work" cases
18:51 sri portability is a nightmare though, since chunk sizes and timing vary a lot
18:53 sri tests are hard, lets go shopping!
18:54 gshank joined #mojo
18:54 mire joined #mojo
18:58 sri or actually
18:58 sri a simple case is actually tested
18:59 sri https://github.com/kraih/mojo/blob/m​aster/t/mojolicious/lite_app.t#L946
19:01 sri chances are you just messed up somewhere, but my offer about the test case still stands if there's a bug
19:01 jnap_ joined #mojo
19:05 sri dropped connection usually just happens after a full response has been sent or the inactivity timeout triggers
19:06 sri which is now 15 seconds by default
19:10 sri wonder if the hypnotoad default heartbeat timeout should be increased a little
19:11 sri 5 seconds might be too small
19:13 amoore joined #mojo
19:15 sri it means a blocking operation that takes longer than 10 seconds kills the worker process
19:17 sri not sure what's better, 10 or 20 seconds
19:18 GitHub149 joined #mojo
19:18 GitHub149 [mojo] kraih pushed 1 new commit to master: http://git.io/ZVtfsA
19:18 GitHub149 [mojo/master] changed default heartbeat timeout of Hypnotoad from 5 to 15 seconds - Sebastian Riedel
19:18 GitHub149 left #mojo
19:18 sri we'll see
19:46 xaka joined #mojo
19:50 sri 15 seconds for connection inactivity and 20 seconds for dead worker does sound sensible imo
19:51 sri hmm
19:52 sri on the other hand, which sensible web app would ever block for 10 seconds
19:53 tinx Thumbnail creation on 5MB raw pics.
19:53 sri use a background worker
19:53 tinx Something that uses whois servers?
19:53 sri or ajax
19:54 sri 10 seconds is pretty much always unacceptable
19:54 amoore joined #mojo
19:54 tinx It's rarely useful :)
19:57 GitHub35 joined #mojo
19:57 GitHub35 [mojo] kraih pushed 1 new commit to master: http://git.io/8T7rrw
19:57 GitHub35 [mojo/master] changed heartbeat timeout back to 5 seconds - Sebastian Riedel
19:57 GitHub35 left #mojo
19:57 sri this is strictly about sensible defaults
19:57 sri it's all of course configurable
19:58 tinx I think the slowest we see at work are forum full text searches.  They can take forever before they send back anything.
20:00 vervain Oh... I see now that when you upload a file bigger than MAX_MESSAGE_SIZE it returns a 413... which Chrome and FF don't treat very delicately at all.
20:01 MojoGuest447 joined #mojo
20:01 MojoGuest447 From: http://www.google.com/url?sa=t&rct=j&q=&a​mp;esrc=s&source=web&cd=4&ved=0CDcQFj​AD&url=http%3A%2F%2Fdev.xantus.org%2F&ei=​TC7ZTpjEF4WvsQLJo5X2DQ&usg=AFQjCNGw6nZv0wO42u​zUnHhWcD0vcKNULg&sig2=EXwzb8TFb5WCwvFUAts_iw (1 hits)
20:04 jnap joined #mojo
20:26 andrefs joined #mojo
20:42 vervain spelling error in comment http://pastebin.com/8R4qdKEr
20:48 Foxcool joined #mojo
21:15 kthakore j/win 2
21:17 [R] joined #mojo
21:18 elb0w_ joined #mojo
21:18 jmmills_ joined #mojo
21:18 mateu joined #mojo
21:19 ereslibre_laptop joined #mojo
21:19 dmn001 joined #mojo
21:19 vervain joined #mojo
21:21 j3nnn1 joined #mojo
21:26 spacebat joined #mojo
22:44 andrefs joined #mojo
22:52 d4rkie joined #mojo
22:55 heytrav joined #mojo
23:02 GitHub111 joined #mojo
23:02 GitHub111 [mojo] kraih pushed 1 new commit to master: http://git.io/ucmpEQ
23:02 GitHub111 [mojo/master] fixed typo - Sebastian Riedel
23:02 GitHub111 left #mojo
23:06 vervain Can anyone recommend reading I can do to better understand this 413 error?
23:07 sri what's there to understand?
23:07 vervain I can catch it by looking at $self->req->error but only if the file is withing a certain amount bigger than MAX_MESSAGE_SIZE... otherwise my browser shows it's internal error screen.
23:07 vervain But curl always acts the same. <shrug>
23:07 japhb joined #mojo
23:07 * sri doesn't follow
23:08 vervain Obviously you can't have a default browser error page every time this happens... I want to do something just like I do for exceptions/500s
23:09 sri return $self->render('limit_exceeded', status => 200) if $self->req->is_limit_exceeded;?
23:10 vervain Lemmie play... I _thought_ that I had tried is_limit_exceeded... maybe I just didn't do it right.
23:11 sri has like a dozen tests, pretty sure it works
23:11 vervain Setting status to 200 is definitely something I wasn't doing... hadn't thought of that.
23:11 vervain Ya - I've been reviewing the tests... there's some really good recipes in there for sure.
23:12 vervain On these 413 errors the log has some number of these: [Fri Dec  2 17:03:04 2011] [debug] GET / (Anonymojo).
23:13 vervain And hte number of those (per POST) seems to vary depending on the browser.  Can you point me in the right direction to learn more about that?
23:13 sri leftover garbage from the connection, harmless
23:13 vervain Oh - and the anonymojo is followed by 'nothing rendered'... 'assuming delayed'
23:14 vervain Oh ok.
23:14 sri feel free to send patches for handling it more gracefully, but it's absolutely harmless
23:15 vervain I'm quite happy to ignore it and move on ;-)
23:15 vervain Just need to know my flotsam from my jetsam. :-)
23:30 GitHub190 joined #mojo
23:30 GitHub190 [mojo] kraih pushed 1 new commit to master: http://git.io/YFOG2Q
23:30 GitHub190 [mojo/master] added exception handling to upload example - Sebastian Riedel
23:30 GitHub190 left #mojo
23:32 sri no idea if i'll ever be able to turn the really crazy tests into documentation https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/upload_stream_lite_app.t
23:32 vervain Ya - I was trying those... fell on my face. ;-)
23:32 gshank joined #mojo
23:33 sri it's insanely cool and powerful, but also quite hard to grok
23:33 vervain I got the gist.... but debugging on my own at this stage was a non-starter.
23:33 sri i'll prolly use it for a mongodb gridfs example, streaming multipart file uploads right into the database
23:34 vervain That would be groovy.
23:34 vervain My app is going to have a _lot_ of uploaded files from a portable scanner... so I'll have to have all of this down pat eventually.
23:34 japhb At my $day_job, we're looking at picking a new Perl 5 web framework to replace our existing ancient homebrew.  I'm finding myself overwhelmed by the large number of options now available, but I've heard some good things about Mojolicious, and am starting to go through the screencasts and docs and such.  Is there somewhere I can look for a comparison of Mojolicious with the other frameworks, or features y'all feel differentiate Mojolicious f
23:34 japhb rom the crowd?
23:35 sri http://mojolicio.us/perldoc/Mojolicio​us/Guides/FAQ#How_does_Mojolicious_co​mpare_to_other_Perl_web_frameworks3F
23:35 elb0w joined #mojo
23:35 vervain You could also put on your fire suit and google Mojo Catalyst Dancer
23:35 sri we do the funky next-gen stuff
23:35 japhb sri, thank you
23:36 vervain Ya - I've settled on mojo _because_ I'm starting a _new_ project.
23:36 japhb vervain, That phrasing makes it sound a little scary.  :-)
23:36 japhb (the fire suit comment_
23:36 vervain The fire suit part is just because there are a lot of strong and yet opposing opinions.
23:36 vervain Which framework is a tough one.
23:37 japhb *sigh*  It's never easy ....
23:37 sri well, if you really want comparisons, best you can do is try them all yourself
23:37 japhb I was afraid someone would say that.
23:37 vervain My last few choices were Life/Scala, Nodejs, Catalyst (again), and Mojo.
23:37 vervain s/Life/Lift/
23:37 sri Play is better
23:38 vervain I have years of prior perl, and Lift/Nodejs were just to 'experimental' for the time being.
23:38 vervain Play?
23:38 purl Play is the thing.
23:38 sri http://www.playframework.org/
23:38 japhb It's a pure Perl 5 house, so thankfully I can at least cut that dimension out of the list of choices.
23:38 sri similar spirit to mojolicious
23:38 sri little bit of rails, but very much real-time oriented
23:39 vervain I hadn't seen play yet.
23:39 vervain But unless it crash-and-burns I'm going to press on with MJ
23:39 sri it is *the* scala framework now that typesafe has picked it up i suppose
23:40 japhb I've now seen mention of "real-time web" in a couple places.  What do you mean by that?
23:40 sri http://en.wikipedia.org/wiki/Real-time_web
23:40 vervain Interesting... others that I've spoke to were all pointing me at Lift <shrug>
23:40 sri wikipedia to the rescue
23:40 vervain that never happens ;-)
23:41 vervain japhb- think server push rather than client pull.
23:41 japhb Nodnod.
23:41 vervain Oh - since there is life here...
23:41 sri http://en.wikipedia.org/wiki/WebSocket # while you're at it
23:41 japhb That concept has changed names so many times in my career, I've lost count.
23:41 vervain Any thoughts on client side templating?
23:41 sri that will be the next evolutionary step in web development
23:42 sri if client side templating makes sense for your use case, do it
23:43 sri but since i'm a ux guy i wouldn't use it much
23:43 sri nobody likes the new twitter ui for example
23:45 vervain So you can't recommend any current solutions for it then?  Or advice a top three to consider?
23:45 sri sure, backbone.js and the like with a REST api on the server side are very appealing from a developer point of view, but users mostly hate it
23:45 vervain I'm read a bit about the jQuery Templates, jRender, jView saga... and moustache... and an other I can't remember the name of.
23:46 vervain Ah ya... it was backbone
23:46 gshank joined #mojo
23:46 vervain What's the user complaint... I imagine that it may feel 'clunky' if it's not setup just right or latency.
23:47 sri users want websites to feel like websites
23:47 sri not like a desktop app
23:47 vervain I think I get that sentiment.
23:48 sri facebook walks the line
23:48 vervain I'm not real big on the whole 'floatbox', modal window kind of crap that has sprung up these last few years.
23:49 vervain But then again I'm building a bookkeepign system... so it's going to be hard to get right but not feel too much like a traditional app.
23:49 vervain Since we have such a big mobile element I'm thinking that will help keep it sane.
23:52 vervain sri: have you pointed chrome or firefox at that new upload example with a 10mb file?
23:53 sri safari
23:53 vervain curl always does the 'right thing'
23:53 vervain Chrome adn firefox both: Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.
23:53 vervain Well that was chrome's message.
23:54 vervain But it's a similar message in FF... with a status of Aborted.
23:55 vervain That's what I've been trying to resolve all afternoon.
23:56 AmeliePoulain joined #mojo
23:58 vervain Ya - and if I try the same thing with a 5MB file... Chrome and FF also do the right thing... that's what I meant earlier by it working when the file wasn't 'too' big.
23:59 vervain It it would help for me to keep analysing with different size files etc... just let me know and i'll see what other data I can collect.

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