Friday, December 31, 2010

"Safe Mode" Programming

When you write software systems , at times  requirements can be fuzzy . Then , we will resort to some sort of plausibility analysis and can come up with software requirements which i would like to call as "Worst Possible Scenario approach" (WPS ).

The stakeholders of project can get worried and after some meeting , most often , some kind of cap on the requirement will be brought about. But, most systems will fall back to the Worst Possible Scenario mode.

How do programmers handle this ?

I call the WPS approach as SafeMode Programming . The code can be written as



if (GetSafeMode() ) {
     //Code Defensively...

}
else {
     // Code to satisfy customer requirements at this point of time….

}

Creative Thinking - can it be taught ?

Normally , I hate prescriptive books which are of self-help nature. Currently , On my table , i have got Edward De Bono's "Lateral Thinking" and James Adams's "Conceptual Block Busting".

Both are amusing read and it can open up your mind for receiving new ideas. Even though , the solutions might not apply , the anecdotes and causes of thinking blocks are enough to stimulate your thinking.

New Year - a Poem

It is going to be great ahead
Celebrate the arrival, with  bash
Throw  away the sleep, to welcome it
Make Resolutions  for it
Bust Crackers and  Sip your drink
Eat Well before you sleep 
Make mery , when you are awoke
for Tomorrow , is yet another day
And Wait for the next one

C++ Language - the designer had the right intent

I was explaining the rationale of C++ to a Virtual Machine Programmer ( read C#,Java ) and he was skeptical about my pitch. Since the skepticism about C++ from that camp is usual , i have learned how to handle it.

I jokingly say , Java is designed by taking away some features which are unique to C++ and C# has tried to bring back most of the stuff which java designers have thrown out from C++.

When it comes to designing Foundation Libraries , C++ is one of the best language available out there.

C++ has got features which make a User Defined Type ( a class ) same as any other built-in type

              a ) Facilities for initialization and destruction
              b)  U can overload operators to mimic the behavior of built-in types
              C) Parametrized types for Generic Programming (Templates )
              D) Overloading of new and delete operator
              E)  traits etc

Another goodie is Standard Template Library ( which is part of standard C++ library ).

Thursday, December 30, 2010

An Expansion of the term "CODE"

To this day , i am proud of my ability and inclination to Code some stuff in modern programming languages. Today , while discussing about Coding strategies , I found an expansion for the term CODE

CODE = The activity we do between COncept to  DEployment

Tuesday, December 28, 2010

Request for Stop and a Serendipitous event

I Know a lady who might be in her late 40s ( her one son is in Infosys and another is a Btech student) for long and is widely regarded as pigheaded and very dominating . She does not speak much and it is rumoured that she won't even speak to her Hubby.


There is a bus stop between Aluva "Pulinchodu" Jn and Aluva Market. That stop has been in existence for close to 50+ years and all private buses stop there. Unfortunately , due to the expansion of highway , it is hard to place a board there. Due to that , it has always been a struggle for me and others to quarell with drivers of Low floor buses and Thiru Kochi to stop the vehichle there.

Today , While disembarking the same old story got repeated. This time , the lady mentioned above was appreciative about my arguments with Bus driver ( resulting in Bus stopping some 15 meters after the stop ) and she talked to me about the necessity of having a board there and her daily struggle to get out there etc. It was a surprise for me !!.

Kerala Calling - a Seductive experience for some

This has happened time and again in my life. A guy who has lived in West for some time , got conditioned into that environment suddenly finds himself back at God's Own country. The reason might be marriage , parental compulsions or some other domestic compulsions.


When these guys come to Kerala , they see easy going mentality of most keralites ,disconcerting for them. The guys who have stayed here all along the life here ( who has has learned to cope up with the surroundings ) are seen as weak minded by those people.

Then, they try to bring about change in the environment. After some time , they realize the futility and will try to be one among the crowd. The impedance mismatch between their inherrent temperment and environmental fitness requirements will take a toll on these people and finally they go back to West with Zest.

A Friend and his plight

A Friend of mine , who is really talented in multiple stuff just called me from Chennai. He was attending the celebration of his niece's marriage. Being from a family who is into trade for more than a century , his aspirations to go alone were nipped at the bud by his parents.

As years went by , when most of the family transformed themselves into professionals , new age enterprueners etc , the guy in question also moved around to find out that inherrently , he is not fit for this rat race and sobbery.


Right before my eyes he transformed himself into a serious professional in a domain which he did not have much expertize couple of years ago. Despite doing all these , he is a loner out there at the venue of the function.

It seems Guys with spirit are not in thick of most things !

Monday, December 27, 2010

STL tutorial - Part 4

This Part will show how we can use STL accumulate with different Functors or Function Object.

////////////////////////////////////
//
// STL accumulate function and customization of that 
// using Functors
//
//
// Written By Praseed Pai K.T.
//            http://praseedp.blogspot.com
//

#include <iostream>
#include <numeric>
using namespace std;


//////////////////////////
//
//
// A Functor to add two numbers
//

template <typename T>
struct addition
{

    T operator () (T& init,  T& a ) { return init + a; }

};


///////////////////////////////
//
//  a Functor for negate and add
//
//

template <typename T>
struct neg_addition
{

    T operator () (T& init,  T& a ) { return init + -a; }

};


////////////////////////////////////////
//
// A Functor for multiplying two stuff
//
//
template <typename T>
struct multiply
{

    T operator () (T& init,  T& a ) { return init * a; }

};

//////////////////////////////
//
//
// Entry Point..
//

int main()
{
   double v1[3] = {1.0, 2.0, 4.0}, sum;

   sum = accumulate(v1, v1 + 3, 0.0, addition<double>());
   cout << "sum = " << sum << endl;

   sum = accumulate(v1, v1 + 3, 0.0, neg_addition<double>());
   cout << "neg_sum = " << sum << endl;

   double mul_pi = accumulate(v1, v1 + 3, 1.0, multiply<double>());
   cout << "mul_pi = " << mul_pi << endl;

   
}



C++ string class - Unicode/Ascii

The ANSI C standard do not have a standard string type. But, ANSI C++ ( and C++ 0x ) has got a standard string class. An Interesting point to note here is for Unicode and Ascii , same code is getting exectued. 


There is a generic string class called basic_string<T>

then the stuff is typedefed as

typedef basic_string<char> string;
typedef basic_string<wchar_t> wstring;

The following C++ program demonstrates how the stuff works in practice...


/////////////////////////////


//

// A C++ Program to demonstrate string and wstring class

// and underlying template class called basic_string

//

//

// Written By Praseed Pai K.T.

// http://praseedp.blogspot.com

//

//

#include <iostream>

#include <string>



using namespace std;





///////////////////////////////

//

//

// A Templated String Printing class

//

//

template <typename T>

void PrintString( basic_string<T>& str )

{

basic_string<T>::iterator it = str.begin();



while ( it != str.end() )

cout << *it++ ;



return;

}



/////////////////////////

//

// Specialization for unicode string 

//

//



void PrintString( basic_string<wchar_t>& str )

{

basic_string<wchar_t>::iterator it = str.begin();



while ( it != str.end() )

wcout << *it++ ;



return;

}



int main( int argc , char **argv )

{



string s = "Hello world....";

PrintString(s);

cout << endl;

wstring us = L"Praseed Pai";

PrintString(us);

cout << endl; 

wcout << us << endl; 



}

Saturday, December 25, 2010

Women , Work and Worth !

Today , After I logged into yahoo , I happen to read an article titled ".....Top job and family can't go hand-in-hand for women: Expert" . One researcher has found out that , women in top positions , ususally have "nominal families". The Comment sections were interesting read and it is the repetition of same old story . Some are out to prove that Women are inferior and another lot who want to paint them at par with men.

This is a contentious debate. In the modern world , Women has to work as well to have a decent standard of living . So, Only few people can afford to make their women folk sit idle back home. Thus, rearing a family is a collective undertaking where men and women have to swap roles. At times , Men ought to take care of the kids. There is no way out. Whatever side you be , one thing is for sure that any man who encourages his wife will have a better life than , some one who tries to subjugate .



Asking a women to forsake her aspirations for men , requires dialogue and there should be a compelling reason given to the women folk to make this "sacrifice". Otherwise , she will curse you for rest of your life.

Source :- http://in.news.yahoo.com/top-job-family-cant-hand-hand-women-expert-20101221-025251-552.html



 London, Dec 21 (ANI): A sociologist at the London School Of Economics has claimed that women should forget about trying to work at a top job and manage their families well at the same time.

Dr Catherine Hakim said that women with high- powered careers rarely see their partner or kids and end up with only "nominal" families.

Her report has called for the Government to drop plans to give fathers more time off and cutting down flexible working hours for women or giving them more places for women on company boards.

Hakim said it is a "waste of time" fretting about that small difference and said any pay gap that might appear is due to women's lifestyle choices.

"In Britain, half of all women in senior positions are child-free and a lot more have nominal families with a single child. They sub-contract out the work of caring for them to other women," the Daily Star quoted Hakim as saying.

"Equal opportunities policies have succeeded in giving equal access for women to the labour market.

"People are confusing equal opportunities with equal outcomes, and there is little popular support for the kind of social engineering being demanded by feminists and legislators." (ANI)

Source :- http://in.news.yahoo.com/top-job-family-cant-hand-hand-women-expert-20101221-025251-552.html

STL Tutorial - Part 3

In this part , we will write a program to demonstrate Templates , Comparitors , Swapper , STL containers , STL Iterators , C++ 0x Lambda etc. Let us dive into the source code and play with it !.


//////////////////


//

//

// A Simple STL program to demonstrate various template features 

// ,STL containers and STL iterators.

//

//

// Written by Praseed Pai K.T.

// http://praseedp.blogspot.com

//

#include <iostream>

#include <vector>

#include <algorithm>



using namespace std;



//////////////////////////////

//

// A Generic Comparison Function ....

//

//



template <typename t="">

bool Cmp( T& a , T&b ) {



return ( a > b ) ? true: false;

}



////////////////////////////////////

//

// A Generic Swap function...

//



template <typename t="">

void Swap( T& a , T&b ) {

T c = a;

a = b;

b = c;



}







//////////////////////////////

//

// Generic Ascending Order Bubble Sort Function...

//



template <typename t="">

void BubbleSortAsc( T *arr , int length ) {





for( int i=0; i< length-1; ++i )

for(int j=i+1; j< length; ++j ) 

if ( Cmp( arr[i] , arr[j] ) )

Swap(arr[i],arr[j] ); 



}



////////////////////////////////////

//

// A Generic Descending Order Bubble Sort Function

//

//

template <typename t="">

void BubbleSortDesc( T *arr , int length ) {





for( int i=0; i< length; ++i )

for(int j=i+1; j< length; ++j ) 

if ( !Cmp( arr[i] , arr[j] ) )

Swap(arr[i],arr[j] ); 



}





////////////////////////////////////

//

// Sort using STL 

//

//

template <typename t="">

void SortSTL( T *arr , int length ) {





vector <t> arr2(arr,arr+length);

std::sort(arr2.begin(),arr2.end(),less());



//////////////////////////////////////////////

// use C++ 0x , lambda function to repopulate the passed array

// needs Visual C++ 2010

// 

for_each(arr2.begin() , arr2.end() , [&] (T& c ) {

*arr++ = c;

});

}



////////////////////////////////////

//

// Sort using STL Descending ...

//

//

template <typename t="">

void SortSTLDESC( T *arr , int length ) {





vector<t> arr2(arr,arr+length);

std::sort(arr2.begin(),arr2.end(),greater&l;t>());



//////////////////////////////////////////////

// use C++ 0x , lambda function to repopulate the passed array

// needs Visual C++ 2010

// 

for_each(arr2.begin() , arr2.end() , [&] (T& c ) {

*arr++ = c;

});

}

///////////////////////

//

// Generic Printing routine for STL containers...

//

//

template <typename t="">

void Print( T& container)

{



for(typename T::iterator i = container.begin() ;

i != container.end(); ++i )

cout << *i << "\n" ;



} 



//////////////////////////////////////////////

//

//

// The entry point function...

//

//

int main( int argc , char **argv )

{

double ar[4];

ar[0] = 20;

ar[1] = 10;

ar[2] = 15;

ar[3] = -41;



cout << "=========================================" << endl;

BubbleSortAsc(ar,4);

vector a(ar,ar+4);

Print(a);

cout << "=========================================" << endl;

BubbleSortDesc(ar,4);

vector a1(ar,ar+4);

Print(a1);

cout << "=========================================" << endl;

SortSTL(ar,4);

vector a2(ar,ar+4);

Print(a2);

cout << "=========================================" << endl;

SortSTLDESC(ar,4);

vector a3(ar,ar+4);

Print(a3);



}

Friday, December 24, 2010

Experience - A Poem

Experience , every one appreciates it
Experience , No one Knows about it


As we age , we think we get it
a Perfect illusion !
Instead, we gain war stories






Experience , What is out there
Experience , to Know things better
With out it , nothing enters your vein






Experience , Ought to Learn from it
Experience , Ought to transfer it






Be Prudent , Try to learn from Other's (Experience )
Lest we do , It can be costly






Experience , we need to forget some
Experience , we should not forget some other
Experience , we appreciate pleasent ones
Experience , we despise unpleasant ones


Of course , Life is all about Experiences !

Celebration - A Poem

Do we Celebrate ?

Celebrate we do , by inventing ocassions
Ocassions are already there
Some, we do create for ourselves

Celebrate , to enable more Celebration
Without it , Life won't move much


Like an Oasis in the desert , It brings back hope

Why Celebrate , when we can Celbrate life itself
The Joy of Pain , Pleasure and Sorrow
Like a cocktail, can be enjoyed



Celebrate we do , to avoid snob
Celebrate we do , to avoid snub
Celebrate we do , to show we celebrate
to bring back the pain , Once it is over


Waiting for the next ocassion, to Celebrate

Binayak Sen - Human rights facade has poped up again.

In the past two years , I have come across lot of Human rights activists who is waging a "war" against our state and they have got sympathizers among Left leaning intellectuals , Some Journalists , Islamic agenda pushing Human rights organizations etc.

They have coined  a term called "BharanaKooda Beegaratha" ( State terrorism ). Then , people blog about it , news papers are filled with columns where how state has done wrong. Ultimately , the blame will be shifted to some state govt. where BJP  is in Power (They are trying to  imply that castiest Hindu led Govt. is the root of all evil happening India ).

Then things not connected with it like Gujarat riots ( silence on Godhra Train buring ought to be noted ) ,   Narendra Modi and others will pop up. The same patterns were observed when Madhani was arrested in Kerala.

Most of these human rights activist have got foriegn wives , wards of some mixed couples , partners in mixed marriages and they support Naxalism/Islamic terrorism by putting the facade of Human Rights. In Kerala , every month there will be posters all across where some ex-terrorist is given Human Rights award instituited in the name of some forgotten Individual ( Mukundan C Menon award, a case in the point ). People like Krishna Iyer ( some times , i feel ,the day he get deceased , some peace will be there for common man )
, Sebastian Paul , Ba surendra Babu are commoners in these felicitations.

I think , there must be some evidence before the court to sentence Binayak Sen . I do not know , who is right or who is wrong here. Let the battle unfold and be ready to side with the eventual winner.

Snow Leopard - I saw one on TV Today

Apple Corporation has named their MAC OS X versions after different genus (or species - uff , i am not a biologist ) of Cats like Tiger , Panther , Leopord , Snow Leopord etc. I have seen Snow Leopord in a screen saver on MAC OS X systesm. Today morning , I saw a documentary aired by Discovery Channel. The documentary deals with Snow Leopord conservation in North Pakistan ( I was thinking that Snow Leopord would be there in Alps or Andese ) . When I searched , I saw that close to 200 hundred of them survive in India as well.

Friday walk

Now a days , every friday evening , I and a colleague of mine walk all the way from Thevara Junction to Kaloor Bus Stand. The stretch must be around 6 kms ( approx. ) .We discuss various stuff about Programming and not so close to Programming issues as well. So far , we have undertaken five or six walks in the last two months.

Confidence vs Self Confidence

Today , In a Tamil Channel , I happen to see a Martial art specialist teaching people how to out-power an adversary. He used the term "Thann Nambikkei" while explaining about his method. Based on my Tamil Film experience , I know that "Nambikkei" means Belief and Thann means Self (I)  . So , he meant Self Belief or Self Confidence.

Wednesday, December 22, 2010

It is Potluck time.

Rather than me describing what is Potluck , I would like to get some aid from Wikipedia to get the meaning across.

I am going to have my first Potluck lunch after a long long time. Last time , I had it , when i was barely 9. We used to play "Kanjiyum Kariyum" during Onam and Mid summer vaccations.

Bias !

In Kerala , you can see big queues at least in one place. On Saturday evening , eve of the first day of any month , Gandhi Jayanthi etc, you can see people flocking to Bevarages corporation store and discipline is maintained like a Professional Army ( Common Interest ! ).

Today (around 7.15 am ) , I happen to see a queue at ShipYard bus stop. Perplexed (I have not seen it so far ) , I probed for a Bevarages corporation store. Instead , I found a Skin Clinic. It has made my day , pleasent ( so far ! )

Sunday, December 19, 2010

Placement new in C++

C++ Programming language has got a nifty feature which allows one to place an Object at a chose location. This is handy sometimes. The following program creates two string objects ( one using placement new and other using new ) and concatenates them so that the content of concatanated string is stored in a buffer created by us .  This example also shows the usage of calling destructor method directly ( to avoid a memory management pitfall )


////////////////////


//

// A Simple Program to demonstrate 

// Placement new in C++

//

// 

// C++ has got a unique feature to place an Object at a 

// specified place. This technique is called placement new

//

//

//



#include <stdio.h>

#include <iostream>

#include <string>



using namespace std;



//////////////////////////////////

//

// Entry Point ....

//

//

int main( int argc , char **argv )

{





char *buffer = (char *)malloc(1000);



//////////////////////////////////////////

// 

// Allocate p at buffer ...or place the string 

// Object at buffer 

string *p = new (buffer) string("Hello");



///////////////////////////////

// Ordinary Heap allocated Object

//

string *q = new string(" World");



*p += *q;



//////////////////////

// Since q is heap allocated ..u can delete it

//

delete q;



//////////////////////////////

// Print the contents of the buffer

// This should print Hello World

printf("%s\n" , buffer );



////////////////////////////

//

// delete calls the destructor and frees the underlying storage

// Since we, manage the storage , called only the destructor

q->~string();



////////////////////////////

//

// free the buffer

free(buffer);

}

STL Tutorial - Part 2

In this part , we will write a program which demonstrates for_each algorithm. We are planning to use a Function Object Version and a Lamba Version. The stuff requires Visual C/C++ 2010 compiler.





////////////////////////////////

//

// second_stl.cpp 

//

// A Simple STL program to compute average of numbers

// using vector container..

//

// This programs , demonstrates insert function 

//

// cl /EHsc second_stl.cpp

//

#include <vector>

#include <stdio.h>

#include <algorithm>

using namespace std;



/////////////////////////////////////

//

// Accumulate Values in a Vector

//

//

double Sum( vector& dblarr )

{



vector::iterator iter = dblarr.begin();

double acc = 0;



while ( iter != dblarr.end() )

acc += *iter++ ;



return acc;

}





///////////////////////////////////////

//

//

// Define Function Object 

//

//



struct Test {



void operator () ( double a ) {



printf("%g\n",a ); 



}

}TEST_FUNC;





////////////////////////////////////

//

//

// Entry Point ...

//



int main( int argc , char **argv )

{



vector varr;





//////////////////////////////

// 

// Populate the vector using insert function....

varr.insert(varr.end(),10.0);

varr.insert(varr.end(),20.0);

varr.insert(varr.end(),30.0);

varr.insert(varr.begin()+2,40 );





///////////////////////////////////

// Iterate using Functor ...or Function Object

//

for_each( varr.begin() , varr.end() , TEST_FUNC );







//////////////////////////////////////////////

//

// Iterate using Lambda ( instead of Function Object ..

// 

for_each( varr.begin() , varr.end() , [] (double a ) {

printf("%g\n",a );

} );





double res = Sum(varr);

printf("%g\n", res);

}

Anxiety - A Poem

Anxiety , Do you have it ?
Who does not have it ?
If you don't , there is some wrong
It drops in, all of a sudden
It fades very slow

Only to return back with a vengance
Face it , to have a fighting chance
Or else , Hope it to fade away
Act well , despite it
Suppress it, not
As it will bubble up , in some other form
When You are having it , I suspect your learning
to Cope with it .

Saturday, December 18, 2010

Computer Programming and Policing - a Parallel

The Responsibility of a Police force is to "Tile" completely the place under it's area. The Police areas are zoned and there is clear guidelines on to the roles and responsbilities of people who are in charge of each zone.

Programming is similar in the sense that , the duty of any computer program is to "tile" the whole area which it is supposed to operate under a set of constraints.


In Programming and Policing , economic factors does not allow us to tile the whole area . Instead , both identify some key areas based on operational characterestics and place restrictions at differnt levels as Criminals or Bugs do not escape the net they have build.



By Identityfying key areas , we should write code or monitor in a such a a way to make bugs or criminals getting slipped bit difficult. That is all we can hope for !

Reema Sen , Riya Sen and Raima Sen - Who is the odd one out ?

When Reema Sen began to make her appearance in films , most ( at least me ) thought , she is the daughter of Bengali actress Moon Moon Sen.

Riya and Raima are sisters (Moon sen is their mother ) . Reema sen does not have anything to do with Moon Moon sen.

I saw Moon Moon Sen In a Telugu Movie ( which was a touching one , a musical entertainer ) which goes by the name Sirivennela ( Dubbed into Tamil and was screened at Kalishweri theatre, Kodungallur )

P.S :- I had seen a movie "Aval Kathirunnu Avanum" Starring Mammootty and Moon Moon Sen before that . But , I was not aware about her. ( The story line is similar to Mauna Ragam starring Karthik , Mohan and Revathy in tamil )

Gossip Columns - What is missing ?

Now a days , when ever you log on to the Yahoo.com site , Your attention will be grabbed by some Bollywood relationship news which goes by Saif/Kareena , Abi/Ash,Hrithik/Susane, Sallu/Kat , Ranbir/Deepika etc to name a few.

Today , It was the news of Salman Khan and Katrina appearing together in Bigg Boss show. The news Item was accompanied by lot of pics from various angles.

Once Physiological survival (Roti , Kapada and Makan and some financial safety net )  worries are behind any Individual , he/she is aware about the need to be less emotional on most matters. These Individuals are well aware about the human fallibilities and also they know that opportunism pays off. So , these people can "act" well in real life as they do on the reel life. A strained relationship off the screen , thus does not affect their On screen chemistry as economic self interest is a binding factor.

If a person is from Entertainment Industry , Sports , Senior Corporate management , Business tyccon , they are a breed who can go to any length to protect their position. They ought to do that , in order to survive.

We "normals" ( ordinary people ) , apply our ethics and mindset to relationship between celebrities. This fallacy makes gossip selling an Industry to reckon with.

Why go that far ? If you look around , among your immediate circle itself people bury their differences to form a symbioitic relationship of some value to keep things bad where it would have gone worse !.

ETL vs ELT

I came across the term ETL (Extract , Transform and Load ) , In the year 2003. I joined a company to work on Ab Initio , World's premier ETL tool. Ab Intio had a graphical development environment and a DSL to work with Data Transformation pipeline and their Data Processing Patterns based architecture made it a productive environment.

Their Graphical development environment emitted Unix Korn Shell Script and this can be tweaked by a developer to add missing features.

I had written some ETL jobs for populating a Terra DB data warehouse.

Today , I came across a term called ELT.  ELT stands for Extract Load and Transform. This means you transform data , after you have  loaded it into the data warehouse.

The full article can be read from here.

Fight for Our Rights - a Poem

We ought to Fight for our Rights
Since , Some try to Snatch our Rights
Why Care , If some one snatches your Rights ?
I do care , for mine


Assert , What you feel is right .
With out it , Adversaries will be more bold
To strike again , with vigor


Why make him Bold to strike ?
Time and again, Never give up your Right
Without a Fight


Fight, to make Adversaries more respectful
In future , to avoid a scaled one


Fight , to avoid remorse
In future , to drive away disgust


Fight , To feed your soul ,
for not giving up ,
your Rights without a fight

Failure - a Poem

Failure , No such thing
True one , Is death
All Others , are illusion
Fail often , to cope with it
Aversion to it ,the root cause of all evil
Lack Of it , Waiting to happen
Learn to Fail , He runs away
to bring , Success all the way
Like Oasis in a desert

Success - A Poem

Success , Can we define ?
Some one ever will ?
Some Say , It is a Phenomena
Some Others Say , It needs to be felt
How come we can chase it ? ,No one has
It arrives , when you least expect
Leaves , When you least expect it
Some Say , It is pointless
With It , brings agony
Lack Of it , Brings pain
To Understand , You need to Lack it
We all Crave for it , Not knowing it
Success, Will Some one ever comprehend ?
Until then , people start expeditions to conquer it

Public Language vs Private Language

When we say that , Some one's language has got finesse , for all practical purpose , we mean his language is rich in vocabulary , fluency (flow ) in his communication , correctness of grammar ,choice of words , framing of sentences etc. We say about their skill-set in "Public Language".

Now a days, Due to the advent of cheaper modes of communication , we have developed a shortened form of human language meant for such medium. The Chat sessions between two individuals can be a source for private lingo between two individuals or members of a group. These are some kind of "Private Language" specific to Individuals in question.

The ability of an Individual lies in developing competancy in handling Public language and at the same time to be at ease with Private languages evolved based on communication with Individuals close by.

Friday, December 17, 2010

Craving - a Poem

We crave for things , which eludes comprehension
Let it remain so , as confusion is not bad
It helps us to weave a life , amidst chaos
Be careful , before craving for something
It so happens that , we will get it
when , least expected
since we had not planned for it , it is all trouble
Crave for something which we can hold
All will be fine , with the soul

Enterprise Systems vs Web Site development

For the un-initiated or who have had not much exposure to the former , Enterprise Systems do have Web portals , which are a special form of Web site. So , most people think that if there is skill-set in ASP.net or JAVA/JEE , you are on your way to become an Enterprise Computing Specialist.

But the reality is far from this myth. Most Enterprise Systems provide services and Services need to be defined in an Unambiguous manner ( by taking into the consideration Business Context , Compulsion and SLA requirements ) before trying to find a Solution architecture for the Enterprise. The Computational requirements of these systems are huge and most of the processing cannot be done Online ( in a Web request ). Essentially , the urls and web services are just rendezvous point to exchange data.

Moment the data is received , an Offline Job or Task needs to be triggered on demand or periodically to process the incoming data.  The Job Orchestration Engine need to use the computational requirements available on the Server Infrastructure and needs to do some kind of Coarse grained distributed processing.

The System also needs support for Complex Event Processing ( Business Alerts is a case in the point ) and a robust Workflow authoring , Compilation and execution systems need to be there.

Most enterprise systems run in web farms and special care needs to be taken to data updates , Session management etc.

These are some points which is included in a long checklist and try to learn the stuff as a first class discipline.

Thursday, December 16, 2010

Installed Cg 3.0 and OpenGL 3.3 drivers from NVIDIA

I have not been following real time graphics scene for more than ten months (Other than a short foray into OpenGL ES 1.1/2.0 on iPhone ) . Now , Version of OpenGL has moved to 4.1 in a short time. It seems , OGL is also going the DirectX (DX ) way. Unfortunately , my graphics card does support only OpenGL 3.3 ( GeForce 9 series card ).

I am comfortable with Pixel and Vertex Shaders. Need to take a look at Geometry Shaders. Also downloaded Cg 3.0 installer. The advantage of Cg is with one shader , u can work with DX11 and OpenGL. Moreover , NVIDIA has got a good developer eco system on their site.

The Problem faced by the new Graphics programers are each of the effect you can produce is a PhD thesis on to itself. So , Graphics Programmers has to seek the help of people from lot of disciplines. With the advent of Scene Graph APIs and Rendering Engines , there is hardly much need to program at the DX and OGL level. They have become the standard for Hardware Vendors. Sort of Assembly language.

I still remember the words of a real time rendering Guru to me , "I Pity the poor professors who are forced to keep track of all these things now a days. The moment programmable shaders arrived , CG Industry has gone wild."

Still , for lot of people putting a sphere on the screen is a tough task though !!

Tuesday, December 14, 2010

Tentativeness

I hesitate , When I start
To get the feet wet, I ponder a lot
Aversion to Loss , Is so great in me
The Arm chair philosopher in me , takes over
Thus , I analyze a lot to endup in paralysis

STL Tutorial - Part 1

In this part , we will write a program to accumulate the sum of series of number stored in a STL vector container. In the process , we will learn something about vector container , vector iterator etc.


////////////////////////////////


//

//

// A Simple STL program to compute average of numbers

// using vector container..

//

//

//



#include <vector>

#include <stdio.h>

using namespace std;



double Sum( vector& dblarr )

{



vector::iterator iter = dblarr.begin();

double acc = 0;



while ( iter != dblarr.end() )

acc += *iter++ ;



return acc;

}





int main( int argc , char **argv )

{



vector varr;



varr.push_back(10);

varr.push_back(20);



double res = Sum(varr);



printf("%g\n", res);

}

Monday, December 13, 2010

Demure - a new term , I came across

Normally , when I log on to Yahoo , Some bollywood gossip article will catch my eye. This time , it was the turn of Sonakshi Sinha ( Daughter of Shatrughnan Sinha ulf Bihari Babu ) and her new pic in the cover of Maxim magazine.

In Dabangg, Sonakshi had played the demure wife of police officer Chulbul Pandey.

I did search about the meaning and found it to be

1. sedate; decorous; reserved


2. affectedly modest or prim; coy
 
usage :-
 
She must be a woman of complicated character, and there was something dramatic in the contrast of that with her demure appearance.

        Moon and Sixpence by Maugham, W. Somerset View in context

Self Interest - a Poem

What do we see around ?
A world of bias and prejudice
Escape from this at our own peril
For Prejudice and Bias , are valuable
Objective , can we ever be ?
Subjective , we should be
We are what we are
because of the path we left behind
Let , Self interest be a guiding light for you
It helps to move the world more than anything else

BCCI vs Sports Ministry

It is very difficult to take sides here . BCCI is being administred well so far ( or at least "shit" is in the pit )  Any National Sports Federation to get grants and patronage from the govt. has to come under the ministry of sports. So, both are right here.

Then , who owns the BCCI now ? i do not have an anwser here , do you ?

http://cricket.yahoo.com/cricket/news/article?id=item/2.0/-/story/cricket.yahoonews.com/ministry-may-take-india-out-bcci-20101213/

Concurrent Programming under Windows

I have started reading Joe Duffy's Concurrent Programming under Windows in a systematic manner. The book covers managed code multithreaded/multicore programming as well as native code programming using C/C++.

A highly recommended book for anyone who is interested in multithreaded/multi core programming.
The book is conceptual and covers lot of ground between the covers

Sunday, December 12, 2010

Defenition vs Definition

To Define something means , to write a prose about a term , word , phrase , entity or a thing. The whole stuff is called Definition. For a long time , when I write Definition , It was written as Defenition ( Some people spell it like that ! ).

To understand more about this , I went to the Wiki page of definition.

Oh my boy , read slowly and carefuly.

Tuesday, December 07, 2010

Lambda in C# - it's uses and abuses

I am taking a session titled "Lambda - it's uses and abuses " , next saturday. I think, use of Lambda expressions or Statements is too often unneccary. The stuff has been implemented by Microsoft to transform LINQ Compreshension syntax to it's function form.


Ocassionaly , it helps to customize filtering of information , implementation of strategy pattern etc.

Sunday, December 05, 2010

A new member to our family

Early today morning , my wife gave birth to a baby boy around 4.40 am . The baby weighs around 3.2 kgs.

Saturday, December 04, 2010

Equanimity - it is the need of the hour , at least i feel so

Modern world is so crowded that , despite being talented you might in for woods.

Equanimity is a state of mental or emotional stability or composure arising from a deep awareness and acceptance of the present moment.

Friday, December 03, 2010

Currying - What is it ?

 Currying is the technique of transforming a function which takes n argument to a function which takes n-1 arguments by supplying one argument at a time.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Curry
{
    class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ///
            // A Lamda Expression which takes two doubles as parameter
            //
            Func<double, double, double> adder = (a, b) => a + b;
            //
            // Define a function add10 ... which reduces the arity 
            // This is an example of currying ....where a 2 arity
            // function got reduced to a one arity...
            Func<double, double> add10 = (c ) => adder(c,10);
            ///
            /// Successor function....
            ///
            Func<double, double> succ = (c) => adder(c, 1);
            //
            // Predecessor function....
            //
            Func<double, double> pred = (c) => adder(c, -1);
            ///
            ///
            /// Mul function defined in term of addition....
            Func<double, double, double> mul = null;
            mul = (a, b) => b == 0 ? 0 : adder(mul(a, b - 1), a);


            //
            // Invoke the arity reduced function... 
            //
            Console.WriteLine(add10(30));
            Console.WriteLine(succ(10));
            Console.WriteLine(pred(21));
            Console.WriteLine(mul(17, 17));
            Console.Read();



        }
    }
}

Thursday, December 02, 2010

Virtual Cage - are we all in it ?

Due to the inherrent limitations of human brain , our thoughts are the products of  our experience. Navigating to the chosen comfort zone is built into us and we do everything to paddle to it.

The context might be demanding something else. When the reality strikes , most often we will be smiling as the new situation is not that worse as we thought.


So, are we always in a virtual cage ?

Wednesday, December 01, 2010

Trucks , their drivers and their plight

I reached home bit early today from my work. I happen to chance upon a program in Discovery Channel which highlights the logistic industry in India and it's associated issues. When we hear about Trucks , the first thing which comes to our mind is Namakkal . The place is renowned for density of  HIV+ people  around it.

The program chronichled the issues faced by the people who drive these trucks . This include Opium consumption , Indiscriminate paid sex on the road side and veneral diseases , high way robberies , corrupt RTO officers , problems from policemen etc..

Rational Ignorance - a new term for an old phenomena ( for me !)

The cost of educating oneself on an issue can some times exceed the potential benefit  derived from that knowledge. In that case ,  Rational ignorance occurs.


We need to cultivate that on a selective basis.

Spaghetti Stack - Have you come across it ?

The Other day , i was exploring Apple's Block (a kind of Closure)  feature available with IOS4 and MAC OS X 10.6. The modifier __block has to be added before variables which are supposed to be captured.

I was thinking about the implementation of such a feature in a programming language compiler. The implementation of Lexical Closure requires capture of free variables ( variables accessed from outside environments which are not parameters ) and capturing a local variable from x86 ( MAC OS X runs on x86 ) stack is impossible as the stack gets thrashed after the invocation of Subroutine.

I came across a new term "Spagheti Stack" ( a data structure which can be used to implement Variable capture ) and here is the wiki page for it.