Camelia, the Perl 6 bug

IRC log for #mojo, 2013-09-30

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

All times shown according to UTC.

Time Nick Message
00:01 good_news_everyone joined #mojo
00:01 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/0yWxHA
00:01 good_news_everyone mojo/master 905eec3 Sebastian Riedel: more validation tests
00:01 good_news_everyone left #mojo
00:02 sri still a little unsure about how to handle multiple values and if file uploads should be supported somehow
00:02 btyler joined #mojo
00:04 sri applying the test to every value individually still seems like the best idea for now... the api even supports stuff like ->multiple_values(4)... the check would just run 4 times... which i guess doesn't matter much
00:06 tba_ joined #mojo
00:06 sri guess we'll learn what works once the first user feedback comes in :)
00:45 shmuel joined #mojo
00:51 laouji joined #mojo
01:05 hrupp joined #mojo
01:25 asarch joined #mojo
01:35 gtodd joined #mojo
02:00 d4rkie joined #mojo
02:09 jberger sri: great work!
02:38 jberger oh I missed label_for, cool!
02:59 memowe joined #mojo
03:04 mtths joined #mojo
03:06 dotandimet joined #mojo
03:07 preflex_ joined #mojo
04:26 dqw6 joined #mojo
04:47 jakir joined #mojo
04:50 jakir I can not seem to get http header in plugin. Can I get http header in plugin?
05:07 crab yes.
05:09 jakir crab:$self->req->headers->user_agent not working in register.
05:14 jakir http://pastebin.com/kwt6pnJF is the code. It is showing Can't locate object method "req" via package "Mojolicious::Plugin::MobileBrowserDetect"
05:16 basic6_ joined #mojo
05:17 yakudza joined #mojo
05:20 jakir crab: can you please send an example;
05:25 shmuel joined #mojo
05:27 crab look at the plugins bundled with mojolicious
05:28 crab the reason you can't ->req there is because there's no request
05:28 crab register is called at startup. you probably want to create a hook or something.
05:28 good_news_everyone joined #mojo
05:28 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ig6d4g
05:28 good_news_everyone mojo/master 601be47 Sebastian Riedel: added AUTOLOAD tests for Mojolicious::Validator::Validation
05:28 good_news_everyone left #mojo
05:28 crab and use ->req inside your hook sub.
05:54 Lee joined #mojo
06:40 Vandal joined #mojo
06:43 batman https://ngrok.com/usage # cool :)
06:45 batman https://github.com/kraih/mojo/commit/a2​53f44449a8cd4a5326071dd4aa9e2c606b04b1 <-- er på author lista til mojolicious nå
06:45 batman det er stas :)
06:46 batman crap!
06:46 batman wrong window :(
06:56 Andreas joined #mojo
06:56 crab sri: batman is making fun of you in norwegian!
06:57 highflying joined #mojo
06:57 batman haha.
07:07 basiliscos joined #mojo
07:11 dod joined #mojo
07:16 trone joined #mojo
07:20 sri batman: :O
07:20 jakir left #mojo
07:20 batman just to be sure no-one believes crab: i'm not making fun of you sri.
07:20 batman :P
07:21 sri but why should i believe you?!
07:22 nicolaas joined #mojo
07:22 batman because it's easy to check with google translate.
07:22 sri but i'm lazy
07:23 batman i said something like: "i'm on the author list of mojolicious now. that's neat :)"
07:23 batman the rest is understandable i think :)
07:23 dod joined #mojo
07:25 batman also...crab doesn't know norwegian
07:45 good_news_everyone joined #mojo
07:45 good_news_everyone [mojo] kraih tagged v4.42 at cfd6518: http://git.io/n7SgoA
07:45 good_news_everyone left #mojo
07:46 sri \o\
07:46 sri /o/
07:47 batman :)
07:50 kwa Morning all.
07:51 crab batman: i do actually know quite enough norwegian to translate what you wrote
07:54 basiliscos joined #mojo
07:54 batman crab: oh. my bad :(
07:54 batman but...why?
07:54 kwa Nice work sri. Just sticking with the four checks/constraints for now?
07:54 sri yes, more will be added based on feedback
07:55 crab batman: lots of norwegian friends, plus i liked norway very much when i was there. plus i like learning languages.
07:56 kwa A good trait for a programmer.
07:57 kwa crab: You tried duolingo?
07:57 crab what is a duolingo
07:58 kwa Website/iphone/android app for learning new languages. I think it only has the Romantic languages at the moment, but it's set up like a game.
07:59 batman crab:)
08:00 batman anyone who wants to tell me if Mandel::Collection::patch() should have another name? https://github.com/jhthorsen/mandel/commit​/c98ebc0adde5a7cef35709b37d60b4d63ac1b816
08:01 kwa crab: It's be the author of reCAPTCHA. I've only used the Android version of Duolingo, and it's awesome. It's like a game. You get X hearts, and lose them if you answer a section wrong. But they use multiple input to reenforce your learning. Translating Spanish, writing in Spanish, listening and writing Spanish, speaking Spanish (checked using Google Translate). You work through sections and get
08:01 kwa points depending on how well you've done.
08:01 crab (i think you mean romance languages.)
08:01 kwa Heh, yer.
08:01 kwa Romance/Romanic.
08:02 marcus I really liked it too, tried it on my iPad
08:03 kwa Yeah. It's just the right amount of tests per section to stop you getting annoyed too. There's a "can't speak right now" bit which is useful for when I'm playing it on the toilet.
08:04 crab a perfect place to speak romantic languages
08:04 kwa lol
08:05 marcus kwa: Or subway :)
08:05 kwa "Me gusta pooh"
08:06 kwa marcus: Hah. Though people might not think it so weird. I've seen people shouting at their bag before.
08:10 sri batman: maybe ->sync
08:11 batman sync() ? i don't get it :(
08:11 sri synchronize client and server side versions
08:12 batman oh. but this method only does update({ _id => ... }, { '$set' => \%data })
08:13 batman i would say save() (which i already have) is more like sync() :)
08:13 themage joined #mojo
08:14 crab is '$set' some special mongo thing?
08:14 batman yes. it updates just selected fields and not the whole document
08:15 batman update({ ... }, \%data) is pretty much like save(\%data)
08:15 batman that's why i was thinking patch(), since it only applies changes, but keeps the rest of the structure...
08:20 ver joined #mojo
08:49 fhelmber_ joined #mojo
08:50 sri i was a little worried we wouldn't have much new stuff for 5.0... but with SO_REUSEPORT, non-blocking bridges and form validation we already have more than enough :)
08:54 sri oh, also around_action hook, HTML5.1 support in Mojo::DOM and element methods in Mojo::Collection :o
09:15 kwa It's impressive sri. You guys should be reet proud.
09:15 mdom joined #mojo
09:17 kwa When's the first Mojocon?
09:17 crab "reet"?
09:19 gear joined #mojo
09:19 gear hello
09:20 gear can i ask for some help with Mojo::UserAgent?
09:20 gear here is the issue
09:21 KindOne joined #mojo
09:21 yakudza joined #mojo
09:21 gear i'm writing a simple web scrapping script. i must be logged in to the web site to get access to the page i need.
09:22 gear i have exported cookies for this site from the browser
09:22 gear and impotring them this way
09:23 gear my $jar = Mojo::UserAgent::CookieJar->new;
09:23 gear # Reading cookies
09:23 gear open COOKIES, "<cookies.txt";
09:23 gear while(<COOKIES>){
09:23 gear chomp;
09:23 gear path   => $c[2]
09:23 gear )
09:23 gear );
09:23 gear }
09:23 gear $ua = $ua->cookie_jar($jar);
09:23 sri STOP!
09:23 crab !#@)&*$!
09:23 crab use a paste site
09:23 gear oops
09:23 gear sorry
09:23 gear 1 moment
09:24 crab also, i don't see any importing going on, and your code makes no sense.
09:24 crab maybe your client was trying to be polite for you and ate up some lines
09:26 gear sorry again
09:26 gear i'm using IRC eventually and forget a manners
09:28 kwa crab: reet = right/very (I'm from the North of England).
09:28 gear http://pastebin.com/vZH3xQg2
09:29 gear here is the code
09:29 gear the issue is that this script works on my laptop
09:29 gear Win7 OS
09:30 gear but i get error 400 bad request on my server running Ubuntu 12.04 LTS
09:30 gear with same script
09:30 gear i have tried to figure out the issue
09:31 gear and i found that under Unbuntu not all cookie included in the request header
09:31 KindOne joined #mojo
09:32 gear and i don't know where to dig
09:33 go|dfish joined #mojo
09:34 gear if i'm not using CookieJar or UserAgent properly so why is it working under Win7?
09:34 * batman still doesn't get why you are reading cookie from a file.
09:34 * batman goes shopping
09:36 trone joined #mojo
09:36 yakudza joined #mojo
09:37 gear because i'm logged in to the site from the browser and the easiest way to give the access to my account for my script is to load my cookies to the script
09:38 Ralesk shame kwa left, I can't educate them about the Dutch meaning of reet then :P
09:39 sri gear: maybe focus less on if you're using Mojo::UserAgent right and more on differences between windows and linux
09:41 gear i can't figure out what differences between this OSes can cause this behaviour
09:42 sri i bet it's your txt file
09:42 gear hm
09:43 dotan joined #mojo
09:45 denisboyun joined #mojo
09:45 gear i have wrote it in Notepad++, UTF-8 wo BOM encoding. I have checked encoding in Ubuntu - it is fine. I have checked jar content after file parsing with "print Dumper($jar->all);" - file parsed OK.
09:46 gear Can wrong Mojolicious installation cause such behaviour?
09:50 D4RK-PH0ENiX joined #mojo
09:51 denis_boyun__ joined #mojo
10:25 dqw6 joined #mojo
10:36 mire__ joined #mojo
10:39 yakudza joined #mojo
10:47 maxhq joined #mojo
10:48 Vandal joined #mojo
10:48 batman sri: would you take a patch, where the default module is configurable for ::PODRenderer?
10:54 sri batman: nope
11:04 kwa joined #mojo
11:12 kwa Ralesk: What does reet mean in Dutch?
11:12 Ralesk (butt)crack :D
11:12 kwa The only Dutch I've been taught is something like 'neuken in the keuken'.
11:12 kwa Haha, really?
11:12 Ralesk yup :D
11:12 Ralesk https://en.wiktionary.org/wiki/reet#Dutch
11:13 kwa Just only that link now. That's hilarious.
11:13 kwa TIL!
11:26 dpetrov_ joined #mojo
11:28 batman sri: because it includes more lines of code...?
11:28 batman or just *because*
11:32 dqw6 joined #mojo
11:38 sri batman: because it's not where i want to take that module
11:38 batman ok
11:39 batman guess i can just do a redirect on my side
11:39 sri you're welcome to fork the plugin
11:39 batman thanks, but i'll skip that
11:46 mst batman: the 'Mojolicious/Guides' bit?
11:48 d4rkie joined #mojo
11:48 batman mst: yes. https://metacpan.org/source/SRI/Mojolicious-4​.42/lib/Mojolicious/Plugin/PODRenderer.pm#L31
11:49 mst why not just poke at the defaults for the route then?
11:50 batman mst: thanks! silly me :(
11:51 sri no guarantees they stay the same
11:52 batman that's true. but /perdoc is not something i need to work 99.9999% of the time.
11:52 batman it's mainly just for me and some other devs
11:57 mst right, for a dev tool if it breaks after a mojolicious upgrade ... you're a developer. fucking fix it and check the fix in with a comment
11:57 batman exactly
12:00 good_news_everyone joined #mojo
12:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XjdQQQ
12:00 good_news_everyone mojo/master c52cf51 Sebastian Riedel: slightly more consistent return values
12:00 good_news_everyone left #mojo
12:05 ver Hi! I have the Mojolicious web-application (running with Morbo) and I need to call some method of class every specific number of hours (interval event). How to add it to my application?
12:08 * sawtooth starts deleting all FormValidator::Lite hax from his mojo apps
12:09 kwa ver: Easiest way to reliably do that is by using crontab.
12:14 batman ver: Mojo::IOLoop->recurring(3600 => sub { warn "yay!" });
12:15 batman anywhere before app->start; or inside startup() if you have a full app
12:18 sri batman: no
12:19 ver where I need to add it?
12:19 sri you don't, it's bad advice
12:22 sri if you have enough requests, the timer would never fire
12:25 trone joined #mojo
12:26 ver sri, you think cron is better?
12:26 sri of course
12:27 ver ok, I will do it in this way, thanks
12:27 ladnaV joined #mojo
12:28 d4rkie joined #mojo
12:36 keedi joined #mojo
12:40 good_news_everyone joined #mojo
12:40 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/1swWTA
12:40 good_news_everyone mojo/master b4a1235 Sebastian Riedel: more validation tests
12:40 good_news_everyone left #mojo
12:42 good_news_everyone joined #mojo
12:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5ToKtA
12:42 good_news_everyone mojo/master 0f3ec82 Sebastian Riedel: test label for optional field too
12:42 good_news_everyone left #mojo
12:44 trone joined #mojo
12:47 crab is that because it's morbo, or what?
12:47 asarch joined #mojo
12:52 mst morbo/hypnotoad are still tehre to serve requests
12:53 mst the presence of timers and etc. is to support asynchronous serving of requests
12:53 mst while you -can- use them, in theory, to emulate other things, pushing that sort of class of work inside the request serving code is almost never a sound architectural choice
12:53 mst sri: does that sound about right?
12:54 sri problem is servers restart workers after a certain number of requests
12:55 sri for hypnotoad it's 500-1000 (second half is random)
12:57 yakudza joined #mojo
12:57 yakudza joined #mojo
12:59 sri another fun thing is that timers are started inside the manager process, and possibly bound to startup time, with every recycled worker the timeframe gets shorter, and in the end your recurring timer will run whenever a worker starts
12:59 sri it's just bad, really don't do it
13:05 sawtooth mojo validation, so far so good
13:05 sri remember, it's still experimental
13:05 sawtooth yes yes, absolutely
13:06 sawtooth but loving how much it will simplify logic in my views
13:06 sri :)
13:27 Dandre hello,
13:28 Dandre How can my application log to the same log file as the server log file ?
13:29 dvinciguerra_ joined #mojo
13:33 Dandre Must I set it using something like: $log     = $log->path('/var/log/mojo.log'); where $log is a Mojo::Log object?
13:36 batman Dandre: did you try?
13:36 Dandre no
13:37 denisboyun joined #mojo
13:37 bluescreen joined #mojo
13:38 Dandre I'd prefer to reuse log facility of the server app. Becaus if I chang mode from development to production I want the log output changed to
13:38 Dandre too
13:39 Dandre so I don't thing setting the file path to use will be the right answer in my case
13:39 btyler joined #mojo
13:43 Dandre What I have done and seem to work is to save $app->log in the startup code and reuse it later user a class method. I don't know whether this is recommanded or a good practice
13:44 sh4 joined #mojo
13:48 batman "user a class method" ?
13:57 mdom left #mojo
13:59 Dandre using...
14:01 Dandre batman: ie: http://pastebin.fr/28906
14:02 batman why do you do that? app->log() never change, unless you tell it to change. just use $app->log, $c->app->log, ...
14:02 batman $app = $self in your paste
14:10 ryozi joined #mojo
14:11 gryphon joined #mojo
14:29 rem_lex joined #mojo
14:36 denisboyun joined #mojo
14:43 Dandre batman: ok but in my module I don't have access to $app instance
14:44 batman ok
14:58 marcus batman: har vi noen endringer i ws-reconnecting.js ?
14:59 marcus batman: i forhold til https://github.com/joewalnes/reconnecting-web​socket/blob/master/reconnecting-websocket.js - bortsett fra at vi har renamet alle variablene til a b c d ...
15:01 marcus oh doh, wrong channel.
15:12 kwa Ember, Angular, Backbone or Knockout?
15:18 sh4 joined #mojo
15:18 russum joined #mojo
15:19 russum left #mojo
15:29 crab Silence
15:37 dqw6 joined #mojo
15:37 kwa I've heard that's good.
15:39 kwa Gonna go with Ember. I've at least heard of it.
15:39 gear joined #mojo
15:51 abhishekisnot joined #mojo
15:57 sri hmm, first validation questions on the list are very very odd... i take that as a good sign
15:57 sri who the hell redirects on validation failure?
15:57 tianon lolwtf?
16:01 sri CSRF token support might be worth considering... but only if someone comes up with a sensible proposal
16:03 sri that's unrelated to validation though
16:40 sri this might have been the last time that i bring design discussions to the mailing list :S
16:41 marcus sri: can't you just use Plack::Middleware::CSRFBlock if you want CSRF?
16:42 sri marcus: what's the relevance?
16:42 sri there's 3 mojolicious plugins for csrf
16:42 marcus oh
16:42 marcus so why do we need it in core? :)
16:42 sri we can potentially make it easier to use
16:43 sri form_for could automatically add a csrf_token field, and $c->validation->csrf could fail the validation if it doesn't match the token in the session
16:44 sri so in the end we could turn the whole decision of doing csrf into calling ->csrf or not
16:44 marcus https://metacpan.org/module/KOORCHIK/Mojol​icious-Plugin-CSRFProtect-0.14/README.pod looks easy enough
16:44 marcus it already updated form_for it seems
16:45 marcus doesn't hook into the validation tho
16:45 sri well, i'm impartial on it... so if there's the slightest resistence i'll just let it be ;p
16:45 marcus (of course :)
16:46 sri and by that i mean i recognize your resistance and will let it be :)
16:46 stokachu joined #mojo
16:54 good_news_everyone joined #mojo
16:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5vQndQ
16:54 good_news_everyone mojo/master ef1528d Sebastian Riedel: show chained checks in validation recipe
16:54 good_news_everyone left #mojo
16:56 dqw6 joined #mojo
17:04 henq joined #mojo
17:26 dvinciguerra joined #mojo
18:16 KindTwo joined #mojo
18:21 KindTwo joined #mojo
18:29 bobkare joined #mojo
18:33 denisboyun joined #mojo
18:35 trone joined #mojo
18:44 trone_ joined #mojo
18:56 sri the derp is strong on the list today
19:09 mire__ joined #mojo
19:20 gear joined #mojo
19:21 gear left #mojo
19:54 trone joined #mojo
19:55 gryphon joined #mojo
19:56 sri i suppose as far as finales go, braking bad was pretty good
19:59 sri *+e
20:02 Liam`` joined #mojo
20:10 rem_lex|pivo joined #mojo
20:26 bowtie_ joined #mojo
20:50 good_news_everyone joined #mojo
20:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Asu-Nw
20:50 good_news_everyone mojo/master e0375af Sebastian Riedel: show more flow variations for form validation
20:50 good_news_everyone left #mojo
21:18 cfedde joined #mojo
21:23 cfedde I'm using Plugin::Mount and public directories under hypnotoad for static assets in my apps.  Prior to a recent Mojolicious upgrade apps seemed to find the right static content.  After the update my static assets are all being looked for in a top level url rathern than a per mount point public dir. What did I break?
21:37 lukep joined #mojo
22:08 spacechicken joined #mojo
22:20 dqw6 joined #mojo
23:15 russum joined #mojo
23:16 russum left #mojo
23:25 napoleon joined #mojo
23:28 napoleon does /hello?format=txt work for anyone
23:29 napoleon never retrieves hello.txt.ep for me, always hello.html.ep
23:32 sri napoleon: where in the documentation did you read about that?
23:33 napoleon bunch of places that mention content-negotiation like https://metacpan.org/module/Mojolicious​::Guides::Rendering#Content-negotiation
23:33 napoleon using .txt or .html or .json or .xml works, and it says ?format= should work
23:33 napoleon also but I can't get it to work
23:33 sri content negotiaion != routing
23:34 napoleon whats that mean?
23:35 rem_lex| joined #mojo
23:47 moltar joined #mojo

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