Camelia, the Perl 6 bug

IRC log for #mojo, 2012-07-04

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

All times shown according to UTC.

Time Nick Message
00:55 laouji joined #mojo
01:16 scott_ joined #mojo
01:54 d4rkie joined #mojo
01:54 * tempire bedazzles
02:14 noganex_ joined #mojo
03:09 gryphon joined #mojo
04:29 ynonperek joined #mojo
04:53 laouji_rouge joined #mojo
05:15 amirite does mojo's serving of static files slow it down any?
05:15 amirite i.e. with catalyst i used to route the static directory to the http daemon so that catalyst doesn't have to deal with it
05:16 rem_lex| joined #mojo
05:17 ovnimancer joined #mojo
05:20 spleenjack joined #mojo
05:22 fhelmber_ joined #mojo
05:42 vishwanathms_ joined #mojo
05:59 fhelmber_ joined #mojo
06:02 Foxcool joined #mojo
06:06 * sri yawns
06:10 ynonperek joined #mojo
06:20 Leandr joined #mojo
06:25 fhelmber_ joined #mojo
06:25 batman joined #mojo
06:30 xaka joined #mojo
06:33 crab argh. it's so absurdly hot. whenever i think about work or code, my brain segfaults.
07:00 xaka1 joined #mojo
07:14 mire joined #mojo
07:18 marcus amirite yes, it's better to serve static assets through a web server rather than your app server in productino.
07:18 marcus production
07:25 pau4o joined #mojo
07:38 Andrei666 joined #mojo
07:46 amirite joined #mojo
08:13 batman joined #mojo
08:18 Vandal joined #mojo
08:39 tempire um.
08:39 tempire hrm: http://search.cpan.org/~tempire/Mojolicious-3.02/
08:39 sri oops, my bad
08:39 * tempire stages a coup!
08:39 sri there are a few new modules
08:40 tempire ah, I see the failed notice now
08:40 tempire I didn't think it accepted the index when failures were present
08:40 tempire Mojo::UserAgent::CookieJar and Mojolicious::Command
08:41 sri you can reindex now
08:48 crab reindex or reindeer? decisions, decisions.
08:55 tempire I'd like to take this opportunity to once again welcome our russian brethren.
08:55 tempire http://www.youtube.com/watch?v=y9GCwNKCzzI&amp​;feature=BFa&list=FLwba_QPz5eoqB7m18kmiIwg
08:59 sri http://tools.ietf.org/html/draf​t-ietf-appsawg-json-pointer-02 # judging by recent discussions, it looks like ~0 and ~1 escaping will stay
09:00 sri better than ^ escaping at least
09:02 * nic quickly grabs a copy of the unauthorized version for the black market
09:06 Grauwolf http://cssdeck.com/item/preview/5​64/dancing-robot-with-reflection
09:08 sri \o\
09:08 sri /o/
09:09 sri ~o~
09:13 tempire oooh
09:13 tempire that is just begging to be an easter egg on mojolicio.us
09:16 Grauwolf tempire, my thoughts
09:19 marcus +1 FOR BENDER EASY EGG
09:20 marcus EASTER EVEN
09:22 crab EASY EGG is visible always!
10:04 daxim joined #mojo
10:19 Psyche^ joined #mojo
10:37 daxim http://stackoverflow.com/questions/11320553/mo​jolicious-test-and-plackup-live-run-different
10:41 Ulti s/pluck/grab/
10:43 GitHub189 joined #mojo
10:43 GitHub189 [mojo] kraih pushed 1 new commit to master: http://git.io/rbYYQw
10:43 GitHub189 [mojo/master] fixed small namespace detection bug in Mojo::DOM - Sebastian Riedel
10:43 GitHub189 left #mojo
10:47 ryozi joined #mojo
10:55 mire joined #mojo
10:55 andrefs joined #mojo
10:56 daxim http://stackoverflow.com/questions/11327639​/mojolicious-cant-start-app-with-hypnotoad
11:30 dbr joined #mojo
11:43 nic For that latest SO question, it seems the app file didn't exist (prob because it's been passed with one '.pl' too many) but the asker says hypnotoad gave no output
11:43 nic (I saw the error in his strace)
11:46 GitHub27 joined #mojo
11:46 GitHub27 [mojo] kraih pushed 1 new commit to master: http://git.io/yweMMw
11:46 GitHub27 [mojo/master] tweaked Mojo::DOM tests a little - Sebastian Riedel
11:46 GitHub27 left #mojo
11:49 sri perl -Mojo -E 'say f("metacpan.org/search" => {q => "mojo"})->dom("big a")->pluck("text")'
11:49 sri pluck pluck pluck
12:08 migo joined #mojo
12:30 nic Anyone seen a perl environment that appends an unwanted '.pl' when you pass 'myapp.pl' to hypnotoad?
12:30 nic (It looks like he's on fedora)
12:44 taryk joined #mojo
13:04 Foxcool joined #mojo
13:35 crab i like pluck
13:43 amirite hmm
13:44 amirite bridges worked fine for running a method before the action
13:44 amirite but what about after?
13:44 amirite i.e. shared method
13:46 gryphon joined #mojo
13:58 marty amirite:  after_dispatch or around_dispatch  hook maybe
14:01 crab amirite: write your own sub-dispatcher
14:01 marty http://en.wikipedia.org/wiki/Plucky_Duck
14:02 crab ->route(...)->to('foo#bar'); and in foo::bar look at stash('whatever') and decide which method to call after you do your setup and call your unsetup code after.
14:06 amirite joined #mojo
14:08 andrefs joined #mojo
14:08 jontaylor I just found out the hard way that you can't have a mojolicious controller action called 'new' :p
14:24 crab heh
14:25 GitHub190 joined #mojo
14:25 GitHub190 [mojo] kraih pushed 1 new commit to master: http://git.io/DPqcmQ
14:25 GitHub190 [mojo/master] added query string roundtrip test - Sebastian Riedel
14:25 GitHub190 left #mojo
14:28 asarch joined #mojo
14:33 inokenty joined #mojo
14:50 xaka joined #mojo
14:58 nic sri: If you're in the mood for some spell-check fun, there are several cases for s/\bunsecure\b/insecure/g
14:58 nic 'unsecured' is a valid word, but there are several cases where the context means it should be s/\bunsecured\b/insecure/
15:03 sri will put it on the todo list
15:16 GitHub18 joined #mojo
15:16 GitHub18 [mojo] kraih pushed 1 new commit to master: http://git.io/7cpZPg
15:16 GitHub18 [mojo/master] mention that XML generated by Mojo::DOM can be encoded - Sebastian Riedel
15:16 GitHub18 left #mojo
15:19 ynon joined #mojo
15:21 Leandr joined #mojo
15:22 nic Has anyone taken the Mojo classes and built something non-Mojolicious with them (yet)?
15:23 Ulti ok this is a bit odd, if I just render some text once I've caught my exception it all works fine, if I redirect_to I get broken out to the Mojolicious Exception page
15:23 Ulti what am I missing?
15:24 sri nic: that's not uncommon
15:24 nic ah, cool
15:26 sri we don't optimize individual components for use outside the framework, but they are only loosely coupled by design
15:27 GitHub54 joined #mojo
15:27 GitHub54 [mojo] kraih pushed 1 new commit to master: http://git.io/_G6Ofg
15:27 GitHub54 [mojo/master] more tests for Mojo::DOM charset handling - Sebastian Riedel
15:27 GitHub54 left #mojo
15:29 sri forks of mojo modules to add more standalone features are not uncommon either
15:38 sri ah, I18N plugin is on cpan now
15:38 sri https://metacpan.org/release/SHARI​FULN/Mojolicious-Plugin-I18N-0.8/
15:51 marcus sharifuln++
15:58 marcus hmm, the redis driver needs a bit of cleaning up. Like supporting hashes to hmset and not returning arrays of single element arrays...
16:00 lammel2 joined #mojo
16:08 Foxcool_ joined #mojo
16:24 inokenty Is there a way to specify default format? For example, I set format 'html' as default, and helper <%= url_for 'route_name' %> would produce '/route_name.html'?
16:28 pau4o left #mojo
16:32 crab hmm, i think not
16:38 MisterHatt joined #mojo
16:42 dog_chocolate joined #mojo
16:45 amirite hmm
16:45 amirite pluck
16:48 dog_chocolate__ joined #mojo
17:01 jontaylor is there any way I can get any of the validation plugins to persist to the next request?
17:02 jontaylor I think its really bad practise to render a post, so I want to redirect to a get page on a validation error, and then show the validation message
17:02 jontaylor but it looks like every validation plugin assumes you are going to be rendering right away!
17:07 mire joined #mojo
17:41 d4rkie joined #mojo
17:54 crab what do you mean, "render a post"?
17:55 jontaylor when a post action outputs HTML to the client
17:55 crab you think that is bad practice?!
17:55 jontaylor yes
17:55 jontaylor its bad user experience
17:56 jontaylor when the user tries to hit back and gets "Do you want to resubmit this form" errors
17:56 jontaylor and you also then have to check for duplicate submissions of anything
17:56 jontaylor its far better to do post -> redirect -> get
17:57 crab i see. well, then, it's up to you to deal with the consequences of that decision. you may or may not find it helpful to store something in the flash before redirecting, and check for it in the get handler.
17:57 jontaylor i've got something that kind of works now, based on that principle
17:57 crab but that's all the persistence you can expect.
17:57 jontaylor $self->flash( validation_errors => $self->validator_error());
17:57 jontaylor and then in the get
17:58 jontaylor $self->stash->{'validate_tiny.errors'} = $self->stash()->{'mojo.session'}->​{'flash'}->{'validation_errors'};
17:58 jontaylor but its a bit clunky
17:58 crab right. that's as good as it gets.
17:58 Ulti I'd like to see your websites handle large file uploads...
17:58 crab well, except that you can call $self->flash('validation_errors') to retrieveit.
17:59 Ulti the user prompt is especially good user experience when you dont want them to upload it again, and they dont want to wait for it either
17:59 sri don't *ever* use mojo.* stash values directly!
18:00 jontaylor Ulti: There isn't any issue with file uploads, if they hit back they get the form they got, and they'd have to hit submit button again to do it again
18:00 Ulti the issue is that you cant URL encode large files
18:00 jontaylor whereas with rendering a post all they have to do is hit refresh, or back from the next page and just dismiss the popup
18:01 jontaylor Ulti: you still submit the form as a post
18:01 jontaylor but on the server instead of just rendering a page, you send a 302 redirect
18:02 jontaylor http://en.wikipedia.org/wiki/Post/Redirect/Get
18:02 sandeep joined #mojo
18:02 crab sri: (yeah, i was wondering why he decided on that horrible way to access it)
18:03 jontaylor crab: sri: I was just testing the concept before I wrap it up nicely
18:05 crab well, ->flash('...') is what you should use when you wrap. mojo.* should be considered strictly off limits.
18:06 amirite ->smash
18:07 jontaylor crab: I can change it to $self->session()->{'flash'​}->{'validation_errors'};
18:07 amirite are we still playing let's pick method names?
18:07 crab why would you do that?
18:08 jontaylor but I can't use $self->flash because that shows new things going in the flash for this request, not what went in the flash for the previous request
18:08 GitHub17 joined #mojo
18:08 GitHub17 [mojo] kraih pushed 1 new commit to master: http://git.io/JfO62w
18:08 GitHub17 [mojo/master] mention that all mojo.* stash values are reserved for internal use - Sebastian Riedel
18:08 GitHub17 left #mojo
18:09 sri jontaylor: that is not true
18:10 amirite he called you a liar
18:11 Ulti jontaylor: I created a form that does exactly what you're talking about today using the flash, I just didnt use the built in form validation... though I ended up rendering straight away where I had to catch some exceptions from the post
18:12 Ulti but thats just because I'm too dumb to work out how to finish off the exception from floating up the stack
18:13 Debolaz[Lo] OT, but I really hate developing under Wordpress. :-(
18:13 jontaylor sri: I've just checked the code and you are right, calling $self->flash() should show the flash messages from the previous request
18:14 jontaylor but I get Can't use an undefined value as a HASH reference when I try and do print Dumper $self->flash
18:15 sri http://mojolicio.us/perldoc/​Mojolicious/Controller#flash
18:29 sandeep joined #mojo
18:45 xaka joined #mojo
18:49 mire joined #mojo
19:14 ynon joined #mojo
19:55 ki0 joined #mojo
20:26 perlite joined #mojo
20:29 * sri wonders if exception and not_found handling should be hooks, similar to around_dispatch
20:32 sri http://hastebin.com/raw/puvedivofe
20:33 negher joined #mojo
20:50 ynon joined #mojo
21:09 tempire I like that idea.  Essentially just sugar for another event?
21:10 sri an event that sits between render_exception and the code that actually renders the exception templates
21:12 sri it would be chained so you can intercept
21:13 crab sounds good
21:15 sri i was hoping someone would say it's a bad idea :)
21:17 crab it's a terrible idea and you should feel bad
21:17 sri \o/
21:18 perlite joined #mojo
21:18 edenc joined #mojo
21:28 amirite joined #mojo
21:30 sri hmmm
21:31 sri something i wrong
21:31 sri s/i/is/
21:31 sri it just works after the first try... this can't be right
21:32 sri nothing breaks and there seem to be no side effects... that's just wrong
21:32 lammel2 joined #mojo
21:35 tempire \o/
21:35 tempire let's celebrate! http://www.youtube.com/watch?v=y9GCwNKCzzI&amp​;feature=BFa&amp;list=FLwba_QPz5eoqB7m18kmiIwg
21:38 sri should logging the exception be part of the event or ->render_exception call?
21:39 sri as in, should it be possible to prevent exceptions from being logged
21:40 sri negative side effect would be that every intercepting hook needs its own logging code
21:40 tempire well
21:40 tempire you've allowed such things in the past to be able to avoid purposeful spamming of the log.
21:41 sri everything that was possible in the past is still possible
21:41 sri this is all new functionality
21:42 sri basically, should an around_dispatch hook require a $c->app->log->error($c->stash('exception')) call or not
21:42 sri umm
21:42 sri around_exception
21:42 * tempire is off to celebrate his independence from evil britain
21:50 lukep joined #mojo
21:59 niczero joined #mojo
22:01 niczero joined #mojo
22:04 niczero jontaylor: prg is for handling successful posts, not validation errors
22:09 jontaylor niczero: I think its still valid even with validation errors
22:09 jontaylor niczero: although I know its "safe" since the state wasn't changed because it wasn't succesful
22:10 jontaylor but it still has the benefit of keeping the users browser history clear of the post request
22:10 jontaylor and it keeps you on the same page as far as the URL is concerned so its less likely to confuse the user
22:11 jontaylor although I know you can get and post on the same URL and have it route to different things
22:12 sri hmm, i can implement around_not_found and around_exception hooks without adding any additional lines of code
22:12 sri just not sure how useful both would be
22:54 sri hmm, now it is actually less code with hooks :o
22:56 sri around_exception should be rather useful for advanced logging services, sending mails and stuff
22:56 sri that's currently a rather tedious task
22:58 sri around_not_found is harder to justify
22:59 sri why would you want to hook into the 404 response generation? as opposed to just setting a catch all route and in turn disabling the framework feature
23:17 lukep joined #mojo
23:18 GitHub123 joined #mojo
23:18 GitHub123 [mojo] kraih pushed 1 new commit to master: http://git.io/2J42wQ
23:18 GitHub123 [mojo/master] added around_exception and around_not_found hooks - Sebastian Riedel
23:18 GitHub123 left #mojo
23:18 sri please test
23:19 dpetrov_ joined #mojo
23:20 dpetrov_ tempire: any idea what breaks Google::Voice with the latest Mojo::DOM
23:22 GitHub163 joined #mojo
23:22 GitHub163 [mojo] kraih pushed 1 new commit to master: http://git.io/JLfp3Q
23:22 GitHub163 [mojo/master] fixed hook documentation - Sebastian Riedel
23:22 GitHub163 left #mojo
23:24 sri http://mojolicio.us/perldoc/Mojolicious#hook
23:26 sri i'm not yet sure if they will stay
23:26 dpetrov_ basically it works with 2.98
23:26 dpetrov_ so the change should be somewhere here https://metacpan.org/diff/file/?target=TEMPI​RE/Mojolicious-2.98/lib/Mojo/DOM.pm&amp;sour​ce=TEMPIRE/Mojolicious-3.02/lib/Mojo/DOM.pm
23:26 sri around_not_found is a little questionable, but without it around_exception seems inconsistent
23:50 sri it's a bit awkward, removing only around_not_found would make the code a lot worse and harder to maintain

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