January 22nd, 2012
I’ve been working away on a project where I’ll be using CouchDB and Perl, and was searching the ‘net for information on CouchDB CPAN modules.
There were, of course a lot of CouchDB modules that turned up on MetaCPAN, however I couldn’t figure out which one I should bother messing around with. I was looking for something simple and straight-forward, similar to the module that was posted in full-source format on Apache CouchDB’s “Getting Started with Perl” guide.
I looked at CouchDB::Client, but found the implementation a little scattered – there are no functions documented that explain how to deal with couchdb documents, only for getting info on and creating databases (the tests in ‘t/’ weren’t very helpful here either). And the functions don’t say anything about document id’s, which would have been nice.
I also looked at AnyEvent::CouchDB, but again there seemed to be too much going on.. too many methods for doing many things that I won’t need to do.
The “Getting Started with Perl” guide talks about a module called Net::CouchDB, a module that is curiously missing from CPAN as far as MetaCPAN and search.cpan.org are concerned – but Jeremy Zawodny wrote up a nice guide called “Hacking with CouchDB” that uses this module, showing it’s clear interfaces with function names like:
- $cdb->create_db
- $cdb->put, and
- $cdb->new
These are of course in contrast to confusing function names like:
- $cdb->couch(), or
- $cdb->replicate()
.. that you’d have to deal with in AnyEvent::CouchDB.
Eventually MetaCPAN lead me to “CouchDB::Simple” which sounded a lot more like what I was looking for. I didn’t get very far with it however, since the install failed. I e-mailed the author to give him a heads up, since I don’t think it was my environment at fault (perlbrew perl 5.14.2 + cpanm). I’ll give it another try this week and see if I can get through that hurdle.
Update (2012-01-25): Gave AnyEvent::CouchDB a try, things didn’t go as smoothly as I was hoping. I can attribute some of this struggle to my lack of familiarity with CouchDB. Also gave DB::CouchDB a try and got a lot further, but ran into a problem with “bad_content_type” error messages when attempting to post a document to the database. A little reading and I found that this error can easily be triggered by JSON syntax errors.. but isn’t that what the module is supposed to handle? I’m thinking I may now give this a try with WWW::Curl or some such, since I’m not having too much luck with CouchDB specific modules… but I’m not done yet :)
Tags: perl couchdb cpan module
Posted in Computing, Projects | No Comments »
January 22nd, 2012
“… To most of us living today, all these fantasies of the future seem most objectionable: the loss of privacy and freedom, the restriction of travel, and the progressive conversion of flesh and blood, wood and stone, fruit and fish, sight and sound, into plastic, synthetic, and electronic reproductions. Increasingly, the artist and musician puts himself out of business through making ever more faithful and inexpensive reproductions of his original works. Is reproduction in this sense to replace biological reproduction, through cellular fission or sexual union? In short, is the next step in evolution to be the transformation of man into nothing more than electronic patterns?”
” All these eventualities may seem so remote as to be unworthy of concern. Yet in so many ways they are already with us, and, as we have seen, the speed of technical and social change accelerates more than we like to admit. The popularity of science-fiction attests to a very widespread fascination with such questions, and so much science-fiction is in fact a commentary on the present, since one of the best ways of understanding what goes on today is to extend it into tomorrow. What is the difference between what is happening, on the one hand, and the direction of its motion, on the other? If I am flying from London to New York, I am moving westwards even before leaving the British Coast.”
- From: The Book.. On the Taboo Against Knowing Who You Are, by Alan W. Watts, First Collier Books Edition 1967
Tags: Alan Watts, Books, classic, existence, Freedom, privacy, QOTD, quote, taboo, The Book
Posted in Insightful Insights, Personal, This is Big | No Comments »
January 15th, 2012
Tags: Bookmarks
Posted in Uncategorized | No Comments »
January 8th, 2012
Tags: Bookmarks
Posted in Uncategorized | No Comments »
December 27th, 2011
- Random Number Generation (C Programming Tutorial) – Geekpedia
Examples of random number generation in C/C++ for various types (float, int, double,etc)
- c – Strange behavior of float in function definition. And declaration-definition mismatch, yet it works, how? – Stack Overflow
working with float as a function argument in C (float gets promoted to double)
- wili – hack blog – Creating a double buffered X window with the DBE X extension
How to use the Xdbe double buffering extension to reduce flicker in computer animation
- Understanding Spacial Locality of Reference
looping by x first and then by y can be up to 6.5 times slower than looping by y first and then by x
- When to use Threads
when to use threads – when it’s appropriate to and when it’s better to keep everything in the same thread.
- Clojure Concurrency
A presentation by Rich Hickey to the Western Mass. Developers Group on Clojure and concurrency. Brief overview of Clojure, discussion of concurrency issues, locking, and immutabiity.
- AbeBooks Official Site – New & Used Books, New & Used Textbooks, Rare & Out of Print Books
Books, books, and more books
- 25 Greatest Science Books of All Time
DISCOVER presents the essential reading list for anyone interested in science.
- 10 Papers Every Programmer Should Read (At Least Twice)
some of the most interesting ideas about software. To me, these are classic papers which contain deep “things you oughta know” about code – the material you work with.
Tags: Bookmarks
Posted in Uncategorized | No Comments »