Code


Apache Cassandra: Iterate over all columns in a row

Recently I have been using Cassandra for one of my projects, and one of the needs is to iterate over all columns of a row. Each column represents an individual data, of type identified by row id, and keeps changing. So I can’t simply use a set of known column names. Using the setRange call on a SliceQuery and setting a large count is also not an option, since Cassandra will try to load the entire set of columns into memory.

Trending

Twitter usually syncs with the (developed) world pretty fast in hashtags. But I'm surprised Copenhagen is not on it. To add some semblance of code: I've been mucking with node.js and some of the effect is simple TagLib bindings with that being used for something more important soon. Much improved ( or rather simplified ) kwin-tiling too with a few regressions like moving and resizing.

Macros for Observers

Here are two little macros too make implementing the Observer design pattern less repetitive. This is C++ File: observermacros.h #ifndef DDM_OBSERVERMACRO_H #define DDM_OBSERVERMACRO_H #define MAKE_OBSERVABLE( obscls ) \ private:\ std::listm_observers;\ public:\ void addObserver( obscls *obs ) {\ m_observers.push_back( obs );\ }\ void delObserver( obscls *obs ) {\ m_observers.remove( obs );\ } #define NOTIFY( obscls, obsmethod, argument ) \ for( std::list::const_iterator it = m_observers.begin();\ it != m_observers.end(); it++ )\

Rounded Corners

Rounded corners have become a staple of web 2.0. So I decided to write my own version. So whats special in this among all the others. Well mine is relatively customisable pertaining to the elements to round. Further it allows elements to have variable width and scales on resizing. The images used use the mountain top technique so that the same image is required, whatever the background color of the elements.