Camelia, the Perl 6 bug

IRC log for #mojo, 2013-10-10

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

All times shown according to UTC.

Time Nick Message
00:07 k-man left #mojo
00:07 hpekdemir joined #mojo
00:07 hpekdemir hi
00:08 hpekdemir I have a weird problem here. everytime I put my zeromq methods inside a Mojo::IOLoop I get error messages like: [error] Event "read" failed: Argument is not an object.
00:09 hpekdemir when I put them outside it works.
00:09 hpekdemir likewise: inside Mojo::IOLoop zmq_setsockopt(...); can not be found. outside the IOLoop it works.
00:16 hpekdemir ok I solved it.
00:46 shmuel joined #mojo
00:46 laouji joined #mojo
00:55 hesco hpekdemir: how?
00:56 hesco Does Mojolicious inherit from Moose under the hood?
00:56 hesco Can I provide attributes to these classes as if I were writing for Moose?
01:14 preaction hesco: no, it has its own Mojo::Base class
01:14 Adura Mojo has has like Moose has has.
01:20 hesco ha, thanks Adura
01:20 hesco so I can create attributes using has.  Where would that process be documented?
01:20 Adura Use of Mojo::Base? Hmm...
01:21 hesco perldoc Mojo::Base perhaps?
01:21 Adura Yeah.
01:21 hesco ok, will check that out
01:34 duncanthrax2 joined #mojo
01:42 d4rkie joined #mojo
01:46 hesco I see no plugin for Config::Simple and used mojo generate to begin writing one I can push out to cpan.
01:48 hesco I'm used to creating Moose attributes for config_files and cfg and using those in my objects, with the config_files being a required attribute at object instantiation, and ->cfg->isa('Config::Simple')
01:49 hesco I'm wondering how it is I can do that here.  create an attribute which ->isa('object') with that object's methods available to it.
01:53 johnny5_ joined #mojo
01:54 hesco meaning that the config_files arrayref is used to instantiate the ->cfg object
01:57 d4rkie joined #mojo
01:58 d4rkie joined #mojo
01:59 Mike-PerlRecruiter_ joined #mojo
02:02 johnny5_ maybe http://mojolicio.us/perldoc​/Mojolicious/Plugin/Config
02:15 bc547 joined #mojo
02:19 hesco thanks johnny5_:  but what I'm really looking for is a way of creating an $app->cfg object which has an $app->cfg->param() method and is available throughout the application.
02:20 hesco with Moose under the hood, I would create a ->cfg attribute and use a builder method to embed a Config::Simple object in the attribute.
02:22 buu hesco: What's wrong with helper?
02:34 btyler joined #mojo
02:58 hesco buu: I'm trying to sort out how to use it right now
03:02 hesco I want this to pass:
03:02 hesco plugin 'ConfigSimple';
03:02 hesco isa_ok( $app->cfg, 'Config::Simple' );
03:03 hesco can_ok( $app->cfg, 'param' );
03:03 hesco can_ok( $app->cfg, 'get_block' );
03:03 gryphon joined #mojo
03:16 buu hesco: Is ConfigSimple something you're writing?
03:47 btyler joined #mojo
03:53 preflex_ joined #mojo
04:16 hesco Yes, but its a wrapper around Config::Simple::Extended which is already written
04:17 hesco which uses Config::Simple under the hood which has been around for years
04:17 hesco buu:  that was in response to your question.
04:18 buu hesco: Well, by default $app has a ->config method..
04:18 buu Maybe you should just override that?
04:18 hesco how owuld I best do that?
04:19 hesco and where is it documented so I know whether that makes sense?
04:19 hesco Although I've been reading about Mojo for a couple of years, I only first tried to use it this morning
04:19 buu hesco: It's in perldoc Mojo
04:20 hesco thanks, looking there now
04:20 buu By default config is just a hash
04:21 buu The only built in code that actually uses app->config I can find is Mojo/Server/Hypnotoad.pm
04:21 buu 74:  my $c = $app->config('hypnotoad') || {};
04:22 hesco I want an object at ->cfg
04:22 hesco something with not just data but also methods
04:22 hesco trying to sort out how to do that
04:23 buu hesco: $app->helper( cfg => $config_object );
04:24 buu or possibly sub { $config_object }
04:24 buu But I'd try to reuse ->config, having cfg and config seems like a bad idea.
04:24 sri hesco: if you make a new config plugin you should follow the conventions used by the existing ones like JSONConfig
04:26 sri you can of course make your own conventions, but then it won't work together with anything else
04:26 buu sri: Does ->config have to return a hash or can it only support the config($x) interface?
04:26 sri honestly, i think you're rushing it, making a plugin before you know how helpers work is crazy
04:26 hesco looking at the perldoc, seems that is just a data structure as well:  say $config->{foo};
04:27 sri buu: it has to do everything it does now
04:27 * buu shrugs
04:27 buu sri: Nothing in the core seems to depend on it being a hash, but I suppose extensions might?
04:27 sri buu: that's insanity...
04:28 hesco Are there any examples for attaching an object to the $app object I could adapt from?
04:28 sri if you break existing functionality you're on your own
04:28 crab "attaching an object to the $app object"?
04:28 crab what does that even mean?
04:28 buu hesco: USE A HELPER
04:28 hesco understood, I'm thinking I should not override something existing, but create something new
04:29 crab yes, USE A HELPER
04:29 buu hesco: $app->helper(cfg=>sub{$object}); $app->cfg->die()
04:29 hesco isa_ok( $app->cfg, 'Config::-Simple' );
04:29 buu Yes?
04:31 sri hesco: you should understand existing conventions before creating something new
04:31 sri look at how existing config plugins on cpan work
04:32 crab and if you think something other than a helper is what you want, you're probably doing it wrong
04:33 sri http://api.metacpan.org/source/DATA/​Mojolicious-Plugin-YamlConfig-0.1.5/​lib/Mojolicious/Plugin/YamlConfig.pm
04:33 hesco they are all (at least the ones I've looked at) returning data structures with no methods
04:34 crab so?
04:34 sri they are using the existing config infrastructure
04:34 sri app->config and <%= config %>
04:35 dqw8 joined #mojo
04:41 hesco ok, that did not c reate any regression.
04:41 hesco next question is: How do I pass a \%hashref to the helper?
04:42 buu hesco: $app->helper(\%hashref)
04:42 buu where helper is cfg
04:43 hesco I need a path to the config file to instantiate the ->cfg object
04:43 buu hesco: helper maps a name to a subroutine
04:43 buu hesco: Create the config object before creating the helper
04:44 buu Create the helper using the 'finished' object
04:45 KindOne joined #mojo
04:46 hesco ok, that is what I was trying to do in the plugin, actually.  Though now I am thinking that was a deadend.
04:47 hesco I'm working up a paste right now
04:53 hesco ok, this is what I'm hearing so far:  https://gist.github.com/hesco/e86d4ba15b4f8d0a2025
04:54 hesco except I do not know how to feed the $args hashref into the ->startup() method.
04:56 hesco looking at the mojo generate app script/myapp lead me to perldoc Mojolicious::Commands, where the ->start_app is documented as: Mojolicious::Commands->start_app(MyApp => @ARGV);
04:56 hesco but I'm not sure how ->start_app() relates to ->startup()
05:01 buu hesco: start_app calls build_app which calls App->new->start(@_)
05:03 sri you've now reached territory where you're completely on your own
05:04 buu hesco: Wouldn't you rather just do CONFIG_FILE=foo ... perl app.pl
05:04 hesco After crawling about inside the code for a moment, I'm thinking I need to just hard code the config file path in, rather than trying to pass it in as I usually do.
05:04 hesco stepping back from the edge as it were
05:05 buu You normally pass config files as part of ARGV?
05:05 hesco thanks buu and sri and crab for helping me to think through this
05:05 hesco to start_app() ?
05:05 buu I mean in general
05:06 buu Any other web app
05:06 dotandimet joined #mojo
05:11 hesco Config::Simple::Extended provides a ->parse_url_for_config_path() method which derives a config file from the host name and path at which an instance of the application is hosted.  The enables me to host a single installation of the code base for an application and multiple clients using that code, each at their own domain name.
05:12 hesco I'm trying to replicate that behavior somehow.
05:15 hesco By way of illustration, I have updated this paste:  https://gist.github.com/hesco/e86d4ba15b4f8d0a2025
05:17 hesco that ->new constructor uses Config::Simple::Extended under the hood to parse and overload / inherit the array of config files to create an instance of the application which is unique to each client.
05:27 crab why isn't this a plugin like the other config plugins?
05:28 crab or is this just an illustration?
05:29 hesco I started to write it as a plugin, but got stumped somehow
05:29 crab oh
05:30 hesco folks were saying I wanted to invoke a helper instead so I tried that
05:30 hesco but I'm still stumped, actually
05:30 crab those are two separate things
05:31 crab the helper is so that $app->hesco-> works
05:31 crab the plugin is so you can write $app->plugin(hesconfig => ...)
05:31 crab the plugin can register the helper
05:32 crab i'd recommend against handling the single-file and multiple-file case differently, but that's just me.
05:33 hesco In practice I always use config_files => [ arrayref ]
05:33 hesco even if it is a single ini file
05:35 crab good. then get rid of the single-file code, i'd say. having unused branches like that is just an invitation to trouble.
05:35 hesco The end result I'm aiming for is this test passing:  isa_ok( $app->cfg, 'Config::-Simple' );
05:35 crab what does 'Config::-Simple' mean?
05:36 hesco https://metacpan.org/modul​e/Config::Simple::Extended
05:38 crab there's no mention of ::-Simple on that page, and i don't know of any such notation from another context
05:40 hesco that emoticon is an annoying artifact of my irc client which interprets a colon followed by another character as an emoticon rather than letting me communicate with others in a clear way
05:41 crab so your actual isa_ok() call just says Config colon colon Simple?
05:41 hesco exactly
05:41 crab so your test is failing because it's a Config::Simple::Extended instead?
05:42 crab or what?
05:42 crab what is the object actually? print ref $cfg
05:42 hesco because I have not yet figured out how to pass in the config file paths needed to instantiate the ->cfg() object
05:43 crab isn't that what you're doing with $args->{config_files}?
05:44 crab or you mean that doesn't work?
05:44 hesco yes, but how do I hand $args to the ->startup() method?
05:44 hesco where is that method called from?  and how do I inject my $args into that call?
05:47 crab ah. i thought you had it working already. you're not really supposed to do that.
05:48 crab but startup() is called by new()
05:49 crab and it's called with the same args as new(), iirc
05:49 crab so... what args do you actually get in startup?
05:51 hesco trying to sort out how to dump things to the logs at the moment
05:56 crab $app->log->info($app->dumper($thingy)) for example
05:57 hesco can't see what startup gets until I sort out how to log
05:59 crab $app->log->info($thingy)
06:05 hesco ok, logging now, can now try to answer your question.
06:05 hesco and I can also see that my $cfg object is working with the hard coded config file path, as well
06:07 hesco We can now write log messages.[]
06:07 crab don't know what you mean by hardcoded config file path. i see only your %defaults. is that what you mean by hardcoded?
06:08 hesco that empty arrayref is what I'm getting in @_ in the ->startup() method
06:08 hesco no.
06:08 hesco my current tests include this:
06:08 hesco my $args = { config_files => [ 't/conf.d/vol_engage.ini' ] };
06:09 hesco its generated by this:
06:09 hesco $self->log->warn( 'We can now write log messages.' . $self->dumper( \@_ ) );
06:10 crab where is that my $args? can you paste the code you're actually trying so i don't have to guess?
06:12 hesco yes, sir.  right here: https://gist.github.com/hesco/e86d4ba15b4f8d0a2025
06:13 Vandal joined #mojo
06:15 crab is Politics::blahblah::WWW a Mojolicious object?
06:15 crab er, i mean. does P::...::WWW inherit from Mojolicious?
06:17 hesco no, it is not,  that is there to demonstrate how I have started my webapps in the past.
06:17 hesco This is my first day working with Mojolicious
06:17 hesco I spent the last few days reading half of the Guides.
06:18 hesco and today I tried to start writing an app with Mojo.
06:18 hesco I have 25 passing tests of all of the routes I need
06:18 crab so the reason your startup() doesn't get the params from %defaults is that whatever code calls <Derivative::Of::Mojolicious>->new() doesn't pass in those arguments.
06:19 hesco that is what I would imagine, yes
06:19 hesco I have no idea what is calling it or how to pass in the $args I need
06:20 crab how do you run your app? (have you run your app yet?)
06:20 hesco prove -l t/routes.t
06:20 hesco sometimes I fire it up with morbo
06:20 hesco look at it in a browser
06:21 hesco the test script uses this:  my $t = Test::Mojo->new('VolunteerEngagement');
06:22 * sri is starting to like the idea of insert/update/delete being commands in mongodb
06:23 sri even if i don't support them completely from the start... people can just call $db->command(insert => ...) instead to get all the features \o/
06:23 crab hesco: so VolunteerEngagement is the Mojolicious derivative?
06:24 hesco it is
06:24 crab ok, so how do you get from P::...::WWW->new() to VolunteerEngagement->new()?
06:24 crab oh, "in the past".
06:25 crab what is the full morbo commandline that you use?
06:26 hesco morbo script/volunteer_engagement &
06:27 hesco or perhaps this insead:
06:27 hesco carton exec morbo script/volunteer_engagement &
06:28 hesco This is a project I am building for YAPC::NA; see: https://docs.google.com/document/d/1YYv9Vk​NdHZDYSvYmtYrZcSJuh8vWy_QtXaNiAhdLlGw/edit
06:29 crab hesco: is script/volunteer_engagement something that was generated by "mojo generate app ..."?
06:29 hesco yes
06:29 bc547 joined #mojo
06:29 hesco -BEGIN { unshift @INC, "$FindBin::Bin/../lib" }
06:29 hesco +BEGIN { unshift @INC, "$FindBin::Bin/../lib";
06:29 hesco +        unshift @INC, "$FindBin::Bin/../local" }
06:30 hesco that is the only change I have made since the mojo generate app invocation
06:30 crab see the call to ->start_app('VolunteerEngagment')?
06:30 crab (please don't paste stuff into irc)
06:31 crab if you change that to ->start_app(VolunteerEngagement => {...}), then your startup() sub will get the {...} as its argument.
06:31 crab i'm not sure if that's the right thing to do, though.
06:31 hesco right, I looked at that, but failed to see how it led me to the ->startup() call
06:31 crab it might be better, as suggested earlier, to take the name(s) of your config file from the environment.
06:32 sri that's not correct
06:32 sri arguments are passed to $app->start
06:32 hesco ok, testing that now
06:32 sri and the command system
06:32 hesco right, that is what I found when I crawled the code.
06:33 crab hesco: ->start_app() calls Mojo::Server->build_app('VolunteerEngagement'), which loads VolunteerEngagement and calls VE->new(), which calls startup()
06:33 hesco could not figure out what was calling the ->startup(0
06:33 sri passing arguments to web apps makes no sense whatsoever, don't try
06:33 crab and yes, new() doesn't get those arguments. sorry. i just looked at the code.
06:33 sri i suppose this is one of your first web apps?
06:34 sri imagine your app is started in a backbox you have no control over
06:34 crab remember you can set environment variables in script/whatever before you call ->start_app
06:35 sri in fact, if you run your web app in CGI, query parameters will be passed in @ARGV!!! so you might have just built a security flaw
06:37 sri the mojolicious command system of course knows about things like that, which is why you shouldn't try bypassing our conventions unless you really know what you're doing
06:37 hesco Actually I have been building webapps since 2004
06:37 hesco in perl, since 2001 in php
06:38 hesco they have all been cgi till now, but I'm trying to sort out Mojo so I can access PSGI
06:38 hesco But my apps tend to use a config file which facilitates reuse and portability.
06:40 hesco lines 36-56 at https://gist.github.com/hesco/e86d4ba15b4f8d0a2025 show my typical usage
06:40 hesco that code would be followed by $pb->run();
06:41 sri so you do want to hardcode config files and not pass them with @ARGV
06:42 sri just not in the class, but the script
06:42 hesco ok, that is where I got to on this question about two or three hours ago then.  But thanks for looking over my shoulder and confirming that.
06:43 sri convention is not to change the script
06:43 crab why is the existing config file mechanism not enough?
06:43 crab that's one thing i haven't understood
06:44 hesco I'll write a method in this module to sort out how to derive the config from the hostname using Config::Simple::Extended::par​se_url_for_config_path($url);
06:44 sri the root problem is that he's trying hard to bend mojolcious to his will, but mojolicious is an opinionated framework
06:45 hesco Trying to bring some of what I already know as I learn new things
06:45 sri this is going to be frustrating for you and anyone trying to help you until you understand mojolicious better, no other way
06:46 tianon sri opinionated?  WAT
06:46 * sri sets tianon on fire
06:46 * tianon burns
06:46 hesco ok, well we've all come to the same conclusion on this one
06:56 dod joined #mojo
06:59 themage joined #mojo
07:05 sri hmm, mango might actually end up with a lot less code after the command change
07:05 hesco is there anyway to derive the URL from a Mojolicious object?  Not a Mojolicious::Controller, but a Mojolicious.
07:06 sri only problem i see is precalculating the message size limit for batch operations
07:06 sri hesco: how would that ever work in any web framework?
07:06 dod joined #mojo
07:07 marcus hesco: you can't know that until you have a request.
07:07 sri suppose Mango::Protocol would require some api changes
07:08 sri it's a little frustrating planning these changes while trying to get a stable mango 1.0 out :o
07:09 sri only way for a stable mango release i see is to tie it to the latest stable mongodb
07:11 marcus sri: are you using Mango yet in any consulting projects?
07:11 sri nope
07:12 sri i imagine frequent mongodb changes that require api updates will be good for business though :)
07:18 mire__ joined #mojo
07:21 Dandre hello,
07:22 Dandre Is there anything similar to SSLVerifyClient for hypnotoad?
07:38 Dandre tempire: Are you there?
07:39 crab mangos are inherently unstable. if you don't eat them quickly, they become overripe.
07:41 basiliscos joined #mojo
07:45 denisboyun joined #mojo
07:45 trone joined #mojo
07:54 dpetrov_ joined #mojo
07:55 hummeleBop joined #mojo
08:15 sri :)
08:25 ver joined #mojo
08:29 arthas joined #mojo
08:29 jpn joined #mojo
08:44 good_news_everyone joined #mojo
08:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ndZZiw
08:44 good_news_everyone mojo/master 7c78bca Sebastian Riedel: improved performance of route matching in Mojolicious::Routes::Pattern
08:44 good_news_everyone left #mojo
08:44 sri funny nobody thought of that yet
08:49 sri the difference is quite substantial even for simple patterns
08:59 Adura That's not a slow perlvar anymore?
08:59 sri dunno, but even for a simple match like "/test/123" it's 20% faster
09:00 sri you're welcome to find something better
09:00 Adura http://perldoc.perl.org/perlvar.html#$' Might have to scroll up a bit.
09:00 sri also tried "substr $$pathref, 0, length($&), ''", which was only slightly faster for simple cases
09:03 sri oh, another perl 5.10-ism we can use :)
09:04 Adura I visit perlvar often enough, so much perl "goodness" there.
09:05 fhelmber_ joined #mojo
09:10 good_news_everyone joined #mojo
09:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/WxjbrA
09:10 good_news_everyone mojo/master f61a6e3 Sebastian Riedel: improved route matching performance further
09:10 good_news_everyone left #mojo
09:10 sri Adura++
09:12 sri difference is noticeable
09:13 Adura Not bad.
09:46 basic6_ joined #mojo
10:19 jpn joined #mojo
10:26 sri oh, i could allow $db->insert($bson) for preserialized documents
10:27 sri that would also mean you could hack in a c bson serializer for more performance when you really need it
10:28 sri (monkey patching Mango::BSON::bson_encode is messy because of all the custom types)
10:31 crab $db->insert($bison)
10:35 good_news_everyone joined #mojo
10:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/EXQ_vw
10:35 good_news_everyone mojo/master 8536012 Sebastian Riedel: added transaction example for non-blocking operations
10:35 good_news_everyone left #mojo
10:36 sri hope that gets the point across
10:54 marcus- joined #mojo
11:14 dotan joined #mojo
11:17 Adurah joined #mojo
11:23 hummeleBop joined #mojo
12:00 batman does include work differently from a layout, compared to a *normal* template?
12:29 maxhq joined #mojo
12:42 bc547 should mojolicious handle http POST requests with Content-Type: application/json correctly? e.g. treat the request payload as json and decode/store it in $self->param?
12:45 batman param()?!
12:46 batman that doesn't sound right
12:46 batman have you tried $c->tx->req->body->json->{foo} ?
12:48 bc547 batman: nm... my mistake. The data can be retrieved with $self->req->json
12:49 batman right. not body :S
12:52 bowtie_ joined #mojo
12:57 rem_lex joined #mojo
13:23 dod joined #mojo
13:28 asarch joined #mojo
13:36 k0xa joined #mojo
13:38 mire__ joined #mojo
13:48 bluescreen joined #mojo
13:59 btyler joined #mojo
14:21 d4rkie joined #mojo
14:23 dod joined #mojo
14:30 dqw8 joined #mojo
14:31 d4rkie joined #mojo
14:47 dod joined #mojo
15:15 gryphon joined #mojo
15:48 hrupp joined #mojo
16:02 mire__ joined #mojo
16:08 sh4 joined #mojo
16:21 btyler joined #mojo
16:29 fhelmber_ joined #mojo
16:31 hesco With much appreciation to sri, batman, marcus, crab and buu; each of whom helped walk me back from dead-ends on the way here and apologies to anyone I missed in these acknowledgements; I offer for your consideration:
16:31 hesco https://github.com/hesco/Moj​olicious-Plugin-ConfigSimple
16:31 hesco http://search.cpan.org/~hesco/Mojo​licious-Plugin-ConfigSimple-0.01/ <-- coming soon, url unconfirmed
16:35 sri hesco: well, you pretty much ignored my advice
16:38 sri the point of conventions like using app->config consistently is that higher level components can depend on it
16:39 sri your plugin can't configure hypnotoaod without intervention for example
16:39 btyler joined #mojo
16:41 hesco sri: so $app->config returns a HASHREF data structure?
16:42 sri http://mojolicio.us/perldoc/Mojo#config
16:42 mire__ joined #mojo
16:43 hesco I will take this as a yes: my $hash = $app->config;
16:44 sri it's great you want to build plugins, but they just won't be idiomatic at this point
16:45 hesco can a ->register return an array?  If so, I can support the idiomatic ->config as well as the ->cfg object I seek to allow for a more comfortable transition from my legacy coding habits.
17:01 batman hesco: no
17:02 batman nevermind me.
17:06 hesco thanks batman, that is what my tests seem to indicate
17:06 batman hesco: why can't you just modify config() ?
17:07 hesco config() is a data structure and I want an object
17:07 hesco though that gives me an idea actually.
17:07 hesco testing that now
17:13 hesco hold that thought.  Actually the plugin() function does seem to cooperate with wantarray
17:13 hesco ok 3 - registering the plugin as a scalar returns expected data structure
17:13 hesco ok 4 - registering the plugin as an array also returns an idiomatic config data structure
17:13 dvinciguerra joined #mojo
17:15 hesco sri, batman: and when I wantarray, I get as my second element the object I want, so I think we can all be happy with the rersult.  Cleaning up and pushing back out.  Would appreciate your review, again if you have a moment.
17:16 batman i don't get why you can't just use the defaults
17:16 batman why download three extra modules, just for config...?
17:18 dod joined #mojo
17:23 hesco Can't say it more precisely then this: to allow for a more comfortable transition from my legacy coding habits
17:23 batman change is pain. embrace change
17:23 hesco I'm updating perldoc now
17:49 btyler joined #mojo
17:57 hesco ok, latest version (supporting idiomatic mojo usage) now push'd to cpan and github: https://github.com/hesco/Moj​olicious-Plugin-ConfigSimple
18:01 sri hesco: i'm afraid there is nothing idiomatic about that
18:02 sri in fact, i don't even understand it
18:02 sri this is an idiomatic config plugin https://github.com/kraih/mojo/blob/ma​ster/lib/Mojolicious/Plugin/Config.pm
18:04 sri another one http://api.metacpan.org/source/KIMOT​O/Mojolicious-Plugin-INIConfig-0.03/​lib/Mojolicious/Plugin/INIConfig.pm
18:05 sri and another one http://api.metacpan.org/source/DATA/​Mojolicious-Plugin-YamlConfig-0.1.5/​lib/Mojolicious/Plugin/YamlConfig.pm
18:15 denisboyun joined #mojo
18:20 punter joined #mojo
18:25 hesco sri: so those each expose a ->parse method which returns a HASHREF, as well as a ->register method which returns (2 of 3 times) some variation on this:  $app->defaults(config => $app->config)->config;
18:26 hesco they may or may not include other methods.
18:27 hesco at this point I'm way past the time I need to be focused on other tasks.  Guess I will have to return to this soon.
18:40 tba joined #mojo
18:49 jim joined #mojo
18:50 mire__ joined #mojo
18:51 jim left #mojo
18:51 jim joined #mojo
18:53 jim Hello everyone, i am very new to mojo and web programming. using it for work project. I get"431 request header fields too large" error. I put too much text in textarea and got this error. any idea how to approach this issue?
18:56 mst are you using a javascript library to submit the form?
18:56 jim no let me post the code to a url
18:57 jim i just started web programming knew nothing about javascript..
18:57 mst a textarea is submitted as part of the request -body-
18:57 mst so 'request header fields too large' and 'amount of text in a textarea' shouldn't be related
18:57 marty joined #mojo
18:58 sjn jim: are you making a GET or a POST request? (it should say in the <form method="<GET or POST>"> field)
19:00 jim here is the code http://snipt.org/AiZf5
19:00 jim sjn, not sure..
19:01 jim i am basically doing a very small project, user fills in two textarea from, to and I need to change from to to in a file.
19:02 sjn jim: I'm guessing it's a GET request
19:03 jim If i put small amount of text in the text area, it is fine, I can get the from to, but if i put too much data in the two text area I get the following error
19:03 sjn change "get '/change' => sub {" to "post '/change' => sub", and add 'method="POST"' to your <form> element in the index template
19:04 sjn usually, GET requests are limited to about 3000 bytes or so
19:04 sjn POST requests don't have that limitation
19:04 jim http://snipt.org/AiZh0 I get this error, yes it is a GET request
19:04 jim @sjn thx, will try
19:04 sjn one way to check if you're using POST or GET, is to check the URL you end up with after submitting some text
19:05 jim the url i get is very long, has all the data i put in the textarea
19:05 sjn jim: if text you wrote seems to have been added to your URL, you're using GET
19:05 jim thx! will research about them
19:06 sjn use POST if you want to submit more that 3kB of data
19:10 TitanOfOld joined #mojo
19:13 jim @sjn, thx! it worked
19:16 Mike-PerlRecruiter_ joined #mojo
19:17 jim thank @mst too
19:19 dotandimet joined #mojo
19:38 stephan48 joined #mojo
19:56 tempire ooo
19:56 tempire http://www.dropzonejs.com/?r=hackernews
20:13 hummeleBop joined #mojo
20:22 perlite joined #mojo
20:32 lukep joined #mojo
20:33 * sri wonders if he should just get a nexus 5
20:43 zivester joined #mojo
20:59 marcus sri: why?
21:00 sri because i don't particularly care for ios anymore and a change might be nice
21:00 marcus well, you'll get wireless charging at least :)
21:00 marcus I really love ios7 actually.
21:01 sri too unfinished
21:01 * marcus spent most of today porting an ios app to 7
21:01 sri i also don't actually like the hardware anymore
21:01 marcus mostly removing custom chrome.
21:02 marcus sri: weirdo
21:02 beyondcreed joined #mojo
21:02 marcus I can see people not liking ios7
21:02 marcus but the hardware quality is undeniable
21:02 sri back of the iphone5 looks just wrong
21:02 sri with the 3 parts
21:02 marcus compared to the nexus 4 or htc one for instance the build quality is so superior
21:03 * sri said that last year too :)
21:03 * sri loved the iphone4 design
21:03 marcus heh glass back :)
21:03 sri ye
21:03 marcus double the chance of breaking it
21:04 marcus I was so happy when they switched to the unibody design
21:04 sri nexus 5 from the leaks does look pretty nice and is dirt cheap
21:04 sri almost impulse buy
21:04 marcus yeah, it's probably the best android buy
21:04 marcus I almost bought a nexus 7
21:04 marcus (the new one)
21:04 marcus but decided to go for retina ipad mini
21:05 sri one 5c = 2 nexus 5 is pretty crazy
21:05 sri the damn thing looks so cheap
21:05 marcus the 5c or the nexus 5?
21:06 sri 5c
21:06 sri no wonder it doesn't sell
21:06 marcus I never had any interest in it
21:07 marcus I guess android 5 might be nice
21:07 marcus I still think 4.3 is a bit crap compared to ios
21:07 sri wonder if i would miss elastic scrolling :)
21:07 marcus I do
21:08 marcus Also I tend to start to try to tweak it.
21:08 marcus and it hardly ever ends well
21:09 marcus I found miyagawa's post on wireless charging interesting tho http://weblog.bulknews.net/post/6284251​0902/wireless-charging-now-becomes-real
21:09 sri yea, nice
21:10 sri a desk with that built in would be awesome
21:13 dvinciguerra joined #mojo
21:13 marcus Really looking forward to getting the new kindle as well.
21:15 sri love the paperwhite
21:15 marcus sri: I've preordered the new one. Due to be delivered on the 18th
21:16 marcus I didn't get the paperwhite last year, so I guess it's going to be a pretty big improvement :)
21:17 marcus DELIVERY ESTIMATE Thursday, October 17, 2013 - Monday, October 21, 2013 by 8:00pm
21:18 sri the light is amazing
21:20 marcus I have a light cover on mine now, which is not as good
21:20 marcus It can actually be a bit annoying
21:20 marcus If you hold it the wrong angle :)
21:21 * marcus is currently reading chronicles of amber
21:21 marcus which I was unable to buy electronically, and had to resort to pirate a scanned copy of :-/
21:21 marcus with some OCR issues
21:23 marcus the books are awesome tho
21:42 TitanOfOld joined #mojo
22:14 bpmedley joined #mojo
22:21 russum1 left #mojo
22:57 rem_lex|pivo joined #mojo
23:16 dvinciguerra_ joined #mojo
23:48 bpmedley https://gist.github.com/brianmed/6927400  <-- Mojolicious::Lite example of WebRTC and DataChannels.  The gist includes signaling.  I'm curious if my approach is valid.

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