Monday, June 29, 2009

Building Boost Lib 1.35 with VC++ 2008

Version 1.35 of the Boost libraries was released on March 29th, 2008.

Below are the steps I followed to have everything working on Win 7.

If not already done, install the following development tools (in the prescribed order, please):

Visual C++ 2008 Express Edition
Microsoft Windows SDK
Microsoft Compute Cluster Pack SDK

The last one will only be needed if you plan to compile the Boost.MPI library.

Download and install Python. Download Boost 1.35 and the latest Boost Jam binary (3.1.17 at the time of this writing). Copy the bjam executable to the Boost root directory. Next, disable the automatic linking features of the Microsoft Visual C++ compiler by enabling the BOOST_ALL_NO_LIB macro on the file user.hpp (boost/config/user.hpp). We’re ready to go (type all the commands inside the Visual Studio 2008 Command Prompt):

bjam stage

Boost Jam auto detects the Visual C++ 2008 compiler!

If you want to compile the Boost.MPI library a couple of additional steps must be followed. Boost Jam is your friend as it prints it nicely for you:

warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add “using mpi ;” to user-config.jam.
note: to suppress this message, pass “–without-mpi” to bjam.
note: otherwise, you can safely ignore this message.

Follow the instructions. The user-config.jam is to be created in your “current” directory ($BOOST_ROOT_DIR\tools\build\v2).

Now build the Boost.MPI library by issuing:

bjam –with-mpi stage

The Microsoft MPI library is auto detected!

That is it! Happy Hacking :)

Sunday, June 28, 2009

Anbe Vaa - Vijay TV's New serial

Here you go. Me and Mani has become a big fan of this title song .. Thats a soft melody song .. Here is the lyrics for the song.

Guys, if u get a chance, hear this song in Vijay TV :)

Ah.. ah... (Female Voice)
(Male voice)
Oru paarvai paarkirai..
pudhidhai nan pookiren..
Idhayam idam maarudhe..
Idhu kaadhala...

Nilavodu theigiren..
Ninaivale karaigiren..
sugamana vedhanai..
Idhu kaadala...

Engeyo.. engeyo.. 
ennule engeyo..
vinmeengal sidharudhe

Anbe vaa..
Anbe vaa..
Anbe vaa
Anbe vaa.. a...


Kannukule kannukule.. kaadhal vandhu nenjai thotu povathen.. 
Enna idhu enna idhu.. vaanavillil vanam rendu koodudhe..
Theendinal.. vaanile..
megamai alaigiren
neenginal dhoorathil..
pulliyai tholaigiren..

Nillarendral nillaamal
yenendru kelaamal
edhedho seigirai..

Anbe vaa..
Anbe vaa..
Anbe vaa
Anbe vaa.. a...

(F)Enna solli enna solli kaadhal adhai unnidathil kaatuven..
(m)Sathamindri sathamindri mounamai nenjukulle pootuven..
(F)kavithaigal ezhudhida vaarthaigal thedinen..
(M)un peyar  ezhudhinaal kavidhayai paadinen..

Enn ulle en ulle..
un kannin minsaram..
edhedho seiyudhe.. 

Anbe vaa..
Anbe vaa..
Anbe vaa
Anbe vaa.. a...

Thursday, June 25, 2009

Secrets of std::map

I should admit that I'm very poor in C++ Programming. Today, me and one of colleague was trying to understand a code writter by one of a pioneer in our team. We initially thought he wrote a crabby code but indeed we were wrong and he proved his expertness :)

Below is the snippet of similar case.

#include "stdafx.h"
#include < iostream >
#include < map >

int main()
// 1. define the map
typedef std::map Map;

// 2. Create the object for it
Map myMap;

for (int i=0; i<10; ++i)
3. Whats going on here ???.
We just created the object.
Could this be a buggy code ??

Nope. When we reference an item in map
and if the item is not available,
it creates the object. Great :)

I personally seen/used the creation
of map on the left side,
something like myMap[2] = 20
But the below is of something which
I am seeing new today :)

int &ref = myMap[i];
ref = i;

for (int i=0; i<10; ++i)
std::cout << myMap[i] << " ";
std::cout << std::endl;

return 0;

Happy Hacking :)

Monday, June 22, 2009

C++ forward declaration error


I am trying to declare and use a class B inside of a class A and define B outside A.I know for a fact that this is possible because Bjarne Stroustrup uses this in his book "The C++ programming language" (page 293,for example the String and Srep classes). So this is my minimal piece of code that causes problems.

class A
struct B; // forward declaration
B* c; A()

struct A::B
/** we define struct B like this
** becuase it was first declared
** in the namespace A */

int i;
int main()



This code gives the following compilation errors in g++ : tst.cpp: In constructor ‘A::A()’: tst.cpp:5: error: invalid use of undefined type ‘struct A::B’ tst.cpp:3: error: forward declaration of ‘struct A::B’


Define the constructor for A AFTER the definition of struct B.

Sunday, June 14, 2009

Sambhar Receipe

Step 1:
Put Onions, Tomato, Chilly, Coriander leaf, 1 Spn of Turmeric Cumin powder (from Amma) in a pressure cooker and keep 3 Whistle.

Step 2:

Put all the needed vegetables in the same pressure cooker and add 1/5 Spn of chilly power, salt to taste. Keep for one more whistle.

Sambhar is ready ;)