Monday, October 19, 2009
Domain Driven Design
Saturday, August 22, 2009
Enabling options based on filetype in vim. Picked from here
:au BufRead *.c so ~/.vim/c.vim
:au BufNewFile *.c so ~/.vim/c.vim
:au BufRead *.py so ~/.vim/py.vim
:au BufNewFile *.py so ~/.vim/py.vim
Then put this in ~/.vim/c.vim:
set shiftwidth=8
And this in ~/.vim/py.vim:
set shiftwidth=8
That'll cause vim to source the specified file when the corresponding file type is read (or when a new file of the corresponding type is created).
Sunday, July 26, 2009
Friday, July 24, 2009
Cilk++
With the advent of 16, 24 (and also 32?) cored machines, multi-core machines are foraying in a big way. Most applications programmed aren't multi-core aware and hence though multi-core hardware prices aren't daunting, the applications can't really scale to it. Redesigning the legacy apps for multi-core aware is not a small task. However suites like Cilk++ do make it so. Cilk++ comes with a complete suite of compiler, run time system et al, which enables legacy applications that have been designed with no scaling in sight to be multi-core aware with minimal changes. Believe it or not, your code requires as less change as using three keywords effectively to indicate parallelism and synchronization – cilk_for, clik_spawn (for areas which have recursive calls or the types to make use of the multi-cores), cilk_sync (gather results from all the calls). Cilk provides race detector and reducers (race free global variables) as well. To know more, read this: http://www.cilk.com/multicore-products/cilk-solution-overview/ On using the three keywords to indicate parallelism, the Cilk++ compiler compiles the serial code into multi-core enabled parallel application. N-Queens Problem A good starting point to understand how this can be used is the N-Queens problem: http://www.cilk.com/multicore-blog/bid/6381/Multicore-enabling-the-N-Queens-Problem-Using-Cilk. There are other problems discussed as well. You could track the cilk blog to know more. And to know more about the Cilk language itself: http://supertech.csail.mit.edu/papers/cilk5.pdf