Camelia, the Perl 6 bug

IRC log for #mojo, 2012-03-29

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

All times shown according to UTC.

Time Nick Message
00:03 mercutioviz joined #mojo
00:24 mattastrophe joined #mojo
00:32 mattastrophe joined #mojo
00:44 mattastrophe joined #mojo
00:44 rwstauner joined #mojo
01:39 mire joined #mojo
01:58 d4rkie joined #mojo
02:11 tempire joined #mojo
02:57 mire joined #mojo
03:10 zivester joined #mojo
03:43 Foxcool joined #mojo
03:55 Foxcool joined #mojo
03:57 cstamas hi
03:57 cstamas is there a way to get a content of page?
03:57 cstamas the rendering part is obvious
03:58 cstamas I want to mail a form after the user completed it
03:58 cstamas thx.
04:04 cstamas close, but not exactly http://search.cpan.org/~sri/Mojol​icious-2.69/lib/Mojo/Template.pm
04:07 cstamas this is it
05:14 Foxcool joined #mojo
06:04 marcus sri: I've read the first book, it was good.
06:20 Foxcool joined #mojo
06:23 arpadszasz joined #mojo
06:26 zivester joined #mojo
06:27 marcus OH LONG JOHNSON
06:47 taryk joined #mojo
07:03 tempire cstamas: the content of a page from another website?
07:03 tempire or a rendered page from the current web app?
07:21 cstamas tempire: a rendered page
07:22 tempire you probably want partial rendering
07:23 tempire http://mojolicio.us/perldoc/Mojolicio​us/Guides/Rendering#Partial_rendering
07:26 batman joined #mojo
07:26 daxim joined #mojo
07:28 cstamas tempire: oh, I missed that....
08:02 dolmen joined #mojo
08:14 tabbi joined #mojo
08:15 tabbi left #mojo
08:35 d4rkie joined #mojo
08:38 hugh joined #mojo
08:39 D4RK-PH0ENiX joined #mojo
08:51 judofyr joined #mojo
09:13 tempire joined #mojo
09:22 rwstauner joined #mojo
09:25 d4rkie joined #mojo
09:33 spleenjack joined #mojo
09:39 olav joined #mojo
09:40 olav yo! guys.
09:40 judofyr yo olav
09:41 marcus yoyo
09:41 marcus as judofyr tends to say
09:41 olav All well :)'
09:41 olav s/'//
09:41 judofyr marcus: I do?  hm… I thought I was more a "hey ho"/"hey oh"-guy
09:42 marcus yo ho ho ?
09:42 purl and a bottle of rum
09:42 * marcus hi5s purl
09:42 olav Well. Actually I've managed to become a bit confused about where to set the "mode" configuration param
09:43 olav I have a mojo-dojo-thingy running under cgi
09:43 judofyr olav: MOJO_MODE=production is easiest (environment variable)
09:43 olav Ah, thats actually quite nice
09:44 olav then I dont have to worry about it in the app
09:45 judofyr yup
09:46 olav So everything is stable now ?
09:47 judofyr pretty much
09:49 olav Sweet :o)
09:49 olav Anybody else using mojo for REST?
10:03 tabbi joined #mojo
10:04 tabbi left #mojo
10:14 crab sure.
10:19 wolf_ joined #mojo
10:21 venkatk_ joined #mojo
10:23 venkatk_ joined #mojo
10:40 marcus crabbie!
10:40 marcus :)
10:46 cosmincx joined #mojo
10:57 olav Im contemplating, that it could be interesting to make a public reference implementation of a REST server in mojo.
10:58 cosmincx joined #mojo
11:01 * sri yawns
11:03 judofyr sri: is it boring with a stable Mojo? :) no bugs to introduce or fix?
11:03 sri yes
11:03 sri but if it gets too boring i'll add a few new experimental features
11:13 judofyr \o7
11:15 spleenjack1 joined #mojo
11:16 sri :D
11:18 spleenjack1 joined #mojo
11:23 stephan48 sri: just mark the whole api as experimental and then break some stuff..
11:23 sri if you insist!
11:25 random Just start a complete rewrite, stuff must always be better if it's rewritten from scartch... the bugs will love you for it!
11:26 judofyr hasn't sri already "rewritten/forked" quite a few frameworks?
11:27 random You can never have too many... just like with cars in your garage ;-)
11:28 olav Its nice to have someone to dust off your cars :o)
11:28 espent joined #mojo
11:28 random (well I don't have a garage, so I guess I'm not able to rewrite a framework then)
11:29 judofyr hey espent
11:30 espent i am trying to make mojolicious serve static files. How can I set content-type dynamically, without having to "stash" it first, by using $app->types->type… ?
11:30 espent judofyr!
11:30 purl i heard judofyr was the hipster tho, not me :)
11:30 abra joined #mojo
11:31 judofyr espent: you can add custom content-types for specific extensions: $app->types->types->{ext} = 'foo/bar'
11:32 judofyr that would server foo.ext as Content-Type: foo/bar
11:33 espent hm, but the mime type is determined by Mime::Type for each request, it could be anything
11:34 judofyr espent: you can also use the after_static_dispatch-hook: https://metacpan.org/module/Mojolicious#hook
11:34 judofyr $app->hook(after_static_dispatch => sub { my $c = shift; $c->res->headers->content_type("foo/bar") })
11:36 judofyr err, that runs for *all* requests
11:37 lbr marcus: hah, just got a call from $recruiter about the same job as in december
11:37 judofyr but you can check if $c->res->code is set (in the after_static_dispatch, it's only set for static files)
11:37 lbr guess there are no perl devs left in norway
11:37 Andrei666 joined #mojo
11:38 espent judofyr: its not really static… http://pastie.textmate.org/3691191
11:39 judofyr espent: ah, I see. does $self->res->headers->content_type($res->mime_type) work?
11:39 espent maybe, ill try!
11:39 espent hopefully ->render won't touch it
11:40 judofyr I don't think it touches it if it's already set
11:41 Andrei666 hello guys, I'm doing this in my template
11:42 Andrei666 % foreach ( @{$return_result->{search_result}} ) {     % print Dumper ($return_result->{search_result}->[$_]->name()); <tr> <td>       %= $return_result->{search_result}->[$_]->name();
11:42 espent judofyr: it works like charm, thanks!
11:42 Andrei666 and I get this result
11:42 Andrei666 I mean error: Can't call method "name" on an undefined value at template "home/search.html.ep" line 11, near "
11:43 Andrei666 but at the same time in console....the dumper prints...my results
11:43 judofyr Andrei666: use http://hastebin.com/ or something to paste stuff
11:44 Andrei666 ok..
11:44 Andrei666 i know it looks ulgy :p
11:45 judofyr Andrei666: have you tried "% foreach $res (@{…})    …    $return_result->{search_result}->[$res]->name()" ?
11:45 Andrei666 this is in the template:        % foreach ( @{$return_result->{search_result}} ) {     % print Dumper ($return_result->{search_result}->[$_]->name()); <tr> <td>       %= $return_result->{search_result}->[$_]->name();  this is the error I get: Can't call method "name" on an undefined value at template "home/search.html.ep" line 11, near "   this is what I s
11:45 Andrei666 damn
11:45 judofyr hahaha
11:45 memowe nopaste!
11:45 purl i heard nopaste was http://paste.scsys.co.uk/ or http://nopaste.snit.ch/ or http://gist.github.com/ or DO NOT USE pastebin.com IT FUCKING SUCKS
11:45 Andrei666 how can I paste stuff from hastebin?
11:46 judofyr Andrei666: click "save", paste the link
11:46 judofyr I don't know Mojo::Template internals, but it might do something funky with the $_…
11:46 memowe It's like url shorteners for code. ;)
11:46 Andrei666 http://hastebin.com/teroqeleca.vbs
11:47 Andrei666 hmm
11:47 Andrei666 ok..
11:47 Andrei666 it look better in the link
11:47 memowe Andrei666: I think it's a perl question.
11:47 Andrei666 judofyr...yes I've tried that...
11:48 memowe You're using the elements of an array as indices to the same array.
11:48 memowe That looks very wrong.
11:48 Andrei666 but why does it work in console?
11:48 judofyr Andrei666: it seems to work for the 3 first, and then it fails
11:49 Andrei666 there are only 3 though..
11:49 memowe Andrei666: please dump $return_result->{search_result} and show us what you get.
11:49 Andrei666 ok
11:50 Andrei666 i get this
11:51 Andrei666 http://hastebin.com/toxejefosa.vbs
11:52 Andrei666 memowe: yes, you're right, it works only for the first item in the table...
11:52 Andrei666 for the second..or multiple rows in the table it doesn't work...
11:53 Andrei666 hmm
11:53 judofyr Andrei666: it works because MyIMDB::Models::Actors probably overloads the int-conversation. so that does ->[1], ->[2], ->[3] and then ->[5]
11:53 memowe You're doing it wrong.
11:53 Andrei666 got to think of a new approch
11:53 judofyr Andrei666: just use $_->name()
11:53 memowe Excuse me, I'm a bit ill.
11:53 memowe Aren't the objects in $_ inside that loop?
11:54 memowe What's wrong with working with $_->name?
11:54 Andrei666 yes...it works
11:55 Andrei666 thank you both :)
11:55 Andrei666 I didn't thought of that..
11:55 Andrei666 I thought I should...use the whole...hash_ref....
11:55 memowe You did!
11:55 Andrei666 but $_->name ...just works...
11:55 Andrei666 :D
11:55 Andrei666 thank you :D
11:55 memowe That's the point of using foreach
11:56 Andrei666 yes...indeed...foreach...object...
11:56 Andrei666 true :)
11:56 memowe It's rather strange that it worked three times.
11:57 memowe OK, judofyr already told us about the int conversion.
11:57 Andrei666 it worked in the dumper...in the console..
11:57 memowe But it didn't work how you intented.
11:57 memowe It worked by accident.
11:58 memowe Oh.
11:58 memowe You don't use warnings, right?
11:59 memowe I'll go back to bed. See you. :)
12:01 judofyr Andrei666: the reason it worked was because of the int conversion.
12:02 Andrei666 yes...
12:03 Andrei666 you're right..
12:03 Andrei666 btw should I use strict and warnings in the template?
12:05 memowe No, they're already activated.
12:06 black joined #mojo
12:07 Andrei666 great...thx :D
12:07 tabbi joined #mojo
12:07 tabbi left #mojo
12:23 hugh joined #mojo
12:37 Foxcool joined #mojo
12:41 batman can i build another module on top of Mojo::IOLoop ? I want to fork a process and read/write from using Mojo::IOLoop instead of creating a server or client
12:42 batman so i'm thinking about writing Mojo::IOLoop::Run or something...
12:48 judofyr batman: what do you mean "on top of"? you can always just use Mojo::IOLoop->singleton
12:49 batman judofyr: "on top of" is wrong. i mean a new module on the same level as Mojo::IOLoop::Client, but that has a different mission
12:49 batman the mission is to fork a process and read/write from it
12:57 Akron joined #mojo
13:00 arpadszasz joined #mojo
13:00 tabbi joined #mojo
13:00 tabbi left #mojo
13:24 inokenty joined #mojo
13:32 tempire joined #mojo
13:50 abra joined #mojo
14:07 batman joined #mojo
14:12 cosimo joined #mojo
14:26 baton8 joined #mojo
14:31 tholuf01 joined #mojo
14:59 mercutioviz joined #mojo
15:09 KayT3 joined #mojo
15:27 mire joined #mojo
15:43 kaare joined #mojo
15:46 Psyche^ joined #mojo
15:54 batman joined #mojo
16:12 joe21 joined #mojo
16:12 joe21 hi guys
16:13 joe21 trying Mojolicious. How do u set header informatio at mojo?
16:15 joe21 i mean like : print "Cache-Control:no-cache\n";
16:15 inokenty joe21: http://mojolicio.us/perldoc/Mojolicious/Lite#HTTP
16:17 joe21 thanks
16:17 joe21 $self->res->headers->header('X-Bender' => 'Bite my shiny metal ass!');
16:17 joe21 it says
16:20 sjn Best quote ever
16:21 sjn can be used any time! :)
16:21 tl joined #mojo
16:23 mattastrophe joined #mojo
16:24 joe21 real one is this
16:25 joe21 $self->res->headers->header('Cache-Control' => 'no-cache'); $self->res->headers->header('pragma' => 'no-cache'); $self->res->headers->header('Refresh' => '5');
16:25 joe21 thanks a lot
16:30 inokenty joe21: http://pastebin.com/8udMhjCZ
16:32 inokenty More beautiful
16:39 mire joined #mojo
16:44 joe21 yes, nice coding. it makes clear to understand.
16:45 joe21 i am running my mojo up in shared hosting as cgi.
16:45 joe21 but it is too slow.
16:45 joe21 what else can i do under shared hosting?
16:46 inokenty mod_perl?
16:46 purl mod_perl is perl.apache.org or embedding a perl interpreter in the apache runtime or FOR WRITING APACHE EXTENSIONS NOT WEB APPLICATIONS. or good for http://bit.ly/cgGLcX, less good for my web app.
16:46 joe21 in order to speed it up..
16:46 inokenty I don't like mod_perl
16:46 inokenty I run my app with Hypnotoad and use apache mod_proxy
16:47 inokenty And It runs very fast
16:48 joe21 i am at shared hosting. i cant run hypnotad or mod_proxy
16:48 joe21 i do not have ssh
16:49 inokenty What about choose another hosting? =)
16:50 joe21 it costs money :(
16:50 joe21 who gives mod_proxy and hypnotoad options under hared hosting??
16:50 joe21 shared..
16:50 purl shared is shared.
16:50 GitHub47 joined #mojo
16:50 GitHub47 [mojo] kraih pushed 1 new commit to master: http://git.io/f1CXSQ
16:50 GitHub47 [mojo/master] improved all bundled TLS test certificates to expire at the same time - Sebastian Riedel
16:50 GitHub47 left #mojo
16:51 inokenty joe21: FastCGI?
16:51 purl FastCGI is a high-performance cgi replacement, http://www.fastcgi.com/ or \ friend or Enterprise Ready (tm) or how you get $c working on dreamhost or randomly pulling environment variables out of its ass, completely breaking jrockway's site or caught up in the request/response infinite loop. means you can't easily keep state between calls.
16:52 sri joe21: umm, dotcloud and heroku are both free
16:52 sri there is pretty much no excuse for using old school shared hosting
16:53 sri CGI is dog slow, that's the whole point
16:53 joe21 my app is not ecommerce up. it is simple db search app
16:53 joe21 no need to waste money
16:54 sri then don't ask for performance
16:54 joe21 what about inventing new things??
16:55 inokenty joe21: You can try heroku https://github.com/judofyr/perloku
16:55 joe21 heroku and dot cloud are good, but they dont allow my domain for free
16:57 joe21 they offer their sub domain
16:58 joe21 i tested perloku, it has fast response
16:59 joe21 Sri, what hosting are u using?
16:59 sri dedicated servers
16:59 purl dedicated servers are a different matter
17:00 joe21 it is professional
17:00 joe21 too professional
17:01 sri for testing i would use heroku however
17:01 sri or dotcloud... now that they have websocket support
17:01 sri never CGI, ever
17:01 joe21 do they provide mysql support?
17:04 joe21 any remedy for sql-injection in mojo or perl?
17:07 inokenty Use '?' placeholders in sql statements
17:08 joe21 Does Mojo have any built in prevention against xss?
17:09 inokenty Yes
17:09 inokenty XML escaping by default
17:09 joe21 xss cross site scripting
17:10 inokenty Yep, I know
17:15 mercutioviz joined #mojo
18:16 arpadszasz joined #mojo
18:49 tempire http://www.youtube.com/watch?v=7mZZ​d4gQrrg&amp;feature=player_embedded
18:53 venkatk_ joined #mojo
19:10 mire joined #mojo
19:13 sri purl: tempire is also http://www.youtube.com/watch?v=7mZZd4gQrrg
19:13 purl okay, sri.
19:16 tempire purl: tempire?
19:16 purl you are trying to include urls in a template without writing out the path in $c->uri_for.  For example, rather than $c->uri_for( "/blog/id/$id/view" ), I want to have something like $c->uri_for( $c->action_for( "view" ), $id ). or http://www.youtube.com/watch?v=7mZZd4gQrrg
19:16 sri wat
19:17 sri purl: no, tempire is a ponycorn and always high on coffee and http://www.youtube.com/watch?v=7mZZd4gQrrg
19:17 purl okay, sri.
19:37 venkatk_ joined #mojo
19:48 arpadszasz_ joined #mojo
20:15 taryk joined #mojo
20:29 batman joined #mojo
20:42 lukep joined #mojo
20:58 venkatk_ joined #mojo
21:29 tempire purl: tempire?
21:29 purl i think tempire is a ponycorn and always high on coffee and http://www.youtube.com/watch?v=7mZZd4gQrrg
21:29 tempire \o/
21:39 mercutioviz joined #mojo
22:13 GitHub52 joined #mojo
22:13 GitHub52 [mojo] kraih pushed 1 new commit to master: http://git.io/5QXIRA
22:13 GitHub52 [mojo/master] a few more examples - Sebastian Riedel
22:13 GitHub52 left #mojo
22:13 jwang joined #mojo
22:32 black joined #mojo
22:49 mercutioviz_ joined #mojo
23:10 GitHub58 joined #mojo
23:10 GitHub58 [mojo] kraih pushed 1 new commit to master: http://git.io/FLb0Bw
23:10 GitHub58 [mojo/master] a few small optimizations - Sebastian Riedel
23:10 GitHub58 left #mojo
23:32 xaka joined #mojo
23:35 black joined #mojo
23:41 GitHub43 joined #mojo
23:41 GitHub43 [mojo] kraih pushed 1 new commit to master: http://git.io/fjikqg
23:41 GitHub43 [mojo/master] added PSGI environment hash example - Sebastian Riedel
23:41 GitHub43 left #mojo
23:46 jnap joined #mojo
23:56 tempire cli tools written in python make me sad
23:56 tempire they all seem to be of such low quality.

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