Camelia, the Perl 6 bug

IRC log for #mojo, 2012-10-10

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

All times shown according to UTC.

Time Nick Message
00:20 jnap joined #mojo
00:56 mandreacchio joined #mojo
00:58 laouji joined #mojo
01:45 d4rkie joined #mojo
01:46 D4RK-PH0ENiX joined #mojo
02:00 mandreacchio joined #mojo
02:17 noganex_ joined #mojo
02:23 mandreacchio joined #mojo
02:55 Averna joined #mojo
02:59 mandreacchio joined #mojo
03:02 mandreacchio joined #mojo
03:43 mandreacchio joined #mojo
03:55 _bob joined #mojo
03:57 mandreacchio_ joined #mojo
04:30 mandreacchio joined #mojo
05:04 kevouze joined #mojo
05:37 Britzel_ joined #mojo
05:39 mandreacchio_ joined #mojo
05:43 ovnimancer joined #mojo
05:54 zpmorgan joined #mojo
06:22 Vandal joined #mojo
06:32 spleenjack joined #mojo
06:41 kevouze joined #mojo
06:47 davido joined #mojo
06:49 davido What namespace should be used for a module that is designed for use with Mojolicious, but doesn't fit the plugin framework?
06:49 davido Is Mojo::* politely reserved for core use?
07:01 dross win 14
07:01 dross oop
07:11 mandreacchio joined #mojo
07:17 yakudza joined #mojo
07:19 Mike-PerlRecruiter_ joined #mojo
07:31 pau4o joined #mojo
07:33 nic davido: Last word I saw from sri suggested MojoX is ok
07:33 buu davido: MojoX!
07:33 * buu snickers
07:33 purl snickers is a candy bar
07:33 nic and you're free to make up your own
07:34 nic only trouble with made up names is its harder to get new top-level names on cpan
07:34 davido Oh, for some reason I was thinking MojoX was out of vogue.
07:34 nic It was
07:34 nic It used to be marked 'deprecated', but sri peeled the stickers off
07:35 buu I'd name it mojox if you want everyone in the entire world to call it mojox from then on
07:35 buu See: DBIX
07:36 nic buu: You just need to hit them with that stick a bit harder
07:36 nic they'll get it in the end
07:36 buu If it comes to a war between pedantic correctness and human nature, I know which side I'm betting on
07:36 * nic hates the entire cpan messy namespace
07:37 buu I hate people trying to force differentiated concepts into abstract namespaces
07:37 nic One day pedants will rule this planet
07:37 buu I mean, it's easy to pick on dbix-class as a name, but it does sort of sum up the problem.
07:37 davido Is there any documentation on MojoX's deprecation and re-birth?  Or is it just #mojo knowledge?
07:38 nic Well, you can find which versions had it mentioned as deprecated and note which was the first version to not mention it being deprecated ;)
07:38 nic sorry, not being helpful, I don't even know which file included the mention
07:39 davido I assumed it must have been in Guides/CodingGuidelines, but maybe not.
07:39 nic that would be more logical than my coffee-less head came up with :)
07:41 mandreacchio joined #mojo
07:45 mandreacchio joined #mojo
07:47 ladnaV joined #mojo
07:57 batman joined #mojo
08:02 fhelmber_ joined #mojo
08:03 amirite joined #mojo
08:16 dpetrov_ joined #mojo
08:26 dpetrov_ joined #mojo
08:30 Kwa joined #mojo
09:09 mandreacchio joined #mojo
09:23 daxim joined #mojo
09:29 kitt_vl left #mojo
09:39 mjy left #mojo
09:48 lukep joined #mojo
09:50 batman sri: any suggestion on what i can call my $snmp->start method?
09:50 batman maybe it shouldn't be required at all...
09:51 batman maybe it should just start doing "whatever" when the queue of requests has elements + the ioloop starts
10:03 cosmincx joined #mojo
10:41 batman looks like s/start()// is the best solution...
10:46 yakudza joined #mojo
11:01 Foxcool joined #mojo
11:02 rem_lex| joined #mojo
11:15 Vandal joined #mojo
11:16 sri i only add ->start when i really need it
11:16 sri like for throttling with ->start/->stop
11:33 ObseLeTe joined #mojo
11:43 d4rkie joined #mojo
11:46 good_news_everyone joined #mojo
11:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XZcW7A
11:46 good_news_everyone [mojo/master] improved to method in Mojolicious::Routes::Route to allow controller classes containing "::" in shortcuts - Sebastian Riedel
11:46 good_news_everyone left #mojo
11:59 sunson joined #mojo
12:00 sunson I'd like to access a session variable, which is a two-levels deep hash, in my .ep template. How do I do this? (the variable is set in the controller as $self->session->{roles}->{Admin} = 1; )
12:01 sunson basically, I want the 'layout' to do intelligent displaying of menus based on the user's roles, which is set in the session.
12:06 motoboi joined #mojo
12:13 bc547 joined #mojo
12:20 sunson never mind, set up a variable like % $roles = session('roles'); and look it up. I was just wondering if there is a way to directly get values through the session() method by passing all the heirarchy of keys.
12:25 Adura Did you try... 'roles', 'Admin' or 'roles.Admin'?
12:26 batman sri: right. and i don't, so i've removed it... thanks :)
12:38 sunson Adura: thanks. will try that.
13:08 user_9267 joined #mojo
13:11 user_9267 hello
13:11 purl niihau, user_9267.
13:11 user_9267 I have a question about Mojo
13:12 user_9267 can I run Mojo application on hostgator
13:13 good_news_everyone joined #mojo
13:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5pijAw
13:13 good_news_everyone [mojo/master] improved router and renderer to allow camel case controllers - Sebastian Riedel
13:13 good_news_everyone left #mojo
13:13 sri that camel case controller thing is much more complicated than i thought :o
13:22 sri tempire, crab, marcus: do we really want that?
13:30 alex_K joined #mojo
13:35 bluescreen joined #mojo
13:41 alex_K joined #mojo
13:48 yko joined #mojo
13:49 jnap joined #mojo
13:56 gryphon joined #mojo
13:59 alex_K joined #mojo
14:00 alex_K left #mojo
14:01 alex_K joined #mojo
14:04 alex_K joined #mojo
14:11 amirite joined #mojo
14:13 yko joined #mojo
14:19 bzero joined #mojo
14:22 Jason__ joined #mojo
14:22 inokenty joined #mojo
14:25 alex_K left #mojo
14:25 alex_K joined #mojo
14:26 Leandr joined #mojo
14:41 knshaum joined #mojo
14:42 motoboi joined #mojo
14:45 amirite joined #mojo
14:47 zpmorgan joined #mojo
15:05 sh4 joined #mojo
15:13 basic6 joined #mojo
15:13 * sri waves
15:19 * basic6 waves back
15:22 basic6 i think the mojo guides need a lot more example codes. and by example i don't mean just a few lines of code where everything "unimportant" has been removed, but a fully working webapp (not lite, modules with singletons, database access and so on)...
15:22 basic6 ("codes" instead of "code" -> more than one such example)
15:24 sri singletons are not commonly used in perl
15:25 sri if you want examples, there are quite a few linked from the wiki
15:25 sri like https://github.com/tempire/MojoExample
15:26 sri tempire: i guess we lack a "how to build a blog" kind of introduction ;p
15:29 basic6 as silly as this may sound - that might actually be helpful. not necessarily a full, great blog application. i don't want to write a blog application. but the code might be a perfect example for the docs and for how to build complex mojo webapps in general
15:30 sri well, the problem with getting something like that into the core docs would be that we basically "bless" one model layer
15:30 sri mojolicious is specifically model layer agnostic
15:31 sri that's why all related information in the core docs is a little shallow
15:31 sri i believe the wiki has more
15:32 sri we generally expect the related plugins to take care of documenting that stuff https://metacpan.org/module/M​ojolicious::Plugin::Database
15:33 sri https://metacpan.org/module/​Mojolicious::Plugin::Mongodb
15:38 basic6 so i'd have to install a (mojo-) plugin in order to do what i can now to with DBI (only Mojolicious::Plugin::Database seems to take care of the db handle)
15:38 sri you don't have to, but you can
15:40 basic6 i'd rather not if i don't have to...
15:43 basic6 part of my original question was how/where to store db handles and other references: someone suggested to use singletons (although useless in perl, apparently) and store the module objects in the mojo object
15:44 pau4o left #mojo
15:44 basic6 the MojoExample doesn't do anything like that
15:45 sri mojoexample is full of best practices
15:46 sri tempire: it could use a little guide to explain those ;)
15:49 xxtjaxx_ Is it possible to change the config of a running mojo app? like posting json to the server which then is set as app.conf value?
15:49 basic6 and it uses DBIx, which may be the better way, but this is where i get lost (not having much perl experience and only having used DBI for database acess from perl)
15:49 sri guess that alone would be like 3 book chapters ;p
15:51 basic6 is there a similar mojo example which uses DBI instead of DBIx::Class ?
15:52 sri without much perl experience just using a plugin until you get more comfortable seems like a very good idea to me
15:52 sri https://github.com/kraih/moj​o/wiki/Example-applications # i'm certain there are
15:52 xxtjaxx_ sri: there is a blog app in the examples. its a lite app. with a slew of templates.
15:54 sri https://github.com/memowe/bootylite
15:54 basic6 sri: a plugin like Mojolicious::Plugin::Database ?
15:54 sri it's a very good example too, but file based, no database
15:54 basic6 and then i got the plugin, but no example code for it
15:54 sri basic6: yes
15:55 sri yea, the example there sucks a bit
15:56 sri http://api.metacpan.org/source/MADCAT/Mojoli​cious-Plugin-Database-1.07/t/01-functional.t
15:56 basic6 i mean i know enough perl to write a web application with mojolicious that uses a db, validates user access and so on, but things will look messed up, some stuff that may belong in the model will be in the controller and so on
15:56 sri something like that should be in the synopsis
15:56 basic6 (and using dbi for the db access, not dbix)
15:59 sri i've been meaning to do a full-stack spinoff of mojolicious with mongodb for quite some time, guess i'll prioritize that again
15:59 gryphon joined #mojo
15:59 basic6 gotta go now, maybe i'll be online later, otherwise tomorrow - thanks for the links so far
16:00 * sri waves
16:00 xxtjaxx_ sri: spinoff as in another mojo-ish perl framework with mongo in the mix?
16:00 xxtjaxx_ sri: or just a mongodb + mojolicious web application?
16:01 sri xxtjaxx_: a bunch of plugins and stuff that tie mojolicious to mongodb
16:01 sri more rails-ish
16:02 xaka joined #mojo
16:04 sri mojolicious is a great foundation for a higher level framework
16:04 xxtjaxx_ sri: yes.
16:05 xxtjaxx_ sri: If you are interested I'd love to have some commentary on what you think I did right or wrong in my Application and where I could do better.
16:11 crab where is it?
16:11 purl it's it!
16:16 xxtjaxx_ crab: the application?
16:16 purl the application is cute.  please do send.
16:21 xxtjaxx_ crab, sri https://github.com/andreas-marschke/nagplot
16:31 inokenty xxtjaxx_: http://pastebin.com/ps0dasji
16:55 xxtjaxx_ inokenty: point taken ^^
16:55 xxtjaxx_ inokenty: made sense at that late hour
17:01 amirite joined #mojo
17:17 jnap joined #mojo
17:26 sri xxtjaxx_: the mode handling code is wrong, startup is too late
17:27 sri mode needs to be set at compile time
17:28 sri ->to(controller => 'web', action => 'dashboard') is a bit verbose for my taste, i prefer ->to('web#dashboard')
17:28 sri but it's a matter of taste
17:30 sri https://github.com/andreas-marschke/n​agplot/blob/master/lib/Nagplot/Web.pm # this seems all pointless, you could just have a route to a template without controller
17:31 sri unused use Data::Dumper everywhere
17:32 sri i like the separation of business logic
17:33 sri but i guess i would turn it into a helper
17:33 sri my $source = $self->nagplot_source; or so
17:35 sri JSON::Util does not appear to use the logger
17:35 motoboi joined #mojo
17:35 sri guess it would look better as a helper too $self->sanitize_json or so
18:21 tempire I don't know that explaining usage of DBI is within the realm of a mojolicious tutorial
18:21 sri tempire: i don't think it is
18:22 sri but an external resource we could point people at would be nice
18:22 tempire I have the perfect link
18:22 tempire http://search.cpan.org/dist/DBI/DBI.pm
18:23 tempire that pod is pretty extensive. and bunce writes concisely
18:23 sri i think the problem is more that folks don't grok how to abstract their model layer correctly for mojolicious
18:23 yakudza_ joined #mojo
18:24 tempire I'm not sure how to address that.
18:24 sri the Model part of the growing guide doesn't appear to be anough
18:24 tempire I'm not even sure what they don't understand.
18:24 tempire connect, query, display.
18:24 sri well, just using DBI in your app directly sucks quite a bit
18:25 sri you're supposed to abstract out business logic into something self contained your web app can use
18:25 sri like the MyUsers class in the growing guide
18:25 tempire which makes DBI direct so much work.
18:25 tempire so maybe you're right, an explanation of what it means to use a result class and a resultset class
18:26 sri i think there's a barrier, people just want to get to the point where they can easily build a blog
18:26 sri we don't get them to that point with the guides
18:26 sri the guides are more of a manual for all our features
18:26 tempire The DBIC docs are a lot to follow, I can see how all that text and inconsistency would be difficult to look at for the first itme.
18:27 sri i'd like something that gets a beginner from zero to simple database backed blog
18:27 sri not explaining too many features, just the ones that are necessary
18:27 sri you know, very pragmatic
18:28 tempire looking at the mojoexample...even with my skewed perspective, it's pretty straightforward.
18:28 sri i like mojoexample a lot
18:28 tempire maybe if I renamed the ->db helper to schema it would be more obvious
18:28 sri i think a little tutorial for it would be more than enough
18:29 tempire that way $self->db->resultset('Blog') would follow an obvious directory path.
18:29 sri something that walks a beginner through the components and features used
18:29 tempire *$self->schema->resultset
18:30 tempire the visual for mojoexample could be modernized a bit.
18:30 sri questions like "why did you abstract out the scheme classes at all?" need to be answered for beginners
18:31 tempire hmm.  maybe a call for questions.
18:31 sri for us it's obvious, but the guy asking earlier wasn't there yet
18:32 sri you need real beginners to find those questions :)
18:32 sri we need guinea pigs!
18:32 * tempire lays out of the truffles
18:33 sri nom nom nom
18:33 purl I eat your head!
18:33 tempire guess I can just have people ask via github issues
18:35 sri Mojolicious::Plugin::Database really needs a better synopsis example
18:35 tempire I find everything about that plugin confusing.
18:36 tempire hmm, or maybe it was another similar plugin.  the pod is fairly simple now.
18:36 tempire must have been another one.  there's nothing to it.
18:37 sri thought i rememberd another dbi plugin too, but can't find it
18:37 sri ::Database just needs a better synopsis
18:39 sri tempire: btw. what do you think about the controller problem?
18:40 sri should ->to('Foo::Bar#baz') be valid?
18:40 sri as an alternative to ->to('foo-bar#baz')
18:41 sri it's a little complicated because both need to result in the same template path of foo/bar/baz.*.*
18:41 tempire I don't see why not.  Are there any drawbacks?
18:42 sri yea, the controller value in the stash may then be in two forms and advanced features that depend on it need to support both
18:42 sri controller => 'Foo::Bar' and controller => 'foo-bar'
18:42 tempire hrm
18:42 tempire that doesn't sound good.
18:43 sri basically force my $controller = Mojo::Util::decamelize($stash->{controller})
18:43 sri to normalize them
18:43 sri i fixed that for ->render in my last commit https://github.com/kraih/mojo/commit/13581​4622c3e25d7a899166a1d14cbb138a672db#L1R170
18:44 tempire so obvious to the new user or a possibility of missing something important by the helper/plugin author.
18:44 sri i don't know anything that depends on the controller value besides our ->render, but it's a possibility
18:45 sri normalizing is easy, but you need to know about it
18:45 tempire I like it.  It seems reasonable and obvious.
18:47 sri at first i wanted to normalize automatically in ->to, but that wouldn't work for $self->render(controller => 'Foo::Bar')
18:47 sri :)
18:51 sri a DBIx::Class schema generator command might be neat
18:52 sri model class generators in general
18:52 tempire mojoexample has something like that, but it's before I started thinking about commands.
18:52 tempire guess I could adjust that.
18:52 sri \o\
18:53 sri /o/
19:03 abra joined #mojo
19:19 Mike-PerlRecruiter_ joined #mojo
19:22 davido joined #mojo
19:23 tempire I must be a hipster.  I already use all the plugins included in http://vim.spf13.com/
19:23 * tempire used the plugins before they were cool
19:26 kevouze joined #mojo
19:29 fibo joined #mojo
19:39 good_news_everyone joined #mojo
19:39 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/aBa5Dw
19:39 good_news_everyone [mojo/master] added camel case controller examples - Sebastian Riedel
19:39 good_news_everyone left #mojo
19:56 gryphon joined #mojo
20:02 fibo joined #mojo
20:34 GabrielVieira joined #mojo
20:41 perlite joined #mojo
20:57 Jason__ joined #mojo
21:30 tempire Times have changed.  The stackoverflow Mojolicious questions get answered now before I even see them.
21:31 tempire Moar users!
21:47 sri \o/
21:50 buu |
21:50 buu \
21:50 buu My slash1
21:50 rhaen hm.
21:50 rhaen let's have a cocktail glas, hm?
21:51 rhaen \o/
21:51 rhaen |
21:51 rhaen |
21:51 rhaen hmpf. failed - let's go shopping
22:09 batman joined #mojo
22:20 jzawodn joined #mojo
22:22 xaka joined #mojo
22:43 mandreacchio joined #mojo
23:08 mandreacchio joined #mojo
23:16 baton8 joined #mojo

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