Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-01

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

All times shown according to UTC.

Time Nick Message
00:00 jnbek joined #mojo
00:14 Molaf_ joined #mojo
00:29 nicomen joined #mojo
00:42 shmuel joined #mojo
00:46 jzawodn joined #mojo
00:50 sri ok, basic blocking and non-blocking cursors as well as commands are working in the mongodb driver \o/
00:52 sri cursors were a lot easier than expected, just killing them non-blocking will require an extra method
00:53 sri will prolly just make it $cursor->rewind or so
00:54 sri so in addition to killing the cursor in the database, you can reuse the object
00:57 sri i'm completely ignoring the api of the current perl driver... it's that terrible
01:09 Mike-PerlRecruiter_ joined #mojo
01:11 ka2u joined #mojo
01:18 vervain joined #mojo
01:19 hlin joined #mojo
01:30 lukep joined #mojo
01:40 marty sri++   sounds great
01:40 vervain joined #mojo
01:41 marty The current driver and I do not get along much either.  Good thing your doing your own thing.
01:42 * marty is trying to wrap his head around a non-blocking cursor
01:43 sri you should mention the things you don't like
01:44 sri non-blocking cursor is really simple
01:44 marty I suppose it could come in handy for large queries and such.
01:44 sri basically... nothing happens until you call ->next or ->all on the cursor, then it decides if it's a blocking/non-blocking operation based on callback argument
01:45 sri ->next is blocking ->next(sub {...}) is non-blocking
01:46 sri ->db('foo')->collection('bar')->find({whatever => 1})->next(sub { my ($cursor, $err, $docs) = @_ })
01:46 sri ->find(...)->limit(10)->skip(5)->all(sub { my ($cursor, $err, $docs) = @_ })
01:47 marty Can we also do ->sort()  ->limit() or ->fields()
01:47 sri yea
01:47 marty lol, you beat me to it
01:47 sri first release will not have ->sort() though, since it's a special case
01:48 sri sort/explain/snapshot... and friends are all special cases
01:48 sri adding them is trivial, but grunt work
01:49 marty In the current driver they use 'multiple'  instead of 'multi' to specify multiple updates.   Any idea on that
01:49 sri they mostly just add a field automatically to the selector, like {$explain => 1}
01:49 marty So no sorting on the first release?
01:49 marty ahh, ok
01:49 sri you can do it all manually
01:50 sri those methods are just sugar coating
01:50 sri that's why i'm so happy primitives mostly work ;)
01:50 marty I have some sort routines that map to a js library and  yes, it's grunt work trying to map them all out
01:50 sri everything else is just compound operations that combine a few of them
01:50 marty Primitives are AOK with me
01:51 marty It will be interesting to see how performance stacks up agains the current driver
01:51 sri compond operations will be added over time, with tests and all
01:51 sri hard to say how it will perform, but there are many many things that can be tuned
01:52 sri like using multiple parallel connections
01:52 * marty shivers
01:52 sri stuff the normal driver can't do
01:52 marty That just sounds frakin awesome
01:53 sri but in the end, it's more about latency, queries and other operations that take time
01:53 marty I can see a distributed chat system with realtime logging for the entire world.  :)
01:53 sri we can always go non-blocking and open more connections ;)
01:53 sri tailable collections will be fun
01:53 marty btw, I'm tesing serving images from Mongo directly through Mojolicous and it is performing quite well
01:54 sri and cache those images in nginx
01:54 * marty nods
01:55 marty Are you going to release the driver as a plugin?  or right in core?
01:55 sri gridfs will also be easy to add, just more grunt work
01:55 sri as a separate distribution
01:55 sri it's a spinoff project
01:55 marty I've not used gridfs but I'm intrigued.  Been reading some neat stories on how people are using it.
01:56 d4rkie joined #mojo
01:56 marty Ahh ok.   Sounds exciting.   Looking forward to beating the frak out of it.  :)
01:57 marty Is it going to have any cpan dependancies?
01:57 sri mojolicious
01:57 marty So sweet,
01:59 sri it will also be unstable for a while though, since i want to get the api right and it will have to evolve over time
02:02 buu This is perhaps a very basic question but do you guys have any decent recommendations for a light 'model framework' I can bolt on to my mojo app to do a bunch of basic crud operations?
02:02 marty Agreed.   No reason to get locked into a less than optimal api
02:02 * marty loves change
02:02 buu dbixclass always seems like ridiculous overkill
02:03 sri nosql4life!
02:03 buu I know! I love me some mongo
02:03 buu But I have a strong suspicion that I'm going to need to host it someplace crappy with only msql =[
02:04 sri rethinkdb should also get pretty nice in a few years
02:04 marty buu:  I have no personal recommendation but I hear a lot of folks talking about dbix class.   however, just wait for the native Mongodb driver,  Yeeee hawwwwww
02:04 buu heh
02:04 buu I'm not really sure what I want from a model-framework-layer-thingy but I'm pretty sure dbixclass isn't it.
02:05 buu Maybe I just haven't learned its true power!
02:05 marty That makes two of us.
02:05 sri go DBIx::Simple?
02:07 sri btw. NoSQL Distilled is on sale today, if anyone wants to get up to speed :) http://www.informit.com/deals/
02:13 TitanOfOld joined #mojo
02:13 crab is that where they take nosql and boil it for a long time and then take the vapour and condense it?
02:14 * sri nods
02:18 sri oh, that looks like a must have mongodb book http://shop.oreilly.com/product/0636920027041.do
02:25 egopro joined #mojo
03:18 jberger I have liked my experience with DBIx::Class
03:18 jberger I like that it makes objects directly
03:18 jberger I also like some of the extras like ::Candy and ::EncodedColumn
03:19 xaka joined #mojo
03:19 jberger I even like ::MigrationHandler except that its unnecessarily complex
03:20 jberger see an example here: https://github.com/jberger/Galileo/blob/ma​ster/lib/Galileo/DB/Schema/Result/User.pm
03:22 jberger some complaints: a) its huge and b) you are still a slave to schemas
03:39 Achilles14 joined #mojo
04:24 buu Schemas are the great satan
04:45 jnbek joined #mojo
04:48 yakudza joined #mojo
05:14 rem_lex| joined #mojo
05:33 ka2u joined #mojo
05:47 ka2u joined #mojo
05:59 spleenjack joined #mojo
06:42 venomo joined #mojo
06:51 Vandal joined #mojo
07:13 venomo joined #mojo
07:14 dpetrov_ joined #mojo
07:22 yakudza joined #mojo
07:56 ObseLeTe joined #mojo
08:05 suy joined #mojo
08:05 diegok joined #mojo
08:22 dod joined #mojo
08:36 rem_lex|pivo joined #mojo
08:42 d4rkie joined #mojo
08:43 dod joined #mojo
09:33 fhelmber_ joined #mojo
09:45 rem_lex|pivo joined #mojo
09:54 ObseLeTe joined #mojo
09:54 d4rkie joined #mojo
10:02 mugenken joined #mojo
10:13 ver joined #mojo
10:18 pingup3rl joined #mojo
10:19 ilbot2 joined #mojo
10:31 egopro joined #mojo
10:51 Britzel joined #mojo
10:56 SmokeMachine joined #mojo
11:01 pingup3rl joined #mojo
11:29 vervain joined #mojo
11:34 ladnaV joined #mojo
11:41 egopro joined #mojo
12:41 mire joined #mojo
12:55 ryozi joined #mojo
13:05 stephan48 joined #mojo
13:05 mire joined #mojo
13:09 Mike-PerlRecruiter_ joined #mojo
13:18 stephan48 joined #mojo
13:46 pingup3rl joined #mojo
13:49 Britzel_ joined #mojo
13:50 Miked joined #mojo
14:01 mire joined #mojo
14:16 mattastrophe joined #mojo
14:18 moltar joined #mojo
14:49 TitanOfOld joined #mojo
15:24 sri hahaha, 4 more releases and mojolicious would be the most released distribution on cpan \o/ http://stats.cpantesters.org/leadercpan.html
15:25 sri damn you CPAN.pm!
15:33 SmokeMac_ joined #mojo
15:35 mugenken hehe. it does have some more years on it though
15:38 lppoix joined #mojo
15:38 lppoix left #mojo
15:45 mugenken sri: btw. is it discouraged to put custom generators on CPAN? i find some on github but only a few seem to make it to CPAN.
15:46 sri nope
15:53 gryphon joined #mojo
16:03 marty sri is release king!   http://1.bp.blogspot.com/_TyIzbuNbkkQ/Ru67V​edXJZI/AAAAAAAAABc/9BE_FX6hquQ/s320/pk1.gif
16:04 marty well, almost.  Right now you are release prince, 4 more and it's king for you
16:25 inokenty joined #mojo
16:28 asarch joined #mojo
16:31 sri not really, adamk is a release machine :)
16:33 mire joined #mojo
16:39 trone hi there. I'm using a mojolicious app with hypnotoad. The app make long elaboration (20-30 secs) and I set high graceful_timeout to prevent the connections drop. Do you have advices about other params?
16:42 trone Sometimes hypnotoad seem blocked because cannot restart a worker after a fail heartbeat check. I'm going to increase the heartbeat_timeout param.
17:04 xaka joined #mojo
17:25 marty I find dealing with mongo ObjectId fields cumbersome.
17:27 sri marty: how so?
17:28 marty I find myself doing my $string = $object->to_string  and my $id = MongoDB::OID->new( value => $id ); a lot
17:29 sri ah
17:29 marty I'd like to use the ObjectId as a key for html elements.
17:29 sri i have shortcuts for all special bson types
17:29 marty \o/
17:29 sri my $id = bson_oid($id)
17:30 marty yabba dabba
17:30 marty sri++
17:30 sri one of the reasons i wanted to do bson serialization myself is total control, we'll make it as fun as possible :)
17:31 sri ordered hash is as easy as bson_doc(foo => 'bar', baz => 23)
17:31 marty It would be nice if mongo had a query param that made mongo return the objectId as a sting right in the record.
17:31 sri marty: why would you want a string right away?
17:32 sri it stringifies to the is value automatically
17:32 diegok sri: that's one of my biggest hates to official mongodb driver. F* IxHash :-/
17:32 sri my $string = "$oid";
17:32 marty I'm loading the record directly into a javascript object
17:32 sri diegok: yea, i'm not doing that, all custom types we can design however we like
17:33 diegok <3
17:33 diegok lot of <3
17:33 * marty agrees with diegok.  IxHash was a drag
17:33 sri the official perl driver is actually very odd that way, ruby, python and node.js ones are much better designed
17:34 marty I'll investigate the $oid.   I think I missed something
17:34 diegok Sure!, perl driver is POO :(
17:34 dod joined #mojo
17:34 diegok old perl driver is POO ;-)
17:35 marty New Mojo driver will be poorfect
17:36 diegok marty: you can use MongoDB::OID as string
17:37 diegok I hate the driver, but that's just work :)
17:40 diegok marty: and I use to coerce str to OID's to prevent that roundtrip madness... but agree with you. It just sucks.
17:43 marty My biggest issue at the moment is syncing mongo to a KendoUI datasource.  The only thing that is holding me up (kinda) is the ObjectId.
17:45 diegok you can stop using OID's on the mongo side just defining _id to be what you want :)
17:45 sri i've also thought about special forms of hash vaues for custom types, like have an oid roundtrip as {'$oid' => '1e2d3c4b...'}
17:46 sri so it plays nicer with json
17:46 diegok sri: what about changing $thing for -thing ?
17:46 diegok to play nice with perl :)
17:46 sri dunno, maybe
17:47 sri for now i'll stay close to the other drivers though
17:54 * diegok hate's hotels wifi more than MongoDB official driver
18:01 mattastrophe joined #mojo
18:06 mugenken joined #mojo
18:11 venomo joined #mojo
18:11 allison joined #mojo
18:28 SmokeMachine joined #mojo
18:36 kitt_vl joined #mojo
18:37 sh4 joined #mojo
18:39 dpetrov_ joined #mojo
18:40 SmokeMac_ joined #mojo
18:40 xaka joined #mojo
18:42 TitanOfOld joined #mojo
18:42 SmokeMa__ joined #mojo
18:47 SmokeMachine joined #mojo
18:54 d4rkie joined #mojo
19:08 SmokeMachine joined #mojo
19:15 ObseLeTe joined #mojo
19:15 labrown joined #mojo
19:29 basic6 joined #mojo
19:29 SmokeMachine joined #mojo
19:32 SmokeMac_ joined #mojo
19:42 biz joined #mojo
19:47 biz attempting to call a method within the default templates
19:47 biz and its keeps saying can't call method on undefined var
19:47 biz i added a key in the stash called content
19:47 biz using <%= $content->id %>
19:48 biz and i get -> Can't call method "id" on unblessed reference
19:49 biz but I can call <%= Data::Dumper::Dumper($content) %> and it dumps the object...
19:52 marty Are you sure it's an object?   %= Data::Dumper::Dumper( ref $content) %>
19:53 biz yes
19:53 biz shit
19:54 marty btw, you can just do <%= dumper $content %>
19:54 biz using Rose::DB::Object::Manager, it returned an array ref... fucking rookie move on my part
19:54 biz its element 0 in an array
19:54 SmokeMachine joined #mojo
19:54 biz shit i've been doing this for 17 years... :(
19:54 marty Ahhh, that one has bit me before also.   Use Rose a bit
19:55 biz what I get for trying to code with one sick kid and my twin 5 year olds destorying my house :)
19:55 biz thanks
19:55 marty lol
19:55 biz s/destorying/destroying/
19:56 * marty ponders the Freudian slip that is "destorying" while referencing children.   hmmmmm
19:57 biz :)
19:57 marty all the stories that have been de-stroyed.
19:58 SmokeMa__ joined #mojo
20:01 SmokeMac_ joined #mojo
20:11 SmokeMachine joined #mojo
20:11 SmokeMachine joined #mojo
20:20 sh4|2 joined #mojo
20:28 vervain joined #mojo
20:34 ObseLeTe joined #mojo
20:38 ObseLeTe joined #mojo
20:43 bpmedley_ joined #mojo
20:56 sri and authentication works too now, so i can test against mongohq.com \o/
20:57 marty \o/
21:04 jzawodn sri: I've only been following along 5% of the time... you working on a new MongoDB client?
21:07 sri jzawodn: yes http://twitter.com/kraih/status/297165250501935104
21:07 jzawodn sri: ah, sweet.  we'd be happy to test it at craigslist.  a project here would definitely like a non-blocking mongo driver
21:13 sri it's still a long way to production ready, but i expect the first release next week
21:15 xaka joined #mojo
21:19 nicomen can one add a command to mojo thru a plugin of some sort?
21:20 nicomen I've just spent like half an hour just adding bootstrap, i18n, templatetoolkit - common stuff that I need in every project
21:20 nicomen would be nice to have a generate foo-app
21:23 jzawodn we're not averse to testing alpha/beta code when the need arises :-)
21:29 dod joined #mojo
21:29 nic nicomen: yes, there are a few examples around of ::command::generate stuff
21:30 nicomen nic: interesting ;)
21:56 ComLock joined #mojo
21:59 yakudza joined #mojo
22:55 Akron joined #mojo
23:03 Miked joined #mojo
23:08 nicomen so has anyone made a plugin that lets you authenticate through facebook/twitter/the lot, but also lets you automatically connect that a local account?
23:30 ObseLeTe joined #mojo
23:31 jontaylor joined #mojo

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