Camelia, the Perl 6 bug

IRC log for #mojo, 2012-10-14

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

All times shown according to UTC.

Time Nick Message
00:07 ObseLeTe joined #mojo
00:07 tempire hello hello
00:07 purl o/` Hello hello? Is there anybody in there? o/`
00:08 tempire yes.
00:43 tempire I really like how rails asset pipeline handles pre-processing
00:44 sri tempire: magic comments? Oo
00:44 tempire not that part
00:45 sri the more i learn about postgres the less i like it :/
00:45 tempire that's just a cheaters dsl
00:45 sri pubsub is interesting though
00:45 tempire but the file.css.scss.epl.moarprocessors.chained.together
00:45 tempire might be too confusing though
00:46 sri ah, that's ok
00:46 tempire postgres does pubsub?
00:46 sri but isn't that bad for minifying?
00:46 sri you want to concat the file before minifying
00:47 sri *files
00:47 sri i guess it doesn't matter much
00:48 memowe joined #mojo
00:48 sri maybe if you want to gz the final file
00:48 sri tempire: oh, yes it does
00:49 sri NOTIFY/LISTEN
00:49 tempire I've never used postgres before.
00:49 sri with channels and everything
00:49 tempire but it seems like it does ALL THE THINGS
00:49 sri i'm not having much fun with it though :/
00:50 sri lots of things that could be fun have batshit crazy sql syntax
00:50 tempire I wonder what sql alternatives exist that just aren't popular enough
00:51 sri my favorite will forever be the redis protocol
00:51 sri guess with embedded LUA it's a little crazy now too
00:52 sri ops, i mean Lua
00:52 tempire PERL
00:52 sri HYPNOTOAD
00:52 purl ALL GLORY TO THE HYPNOTOAD!!!
00:53 sri i'm still having the most amount of fun with redis and mongodb
00:54 tempire I've essentially copied sinatra's asset format
00:54 tempire reading it from myapp.conf
00:54 tempire I could do the asset.preprocessor.chaining, but then there's the issue of passing options to the preprocessors
00:54 sri good point
00:54 purl nice and sharp
00:55 tempire though maybe those can be in the collections
00:55 tempire optional hashref at the end of the list
00:56 sri hmm, considering that crab will work on postgres anyway, i guess it wouldn't hurt if i keep focusing on mongodb
00:56 tempire what's crab doing?
00:56 sri he only told me in private, i'll let him answer if he wants to :)
00:57 tempire looks like every core dev is working on something
00:57 tempire though I'm most excited about marcus' secret project.
00:57 sri his not-so-secret project? ;p
00:58 tempire yes, his not-really-announced-maybe secret project
00:59 GabrielVieira2 joined #mojo
00:59 tempire is there a de-facto book on database design?
01:08 kthakore hi tempire
01:08 * tempire waves violently
01:08 kthakore whats up
01:13 tempire has anyone here used sinatra's assetpack?
01:14 tempire echo echo echo
01:29 kthakore no?
01:29 purl or a built-in
01:29 kthakore tempire: what is that?
01:29 purl that is true too.
01:30 kthakore stfu purl
01:30 purl YAASA, kthakore!
01:30 tempire https://github.com/rstacruz/sinatra-assetpack
01:55 spyder2010 joined #mojo
01:55 sri looks like python wants a piece of the async pie https://plus.google.com/u/0/115212​051037621986145/posts/fnb8pqsGGb2
01:59 davido joined #mojo
02:14 spyder2010 joined #mojo
02:21 kevouze joined #mojo
02:39 bluescreen joined #mojo
02:41 gryphon joined #mojo
02:49 noganex_ joined #mojo
02:52 SmokeMachine joined #mojo
03:22 xaka joined #mojo
04:33 Foxcool joined #mojo
04:43 bluescreen joined #mojo
05:36 Vandal joined #mojo
06:09 marcus morning fellow hoomans.
06:09 * marcus brought the laptop to the beach
07:18 Mike-PerlRecruiter_ joined #mojo
07:49 Foxcool joined #mojo
07:55 sh4 joined #mojo
08:03 davido joined #mojo
08:27 jamesw joined #mojo
09:11 asarch joined #mojo
09:22 davido joined #mojo
09:43 Britzel_ joined #mojo
10:34 abra joined #mojo
11:02 rem_lex| joined #mojo
11:22 ladnaV joined #mojo
11:25 Vandal joined #mojo
11:39 batman left #mojo
12:14 batman joined #mojo
13:13 vishwanathms joined #mojo
13:14 vishwanathms_ joined #mojo
13:20 sh4 joined #mojo
13:29 vishwanathms_ joined #mojo
13:29 vishwanathms joined #mojo
13:34 ki0 joined #mojo
13:37 human39 joined #mojo
14:01 ryozi joined #mojo
14:08 gryphon joined #mojo
14:13 duncanthrax joined #mojo
14:15 duncanthrax hi all
14:16 duncanthrax quick question: Can I set up a route to cause an external redirect without handing off to a controller action?
14:22 batman duncanthrax: you could use to(cb => sub { $_[0]->redirect_to(...) });
14:23 duncanthrax ah ok :) thanks, that makes sense
14:23 dwilkinsperlorg joined #mojo
14:26 sri eeep
14:27 sri just use the pretty version
14:27 sri ->any('/lalal' => sub { shift->redirect_to(...) })
14:31 duncanthrax thanks, looks nicer :)
14:32 batman sri:)
14:33 batman duncanthrax: you can also choose between the method: use get(.... => sub {}) instead of any() to just catch GET requests
14:33 duncanthrax just transferring my lite code to the full thing, while trying to refactor everything. I might come up with more questions :)
14:34 batman https://github.com/jhthorsen/mojo-snmp <-- i think i'm pretty much done with the snmp library now. even written some unittests to see that it actually works :)
14:34 batman not sure about my "master_timeout" attribute...
14:35 batman i'm really pleased with the number of method/attributes. not sure if i've ever written a library with this few methods :)
14:37 batman i'm considering hiding "ioloop" attribute as well.
14:37 batman not sure if it's any reason to expose it at this point
14:39 sri batman: i like having ioloop attributes, since it allows embedding in different environments
14:39 sri emulate blocking and the like
14:40 batman yeah, but should it be public?
14:40 sri if it's private you can't do that
14:40 batman ok. *rollback last commit*
14:41 sri i'm not saying it makes sense for snmp
14:41 * batman is confused
14:42 sri but in general... i could embed Mojo::SNMP into a blocking Mojo::Useragent
14:42 batman yeah. will keep it public then
14:42 sri $snmp->ioloop($ua->ioloop); $ua->get('mojolicio.us');
14:43 batman right
14:44 sri if you only want to support the singleton it doesn't make sense though
14:44 batman it's up to the user really
14:44 * sri nods
14:45 batman but i'm defaulting to singleton to make it simpler to use unless you know you're doing
14:45 batman s/unless you know you're doing/by default/
14:45 sri Mojo::Server::Daemon does the same
14:45 batman i think clever defaults make sense
14:46 batman it's super anoying to set attribute values when you really don't care :)
14:46 sri not really related, but this recipe may give you an idea of what i mean http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Cookbook#Web_server_embedding
14:47 batman yeah. i'm doing that at work
14:49 batman https://github.com/jhthorsen/mojo-sn​mp/blob/master/lib/Mojo/SNMP.pm#L247 <-- would you mind looking at this method to see if i'm doing it "right" ?
14:50 batman i was thinking about hooking into the internals of snmp and make the ioloop watch the filehandles, but i think it will probably blow up
14:50 batman s/snmp/Net::SNMP/
14:55 batman i have one issue with the code and that is that i have no idea how to emit finish/timeout if i have multiple Mojo::SNMP objects
14:56 batman the only way i can see is to add the objects to a package variable and loop through them when (not $DISPATCHER->one_event)
14:56 batman but i don't like it
14:58 sri i wish more blocking modules would just expose handles so we could attach i/o watchers and make them truly non-blocking
14:58 batman +1
14:58 purl 1
14:59 sri like DBD::Pg... their async mode is completely useless without handles
14:59 batman :/
14:59 sri i've actually seen code that tries to guess the file descritptor number! and attaches an i/o watcher to that xD
14:59 batman https://metacpan.org/source/DTOWN/Net-​SNMP-v6.0.1/lib/Net/SNMP/Dispatcher.pm <-- maybe i should just override this module...
15:00 batman holy crap. sounds like bad practice :)
15:02 sri yea, it uses an 1 second timer as fallback, for polling, and the last active file descriptor number to poll on i/o... with a little luck it's the fd of DBD::Pg
15:02 batman :)
15:04 kthakore MOrning
15:05 * sri waves
15:05 kthakore hi sri whats up?
15:05 sri clouds
15:06 * sri is still trying to decide if he will invest more heavily in postgres or mongodb
15:07 kthakore for what type of data?
15:08 sri a general puprose model layer for mojolicious i will use in new examples
15:18 kthakore ah ok
15:18 kthakore sqlite?
15:18 purl i heard sqlite was an instant database! also easy to backup (one file per database). like a local mysql install, but with a sane upgrade path. see DBD::SQLite (no server required! joy!), and also the fk trigger generator at http://xrl.us/t4tb or pfn but it has dangerous crocodiles or nice, but it will in rare situations throw strange errors at me. or acceptable or kicks the crap out of MySQL
15:19 sri something more serious than sqlite
15:19 Foxcool joined #mojo
15:25 kthakore sri: seriousSQL !?!
15:26 kthakore I heard drizzle is cool too
15:26 sri the options are postgres and mongodb :)
15:26 kthakore ok you dah baws
15:27 sri long time since i last heard someone mention drizzle
15:27 kthakore sri: How do I get Mojolicious::Renderer [$c->render({ json=> .. etc ] to handle utf8 string without double encoding?
15:27 sri mariadb seems all the hipness lately
15:27 kthakore sri: drizzle drizzle drizzle
15:28 sri kthakore: not enough context
15:28 kthakore hmm ok I will make a gist
15:28 sri json => ... works with characters, so just don't double encode ;p
15:29 sri basically all rendering in mojolicious works with characters, unless their description says otherwise
15:30 kthakore I am using mysql, with enable_utf8=1 flag, and utf8 charset on the tables, etc
15:31 kthakore I just don't understand where it is being encoded twice
15:34 kthakore sri: why not mysql for your example?
15:34 sri it's usually DBI's fault :)
15:34 sri oracle
15:34 kthakore DBIx::Class ?
15:34 purl it has been said that DBIx::Class is a resultset-driven ORM with a Class::DBI compatiblity or http://lists.scsys.co.uk/m​ailman/listinfo/dbix-class or see 'dbic repo' or http://dbix-class.shadowcatsystems.co.uk/ or discussed on #dbix-class or a bit like handing an automatic rifle to a squirrel. or ilmari's mro orm or known to be slow at startup
15:34 sri blocking
15:34 purl blocking is worse than non-blocking
15:34 sri !
15:34 kthakore ah right I keep forgetting
15:34 sri i want a blocking/non-blocking hybrid again
15:34 sri like the user agent
15:34 kthakore what is that?
15:34 purl well, that is true too.
15:35 kthakore blocking/nonblocking in db?
15:35 sri doesn't exist yet
15:35 kthakore ah ok
15:35 sri well...half exists for mongodb
15:35 sri i've been working on that before
15:36 kthakore ah ok
15:36 kthakore have you heard of Riak?
15:37 kthakore I use that for our cardiac DB/Reporting application
15:37 kthakore which is build on mojolicious, backbone.js, bootstrap
15:37 kthakore \o/
15:38 kthakore sri: btw did I show you http://scratchd.ca? Mojo server that talks to android/iphone app. :D
15:56 sri kthakore: yea, i've used riak too, but i doubt it will ever be a general purpose database
15:57 kthakore oh yeah? why do you think that?
15:57 sri oh, neat mobile app
15:58 sri the riak api is too complicated and the whole thing lacks focus
16:00 sri components like the key/value store, riak search, secondary indexes... feel like separate projects
16:00 sri not to mention the erlang config files
16:01 sri or the erlang examples in the docs
16:22 rhaen oh!
16:22 rhaen hej, Mojo is getting more famous with all the articles around it :)
16:23 sri some people trying to stir up drama it seems :)
16:23 rhaen jep, I should join them with an article, too :)
16:23 sri \o/
16:24 rhaen sri: didn't know that you was a badass in the Catalyst project.
16:24 rhaen err s/was/were/
16:24 rhaen anyways - let's build a RPM for the new version.
16:24 sri i don't even know those people ;p
16:25 rhaen I can remember the "war" about the debian package at that time when we were close to 1.0
16:25 rhaen that was enough for me. :)
16:25 rhaen anyway - let's do some RPM work
16:28 arthas_ joined #mojo
16:29 rhaen sri: anyways, I was working with Mojo on Windows alot.
16:29 rhaen sri: everything seem to be pretty stable and worked reasonably well for me.
16:29 sri \o/
16:30 rhaen sri: choosing DB backends is a little problem on Win32 - however, I am using redis for almost everything and it works well.
16:32 rhaen ok, built
16:40 rhaen sri: I am providing rpms for two projects I am using, Mojolicious and collectd.
16:41 rhaen both have something like 2-5 downloads a day which is quite remarkable.
16:41 rhaen so it's always good to provide updates as soon as they are out.
16:52 Polarn joined #mojo
16:58 sri http://blogs.perl.org/users/ovid/2012/10/mojoli​cious-an-unexpected-result.html#comment-219304
16:58 sri i've commented
17:00 asarch joined #mojo
17:00 rhaen that's ok.
17:01 rhaen Don't try to "fight" back - as it won't be in the streamline of the Mojo movement :)
17:01 rhaen We just want to get some work done :)
17:01 sri i have no interest in fighting whatsoever ;)
17:02 rhaen btw, I always felt the start with Mojo without the need of CPAN as a plus.
17:02 rhaen if you want to run https requests you have to make a use of CPAN anyways
17:02 Britzel_ How can CPAN modules contribute to better Mojo performance? Example(s)?
17:02 sri EV
17:02 Britzel_ k
17:03 Britzel_ Never touched that part of Mojo until now...
17:03 sri depending on your needs a psgi web server can also result in more performance
17:03 Britzel_ ok
17:03 rhaen Britzel_: it's getting interesting when you are looking in all the event stuff.
17:03 sri if you don't need any of the event features starman can be pretty good
17:04 sri it's all about tradeoffs
17:04 rhaen sri: the company I was working for is still using my Mojo stuff for accessing a media database.
17:04 Britzel_ I haven't had the need for event driven stuff so far. Indeed, I don't know where I would need that. Any good reading on tha taspect?
17:04 sri the cookbook has a few examples
17:05 rhaen Mojo as frontend to a MongoDB. Something like 500 users are using it all the time - it's fine.
17:05 sri but we still need a really good introduction to event loops
17:05 rhaen balanced with 3 apaches using mod_proxy_balancer
17:05 sri neat
17:05 rhaen sri: I really like the node.js video transcoding examples.
17:06 rhaen sri: like start encoding a job - and react on the event once the job has finished and emitted the event "I am finished"
17:06 sri perl folks usually lack basic understanding of how event loops work
17:06 sri javascript has it a bit easier there
17:07 Britzel_ That certainly applies to me :)
17:07 sri i would love something that starts at zero
17:07 rhaen sri: hm, I've read somewhere that javascript provides the best idle performance - I still like the quote
17:07 sri like "an event loop is basically a while (1) {} loop...yada yada"
17:08 Britzel_ sri: That's all clear to me, what I need is a good example where I would need something like this in web app programming.
17:08 rhaen Britzel_: a good example might be resizing thumbnails
17:08 Britzel_ But I will check the cookbook.
17:08 sri Britzel_: http://mojolicio.us/perldoc/Mojoli​cious/Guides/Cookbook#REALTIME_WEB
17:09 rhaen Britzel_: e.g. photographers who upload huge images and you provide the thumbs for the webpage. Probably something like this.
17:09 Britzel_ ah, ok
17:09 sri websockets are a great example imo
17:10 rhaen sri: but usually very specific to web stuff :)
17:10 sri he was interested in a web example ;)
17:10 rhaen sri: will you blame me if I am using Mojo::IOLoop stuff for batch jobs?
17:11 sri i might
17:11 rhaen ok, I won't tell you.
17:11 sri good
17:11 rhaen sri: hej websockets are a great example!
17:12 rhaen uh, #livejump data is available via jsonp at http://t.co/omfpDlQD
17:12 rhaen haha - from twitter.
17:12 rhaen some great stuff to test the IOLoop stuff :)
17:33 vishwanathms joined #mojo
17:33 vishwanathms_ joined #mojo
17:52 ObseLeTe joined #mojo
18:01 sri and another answer http://blogs.perl.org/users/joel_berger/2012/10/wh​y-people-dont-like-mojolicious.html#comment-219379
18:24 ObseLeTe joined #mojo
18:32 duncanthrax One more question from the noob in the room, please bear with me ...
18:34 duncanthrax How can I create a code prequisite for two or more routes that don't have a common path? (so I can't use bridge)
18:34 duncanthrax to illustrate:
18:34 duncanthrax # Password reset form
18:34 duncanthrax $r->get( '/recover/:token')->to(template => 'resetpw', title => "Reset password");
18:34 duncanthrax $r->post('/recover/:token')->to('public#recover');
18:34 duncanthrax # Signup form
18:34 duncanthrax $r->get( '/join/:token')->to(template => 'join', title => "Signup");
18:34 duncanthrax $r->post('/join/:token')->to('public#join');
18:35 duncanthrax how can I add a piece of code that behaves like a bridge and checks the token validity before handing off to the templates or POST controller actions?
18:35 duncanthrax (for all of those routes)
18:36 duncanthrax I know one answer would probably be to use a common prefix like /auth/(join|recover)/:token, but is there another way?
18:37 tempire duncanthrax: abstract the common functionality into a helper
18:37 sri you can also have a bridge without a route
18:38 tempire oh, that's better.
18:38 duncanthrax so then it's a NULL path?
18:38 sri my $bridge = $r->bridge->to(...);
18:38 tempire duncanthrax: do that ^
18:38 duncanthrax ah ok
18:38 tempire whoa!  sri actually engaged in commenting.  It's been a while since that happened.
18:38 tempire sri: I'm impressed with your responses.
18:38 duncanthrax I was thinking too much in terms of Lite's "under"
18:38 sri \o/
18:38 duncanthrax thanks, let me try :)
18:40 tempire I just don't get the anti-cpan thing.
18:40 tempire makes no sense.  just fud.
18:40 tempire goopy fud
18:41 tempire joel really does go out of his way to be über nice
18:42 sri yea, even though his title is a bit linkbait-y :)
18:43 VK joined #mojo
18:43 tempire yeah, I'm not a fan of that particular title, and the first sub-title, for the same reasons there was a push to stay saying "perl is not dead" a couple of years ago.
18:43 tempire s/stay/stop/
18:43 tempire oh crap I just said it.
18:43 tempire fortunately those articles have gone away
18:44 sri i think python is now dead
18:44 sri hard to keep track though
18:44 tempire python is dead and python 3 killed it
18:45 tempire irony!
18:45 tempire if only that were true, I would try to back it up.
18:45 tempire mojolicious 2.x is dead and mojolicious 3.x killed it.
18:46 sri ALL GLORY TO THE HYPNOTOAD!
18:46 tempire THE HYPNOTOAD IS DE...http://www.youtube.com/watch?v=zHU2RlSCdxU
18:47 * tempire remains unavailable for 10 hours
18:48 tempire Now all we need is an article named "How I learned to stop worrying and love Mojolicious"
18:52 sri reminds me of a tweet from yesterday "MongoDB is like a nuclear reactor: ensure proper working conditions and it's perfectly safe and powerful."
19:03 abra joined #mojo
19:20 Mike-PerlRecruiter_ joined #mojo
19:38 alnewkirk MongoDB is perfectly viable once you start thinking with the right-side of your brain
20:03 buu GLORY TO THE MONGOTOADS?
20:07 ObseLeTe joined #mojo
20:34 lukep joined #mojo
20:41 lukep joined #mojo
21:31 Averna joined #mojo
22:07 lammel2 joined #mojo
22:24 jzawodn joined #mojo
22:59 ObseLeTe joined #mojo

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