Monday, October 19, 2009

Domain Driven Design

Recently read a few sections of the book Domain Driven Design. The importance of understanding the domain is not to be undermined. 

It is not that you can't design/develop without knowing the domain. And not that you could know the domain overnight and design.

Knowing a domain and designing/refactoring is an ongoing process. And the more you know, the more you improvise. 

I, for one, had never given so much of  a thought to domain knowledge, but the examples in the book were really enlightening. I could relate to many of them and also realised that in reality knowing the domain had helped me get many things right in the last 6 yrs!

All and all, the design tips and methodologies in the book are uber cool and helpful too.

Updated: The book: http://www.amazon.com/gp/product/0321125215 

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

Recording some good links

http://www.ddj.com/go-parallel/

http://www.linux-mag.com/cache/7407/1.html

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