Camelia, the Perl 6 bug

IRC log for #mojo, 2011-12-21

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

All times shown according to UTC.

Time Nick Message
00:13 j3nnn1 joined #mojo
00:30 ispeak joined #mojo
00:55 Alias_ joined #mojo
01:19 metaperl joined #mojo
01:20 mire_ joined #mojo
01:38 chansen joined #mojo
01:59 gshank joined #mojo
02:10 ccushing http://privatepaste.com/7627a45ad5
02:11 ccushing when I request text/plain the json is still rendered
02:11 ccushing http://localhost:3000/.txt or even if I do that
02:15 jnap joined #mojo
02:22 jnap joined #mojo
02:47 Therstrium joined #mojo
03:00 jnap joined #mojo
03:22 MojoGuest223 joined #mojo
03:22 MojoGuest223 From: http://www.reddit.com/r/html​5/comments/bt76k/irc_client/ (24 hits)
03:25 vervain ccushing: should your txt be text?
03:28 xaka joined #mojo
03:36 Psyche^ joined #mojo
05:07 crab hi
05:11 chansen joined #mojo
05:23 mire_ joined #mojo
05:50 tempire arg
05:51 tempire iMovie is no longer sufficient to meet my standards for a mojocast
05:53 tempire oooo
05:54 tempire 30 day trial for final cut pro x
05:54 tempire wonder how many viewers they really have
05:54 tempire google analytics is useless by itself
05:55 tempire I would need to add some custom code to determine what people are actually watching
05:55 tempire probably worth it.  not sure if all this time I'm putting in is actually helping people.
06:08 d4rkie joined #mojo
06:14 cfedde more screen casts please :-)
06:22 cfedde it might be nice to use a wipe from one screen to the next rather than a fade.
06:28 Alias_ left #mojo
06:40 MojoGuest472 joined #mojo
06:42 MojoGuest288 joined #mojo
06:42 MojoGuest288 From: http://www.google.com/url?sa=t&rct=j&amp​;q=websocket%20demo&source=web&cd=7&​amp;ved=0CGIQFjAG&url=http%3A%2F%2Fdev.x​antus.org%2F&ei=tH_xTp7eLsfysgbvxfTYDw&a​mp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
06:57 koban joined #mojo
06:58 rhaen Good morning, everyone!
06:59 rhaen btw, what was the last Mojo version running on perl 5.8
06:59 koban good morning!
06:59 purl Lies!
07:01 rhaen well, 1.99 should work :)
07:01 rhaen yep. 1.99 is the last version
07:18 Vandal joined #mojo
07:23 d4rkie joined #mojo
07:31 sugar joined #mojo
07:43 tempire left #mojo
07:43 cekedess joined #mojo
07:43 tempire joined #mojo
07:47 spleenjack joined #mojo
07:48 rhaen hej tempire
07:53 MojoGuest570 joined #mojo
07:53 MojoGuest570 From: http://www.google.com/url?sa=t&rct=j&amp​;q=websocket%20demo&source=web&cd=7&​amp;ved=0CGIQFjAG&url=http%3A%2F%2Fdev.x​antus.org%2F&ei=tH_xTp7eLsfysgbvxfTYDw&a​mp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (3 hits)
08:00 marcus joined #mojo
08:07 d4rkie joined #mojo
08:18 berov joined #mojo
08:18 cosmincx joined #mojo
09:02 Andrei666 joined #mojo
09:16 tempire 🍃
09:38 ispeak joined #mojo
09:42 sri good morning
09:42 purl Lies!
09:43 sri oooh, i'm about to reach 1000 followers on twitter :)
10:21 rhaen sri: you are famous! Awesome! :)
10:22 rhaen Do you have any fancards?
10:22 rhaen :)
10:22 rhaen May I ask to sign one for me?
10:23 espent joined #mojo
10:25 sri ;p
10:26 rhaen oh, I am porting an old legacy application from CGI::Application to Mojolicious right now
10:26 rhaen it's still alot of work
10:26 rhaen to refactor everything
10:27 rhaen some of the wiki recipes are quite old and need some more tailoring
10:28 rhaen as I am on sick leave right now - I might spend sometime in refactoring some of the stuff in the mojo wiki
10:28 rhaen May I ask for commit permission to the project then to work with the wiki?
10:28 rhaen I won't commit to the src of mojo - just the wiki part
10:30 sri sure
10:30 rhaen OMG! I forgot I used Moose when I coded parts of the old app
10:30 rhaen *ugh* - well, ok - let's port that, too
10:34 netfeed is moose not recommended?
10:38 rhaen netfeed: I am not sure if it is not recommended. I like it and it's a very nice object model for perl
10:38 rhaen before someone writes ugly code - use Moose.
10:38 rhaen However, when I am working with lightweight apps - such as Mojolicious which has no dependencies at all
10:39 rhaen I refuse to use something which brings in more stuff.
10:39 netfeed right
10:39 rhaen When I am using MongoDB as database backend for my models I have Moose already on the system so I am using it
10:39 rhaen It depends on the situation.
10:40 rhaen So I am not saying right or wrong - just: Think what you need to solve and think about the toolchain.
10:40 netfeed moving one of my sites from ruby to perl and i needed an ORM, didn't really know what to choose, was standing between DBI::SomethingSomething(with moose) and Rose::DB::Object, ended up with rose, felt easier to start with
10:41 netfeed DBIx? hmm, don't rememeber the name
10:42 rhaen DBIx::Class?
10:42 purl i think DBIx::Class is a resultset-driven ORM with a Class::DBI compatiblity or http://lists.scsys.co.uk/m​ailman/listinfo/dbix-class or see 'dbic repo' or http://dbix-class.shadowcatsystems.co.uk/ or discussed on #dbix-class or a bit like handing an automatic rifle to a squirrel. or ilmari's mro orm or known to be slow at startup
10:43 rhaen I think DBIx::Class rocks - it's nice and wonderful, however, complicated things are still complicated, you just don't see any SQL in your code
10:43 rhaen which is nice
10:43 rhaen I like to use mongo or redis these days when it's about storing things.
10:44 netfeed i just wanted to get stared fast, and rose felt faster to get started with, no other real thought other then that :)
10:44 rhaen true DBIx::Class takes a while to get into it. :)
10:44 rhaen Never worked with Rose tho.
10:45 netfeed but then, if DBIx::Class has easier way to do stuff like "select count(col), col from...", then i'm game, it was a bit, eh, cumbersome to get it running in Rose
10:45 rhaen so you need to "map" a legacy DB used by Ruby to a ORM thing with Perl?
10:46 rhaen I am not sure about Rose but DBIx::Class and its helper can generate the code for the Perl classes
10:46 netfeed more or less, that part was easy in rose
10:46 rhaen However, it requires correct relationships
10:47 rhaen hm, might be a coin flip situation, hm :)
10:47 netfeed and fetching objects and suchs was easy, but writing custom sql wasn't as forthcomming as one could hope
10:47 rhaen hu :)
10:47 netfeed but i really like Mojolicious, it maps well with how i think a webapp should be written
10:48 rhaen but hey, you should think of using MongoDB - it's webscale!
10:48 rhaen (just kidding - it's an insider joke here)
10:48 netfeed haha, nah, i need something that can run on 512mb ram and postgres works "just fine" for that :)
10:48 rhaen Do you use Mojolicious or Mojolicious::Lite for your apps?
10:48 netfeed the full one
10:48 purl i think the full one is [^W\\\\\
10:49 rhaen http://www.mongodb-is-web-scale.com/
10:50 rhaen this one is awesome - if you have a couple of minutes to spare :)
10:50 netfeed rhaen: i'm evaluating it for a bigger app, so i went with the full thing directly :)
10:50 netfeed i'll take a look when the webbrowser works again :)
10:52 rhaen netfeed: I just built an image store based on Mojolicious and Mongo. So far around 160.000 images have been imported and the metadata about the images were imported into Mongo
10:52 rhaen it's still fast as hell. I think, it's webscale
10:54 netfeed i'm building something simillar, got irc-bots that is downloading directly linked images in the channels as shows them on a website, 45k collected thus far
10:54 rhaen :) - sound like a nearby usecase
10:56 netfeed well, it i like it so far at least, much better then what we use at work
10:56 rhaen :) my kindle just arrived. Finally.
10:57 rhaen hm, I thought redis might be a perfect db for that
10:57 rhaen however, redis require to store everything in RAM not just the keys
10:57 rhaen so it will blow up the server, that's why I chose MongoDB
10:58 rhaen as I am extracting the EXIF infos out of the images and store them with the images inside mongo
10:58 rhaen I started to enjoy MongoDBs indexes and find function. Very helpful.
10:59 crab i never managed to get along with DBIx::Class at all
10:59 rhaen Make sure to have indexes on the attributes which are needed often.
11:09 vervain "If /dev/null is fast in web scale I will use it. Is it web scale?" :-D LOL  great for 5am!
11:39 abra_ joined #mojo
12:06 mire_ joined #mojo
12:27 cosmincx joined #mojo
12:49 cosmincx joined #mojo
12:57 GitHub58 joined #mojo
12:57 GitHub58 [mojo] marcusramberg created fix_live_tests (+1 new commit): http://git.io/igXadg
12:57 GitHub58 [mojo/fix_live_tests] Change live tests to not be location specific - Marcus Ramberg
12:57 GitHub58 left #mojo
12:58 marcus sri: I still get a failure for keepalive, against apache.org  at line 261, but  I don't think that is location specific
12:59 sri marcus: i get those sometimes too, apache.org is not very reliable
12:59 sri marcus: why don't you perltidy btw?
13:00 marcus sri: I'll start
13:00 sri marcus++
13:00 marcus urk, no perltidy in perlbrew.
13:01 marcus hmm, I have it
13:01 sri it works for me
13:01 sri but i have to add the perlbrew path to textmate
13:03 marcus I just set the TM_PERLTIDY var in .tm_properties
13:04 marcus sri: there's nothing to tidy in my changes to the live tests tho :)
13:05 sri oh, i was almost certain there was :)
13:05 marcus I've pretty much only changed urls
13:05 sri (the test descriptions)
13:07 Andrei666 joined #mojo
13:07 judofyr joined #mojo
13:09 marcus uhm, you're right
13:10 GitHub59 joined #mojo
13:10 GitHub59 [mojo] marcusramberg pushed 1 new commit to fix_live_tests: http://git.io/7UkkNA
13:10 GitHub59 [mojo/fix_live_tests] Tidy, fix keepalive tests - Marcus Ramberg
13:10 GitHub59 left #mojo
13:10 sri \o/
13:11 sri you're usng the mojolicious .perltidyrc?
13:11 marcus yes
13:11 sri great
13:12 sri have you thought about changing apache.org to something else?
13:13 marcus sri: I changed it to www.wikipedia.org in my second commit.
13:13 marcus all green now.
13:13 sri oh
13:13 sri marcus++
13:13 GitHub103 joined #mojo
13:13 GitHub103 [mojo] kraih pushed 1 new commit to master: http://git.io/t63LSQ
13:13 GitHub103 [mojo/master] Merge pull request #252 from kraih/fix_live_tests - Sebastian Riedel
13:13 GitHub103 left #mojo
13:15 genbit joined #mojo
13:17 GitHub77 joined #mojo
13:17 GitHub77 [mojo] kraih pushed 1 new commit to master: http://git.io/Nup2Rw
13:17 GitHub77 [mojo/master] updated Changes - Sebastian Riedel
13:17 GitHub77 left #mojo
13:18 marcus sri: did you look at  https://github.com/kraih/mojo/issues/248 ? I'm not sure I understand it.
13:18 sri i don't understand it
13:19 marcus doesn't exactl help that the code is being markdown formatted
13:20 genbit_ joined #mojo
13:20 marcus test passes here
13:20 marcus so I'll close it and ask him to test latest.
13:21 pierrick joined #mojo
13:21 genbit_ i was disconnected, somebody answered to the my question?
13:21 marcus genbit_: what question??
13:21 purl i think question is more "unaffected by environment"
13:21 sri marcus: it actually doesn't make much sense to use Mojo::IOLoop::Stream for file handles
13:22 sri files are *always* readable and writable
13:22 noganex joined #mojo
13:22 genbit_ can I re-render response in after_dispatch hook? I want return json if 500 error
13:22 sri s/make much sense/make no sense whatsoever/
13:23 marcus sri: a fh could be tied to a pipe or whatever, couldn't it?
13:24 marcus genbit_: you could just make an error template with json in it?
13:24 sri pipes and sockets are entirely different
13:24 sri i mean file handle as in handled for a file
13:24 sri *-s
13:25 marcus sri: he just wants to stream a file to a http client?
13:26 sri i don't know, it makes no sense
13:26 marcus (need to read file handle and stream it to the client, so the read should be paused while the client is still reading in order to avoid ever-growing buffers).
13:27 sri the point of Mojo::IOLoop::Stream is to handle watching for read/write events transparently
13:27 marcus sri: should probably point him to http://mojolicio.us/perldoc/Mojolicio​us/Guides/Cookbook#Streaming_response ?
13:27 marcus request even
13:27 sri yea
13:31 genbit_ marcus, yes,  but I thought I can just replace response in after_dispatch
13:31 marcus genbit_: did you try it?
13:35 sri i don't quite get why everybody cares so much about json exceptions
13:35 sri exceptions are very exceptional, your app screwed up big time and died, why would you make that part of your official api?
13:36 marcus sri: maybe they expect it to happen often. :)
13:36 sri yea, i don't get it ;p
13:37 sri if you're returning validation errors or so that's something else, but those exceptions mean something very very bad happened, that just shouldn't
13:37 ilyuhan joined #mojo
13:38 sri of course that stuff can happen, but why would your user need to know details?
13:38 sri puzzles me a little
13:38 marcus sri: one of my clients has a json api that throws 500 internal server errors every time it's unhappy
13:38 marcus it's pretty fucking annoying to work with
13:38 marcus you never know if it 's something you did or if it's just broken again.
13:39 marcus not getting the 500 as a json response is the least of my worries.
13:39 sri well, that's just a badly designed app :)
13:39 marcus yes
13:40 sri i'm wondering because we've had like 5 people ask about it during the last few days
13:40 sri where is that coming from?
13:41 sri tbh. i think if 500 errors are part of your api you're doing it wrong
13:43 genbit_ actually, I have external API that can return exception (just die), and I just want returns json only in this case
13:44 genbit_ I don't want to return json exception, if something wrong inside mojo
13:44 marcus genbit_: wrap it in an eval?
13:45 genbit_ and I don't want wrap in an eval  into each controller
13:45 marcus eval { $external->get() } ; if($@) { $self->render(json=>'External service shat itself'});
13:45 marcus genbit_: put it in a model then, and wrap it there.
13:45 sri make a helper that wraps it in an eval
13:45 genbit_ yes, I will have this code in each controller
13:45 sri or model
13:45 marcus or help
13:45 marcus er
13:45 marcus :)
13:47 jnap joined #mojo
13:48 genbit_ also I don't want rewrite all code ) I just want wrap all routes, and if error - detect should I render json or mojo html exception
13:48 genbit_ so, I think I can replace response content
13:50 genbit_ model - it's external lib, I cannot rewrite it
13:50 genbit_ helper - in this case I should rewrite each controller anyway, right?
14:00 noganex joined #mojo
14:08 genbit_ ok, I replace response
14:08 genbit_ *replaced
14:13 inokenty joined #mojo
14:16 MojoGuest360 joined #mojo
14:16 MojoGuest360 From: http://www.google.com/url?sa=t&rct=j&am​p;q=&esrc=s&source=web&cd=4&amp​;ved=0CEUQFjAD&url=http%3A%2F%2Fdev.xan​tus.org%2F&ei=KurxTsOjH6L54QSozOjHAQ&am​p;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
14:16 MojoGuest360 hfggfhghfgh
14:17 MojoGuest360 neneeneeee
14:17 d4rkie joined #mojo
14:37 abra__ joined #mojo
14:44 amoore joined #mojo
14:50 chansen joined #mojo
15:14 marcus once upon a time is soo boring :/
15:16 sri haha
15:16 sri i stopped watching half way into the first episode
15:17 omega is that the western thing?
15:17 marcus I managed all the way to ep. 3
15:17 marcus but going to kill it now
15:17 marcus omega: fairytales
15:17 omega ahh, rite
15:17 omega I'll take that of the list over things to watch then :p
15:17 marcus good idea
15:18 * omega has mostly been watching this interactive movie called Skyrim lately anyways
15:18 sri was a little surprised i didn't like Chuck though
15:18 marcus so not trying skyrim
15:19 sri spoiled by good comedies like  big bang theory and community
15:19 netfeed sri: could be because it's the same plot every episode?
15:19 * sri has to stay away from Skyrim too
15:19 omega it is awesome
15:19 omega :D
15:19 netfeed something happens, chuck wants what's-here-name, his sister is annoyed and everything ends in the store
15:20 netfeed and adam baldwin is cool as ever :)
15:20 sri yea :)
15:21 sri wonder what to watch next
15:21 netfeed oz!
15:21 sri wasn't that a show from the 90s?
15:21 netfeed first show that hbo produced themselves
15:22 netfeed awesome
15:22 purl awesome is probably a highly configurable, next generation framework window manager for X, at http://awesome.naquadah.org/
15:22 netfeed it's not!
15:22 sri need another crime drama like white collar
15:22 netfeed the wire? cop show
15:23 sri all old shows
15:23 netfeed good stuff though
15:24 tarski joined #mojo
15:24 metaperl joined #mojo
15:25 tarski left #mojo
15:26 tarski joined #mojo
15:26 j3nnn1 joined #mojo
15:34 judofyr sri: https://twitter.com/#!/seancri​bbs/status/149221088633683968
15:36 sri judofyr: i'll believe it when i see it (ux at basho)
15:38 lammel2 joined #mojo
15:38 sri marcus: btw. i've been doodling a bit and maybe got a metacpan logo idea
15:57 abra_ joined #mojo
15:59 MojoGuest922 joined #mojo
15:59 MojoGuest922 From: http://extjstutorial.org/extjs/moj​o-websocket-demo-extjs-irc-client/ (14 hits)
16:00 MojoGuest922 d
16:04 MojoGuest922 kuk
16:04 MojoGuest922 chansen:test
16:05 MojoGuest922 fgsfg
16:05 MojoGuest922 dfgh
16:05 MojoGuest922 dfgh
16:05 MojoGuest922 dfgh
16:05 MojoGuest922 dfgh
16:06 sri is it just me or get our guests more spammy?
16:06 elb0w I can confirm your keyboard is working
16:07 abra_ joined #mojo
16:15 * marty waves good morning
16:20 metaperl|2 joined #mojo
16:20 mire_ joined #mojo
16:27 jnap_ joined #mojo
16:28 jnap joined #mojo
16:28 metaperl joined #mojo
16:30 chansen joined #mojo
16:30 judofyr joined #mojo
16:30 MojoGuest472 joined #mojo
16:30 rsimoes joined #mojo
16:30 ashleydev joined #mojo
16:30 trone joined #mojo
16:30 vervain joined #mojo
16:30 dmn001 joined #mojo
16:30 jwang joined #mojo
16:30 wose joined #mojo
16:30 gabb joined #mojo
16:30 stephan48 joined #mojo
16:30 burk joined #mojo
16:30 meraxes joined #mojo
16:30 ereslibre joined #mojo
16:30 bzero joined #mojo
16:30 tinx joined #mojo
16:30 cxreg joined #mojo
16:30 sjn joined #mojo
16:30 hernan joined #mojo
16:30 purl joined #mojo
16:30 * marcus ponders buying http://riakhandbook.com/
16:44 metaperl|2 joined #mojo
16:46 arpadszasz joined #mojo
16:50 noganex joined #mojo
16:51 xaka joined #mojo
16:52 MojoGuest938 joined #mojo
16:52 MojoGuest938 From: http://www.google.com.ph/url?sa=t&rct=j&a​mp;q=irc%20client%20html5&source=web&​cd=4&ved=0CDMQFjAD&url=http%3A%2F%2Fd​ev.xantus.org%2F&ei=ww7yTsC8A7G8iAe24LC7C​Q&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
16:52 MojoGuest992 joined #mojo
16:52 MojoGuest992 From: http://www.google.com.ph/url?sa=t&rct=j&a​mp;q=irc%20client%20html5&source=web&​cd=4&ved=0CDMQFjAD&url=http%3A%2F%2Fd​ev.xantus.org%2F&ei=ww7yTsC8A7G8iAe24LC7C​Q&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (2 hits)
16:53 sri marcus: if you try riak, let me know how you like it
16:53 MojoGuest938 left #mojo
16:55 mire_ joined #mojo
17:06 MojoGuest852 joined #mojo
17:06 MojoGuest852 From: http://www.google.com.ph/url?sa=t&rct=j&a​mp;q=irc%20client%20html5&source=web&​cd=4&ved=0CDMQFjAD&url=http%3A%2F%2Fd​ev.xantus.org%2F&ei=ww7yTsC8A7G8iAe24LC7C​Q&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (3 hits)
17:09 marcus Sri: saw http://perladvent.org/2011/2011-12-11.html ?
17:10 sri marcus: yes, quite sure we talked about it ;p
17:10 marcus Pretty sure I didn't
17:10 jmhgtx I've got a server running on port 3000 but when I run a test it's trying to connect to a different port.  I tried setting the port but it's not working. Anyone have an idea what I need to do?
17:11 marcus It's my fault anyways, since he attended my mojo talk at npw :)
17:11 * sri blames marcus
17:13 nightmare joined #mojo
17:18 nightmare Can I use a route placeholder to construct an action with a different name?  Prepend "action_" to "target" placeholder.  $r->route('/:target')->to(controller => 'AppController', action => "action_$target");
17:19 inokenty Maybe $r->route('/:target')->to(controller => 'AppController', action => 'action_' . $self->stash('target));
17:20 inokenty But not sure
17:23 marty jmhgtx: How are you running your tests?
17:23 sri nightmare: stuff like that can be done with conditions, i wouldn't do it though
17:23 jmhgtx prove -lv t/test_name.t
17:24 jmhgtx I tried $t->ua->http_proxy('http://127.0.0.1:300').
17:25 jmhgtx That sets the http proxy in the Mojo::UserAgent. The port changes every time I run the test though.
17:26 marty that is port 300
17:26 jmhgtx Sorry. It's 3000.
17:27 jmhgtx When I dump the UserAgent there is " listen =>[ http://*:13788"] .
17:27 rsimoes1 joined #mojo
17:27 jmhgtx Seems like I need to change that.
17:28 marty Not sure.  I just tried it here on ports 3000 and 3001 and my test completed successfully.
17:29 jmhgtx Ok. Thanks. I'm getting expected results via the browser but for some reason the tests are failing.  Thanks for looking.
17:36 abra__ joined #mojo
17:36 tempire am I right in reading this?  mongodb map reduce queries require Tie::IxHash?
17:37 tempire This can't be right.
17:37 sri tempire: yes, mongodb expects hashes to preserve order, it's a little weird
17:37 jnap joined #mojo
17:37 tempire If only there was a data structure that could preserve order
17:37 sri well, ruby hashes preserve order these days too :o
17:38 tempire objects are the new list!
17:38 * tempire shoots himself
17:41 marcus Pretty sure php 'hashes' preserve order too :p
17:42 * marcus just bought monopoly for a buck.
17:43 marcus And monopoly. Christmas can start.
17:43 Therstrium joined #mojo
17:48 mercutioviz joined #mojo
17:57 tempire I'm starting to see why mongodb has gained such traction.  the interfaces treat map/reduce as an oddity.
17:57 cosimo joined #mojo
18:11 nightmare Tried using condition for custom action.  Did not work. Oh well.  http://mibpaste.com/tvs6NN
18:14 tempire nightmare: you want your users to be able to call any subroutine name in your controller?
18:17 nightmare I want http://localhost/feedback to route to controller->action_feedback().  I have a CGI app with a bunch of method like "action_" that I want to port to Mojolicious.
18:17 tempire what happens if the user goes to http://localhost/an_action_that_does_not_exist?
18:17 tempire esplode!
18:18 sri nightmare: you're supposed to update $captures of course
18:19 sri but yea, i should stop telling people how to shoot themselves :)
18:19 nightmare :)
18:20 nightmare Our current simple routing would catch http://localhost/an_action_that_does_not_exist and gives 500 error page.
18:20 ccushing oi revisiting what appears to be respond_to not working as advertised http://privatepaste.com/8147500fe5
18:22 ccushing hmm /.json appears to work but not if I send application/json
18:25 ccushing http://privatepaste.com/8d1b806363
18:25 ccushing if I change code to that I get the json
18:25 ccushing but still status 204
18:25 purl Since Thu Aug  5 20:55:17 2010, there have been 53846 modifications and 27895 questions.  I have been awake for 502 days, 21 hours, 30 minutes, 14 seconds this session, and currently reference 895150 factoids. Addressing is in optional mode.
18:26 ccushing even if I explicitly set json status to 200
18:26 tempire if all you need is json, just use $self->render_json by itself
18:26 tempire don't bother with respond_to
18:27 ccushing tempire well one of my other objectives is to respond with a 204 if the wrong content type is requested
18:28 ccushing tempire even if I did need another format I have been unable to get respond_to to work correctly
18:34 sri respond_to is experimental
18:35 ccushing yes I'm aware, but if it's buggy shouldn't that be looked at, also you guys show it on the front page
18:35 sri if there's a bug feel free to open a ticket
18:35 tempire ccushing: it's not a bug, it's by design.  it's an ongoing discussion.
18:35 tempire best to stick with ->render by itself for the time being
18:36 ccushing http://mojolicio.us/ curious if it's so experimental, why do you guys show it on the home page?
18:36 tempire return $self->render_json({one => 1}) if $self->req->headers->accept eq 'application/json'; or so
18:36 sri it's not *so* experimental
18:37 sri just experimental
18:37 sri anyway, if you want to be constructive here's the proper discussion https://github.com/kraih/mojo/issues/237
18:37 ccushing well before I go filing bugs, can you verify that my code /should/ be working?
18:38 sri read that link
18:39 ccushing not sure on relevance? I'm not interfacing with a browser
18:40 marty ccushing:  Are you sure you do not have a routing inconsistency between / and /.json
18:40 ccushing marty     $r->get ('/'             )->to('Root#index'  );
18:40 ccushing that's my route
18:42 marty I've never used a rul such as /.json   is it even a valid url?
18:42 marty s/rul/url/
18:44 ccushing why wouldn't it be
18:44 sri stop making assumptions
18:44 ccushing it could even be a valid file
18:45 sri your code is just broken
18:45 sri respond_to is fine and you're using it wrong
18:45 ccushing sri so how do I fix my code to make it work right?
18:46 sri you use respond_to like it's documented
18:46 ccushing I pulled my code from the documentation
18:47 ccushing http://privatepaste.com/2a8f8c739b < front page
18:47 sri i guarantee you http://privatepaste.com/8d1b806363 is not documented
18:48 sri the code on the frontpage has dozens of unit tests and work exactly as expected
18:49 xaka ccushing: in your request headers i dont see valid Accept header
18:50 ccushing http://privatepaste.com/325c143859 < what is different about this from the example on the front page?
18:50 xaka ccushing: Content-Type is not what do you think in case of request headers
18:50 xaka Content-Type used by server to parse body properly, but not to detect expectable response format
18:50 xaka to detect format servers use Accept
18:54 sri xaka++ # well spotted :)
18:55 xaka sri: but! http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Rendering#Content_negotiation shows that ?format=<type> and .<type> should also work in case of Accept is missing
18:56 xaka ccushing: try ?format=json and if it works, probably there is the bug when you use .json for index pages
18:56 ccushing xaka++ ok, that seems to work. I was trying to assume it was my error, but be damned if I could figure out why my code was wrong
18:56 xaka ccushing: nono, wait, try ?format=json without Accept
18:56 ccushing gimme a min
18:57 ccushing xaka that works to
18:57 ccushing so was /.json
18:58 xaka ccushing: try to /index.json - will it work for you?
18:59 ccushing index.json throws an exception
18:59 ccushing :/
18:59 xaka sure it is, you have to define route :)
18:59 ccushing right
18:59 sri https://github.com/kraih/mojo/issues/237 # that ticket still needs attention, or respond_to will stay experimental forever
18:59 xaka sri: looks like .<type> doesn't work for index urls (/name/.json), (/.json), ... i'd mark it as a bug
18:59 ccushing it's kind of expected
19:00 ccushing sri /.json works
19:00 ccushing err xaka
19:00 ccushing just not index.json
19:00 xaka ccushing: ah? now it works?
19:00 * xaka confused
19:00 purl You won't be after this episode of Soap!
19:00 ccushing no that worked from the beginning it appears
19:00 ccushing xaka /index.json doesn't work, but that's a route issue
19:00 ccushing [12:58] <xaka> ccushing: try to /index.json - will it work for you?
19:01 xaka ccushing: so what was the issue then from the beggining? :)
19:02 ccushing xaka I was sending Content-Type: application/json and apparently I need to be sending Accept: application/json
19:02 xaka ccushing: wait wait wait again, remove Accept please and try to use ?format=json, then /.json
19:02 ccushing xaka yeah I've tried both of those and they work without the Accept
19:03 sri content negotiation has 333 unit tests, just saying
19:03 xaka ccushing: why it wasn't working for you an hour ago? (without Accept)
19:06 ccushing checking to see if I can replicate
19:06 ccushing and figure out what else I had different
19:10 xaka wonder if we could have "exception" handler like bridge to handle all exceptions for routes/sub-routes
19:11 ccushing xaka no idea what I was talking about, possible type
19:11 ccushing typo
19:12 ccushing meant to say it was working with /.json
19:12 xaka :) everyone is happy then
19:12 ccushing xaka yeah, thanks for helping figure out what I was doing wrong
19:12 * ccushing considers doc patch
19:12 xaka ccushing: actually i still don't get what you were doing wrong :)
19:13 ccushing xaka I needed to be sending Accept: headers
19:13 xaka it isn't required if you have ?format or .format suffix at the end of URL
19:14 ccushing xaka yeah, I had /.json working but I don't normally use that url
19:14 xaka i mean you 3 options to do content negotiation
19:14 xaka *you have
19:14 ccushing right
19:14 ccushing for straight up API requests I just use /
19:14 marcus NOBODY EXPECTS THE CONTENT INQUISITON
19:14 xaka marcus: good morning
19:14 purl Lies!
19:14 marcus xaka: afternoon
19:14 purl afternoon is when we eat my lunch.
19:15 * ccushing runs off to a meeting
19:15 ccushing bbl
19:18 xaka marcus: yesterday we were discussing an idea of having application level exception handling. what do you think? for an example all your routes generate JSON and in case of internal error you want to respond with HTTP 500 + JSON body, but you don't want to have "eval" in every method so you need global solution
19:19 marcus xaka: like sri said, 500 exceptions should be exceptional, I don't really care what data they output
19:19 marcus your api should never throw a 500 if it's working properly.
19:19 xaka marcus: for your own application you really care, but you don't want to wrap every into eval
19:20 marcus xaka: I mean, if there's a 500, it means your api is broken
19:20 xaka api will never throw 500, but what if there is something wrong with backend? i cant handle such situations, i don't have failover
19:20 marcus what kind of information do you want to ship with your brokenness?
19:21 marcus xaka: yes, so the client sees there's a 500, and moves on. what kind of data would like to return as json?
19:21 xaka i just need to show user that there is an error, here is the text (and probably stacktrace) - send it to tech support
19:21 marcus I'd never expose a stack trace in a production app.
19:21 xaka i even know type of exception (if they are blessed) so i could generate better error message, but i don't want to handle it in every 100 method
19:22 marcus xaka: if your app is broken, it's broken, and there's not much the client can do with it. actual error messages are for you to fix.
19:23 xaka uh, ok, nevermind. i really dont like to discuss application design decissions, but abillity to redefine common things which is good idea
19:25 sri xaka: i agree with marcus
19:25 marcus xaka: you can easily write an exception template that shows json, if that makes you feel better about it.
19:27 sri or overload render_exception in a custom controller base class (which you already know, since you mentioned it yourself yesterday)
19:28 ccushing well... there is also  I just noticed on requesting /index.json which had no route, that I got a 404 in html
19:28 ccushing that's kinda bad imo
19:29 sri why would a json 404 be part of your api?
19:29 sri that makes no sense, like the 500
19:29 ccushing well a 404 would mean that you can't find the resource, however, why would I respond with html
19:29 sri if you got the wrong REST endpoint, you got the wrong REST endpoint
19:30 marcus status code goes before content.
19:30 purl Since Thu Aug  5 20:55:17 2010, there have been 53861 modifications and 27898 questions.  I have been awake for 502 days, 22 hours, 34 minutes, 59 seconds this session, and currently reference 895162 factoids. Addressing is in optional mode.
19:30 ccushing if there's more message to be displayed I'd rather it be in the format requested
19:30 ccushing also html+css is a much bigger payload
19:30 sri the json content would be arbitrary, you couldn't use it anyway
19:31 sri you can't make assumptions
19:33 marcus ccushing: if you want a smaller payload, make an empty exception template
19:34 sri or overload render_not_found, or make a catch everything route
19:35 * marcus is pondering a mojolicious twitter bootstrap plugin.
19:35 ccushing yeah will probably end up doing both, but you're saying that it's impossible to do something in general like respond_to does for regular content for errors. e.g. having a serialized hash that is returned depending on the content type requested
19:36 sri of course it's possible
19:36 sri like i said before, overload render_exception in a custom controller base class, it's just bad design
19:37 sri all i'm saying is that i have no intention to make it easier
19:41 marcus sri: seems .html.ep isn't detected as Perl (Mojolicious templates) in TM2? came up as just html here
19:50 MojoGuest390 joined #mojo
19:50 MojoGuest390 From: http://blog.kraih.com/perl-is-ready-for-html5 (86 hits)
19:50 sri marcus: strange
19:51 sri i'm not yet a TM2 user though
19:54 marcus fair enough, it's still alpha :)
19:59 tempire oh.  mongodb accepts an array ref instead of a Tie::IxHash
19:59 tempire what a strange thing to put front and center, though.
19:59 tempire marcus: what would the bootstrap plugin be?  template helpers?
19:59 marcus tempire: yes
19:59 tempire I'd use it.
20:00 tempire Might even contribute to it
20:00 tempire if it's pretty enough
20:00 * marcus puts makeup on the pig
20:00 tempire if you include a BUILD_ARGS subroutine anywhere, I'm out. :)
20:01 marcus thinking of rewriting iwatchthis.com in mojolicious and riak, using bootrap as a basis.
20:01 tempire sexy
20:01 marcus as a project to play with new stuff
20:02 marcus so I figured I could reverse engineer some helpers out of that.
20:02 tempire I'm really glad I learned riak before mongodb
20:02 tempire I think mongodb would have subverted my mad reduce enlightenment
20:02 marcus tempire: are you using anyevent::riak?
20:02 sri marcus: why are you suddenly interested in riak again?
20:03 tempire no.  I used Riak::Tiny, and then Net::Riak, and then just went to straight Mojo::ua
20:03 marcus sri: this thing has fairly simple query needs, and I think riak architecture is so much nicer.
20:04 marcus sri: I've not done any projects in riak yet, and I've done a couple in couch, figure I should at least give it a chance
20:04 tempire I would probably use Net::Riak now, though, since they support PBC now
20:04 sri it's certainly more fun than couchdb
20:09 tempire I kind of want to steal this design: http://mojocookie.com/
20:09 sugar joined #mojo
20:09 mire_ joined #mojo
20:11 MojoGuest639 joined #mojo
20:11 MojoGuest639 From: http://www.google.it/url?sa=t&amp;rct=j&amp;q=webs​ocket%20demo&amp;source=web&amp;cd=3&amp;ved=0CEoQ​FjAC&amp;url=http%3A%2F%2Fdev.xantus.org%2F&amp;ei​=RD3yTvrzLI3V4QTRsLzEAQ&amp;usg=AFQjCNGw6nZv0wO42u​zUnHhWcD0vcKNULg&amp;sig2=DLgHfBqpCEPiHZ8aykOzLw (1 hits)
20:16 MojoGuest120 joined #mojo
20:16 MojoGuest120 From: http://www.google.it/url?sa=t&amp;rct=j&amp;q=webs​ocket%20demo&amp;source=web&amp;cd=3&amp;ved=0CEoQ​FjAC&amp;url=http%3A%2F%2Fdev.xantus.org%2F&amp;ei​=RD3yTvrzLI3V4QTRsLzEAQ&amp;usg=AFQjCNGw6nZv0wO42u​zUnHhWcD0vcKNULg&amp;sig2=DLgHfBqpCEPiHZ8aykOzLw (2 hits)
20:19 marcus wow, being snarky against adobe is popular, 5 retweets already.
20:19 marcus tempire: mojo for your life?
20:21 tempire it's such a hip design.  should be for a hip project.
20:23 marcus hip replacement
20:24 tempire hippa project
20:41 ilyuhan left #mojo
20:53 tempire what version of perl added the ability to iterate over references without dereferencing
20:53 tempire ?
20:55 marcus 5.14
20:55 marcus tempire: http://search.cpan.org/dist/perl-5.14​.0/pod/perldelta.pod#Array_and_hash_c​ontainer_functions_accept_references
20:55 tempire thanks
21:00 jnap_ joined #mojo
21:06 netfeed where should the hypnotoad.conf file be places?
21:07 tempire same level as the app
21:08 netfeed in ./ or in ./script ?
21:09 tempire ./
21:10 netfeed thanks
21:10 jnap joined #mojo
21:11 jnap joined #mojo
21:12 jnap tempire:  the newest one I think
21:18 netfeed man, that was easy to setup, that was really a pleasure :)
21:18 marcus netfeed: \o/
21:18 tempire netfeed: have you tried a hot code reload?
21:19 netfeed not yet, soonish though
21:20 marcus hmm, was thinking there should be a shortcut to add helpers like 'title', 'default', 'layout'. a helper helper. :)
21:23 marcus $self->helper( subtitle => $self->stashed );
21:23 marcus or maybe just $self->helper(subtitle);
21:23 marcus 'subtitle' even
21:25 sri $self->stashed('subtitle')
21:26 sri well, the code actually already exists
21:26 sri https://github.com/kraih/mojo/blob/master/l​ib/Mojolicious/Plugin/DefaultHelpers.pm#L16
21:28 sri plugin 'Stashed'; app->stashed('subtitle');
21:28 sri :)
21:29 marcus sri: yeah, was after looking at that code I was thinking it should be user accessible :)
21:30 marcus what about just changing the defaulthelper code to make a stashed helper, and then use it to setup layout and the others?
21:30 sri not sure
21:30 yko joined #mojo
21:30 * sri pokes crab and tempire
21:31 bzero joined #mojo
21:32 ccushing how would I set accept headers in a test?
21:32 marcus ccushing: get_ok takes the same parameters as Mojo::UA::get
21:34 marcus ccushing: actually, look at perldoc Mojo::UserAgent::Transactor for an example.
21:36 netfeed what's the default worker count for hypnotoad?
21:37 * ccushing investigates these pods and tries to understand the relation to a Test::Mojo object
21:37 sri netfeed: http://mojolicio.us/perldoc/M​ojo/Server/Hypnotoad#workers
21:37 netfeed ah, 4, thanks
21:37 netfeed hot reload was nice too, much simpler then in unicorn
21:38 perlite_ joined #mojo
21:38 netfeed im really happy with the experience so far
21:40 sri glad to hear that
21:40 ccushing ah got it
21:50 tempire shnikies
21:50 tempire http://www.youtube.com/watch?feature​=player_embedded&amp;v=ACkmg3Y64_s#!
21:50 tempire crazy germans
21:54 marcus working for them must be pretty awesome
21:58 netfeed cool thing, but he has an annoying voice
22:11 ccushing is there a way to dump a request and/or response as a string? like I can with LWP
22:14 marcus ccushing: ->to_string ?
22:15 ccushing marcus where is that documented? I'm poking around docs for it and can't find it
22:15 marcus ccushing: Mojo::Message, the base class for ::Request and ::Response
22:15 ccushing ok
22:16 Topic for #mojo is now Mojolicious real-time web framework 🍃 http://mojolicio.us 🍃 http://irclog.perlgeek.de/mojo/today 🍃 Prepare for Mojocalypse
22:16 marcus supergreen
22:16 Topic for #mojo is now Mojolicious real-time web framework 🍃  http://mojolicio.us 🍃 http://irclog.perlgeek.de/mojo/today 🍃 Prepare for Mojocalypse
22:16 Topic for #mojo is now Mojolicious real-time web framework 🍃  http://mojolicio.us 🍃 http://irclog.perlgeek.de/mojo/today 🍃  Prepare for Mojocalypse
22:17 sri \o/
22:17 Topic for #mojo is now Mojolicious real-time web framework 🍃  http://mojolicio.us/ 🍃 http://irclog.perlgeek.de/mojo/today 🍃  Prepare for Mojocalypse
22:19 sri /topic Mojolicious real-time web framework 🍃 http://mojolicio.us/ 🍃 http://irclog.perlgeek.de/mojo/today 🍃 Prepare for Mojocalypse
22:19 sri noo
22:19 tempire unifail
22:29 ccushing whats the shortest way to pass a json payload to a test request? e.g. $t->post_ok('/user' => { Accept => 'application/json' } => $json_payload ); would this be the easiest way? what's the right way at that point to get the payload serialized?
22:37 tempire Mojo::JSON
22:37 purl i heard Mojo::JSON was about 3 times faster than json::pp
22:38 sri hmm, i'd like to make a change that can't really be deprecated
22:38 ccushing so no way to get it to auto serialize a hash
22:39 ccushing :260
22:44 sri marcus/tempire/crab: i'd like to replace the useragent logger with an error event
22:44 ccushing is it possible to have mojo's debug log output in notes in the test?
22:44 sri but i don't see how the logger could be deprecated
22:45 marcus sri: you mean the tracing?
22:45 sri no
22:45 marcus ccushing: prove -v will output debug output.
22:45 sri Mojo::UserAgent->log
22:46 marcus oh. I never used that
22:46 sri neither did i
22:46 sri but someone somewhere will be using it, i'm certain
22:46 marcus yes, for sure
22:46 purl like totally!
22:46 ccushing marcus using prove -lv , it doesn't output my logging?
22:46 ccushing I think logging is still going to log/...
22:47 sri i'm thinking, maybe make it sub log { deprecation warning; return Mojo::Log->new }?
22:47 marcus sri: then you can't set it anymore
22:48 sri it doesn't do anything anyway
22:48 ccushing hmm... I've been using morbo.conf to define my database handle but that appears to not get used when I'm running tests
22:48 sri it's just there so code doesn't break
22:48 marcus eh, morbo.conf? :o
22:48 ccushing that's what I figured out
22:48 marcus ccushing: is your app named morbo?
22:48 ccushing marcus no
22:48 marcus ccushing: then you should be using myapp.conf
22:48 Therstrium any way to signal morbo to reload the application?
22:49 marcus ccushing: if morbo.conf works then that is by accident.
22:49 ccushing how to get config working was a bit cryptic
22:50 ccushing the fact that FooBar::Baz translates to foo_bar-baz.conf is odd
22:50 ccushing imo
22:50 marcus ccushing: http://mojolicio.us/perldoc​/Mojolicious/Plugin/Config
22:50 ccushing yeah I've read it
22:50 ccushing I did not find its integration straight forward
22:51 marcus yeah, I'm working on an app named IWT.pm now, which translates to i_w_t.conf - not so pretty.
22:51 sri just give it a custom name
22:51 xaka i_w_t.conf looks like Titanic
22:52 ccushing tomorrow I think I'm going to go write a bunch of doc patches
22:52 marcus sri: yeah, I'll just use the file param
22:52 marcus at least the script is named iwt :)
22:55 sri hmm, user agent logger is untested, which theoretically makes it not a feature
23:05 ccushing Test::Mojo doesn't have Test::Deep like regex comparison's does it?
23:05 ccushing esp for json content
23:10 sri argh
23:10 sri and of course user agent logging doesn't even work
23:10 sri events to the rescue
23:10 marcus ccushing: no. atm we only have json_content_is. Crab is working on jsonpointer support tho.
23:11 ccushing ok, I'll just use Test::Deep
23:11 ccushing it seems to still be working
23:11 marcus yes, sure.
23:16 MojoGuest266 joined #mojo
23:16 MojoGuest266 From: http://www.google.com/cse?cx=00268341​5331144861350%3Atsq8didf9x0&amp;q=web​socket+irc&amp;ie=utf-8&amp;sa=Search (1 hits)
23:20 MojoGuest266 ?
23:20 MojoGuest1 joined #mojo
23:20 MojoGuest1 From: http://www.google.com/cse?cx=00268341​5331144861350%3Atsq8didf9x0&amp;q=web​socket+irc&amp;ie=utf-8&amp;sa=Search (2 hits)
23:25 metaperl joined #mojo
23:36 GitHub187 joined #mojo
23:36 GitHub187 [mojo] kraih pushed 1 new commit to master: http://git.io/613mnw
23:36 GitHub187 [mojo/master] replace user agent logger with error event and fixed multiple related bugs - Sebastian Riedel
23:36 GitHub187 left #mojo
23:36 sri ok, review would be appreciated
23:38 mire_ joined #mojo
23:41 sri oh, i actually have an even better test case
23:53 GitHub103 joined #mojo
23:53 GitHub103 [mojo] kraih pushed 1 new commit to master: http://git.io/WFBzlg
23:53 GitHub103 [mojo/master] better tests for user agent error event - Sebastian Riedel
23:53 GitHub103 left #mojo
23:53 sri that's one crazy test case :)
23:54 tempire ->signed_cookie is for accessing cookies signed manually, right?  So, if I wanted to manually access the mojolicious session cookie, I could use signed_cookie
23:54 sri ye
23:57 sri i'm stupid
23:57 sri i do so much work to subscribe and unsubscribe from events in tests when could just use a ->once...
23:59 * marcus reads

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