The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-04-03

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

All times shown according to UTC.

Time Nick Message
00:06 shmuel joined #mojo
00:21 mattastrophe joined #mojo
00:25 jack joined #mojo
00:58 laouji joined #mojo
01:09 gryphon joined #mojo
01:25 punter joined #mojo
01:40 klapperl_ joined #mojo
01:48 aggrolite joined #mojo
02:22 inokenty joined #mojo
02:25 good_news_everyone joined #mojo
02:25 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/g0n8lg
02:25 good_news_everyone mojo/master fca2055 Sebastian Riedel: link to GitHub
02:25 good_news_everyone left #mojo
02:47 disputin joined #mojo
03:32 robinsmidsrod joined #mojo
03:35 sujithm joined #mojo
04:16 alnewkirk joined #mojo
04:49 laouji joined #mojo
05:07 denis_boyun joined #mojo
05:19 dotandimet joined #mojo
06:05 sujithm joined #mojo
06:15 Vandal joined #mojo
06:20 Eke- joined #mojo
06:22 gnephiak joined #mojo
06:29 sujithm joined #mojo
06:35 Negor|3 joined #mojo
06:35 Negor|2 joined #mojo
06:37 dotandimet joined #mojo
06:50 laouji joined #mojo
06:50 laouji_ joined #mojo
06:58 fhelmber_ joined #mojo
07:03 shmuel joined #mojo
07:06 eseyman joined #mojo
07:16 laouji_ joined #mojo
07:30 trone joined #mojo
07:35 dod joined #mojo
07:39 rawler joined #mojo
07:42 shmuel is there an explanation how the routing is done? how the router is finding an endpoint,
07:42 Adurah The documentation?
07:42 purl i think The documentation is the weakest part right now (The rest would have to stink really badly to compare ;)
07:42 shmuel when the bridges are executed and so on.
07:42 shmuel the docs talk a lot about how to define routes.
07:43 Adurah You want a diagram...?
07:43 shmuel I think (but not sure) that the router is searching for endpoint first,
07:44 shmuel and once found, it execute the bridges there were in the way.
07:44 shmuel yes, diagram will be nice.
07:44 Adurah I just banged on things till they worked.
07:44 Adurah I don't know of a diagram... someone make one.
07:45 shmuel sorry, I hate to do things that way. I like to understand how things works, so when it doesn't work I'll know why and how to fix that.
07:50 basiliscos joined #mojo
07:59 hummeleBop joined #mojo
07:59 Gedge joined #mojo
08:03 dotandimet joined #mojo
08:04 dotandimet joined #mojo
08:23 inokenty joined #mojo
08:27 Gedge_ joined #mojo
08:27 sujithm joined #mojo
08:32 maxhq joined #mojo
08:38 HtbaaPi_ joined #mojo
08:43 edestler joined #mojo
08:44 mire joined #mojo
08:50 ver joined #mojo
09:08 laouji joined #mojo
09:21 inokenty joined #mojo
09:23 sujithm_ joined #mojo
09:26 batman joined #mojo
09:27 batman joined #mojo
09:31 laouji joined #mojo
09:44 inokenty joined #mojo
09:46 meshl joined #mojo
09:57 rawler joined #mojo
10:05 hshong joined #mojo
10:06 hshong hi `Mojo::UserAgent::CookieJar` works different i expected, here: http://ix.io/brN/perl
10:07 hshong it should be '1'
10:17 bzero joined #mojo
10:20 zackiv31 joined #mojo
10:23 batman hshong: the cookie need domain and path as well
10:24 hshong yeap, i checked just now;
10:24 hshong batman: thanks
10:25 mire joined #mojo
10:28 laouji joined #mojo
10:30 jack joined #mojo
10:30 jack joined #mojo
10:38 rem_lex|pivo joined #mojo
10:46 geira joined #mojo
10:55 punter joined #mojo
11:06 geira joined #mojo
11:13 mattastrophe joined #mojo
11:18 d4rkie joined #mojo
11:20 rawler joined #mojo
11:25 sujithm joined #mojo
11:32 d4rkie joined #mojo
11:47 rawler joined #mojo
12:05 inokenty joined #mojo
12:11 good_news_everyone joined #mojo
12:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/GgwZdQ
12:11 good_news_everyone mojo/master 878b84e Sebastian Riedel: do not use each anymore
12:11 good_news_everyone left #mojo
12:13 sri for future reference http://blogs.perl.org/users/rurban/2014/04/do-not-use-each.html
12:16 neilhwatson joined #mojo
12:23 denis_boyun joined #mojo
12:34 dod joined #mojo
12:44 Negor joined #mojo
12:44 jberger_ joined #mojo
13:10 inokenty joined #mojo
13:22 sujithm_ joined #mojo
13:44 cfedde Are there conventions used when posting a large json document into a REST endpoint?
13:46 bzero joined #mojo
13:47 bluescreen joined #mojo
13:58 batman cfedde: what do you mean?
14:06 mire joined #mojo
14:08 gryphon joined #mojo
14:18 jim joined #mojo
14:25 inokenty joined #mojo
14:33 sujithm joined #mojo
14:35 sri Bender: trust batman
14:35 Bender OK, sri
14:37 bluescreen_ joined #mojo
14:39 aggrolite joined #mojo
14:43 dod joined #mojo
14:57 btyler joined #mojo
15:09 bluescreen_ joined #mojo
15:10 someanon joined #mojo
15:11 someanon hi guys!
15:11 purl OI! i'm a girl ye monkey!
15:11 beyondcreed joined #mojo
15:11 someanon i need help!
15:11 someanon with mojo
15:11 someanon can someone help me?
15:12 bzero joined #mojo
15:15 marty someanon:  ask away
15:15 someanon i 'm trying to use controller's write to generate csv from gzipped json
15:16 someanon and i got this message in morbo output
15:16 someanon Mojo::Reactor::EV: Write failed: Wide character in syswrite at /usr/lib64/perl5/IO/Handle.pm line 476.
15:18 someanon http://pastebin.com/546zfnbP
15:19 someanon this is my controller's action
15:20 someanon i'm using it from another one like that: $self->upload_csv($headers_config, $file_name, @files)
15:20 someanon and yes, there is utf8-characters in csv_headers
15:21 someanon but i got same error if use not utf8 symbols
15:21 marty I've never seen that error before so I may not be much help.   Have you ever gotten it to work correctly?
15:23 someanon if i dump csv-lines, they look good
15:24 someanon troubles happen when i use $self->write
15:27 basiliscos joined #mojo
15:29 marty if you could distill your example into a small testable case it would be easier to help.
15:31 asarch joined #mojo
15:31 someanon oh, i forgot that the error above repeating infinitly
15:32 someanon even if there is 100 lines
15:33 mattastrophe joined #mojo
15:34 someanon marty, ok, i will try
15:35 someanon maybe tomorrow
15:35 purl maybe tomorrow is a better day for some more enlightenment...
15:35 someanon yes i thing=))
15:38 bobkare someanon: my guess would be that you have unicode characters in $csv that you haven't encoded to any specific encoding, but you haven't even shown the code generating the CSV
15:38 mire joined #mojo
15:39 someanon bobkare, i tried to use utf8::encode($csv) before write
15:40 someanon that csv generating code is simple
15:41 someanon http://pastebin.com/RWVavTqC
15:42 someanon bobkare, .. it tried to use, but morbo outputs same error
15:43 bobkare try $csv = Encode::encode('UTF-8', $csv)
15:44 someanon bobkare, same error
15:48 bobkare Hm, dunno then. But in general: make sure you know which strings contain bytes and which have characters. And check any libraries involved with json/csv/IO for which functions want and give you bytes/characters
15:51 someanon bobkare, all, thanx!
15:52 someanon i will try
15:53 someanon bobkare, recently, a one or two weeks ago that code works, but after some changes stopped
15:54 someanon the same error: $csv = "god help me!\n"; $self->write($csv, $cb);
16:05 odc WARN> Use of uninitialized value $msg in pattern match (m//) at /usr/local/share/perl/5.14.2/Mojo/Exception.pm line 83.
16:05 odc this happens when i call render_exception without any argument
16:06 odc adding a $e //= '' in exception handling wouldn't hurt
16:06 batman odc: why would you render_exception without telling what went wrong?
16:06 batman odc: $self->render("exception", status => 500) is maybe what you want instead...
16:07 odc batman, lazyness :)
16:07 batman lazyness--
16:08 odc i wouldn't use perl if i wasn't lazy
16:10 denisboyun joined #mojo
16:13 asarch Do you have to run the server as root with Hypnotoad?
16:14 hesco how can I bump the logging level in a production installation?
16:15 asarch I: "hypnotoad script/my_app" and nothing happeds
16:15 someanon asarch, it run
16:15 someanon just check it in browser
16:15 Adurah It's a daemon.
16:16 asarch No, it does not" "Oops! Google Chrome could not connect to 127.0.0.1:3000"
16:16 someanon run it with -f flag
16:16 someanon means foreaground
16:17 asarch "Starting hot deployment for Hypnotoad server 5050."
16:17 asarch And that's all
16:17 meshl joined #mojo
16:17 Adurah Doubt hypnotoad would use the morbo port.
16:17 Adurah Try 80/8080.
16:18 asarch Yeah!
16:18 asarch It uses the 8080 port!
16:18 asarch Thank you guys
16:18 asarch Thank you very much :-)
16:19 asarch A very powerful web server powered by the most powerful programming language \o/
16:20 asarch This is great gentlemen
16:20 Adurah Never really thought of Perl as that, but ok.
16:25 inokenty joined #mojo
16:29 hesco If I use $validation->required(), do I also have to handle myself checking that and handling invalid data?  Or will this framework provide me some means to feed error messages into a data structure and let mojo handle the details under the hood?
16:31 hesco and if that reporting of data validation bubbling back up is not handled by mojo, are there any plugins which might make that easier for me, please?
16:33 batman asarch: http://thorsen.pm/perl/2014/03/09/mojolicious-on-digitalocean.html#step_4_listen_to_port_80_instead_of_8080 <-- if you want to listen to port 80, but still start hypnotoad as a normal user
16:35 batman hesco: it will stop the validation process if data is not present
16:35 batman hesco: the validator tries the first rule, then the second if the first was successful, and then the third if second was successful, ...
16:37 hesco thanks batman:  ok, well I keep getting redirected to the POST route, but it is not displaying my data, nor rendering any messages about missing required data.
16:38 batman you need to check the validation result.
16:38 batman mojo won't throw an exception or anything like that on invalid data
16:38 dod joined #mojo
16:38 batman https://metacpan.org/pod/Mojolicious::Validator::Validation#has_error
16:38 hesco how is it I feed validation errors back to the template?
16:39 batman i often do $c->validation->has_error and return $self->render(status => 400);
16:39 batman hesco: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Rendering.pod#Form-validation
16:39 asarch Thank you batman
16:39 hesco thanks batman, that looks like exactly what I need to read next.
16:39 asarch BTW, happy first 75 years!
16:40 cfedde we're developing a restpoint that has semantics like: "Reboot these 2000 systems".  the UI end will ship the request as a JSON document.   I've not done such an endpoint before.  Is it common to simply use Content-Type: application/json with the json doc in the body?  Historicaly requests have been smaller and so have been content-type: multipart/form-data.
16:40 batman 75 years..?
16:40 asarch ...of Batman?
16:40 batman haha. right. time flies ;)
16:40 asarch Cheers! o/
16:40 batman cfedde: that's what i would do
16:43 cfedde I'll proceeed in that direction till our UI guys start complaining.
16:43 dotandimet joined #mojo
16:43 batman why would they complain?
16:44 cfedde they might not.
16:45 cfedde there may be some constraint in the js framework they are using that limits how I do the end poinnt.  At worst it would reduce to 2000 posts of one element each.
16:46 good_news_everyone joined #mojo
16:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/y8NSpw
16:46 good_news_everyone mojo/master d35255e Sebastian Riedel: no need for javascript and stylesheet helpers most of the time
16:46 good_news_everyone left #mojo
16:50 disputin joined #mojo
16:55 meshl joined #mojo
17:03 punter joined #mojo
17:20 inokenty joined #mojo
17:41 meshl joined #mojo
18:17 sujithm joined #mojo
18:35 mire joined #mojo
18:41 good_news_everyone joined #mojo
18:41 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZGIPxA
18:41 good_news_everyone mojo/master 3264410 Sebastian Riedel: use tag instead of helper
18:41 good_news_everyone left #mojo
18:50 sri \o\
18:50 sri /o/
18:51 moritz |o|
18:54 bluescreen joined #mojo
18:59 btyler joined #mojo
19:08 jim how do i remove the [debug]Helper "***" already exists, replacing. messages from morbo log. seems to be related to embedded perl templates.
19:09 cfedde override the default template.
19:10 jim how to override the default template?
19:15 denis_boyun__ joined #mojo
19:17 dotandimet joined #mojo
19:53 inokenty joined #mojo
20:46 marty Jim:  is that the actual error message or did you replace the helper name with "***"
20:51 zackiv31 joined #mojo
20:57 hesco The behavior I seek is that an invalid submission reloads the previously entered data and returns the user to the form, to correct invalid data, assisted by error messages exposed on the form. Any pointers would be appreciated. Thanks.  https://gist.github.com/hesco/1782d63d3b9cc8cc3894
21:03 jim Hi Marty, I replaced the helper name with "***" there are many of them.
21:05 jim the debug lines look like this http://pastebin.com/XDRwGCH2, they are shown as debug not errors not warnings.
21:10 sri why are you replacing all those helpers?
21:10 inokenty joined #mojo
21:11 jim sri, I am not sure what I did, what might have caused this?
21:11 sri loading the taghelpers plugin a second time
21:11 jim ic let me check
21:13 jim I have $self->plugin(Taghelpers') only once in sub startup{ }, however I run morbo with config plugin, all the debug lines are after "Reading Configuration file ..."
21:13 sri http://mojolicio.us/perldoc/Mojolicious/Plugin/TagHelpers#DESCRIPTION
21:14 sri "This is a core plugin, that means it is always enabled..."
21:14 jim ahh, THank you sri, no need to load it.:-D
21:16 zackiv31 joined #mojo
21:22 punter joined #mojo
21:22 punter Minion is this week's winner: http://niceperl.blogspot.gr/2014/04/cii-metacpan-weekly-report-minion.html
21:41 punter joined #mojo
21:43 alnewkirk joined #mojo
21:45 denis_boyun joined #mojo
21:47 sri :)
21:48 sri http://wallgood.com/wp-content/uploads/2013/07/Happy-Minions-Wallpaper-HD.jpg
22:03 basiliscos joined #mojo
22:58 beyondcreed joined #mojo
23:00 d4rkie joined #mojo
23:05 punter joined #mojo
23:10 mattastrophe joined #mojo
23:20 inokenty joined #mojo
23:22 gryphon joined #mojo

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