Wednesday, December 1, 2010

Rejecting records in Fact table loads - Informatica

In some development environments, you dont have all the required dimension data and as a result, your fact loading mapping's test runs go for a toss. The mapping wont be able to load anything (reject everything) since some or other foreign key would be missing for each row.

In other words, only those records would be loaded for which ALL the foreign key constraints would be satisfied. However, in Production environment, this would almost never happen. Or even if its the case, we'd actually want those rows to be rejected.

This can work out to be a serious impediment to development/unit testing. It prevents the developer from seeing whether or not his his mapping is behaving appropriately for the happy flow functionality.

One way of achieving this can be to work using a Mapping Variable indicating the Environment. The developer can run using a value like 'D' or something, indicating a different environment than Production, with 'P' (production) being the default value.

Now in the mapping, just about where you decide to reject a record based on different type of conditions, you could put an AND condition involving this mapping variable, e.g. ....AND $$MAPP_ENV = 'P'

Now, the expression would return true only in the Production environment, and therefore would work as expected. In Dev though, this expression would return false and would not reject that row.  

Now, to be able to satisfy the db constraints for the fact table so that the row is actually inserted, you'd need to use some placeholder convention. One of the approaches can be to use an outlier value as the foreign key value.  For Example, for customer id, keep a -1 in dimension table, meaning "Undefined".  And, in all such dev cases, send -1 to the fact. 

It would serve both the purposes, tell your fact table that there is something diff about that row, and still inserting a row in there, so that the testing for the rest of the columns is not stopped because of one foreign key missing out.

Wednesday, November 17, 2010

Setting a useful command prompt in Unix

I just came across a unix system at my workplace that had a static prompt set. Basically, the prompt was just the shell executable's name and version, more like 

bash-3.2 $

Well, this kind of prompt has many drawbacks, some of them i'd list here - 
1. You never know (just like that) where you are in the file system. When you are dealing with multi-directory situations, you might want to stop typing pwd to figure out ur current location.

2. You never know by what user you are logged in (again, just by looking at the prompt). You'd have to run a whoami to figure that out.

3. More importantly, if you are dealing with multiple systems, this one's the most killer.  You never know to what system you are logged in right now. you'd have to issue a hostname command.

Well, there might be, and for sure there are many other, consequences of having such a cryptic command prompt.  And therefore, my favourite, to have a command prompt, that displays at least these three things, always, dynamically...

Something like, 

raghav@deskubuntu:/homes/raghav/rails $ 

wherein, I am always aware of the three things mentioned earlier. This is very very useful when you are dealing with multiple systems and you have multiple users who are configured to run different types of processes.  For example, an oracle user who is supposed to be owner of oracle processes, and an informatica user which is supposed to own everything linked to informatica, and then a connect direct user which owns the CD processes, which receives files coming in from some other system.

With this kind of system, and your own user id to log in to the system, you'd better be careful which processes you are looking at / launching and by what user.  Its really very very important.

When and if you are dealing with a multiple system scenario, like dev / test / acceptance / production, you'd be better advised to use something like this only.

the magic command to do that is by setting appropriate flags and text in a environment variable called PS1.

Just set PS1 to your .profile or .bashrc (depending on your environment) file and you are set .

The example prompt that I mentioned can be achieved by saying - 

export PS1="\\u@\\h:\\w \\$ "

There are many more possibilities that go with special meanings for PS1 variable. Read some of them here - 

    * \$ : if the effective UID is 0, a #, otherwise a $
    * \[ : begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
    * \\ : a backslash
    * \] : end a sequence of non-printing characters
    * \a : an ASCII bell character (07)
    * \@ : the current time in 12-hour am/pm format
    * \A : the current time in 24-hour HH:MM format
    * \d : the date in "Weekday Month Date" format (e.g., "Tue May 26")
    * \D{format} : the format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required
    * \e : an ASCII escape character (033)
    * \H : the hostname
    * \h : the hostname up to the first '.'
    * \j : the number of jobs currently managed by the shell
    * \l : the basename of the shell’s terminal device name
    * \n : newline
    * \nnn : the character corresponding to the octal number nnn
    * \r : carriage return
    * \T : the current time in 12-hour HH:MM:SS format
    * \t : the current time in 24-hour HH:MM:SS format
    * \u : the username of the current user
    * \s : the name of the shell, the basename of $0 (the portion following the final slash)
    * \V : the release of bash, version + patch level (e.g., 2.00.0)
    * \v : the version of bash (e.g., 2.00)
    * \W : the basename of the current working directory
    * \w : the current working directory

Tuesday, November 16, 2010

Happy 2nd Birth Day ....

I am not there with him today, the mom is. And though he would have some fun for sure, I am going to miss all of that... :(

wish you a happy birthday remotely...

Monday, November 15, 2010

scripts and hash bang ( #! )

More often than not, people have to tell the unix shell / perl scripts or other programs where lies their interpretor, e.g. write their command line calls as 



ruby ARubyProgram.rb



this is because the system may not be aware of the location of the the executable interpreter of the exact type that needs to be used for the corresponding script.  Well, for this purpose, windows has the file extension association concept, but we are dealing with Unix like systems not windows, so that option is not really available to us (besides, there are ill effects of that convention too, but lets not go in that discussion).

So, to tell a unix program where to find its interpreter, besides launching the script along with it on command line, there is another way, and rather beautiful at that.

Just put the exact path of your interpreter executable at the very first line of your script preceded by these two magic characters, a hash and an exclamation (#!) also called as hash-bang or shebang.  Now, once your script is marked as executable (see chmod), you are good to go, no need of putting explicit calls to the interpreter to run your code.

Basically, your code should now look like this - 

print "testing hashbang with raghav"

Save this short script as (assuming that your system has perl 5 interpreter installed in the location I used). Make the script executable (chmod) and you can just launch the script, like ./  instead of earlier example perl

A word of caution though, these magic characters have to be absolutely the first and second character of the file, no exceptions to that. Else, the system cant make out the special meaning of this and the purpose is lost.

Pretty neat.. hunh...

Tuesday, November 9, 2010

Experience with Air India - 2

The return flight from Delhi to Bangalore, on the evening of Sunday 7th Nov 2010, turned out to be the most horrible flying experience I have ever had, till date.  The flight was AI-622, bound to fly out from T3 at 2010 hours 7th Nov.

When I reached at the airport, the check-in area was a mess in itself.  The Air India staff had invited all the passengers to check-in from all the counters, basically creating a mess of a situation. When they realized what they have done, they scrambled to a fix, and started calling out to the people for whom the flights were about to depart (and these ppl were still stuck in check-in queues).

When these people were taken away, my checkin process suddenly looked easier and faster.  Basically, I was all checked in at around 6:45 and inside the boarding gates area by that time.

The display panel had no mention of my flight but other flights both domestic and international, before and after my flight were listed properly, with whatever status applicable to them.  When inquired, they said, it was ok, not to worry, and told me of my gate no for boarding (also that the flight was on schedule).

By 7:25 pm, the boarding should have begun, but there was no air india official to be seen around the gate till that time, or even later, till 2000 hrs.  I think thats when I begun to think, that something was wrong.  I went to the info desk and asked the person there, he had no information.

Slowly people started assembling around the gate and asking questions. There was nobody to answer them. Slowly the mob mentality was becoming visible. People shouting, grabbing whoever was visible in an air india garb, or with some kind of airport office link.

Initially, someone caught hold of a lady, fairly senior (by age i mean), and started asking her questions. She DID NOT know anything. Someone said that she was the duty manager, and this angered people even more.  

By now, it was well past 2100 hrs and still nobody had appeared on the assigned gate.  Then people caught hold of two air india officials who were just passing by. The mob really got angry and wanted answers.  The two guys were so visibly helpless they couldnt do anything.  Ppl asked them to call up the responsible officials, but none of the officials were picking up their phones.  Then one passenger asked for the officials' number and called from his own mobile. The official did pick up the phone, but, still couldnt offer any answers to the situation.

Slowly a pattern was emerging out of the situation. No flights scheduled to leave after 1900 hrs or so were taking off. Flights to Bangalore, Chennai, Kolkata, Mumbai and Dubai were in this unknown situation. Some people for bangalore flight were waiting since 1100 in the day since their 1300 flight was cancelled and they were bumped up to this 2010 flight.  Effectively they were the worst hit guys, waiting for about 10 hrs already.

Finally, the mob started walking with this official, demanding to be put in touch with the officials face to face, nothing happened, since the passengers are not allowed to leave the boarding area after check-in. People were diverted to another official at another gate, who could not answer any questions anyway.

By now, it was already 2300 hrs, and still no answers. It was pretty chaotic, since nobody knew whats the status of the flight, and whats going to happen.  There was some infants among the passengers. Their parents were the more anxious lot. A Danish national got migraine attack during all this chaos. There were at least 10 people who were over 70 yrs old, and the waiting process was not helping them at all, let alone the uncertainity.
As it turned out, around 2330 there was announcement of the cancellation the bangalore flight.  It just broke some patience barriers. People started shouting at the info desk guy, since he had not been advised about the next steps for the passengers.  

He made a few phone calls and a lady appeared.  This lady tried to offer some hope, but it was a failed attempt. People had realized by now that air india has no intention of flying the people to their destinations and it would be a cancelled flight for good. They are just not announcing it in good time so that they wont have to pay the passengers' hotel stay etc.

They still had no clue around the solution to the problem.  Now a new face appeared, Mr Nalin. He claimed to be in an executive authority and wanted to fix the problem for good. He promised a special flight to Bangalore at 0145 hrs in the night. After making some other promises, he went off. Nowhere to be seen again.

People thought that they have been conned again.  By now, its already 0015.  Suddenly, people caught hold of two female officials in air india garb. The poor girls didnt know anything but were shouted at anyway.  A new face appears now, Mr Pankaj, supposedly GM of Air india.

He was shouted at all possible ways. Everybody was venting his anger on him, but guy showed remarkable patience and didnt react even once. We were thinking, had he reacted even once, god knows how the mob would have acted/reacted.  I would say, he was not physically handled, barring that, all possible ways were used to vent anger at him.

Finally, he started moving some things, the officials started appearing. He found a crew for one of the flights, and then another crew came in.  Some more officials came in, a lot of CISF people showed up. Apprantly to handle the situation if the mob went physical with him.

Already 0100 hrs and no sign of boarding activity. Mob had not let him go anywhere, so he announced that the bangalore flight will leave "if not 0145 perhaps by 0200 or 0215".  Another 30 minutes passed by, and now the mob was on the brink.  A gentleman, father of two young kids, literally charged at him, wanting to know when the flight would actually go.  

Now he says, 0300. And this was genuinely interesting, the guy asked Mr GM, what would you do if the flight does not depart by 3 AM... the GM guy had no answer, literally tense face, sweating brows, no voice. 

Finally, around 0255 there was an announcement for boarding for the bangalore flight.  A decent 7hrs 30 mins delay, and I am sure, had the people not been so vocal and demanding, the flight would never have been arranged and we got home the way we got home.

At the end, the flight, which should have landed bangalore 2240 the previous evening, now landed past 0600 the next morning, spoiling the next day for everybody, more so for the working passengers.

Someone rightly spoke, "this is my last flight with air india, never again". Well, I am with the group who says, "never say never", but for once, for this one I feel like agreeing with him. Never Again with air india, or at least till the wounds are fresh :)

Experience with Air India - 1

It was not my first time flying with air india, perhaps 2nd or 3rd, but its going to be the last one, at least these are the emotions rights now...

I booked this round trip in october last week, attempt to go home for Deepawali utilizing the long weekend.  It was a Bangalore - Delhi - Bangalore round trip, and I was pretty excited to have clinched this deal.

Flying out to Delhi from Bangalore was already giving indications of trouble with Air India.  When I reached airport, they had already cancelled my flight.  Later I got to know that they had in-fact merged my flight with another flight, which was an international flight, coming from somewhere. The fact was, almost nobody was certain whats the situation. On the check-in counter, I was told that my seat was not confirmed yet, was on standby. Luckily, it was confirmed within the next few seconds itself, and I had a seat (which I realized later, was the last available seat on the flight).

The flight was delayed by about half an hour was another fact. During the waiting period, I met a few passengers, who were waiting since 4-5 hours since another afternoon flight was delayed and the passengers were supposed to leave together on this flight.

Inside the aircraft, we were welcomed by two angry air hostesses, and a third one relatively better.  Mis-management was rampant there too. Ground staff had put in some stuff meant for passengers cabin luggage and the air hostesses were having hard time accomodating passengers' luggage.

Once I got to my seat, I found out a few more things. The hand rest of the seat was taped using cello tape, or else it would just come out into your hands. Later during the flight, one of the overhead lights came out into the hands of of the passengers when she was trying to refocus the beam.  All in all, the aircraft looked like from stone age,  not withstanding the fact that they didnt have aircrafts in stone age :) .

Eventually, we reached delhi airport, but were informed that we would land on the newly built-operationalized terminal (known as T3).  While going to the baggage claim area through a bus, we could actually see labour working here and there. Basically, it was evident that construction work is not over.

The baggage claim belt didnt start until about half an hour after our arrival in the lounge. Some passengers had literally shouted out to get some air india officials around there and take some action for that.

At the end, it turned out, the new terminal is really still new for the people also, and they have issues synchronizing everything. 

It turned out that the whole ordeal took about 2 hours extra than the normal.

Sunday, October 31, 2010

A Note to New Consultants

I  am about to start a new role, that of a consultant at a new customer site soon. In order to prepare for that mentally, I was looking around for inspiration and advice. In the process, I stumbled across this gem from the founder of Boston Consulting Group.  I have picked up the text from this webpage(, and then tried to see through it from my own eyes.  All credits with the original webpage owners.

Written by Bruce Henderson, Founder of Boston Consulting Group in the 1970s

In a sense the consultant's role is a paradox. He gives advice to people of equal intelligence who have vastly superior and extensive experience and knowledge of the problem. Yet he is not necessarily an expert in anything. What is the justification for his value?

       Need of Consultant
  1. The consultant can function as a specialist or expert, In this role he must be more knowledgeable than the client. This implies a very narrow field of specialization, otherwise the client with his greater continuity of experience would be equally expert.

    The consultant can function as a counselor or advisor on the process of decision making. This implies an expertise of a special kind, that of the psychotherapist. This is merely a particular kind of expertise in a particular field.

    The most typical role for a consultant is that of auxiliary staff. This does not preclude any of the other roles mentioned before, but it does require a quite different emphasis.

    All companies have staff capabilities of their own. Some of this staff is very good. Yet no company can afford to have standby staff adequate for any and all problems. This is why there is an opportunity for consultants. They fill the staff role that cannot be filled internally.

    By definition this means that consultants are most useful on the unusual, the non-recurring, the unfamiliar problem. Outside consultants are also most useful where the problem is poorly defined and politically sensitive, but the correct decision is extremely important. Outside consultants get the tough, the important and the sensitive problems.

    The natural function of a consultant is to reduce anxiety and uncertainty. Those are the conditions under which anxiety and uncertainty are greatest and where consultants are most likely to be hired.

    Problem Definition
  2. If this point of view is our starting point, then problem definition becomes extremely important.
    • If the problem is incorrectly defined, then even its complete solution may not satisfy the client's perceived needs.
    • If the problem is improperly defined, it may be beyond our ability to solve.
  3. Problem definition is a major test of professional ability. Outside consultants can frequently define problems in a more satisfactory fashion than internal staff, primarily because they are unencumbered with the historical perspective of the client and the resulting "house" definition.

    A consultant's problem definition is the end of the assignment if the problem is not researchable. If the problem is not researchable, then the consultant is either a specialist-expert or a psychotherapist. Neither of these roles are suitable for the use of the resources of an organization such as The Boston Consulting Group.

    A researchable problem is usually a problem that should be dealt with by a group approach
    . Data gathering and analysis requires differing skills and different levels of experience that can best be provided by a group. The insights into complex problems are usually best developed by verbal discussion and testing of alternate hypotheses.

    Good research is far more than the application of intellect and common sense. It must start with a set of hypotheses to be explored. Otherwise, the mass of available data is chaotic and cannot be referenced to anything. Such starting hypotheses are often rejected and new ones substituted. This, however, does not change the process sequence of hypothesize / data gathering / analysis / validation / rehypothesize.

    Great skill in interviewing and listening is required to do this. Our client starts his own analysis from some hypothesis or concept. We must understand this thoroughly and be able to play it back to him in detail or he does not feel that we understand the situation. Furthermore, we must be sure that we do not exclude any relevant data that may be volunteered. Yet we must formulate our own hypothesis.

    Finally, we must be able to take our client through the steps required for him to translate his own perspective into the perspective we achieve as a result of our research. This requires a high order of personal empathy as well as developed teaching skills.

  4. The end result of a successful consulting assignment is not a single product. It is a new insight on the part of the client. It is also a commitment to take the required action to implement the new insights. Equally important, it is an acute awareness of the new problems and opportunities that are revealed by the new insights.

    We fail if we do not get the client to act on his new insights. The client must implement the insights or we failed. It is our professional responsibility to see that there is implementation whether we do it or the client does it.

    Much of the performance of a consultant depends upon the development of concepts that extend beyond the client's perception of the world. This is not expertise and specialization. It is the exact opposite. It is an appreciation of how a wide variety of interacting factors are related. This appreciation must be more than an awareness. It must be an ability to quantify the interaction sufficiently to predict the consequences of altering the relationships.

    Consultants have a unique opportunity to develop concepts since they are exposed to a wide range of situations in which they deal with relationships instead of techniques. This mastery of concepts is probably the most essential characteristic for true professional excellence.

    A successful consultant is first of all a perceptive and sensitive analyst. He must be in order to define a complex problem in the client's terms with inadequate data. This requires highly developed interpersonal intuitions even before the analysis begins.

    His analytical thinking must be rigorous and logical, or he will commit himself to the undoable or the unuseful assignment. Whatever his other strengths, he must be the effective and respected organizer of group activities which are both complex and difficult to coordinate. Failure in this is to fall into the restricted role of the specialist.

    [raghav] The first time I have read that a specialist role can be restrictive, and honestly, when you think about it again, it does come back as a correct statement, specially in the wider world of other opportunities. Specially for a management consultant.

    In defining the problem, the effective consultant must have the courage and the initiative to state his convictions and press the client for acceptance and resolution of the problem as defined. The client expects the consultant to have the strength of his convictions if he is to be dependent upon him. Consultants who are unskilled at this are often liked and respected but employed only as counselors, not as true management consultants.

    The successful professional inevitably must be both self-disciplined and rigorous in his data gathering as well as highly cooperative as a member of a case team.

    The continuing client relationship requires a sustained and highly developed empathy with the client representative. Inability to do this is disqualifying for the more significant roles in management consulting.
In other words, the successful consultant:
  • Identifies his client's significant problems;
  • Persuades his client to act on the problems by researching them;
  • Organizes a diversified task force of his own firm and coordinates its activity;
  • Fully utilizes the insights and staff work available in his client's organization;
  • Uses the full conceptual power of his own project team;
  • Successfully transmits his findings to the client and sees that they are implemented;
  • Identifies the succeeding problems and maintains the client relationship;
  • Fully satisfies the client expectations that he raised;
  • Does all these things within a framework of the time and cost constraints imposed by himself or the client.

Thursday, October 7, 2010

Thursday, September 30, 2010

my experiments with solr :)

Its a catchy title, but yes.. thats what I am going to talk about...

I came across hadoop, when I was looking for a new solution for one of our in-house projects. The need was quite clear, however, the solution had to be dramatically different.

The one statement we received from business was, "We need an exceptionally fast search interface". And for that fast interface to search upon they had more than a hundred million rows worth of data in a popular RDBMS.

So, when I sat about thinking, how to make a fast search application, the first thing that came to my mind was, Google. Actually, whenever we talk about speed or performance of web sites, Google is invariably the first name that comes across.

Further, Google has a plus point that there is always some activity at the back end to generate the page or results that we see, its never static content. And, then, another point, Google has a few trillion pieces of information to store/index/search whereas our system was going to have significantly lower volume of data to manage.   So, going with that, Google looked like a very good benchmark for this fast search application. 

Then I started to look for "How Google generates that kind of performance". There are quite a few pages on the web talking about just that.   But, probably none of them has the definitive/authoritative view on Google's technology or for that matter the insider's view on how it actually does what it does so fast.

Some pages pointed towards their storage technology, some talked about their indexing technology, some about their access to huge volumes of high performance hardware and what not...

For me, some of them turned out to be genuinely interesting, one of them was the indexing technology. There has to be a decent indexing mechanism to which the crawler's would feed and the search algorithms hit.  The storage efficiency is probably the next thing to come in the play. How fast can they access the corresponding item ?

Another of my observation is that, the search results (the page mentioning page titles and stuff) comes real fast, mostly less than 0.25 seconds, but the click on the links does take some time.  So, I think it has to be their indexing methodology that plays the bigger role.

With that in mind, I sat about finding what can do similar things and how much of Google's behaviour they can simulate/implement.

Then I found Hadoop project on apache ( which to a large extent reflects the way Google kind of system would work. It provides distributed computing(hadoop core), it provides a bigTable kind of database (hbase), provides map/reduce layer, and more.  Reading into it more, I figured out that this system is nice for a batch processing kind for mechanism, but not for our need of real time search.

Then I found solr(, a full text search engine under Apache Lucene.  It is a java written, xml indexing based genuinely fast search engine.  It provides many features that we normally wish for in more commercial applications, an being from apache, I would like to think of it as much more reliable and stable than compared to many others.

When we sat about doing a Proof of Concept with it, I figured out a few things –

•    It supports only one schema, as in, rdbms tables – only one. So, basically you would have to denormalize all your content to fit into this one flat structure.
•    It supports interactions with the server interface only through http methods be it the standard methods get/put etc or be it REST like interfaces.
•    It allows you loading data in varying formats, through xml documents, through delimited formats and through db interactions as well.
•    It has support for clustering as well. Either you can host it on top of something like hadoop or you can just configure it to do it within solr as well.
•    It supports things like expression and function based searches
•    It supports faceting
•    Extensive caching and “partitioning” features.

Besides other features, the kind of performance without any specific tuning efforts made me think of it as a viable solution.

In a nutshell, I loaded around 50 million rows on a “old” Pentium-D powered desktop box with 3 GB RAM running ubutnu 10.04 server edition (64 bit) with two local hard disks configured over a logical volume manager.

The loading performance was not quite great. Though its not that bad either. I was able to load a few million rows (in a file that was sized about 6 GB) in about 45 minutes when the file was on the same file system.

In return, it gave me query performances in the range of 2-4 seconds for the first query. For subsequent re-runs of the same query (within a span of an hour or so), it came back in approx 1-2 milliseconds.  I would like to think that its pretty great performance given the kind of hardware I was running upon, and the kind of tuning effort I put in (basically none – zero, I just ran the default configuration).

Given that, I wont say that I have found the equivalent or replacement of Google’s search for our system, but yeah, we should be doing pretty good with this.

Although there is more testing and experimentation that is required to be able to judge solr better, the initial tests look pretty good.. pretty much in line with the experiences of others who are using it.

Sunday, September 12, 2010

Business & Open Source - How both can benefit

I had the opportunity to scout for a new technology/solution for one of our in-house projects.  Quite a few of the options that I looked for were from open source arena.  And amazingly, the products were far more capable from our expectations, just that we'd have to pitch in with some effort to get it working for us.

I have always felt that for open source projects/products to become commercially viable for a business enterprise, the enterprise has to come up and spend some resources to it to get the actual value out of it.

In other words, if an organization wants to use an open source product, which has an equivalent competitive commercial product available in market, they should be open enough to have their own in-house people who can take ownership of the installation. The organization shouldn't completely rely on the support available from the community forums and such.

I have seen more than one manager complain about the lack of support on the open source products.  Had there been proper support system for each of the open source products, we'd see a lot of stories similar to mysql's model or pentaho model.

What I would like to see perhaps is that the organizations' becoming mature enough in their adaptation of the open source products. By that, I expect them to have a open vision, have people who understand and like and own the product, and at the same time tweak and tune the product to suit the organization's business needs.

In the process, the organization should contribute to the product's development cycle.  This could happen in many ways, bug fixes, contribution of new features, the employees could contribute on community forums and such.  Using the terminology from peer to peer sharing, only leechers dont help a torrent, people need to seed to it as well. Same way, unless organizations contribute to an open source product, they would stand to become only leechers.

Only after we have a decent balance of organizations using and contributing to the open source products, we'd see the ecosystem flourishing...

Thursday, September 9, 2010

Tips for brainstorming...

Interesting read, from both positive and negative viewpoints -

1. Use brainstorming to combine and extend ideas, not just to harvest ideas.

2. Don't bother if people live in fear.

3. Do individual brainstorming before and after group sessions.

4. Brainstorming sessions are worthless unless they are woven with other work practices.

5. Brainstorming requires skill and experience both to do and, especially, to facilitate.

6. A good brainstorming session is competitive—in the right way.

7. Use brainstorming sessions for more than just generating good ideas.

8. Follow the rules, or don't call it a brainstorm.

Read more here -

in reference to:

"8. Follow the rules, or don't call it a brainstorm."
- Eight Tips for Better Brainstorming (view on Google Sidewiki)

Wednesday, September 8, 2010

Big help...

I wanted to get my table sizes in infobright, and this page came to my help...

SELECT table_schema,table_name,engine, table_rows, avg_row_length,
(data_length+index_length)/1024/1024 as total_mb,(data_length)/1024/1024 as data_mb,
(index_length)/1024/1024 as index_mb, CURDATE() AS today
FROM information_schema.tables
WHERE table_schema='mySchemaName'

Thanks Ron...
in reference to: Calculating your database size | MySQL Expert | MySQL Performance | MySQL Consulting (view on Google Sidewiki)

Thursday, September 2, 2010

आरती कुंजबिहारी की... Aarti Kunj Bihari Ki...

श्री कुंजबिहारी जी की आरती

आरती कुंजबिहारी की, श्री गिरिधर कृष्णमुरारी की ॥
गले में बैजंती माला, बजावै मुरली मधुर बाला ।
श्रवण में कुण्डल झलकाला, नंद के आनंद नंदलाला ।
गगन सम अंग कांति काली, राधिका चमक रही आली ।
लटन में ठाढ़े बनमाली;
भ्रमर सी अलक, कस्तूरी तिलक, चंद्र सी झलक;
ललित छवि श्यामा प्यारी की ॥
आरती कुंजबिहारी की...
श्री गिरिधर कृष्णमुरारी की…


कनकमय मोर मुकुट बिलसै, देवता दरसन को तरसैं ।
गगन सों सुमन रासि बरसै;
बजे मिरदंग, ग्वालिन संग;
अतुल रति गोप कुमारी की ॥
आरती कुंजबिहारी की...
श्री गिरिधर कृष्णमुरारी की…
जहां ते प्रकट भई गंगा, कलुष कलि हारिणि श्रीगंगा ।
स्मरन ते होत मोह भंगा;
बसी सिव सीस, जटा के बीच, हरै अघ कीच;
चरन छवि श्रीबनवारी की ॥
आरती कुंजबिहारी की...
श्री गिरिधर कृष्णमुरारी की…


चमकती उज्ज्वल तट रेनू, बज रही वृंदावन बेनू 
चहूँ दिसि गोपि ग्वाल धेनू;
हंसत मृदु मंद,चांदनी चंद, कटत भव फंद;
टेर सुन दीन भिखारी की ॥
आरती कुंजबिहारी की...
श्री गिरिधर कृष्णमुरारी की…

Tuesday, August 24, 2010

I also feel like saying, 1984...

This story appears in Economic Times, wherein Apple claims to have developed (or is busy doing that) sensitive info about an iphone user. Subsequently, Apple intends to hold/halt usage of the iphone device from the "unauthorized" user, this unauthorized reportedly includes -

1. an iphone that has been hacked to work outside the contract with which it was sold, read "jailbroken"

2. an iphone that is perhaps being used by someone other than the person who registered the first heartbeat or facial recognition info..

Apple intends to capture the phone location using GPS/other tech and perhaps control the device remotely if they feel its being used "unauthorized"..

i agree with people who remember 1984 after reading apple's intentions...ha.. time does come back...George Orwell.. were u too right ??

in reference to: Apple to make iPhone theft-proof - Hardware - Infotech - The Economic Times (view on Google Sidewiki)

I also feel like saying, 1984...

This story appeared in Economic Times, wherein Apple claims to have developed (or is busy doing that) sensitive info about an iphone user. Subsequently, Apple intends to hold/halt usage of the iphone device from the "unauthorized" user, this unauthorized reportedly includes -

1. an iphone that has been hacked to work outside the contract with which it was sold, read "jailbroken"

2. an iphone that is perhaps being used by someone other than the person who registered the first heartbeat or facial recognition info..

Apple intends to capture the phone location using GPS/other tech and perhaps control the device remotely if they feel its being used "unauthorized"..

i agree with people who remember 1984 after reading apple's intentions...ha.. time does come back...George Orwell.. were u too right ??
in reference to: Apple to make iPhone theft-proof - Hardware - Infotech - The Economic Times (view on Google Sidewiki)

Wednesday, August 18, 2010

Use (misuse) of Tax Money in India

Use (or should I say misuse) of my tax money...
Interesting one, Only this morning I was thinking about the damned MPs.

You know, they are protesting in parliament to increase their salaries…

And now, look at the irony, they are the same people who have to vote for their own salary hike, there’s no one above them who has to approve of it…

Think about the group of cheats that we have as MPs who are now going to get a salary hike, which basically means, the amount of expenditure on 534 MPs, approx 855Cr would go still higher.. to where, nobody knows…

The problem is, on no other issue, do these guys show the kind of unity that they are showing here, on salary hike issue…

Read some here…

And some more insights, on the current expenditure -

Monthly Salary : 12,000

Expense for Constitution per month : 10,000

Office expenditure per month : 14,000

Traveling concession (Rs. 8 per km) : 48,000
( eg.For a visit from kerala to Delhi & return: 6000 km)

Daily DA TA during parliament meets : 500/day

Charge for 1 class (A/C) in train: Free (For any number of times) (All over India )

Charge for Business Class in flights : Free for 40 trips / year (With wife or P.A .)

Rent for MP hostel at Delhi : Free

Electricity costs at home : Free up to 50,000 units

Local phone call charge : Free up to 1 ,70,000 calls.

TOTAL expense for a MP [having no qualification] per year : 32,00,000 [ i.e. 2.66 lakh/month]

TOTAL expense for 5 years : 1,60,00,000

For 534 MPs, the expense for 5 years : 8,54,40,00,000 (nearly 855 crores)


This is how all our tax money is been swallowed and price hike on our regular commodities.......

in reference to: Congress, BJP MPs join hands on salary hike issue - India - DNA (view on Google Sidewiki)

Priceless Words

A husband wakes up at home with a huge hangover.

He forces himself to open his eyes, and the first thing he sees is a couple of aspirins and a glass of water on the side table.

He sits down and sees his clothing in front of him, all clean and pressed. He looks around the room and sees that it is in perfect order, spotless, clean. So is the rest of the house.
He takes the aspirins and notices a note on the table.

"Honey, breakfast is on the table, I left early to go grocery shopping.
Love You!"

Totally shocked with the note , he goes to the kitchen and sure enough there is a hot breakfast and the morning newspaper.
His son is also at the table, eating. He asks, "Son, what happened last night?"

His son says, "Well, you came home around 3 AM, drunk and delirious. Broke some crockery, puked in the hall, and gave yourself a black eye when you stumbled into the door".

Confused, the man asks, "So, why is everything in order and so clean, and
breakfast is on the table waiting for me?
I should expect a big quarrel with her!"
His son replies, "Oh, that! Mom dragged you to the bedroom, and when she tried to take your clothes n shoes off, you said,


Self-induced hangover - $ 400.00
Broken crockery - $ 800.00
Breakfast - $ 10.00
Saying the Right Thing While Drunk – "PRICELESS”

There are truly some things that both money and MasterCard can't buy

in reference to: Reuters – Search Reuters (view on Google Sidewiki)

Sunday, August 8, 2010

Nuclear Weapons : Devices for peace ??

Well, the point is there, just because the other country has nuclear weapons, parties stay within a certain limit lest the fury of nuclear capable country might incinerate them.

The result is either a gorilla war kind of situation, one that is going on in Kashmir, one that is going on in parts of Iraq or a Cold war kind of scenario, where everything happens behind the curtains...

I dont really think they are devices of peace, but yes, they help avoid direct confrontation, acting as a deterrent. Though its needless to point out the continued civilian loss in gorilla warfare...

weapons are evil, anyway, nuclear or napalm or any other type... must be avoided..

in reference to: The bomb, 65 years later - Views - (view on Google Sidewiki)

test a

Published with Blogger-droid v1.4.12

Thursday, August 5, 2010

Corruption @ Common Wealth Games in Delhi

I guess you have missed out the latest reports in Indian newspapers regarding the corruption scandal that has broken out of the CommonWealth Games Organizing committee. They are renting stuff for 45 days by paying more money than is required to buy that item in first place. Contracts have been given to the relatives of the OC members, and stadium rooftops are falling down hours after inauguration.

All this results in more money being spent, in addition to the insult that the nation carries because of this bunch of "organizers". And who pays the money, the poor taxpayer like me and you (assuming you are a salaried indian). The fact that the budget of the event has come to about 10 times the original estimates is an alarm bell nobody is ready to listen to. At this moment, everybody is in a mood, "ok, so what if some corruption happened, some planning glitches, they happen everywhere. Lets spend some more of tax payer money, and try to fix it."

I read a statement by Mr Aiyyar, where he was wishing for the games to fail. Perhaps its a cost that other nations need not pay (by appearing in a failed games event), but may be thats what this corrupt govt system needs to wake up, and change a few things for good...

I dont even want to start about the level of preparations for the event, and the mismanagement that is rampant in there... Let me just say this much, I've never felt worse on being part of what its they call "India". Its genuinely a shame to be called from the same country as these corrupt organizers and their bosses are...

Just one example to point to the corruption level, they are renting, mark my word, renting, not buying a chair for the event (i.e. about 6 weeks) for about 8000 INR, which would be used by spectators, whereas you can buy a decent chair for a few hundred rupees... Thats the worth of taxpayer's money in this country... and this report was filed by Vigilence committee a while back, nobody took note of it, until someone filed a RTI request...

Shame organizers.. shame..

in reference to: The Commonwealth Games: “Is It Safe?” - India Real Time - WSJ (view on Google Sidewiki)

Monday, August 2, 2010

Country General Mood using Tweets

Well, it sure is pretty fascinating to do that kind of study and come back with results as commonsensical as we see here...

I quote - (with all credits where its due, none to me...)

A group of researchers from Northeastern and Harvard universities have gathered enough data from Twitter to give us all a snapshot of how U.S. residents feel throughout a typical day or week.

Not only did they analyze the sentiments we collectively expressed in 300 million tweets over three years against a scholarly word list, these researchers also mashed up that data with information from the U.S. Census Bureau, the Google Maps API and more. What they ended up with was a fascinating visualization showing the pulse of our nation, our very moods as they fluctuate over time.

The researchers have put this information into density-preserving cartograms, maps that take the volume of tweets into account when representing land area. In other words, in areas where there are more tweets, those spots on the map will appear larger than they do in real life.

A apparantly public domain result of the analysis is available here -

Tuesday, July 27, 2010

Oracle Count(1) vs Count(*)

Well, it might have been an everlasting discussion about which one of these to use, count(1) or count(*).

I guess, this article of Thomas Kyte already clarified the situation long long ago (well, for IT industry 2005 is long ago anyway, especially given the speed at which we are moving.)

Essentially, what askTom says that, count(*) is better than count(1) since count(1) translates to count(*) internally anyway. I wonder then, why would someone want to use count(1) anyway.

There is at least one more step involved in getting to the actual result. And there is another possible tweak, count(1) has to evaluate an expression as well, "count(1) where 1 is not null". Though its a tautology equivalent, it has to be evaluated nonetheless.

Further, there was some misconception about how the result is returned, whether its read from the data dictionary, this view or table or something like that. I dont think so. The result is calculated at the exact run time,when the query is run, and it actually goes ahead and counts the records in the table.

Should set the record straight...

in reference to: Ask Tom "COUNT(*) Vs COUNT(1) on tables with CLOB..." (view on Google Sidewiki)

Friday, July 23, 2010

Developing a Rails application using an existing database

This is the latest challenge for me. A database exists with real data in there, and I have to develop a rails application around that.

Initially we needed the basic CRUD screens for some tables.  Being lazy (i m really proud of that), I set out finding if there a solution that generates the forms (read views) for the existing tables/models.

I have already managed to generate models/schema.rb using another gem. This is called magic_model.  Read more about that here

Then google helped me find this another gem called scaffold_form_generator which generates the necessary views/forms for a given model.  However, there need to be some improvements required on that (I think).  perhaps I would contribute something (if I find out enough on how to do that)

Well, for the moment, I am struggling with handling of the missing special meaning column from the legacy tables. Will continue writing on this...

Wednesday, July 21, 2010

Making rails talk to SQL Server Express Edition

I had zero exposure to sqlserver before today. With the help of a dba and google :) I finally achieved the communication.  Here's what I did to achieve this -

Make an odbc connection - pointing to the db server, preferably make a sql server authentication user

Install the following gems
  1. activerecord-odbc-adapter (2.0)
  2. activerecord-sqlserver-adapter (2.3.8)
  3. dbd-odbc (0.2.5)
  4. dbi (0.4.5)
  5. deprecated (2.0.1)

Further, I copied and files from to .../ruby/1.8/i386-msvcrt even though exact directory was not found in the path. So, the files were eventually copied to ...\Ruby187\lib\ruby\1.8\i386-mingw32

My database.yml file looks like this -

  adapter: sqlserver
  mode: ODBC
  username: myUserName
  password: myPassword

Thursday, July 15, 2010

winscp vs cuteftp

I recently had an experience of transferring relatively larger files from a windows box to linux one.

I had some files which were ranging from 2.1 GB to 4.x GB. The company traditionally uses cuteftp to transfer (read ftp) files across servers. So I started with that anyway.

However, all my transfer attempts were failing. After transferring 2 GB of data, cuteftp would end the transfer and give away some or other error message. I figured that this was happening only to files which were larger in size. And this transfer consumed more than hour or so before it failed.

Google couldnt help a lot, so, finally i got down to winscp. And, it worked out so well. Not only the transfers didnt fail, but they finished within minutes, instead of the hours and hours spent by cuteftp.

Perhaps its some setting somewhere in cuteftp that I couldnt find, but the whole experience has left me more inclined towards the open source community.

Thanks a ton guys .. :)

in reference to: Download WinSCP from (view on Google Sidewiki)

Wednesday, July 14, 2010

Trying to become a Data warehousing architect... !!!

If someone wants to become a DW Architect, there is a lot of knowledge required.  Some of the different perspectives (one from MS not specifically for DW, rather enterprise) and another on DW specifically..

Although I think its strange already that someone has to think about the kind of questions being asked in such interview, there are things posted on these lines.  i believe its more of a discussion on thought process and approach rather than question-answer session in such an interview. Still, presenting an excerpt, outlining some of the interesting topics that might turn up in a discussion for this kind of position.

  1. Describe advantages of the CIF architecture versus the bus architecture with conformed dimensions. Which would fit best in our environment given [some parameters they give you] and why
  2. Describe snow-flaking
  3. Describe fact-less fact tables.
  4. Draw a star schema of our business
  5. Describe common optimization techniques applied at the data model level
  6. How do you handle data rejects in a warehouse architecture?
  7. Describe common techniques for loading from the staging area to the warehouse when you only have a small window.
  8. How do you load type 1 dimensions
  9. How do you load type 2 dimensions, and how would you load it given our [insert business particularity]
  10. How would you model unbalanced hierarchies
  11. How would you model cyclic relations
  12. What major elements would you include in an audit model?
  13. How would you implement trace-ability ?

One of the Microsoft guys wrote about possible feathers in the cap of an Enterprise Architect -

Wednesday, June 16, 2010

Should India learn a lesson from the Gulf of Mexico Oil Spill ??

Not undermining the terrible tragedy of the oil leak in the gulf, this is some ways a more environmental disaster than humanitarian.

If you stop for a moment and give a thought to the Bhopal Gas Tragedy of 80's (at a Union Carbide plant in Bhopal, India, read more here, that tragedy had taken lives of more than 3000 people, in addition to contaminating air and water around the place. The genetic effects of that appear to date. And I am not even counting the wounded/disabled due to that accident.

What happened there, from the point of view of compensation to the affected ? Well, nothing is my feeling, but if you count what was paid to the people, I wont be able to say more than, "peanuts", which is nothing anyway.

Here, you see, in the current context of the oil leak (where only 10-20 people have passed away, but lots more have lost jobs), the US govt is handling BP as if it has committed a genocide.

Well, I am sure the Indian govt and legal system can take a cue from this and start holding the business corporation behind Bhopal tragedy responsible for that too. In case of Bhopal, nobody was held accountable, and the CEO of that company was allowed to leave country hours after he was "formally" arrested. I wonder if bribery of govt officials and/or politicians was playing any role there ??

Seriosly, anybody at Indian govt offices listening ??

in reference to: BBC News - US Congress set to grill BP chief Tony Hayward (view on Google Sidewiki)

Sunday, May 30, 2010

An interesting essat on flyovers [in Indian context]

Forwarded by a friend, couldnt help but sharing -

निम्नलिखित लेख उस छात्र की कॉपी से लिया गया है, जिसे निबंध लेखन
प्रतियोगिता में पहला पुरस्कार मिला है। निबध का विषय था - फ्लाईओवर।

फ्लाईओवर का जीवन में बहुत महत्व है, खास तौर पर इंजीनियरों और ठेकेदारों
के जीवन में तो घणा ही महत्व है। एक फ्लाईओवर से न जाने कितनी कोठियां
निकल आती हैं। पश्चिम जगत के इंजीनियर भले ही इसे न समझें कि भारत में यह
कमाल होता है कि पुल से कोठियां निकल आती हैं और फ्लाईओवर से फार्महाउस।

खैर, फ्लाईओवर से हमें जीवन के कई पाठ मिलते हैं, जैसे बंदा कई बार
घुमावदार फ्लाईओवर पर चले, तो पता चलता है कि जहां से शुरुआत की थी, वहीं
पर पहुंच गए हैं। उदाहरण के लिए ऑल इंडिया इंस्टिट्यूट ऑफ मेडिकल साइंसेज
के पास के फ्लाईओवर में बंदा कई बार जहां से शुरू करे, वहीं पहुंच जाता
है। वैसे, यह लाइफ का सत्य है, कई बार बरसों चलते -चलते यह पता चलता है
कि कहीं पहुंचे ही नहीं।

फ्लाईओवर जब नए-नए बनते हैं, तो एकाध महीने ट्रैफिक स्मूद रहता है, फिर
वही हाल हो लेता है। जैसे आश्रम में अब फ्लाईओवर पर जाम लगता है, यानी अब
फ्लाईओवर पर फ्लाईओवर की जरूरत है। फिर उस फ्लाईओवर के फ्लाईओवर के
फ्लाईओवर पर भी फ्लाईओवर चाहिए होगा। हो सकता है कि कुछ समय बाद फ्लाईओवर
अथॉरिटी ऑफ इंडिया ही बन जाए। इसमें कुछ और अफसरों की पोस्टिंग का जुगाड़
हो जाएगा। तब हम कह सकेंगे कि फ्लाईओवरों का अफसरों के जीवन में भी घणा
महत्व है।

दिल्ली में इन दिनों फ्लाईओवरों की धूम है। इधर से फ्लाईओवर, उधर से
फ्लाईओवर। फ्लाईओवर बनने के चक्कर में विकट जाम हो रहे हैं। दिल्ली
गाजियाबाद अप्सरा बॉर्डर के जाम में फंसकर धैर्य और संयम जैसे गुणों का
विकास हो जाता है, ऑटोमैटिक। व्यग्र और उग्र लोगों का एक ट्रीटमेंट यह है
कि उन्हें अप्सरा बॉर्डर के जाम में छोड़ दिया जाए।

फ्लाईओवर बनने से पहले जाम फ्लाईओवर के नीचे लगते हैं, फिर फ्लाईओवर बनने
के बाद जाम ऊपर लगने शुरू हो जाते हैं। इससे हमें भौतिकी के उस नियम का
पता चलता है कि कहीं कुछ नहीं बदलता, फ्लाईओवर का उद्देश्य इतना भर रहता
है कि वह जाम को नीचे से ऊपर की ओर ले आता है, ताकि नीचे वाले जाम के लिए
रास्ता प्रशस्त किया जा सके।

फ्लाईओवरों का भविष्य उज्जवल है। कुछ समय बाद यह सीन होगा कि जैसे डबल
डेकर बस होती है, वैसे डबल डेकर फ्लाईओवर भी होंगे। डबल ही क्यों,
ट्रिपल, फाइव डेकर फ्लाईओवर भी हो सकते हैं। दिल्ली वाले तब अपना एड्रेस
यूं बताएंगे - आश्रम के पांचवें लेवल के फ्लाईओवर के ठीक सामने जो फ्लैट
पड़ता है, वो मेरा है। कभी जाम में फंस जाएं, तो कॉल कर देना, डोरी में
टांग कर चाय लटका दूंगा। संवाद कुछ इस तरह के होंगे - अबे कहां रहता है
आजकल रोज अपने फ्लैट से पांचवें लेवल का जाम देखता हूं, तेरी कार नहीं
दिखती। सामने वाला बताएगा - आजकल मैं चौथे लेवल के फ्लाईओवर में फंसता
हूं। अबे पांचवें लेवल के जाम में फंसा कर, वहां हवा अच्छी लगती है। अबे,
ले मैं तेरे ऊपर ही था, पांचवें वाले लेवल पर और तू चौथे लेवल पर, कॉल कर
देता, तो झांककर बात कर लेता। आने वाले टाइम में दिल्ली वाले अपने
मेहमानों को फाइव डेकर जाम दिखाने लाएंगे।

Thursday, May 13, 2010

Parallel Querying using Oracle

Perhaps a long awaited feature, this one is clearly the one that I like most.

Using pre-built packages its now possible to break a single (relatively heavy) operation into multiple small operations, which run in parallel. The benefits are obvious, and cant be ignored.

I am yet to ascertain the usability of such a feature with tools like informatica or pentaho, but I am quite sure a lot can be achieved, especially in the direction of updates to huge tables in data warehouses.

And looking at the implementation, its genuinely simple and straightforward.

Would be nice to see more applications utilizing the benefits of such features..

Read more on Oracle magazine, article written by Steven Feuerstein...

in reference to: PL/SQL Practices: On Working in Parallel (view on Google Sidewiki)

Friday, May 7, 2010

101 Romantic ideas

1. Remember to say "I love you" and "I need you" often.

2. Walk hand in hand in the rain.

3. Write a love poem.

4. Call a radio station and dedicate a favorite song.

5. Write "I Love You" in lipstick or shaving cream on the mirror.

6. Hide love notes in a lunch box, briefcase or purse.

7. Make heart-shaped cinnamon toast for breakfast.

8. Place a love note in the personals section of the newspaper.

9. Take a carriage ride around the city.

10. Plan a surprise getaway.

11. Do your mate's household chores.

12. Write notes on future dates in their date book ("I love you," I miss you," etc.)

13. Make reservations at a favorite restaurant.

14. Let them choose the movie.

15. Give a foot massage.

16. Make a heart-shaped bookmark, and place it in their book.

17. Pop in a romantic music CD and slow dance.

18. Throw a just-because surprise party for two.

19. Buy a stuffed animal for your honey.

20. Read each other's horoscopes.

21. Make a list of the top 10 things you love about your partner.

22. Display it in a prominent place.

23. Tattoo your mate's name on your body.

24. Make an album or scrapbook of your favorite memories together.

25. Go camping together and only take one sleeping bag.

26. Send a mushy message in a bottle...a balloon...a sandwich...

27. Cut out a silly cartoon that you know they'd enjoy.

28. Shower together.

29. Dim the lights, and snuggle together on the couch.

30. Be the first to say "I'm sorry" and kiss and make up.

31. Give each other a full-body massage.

32. Kiss every hour on the hour all day long.

33. Send a gift basket of indulgent items.

34. Write "I'm hot for you" in the steam on the bathroom mirror.

35. Ribbon wrap your bed with a big bow.

36. Fill up the gas tank of your partner's car.

37. Act like teenagers. Maybe even pierce something!

38. Show up with a bouquet of flowers -- for no reason at all.

39. Play Scrabble���� together, using as many "love" words as
you can.

40. Run a warm bubble bath for your partner, with lots of lit

41. Meet in the park for a picnic.

42. Hold hands.

43. Leave a trail of rose petals through the house, leading to a romantic candlelight dinner.

44. Make a donation in your mate's name to a special cause or charity.

45. Pick up their clothes from the floor -- without saying a word about it.

46. Watch an old black and white romantic movie and share a bowl of popcorn.

47. Reenact your first date.

48. Surprise your partner with tickets to a special event.

49. An unexpected hug can brighten any day.

50. Buy a silly, impromptu gift.

51. Send an email just to say "I'm thinking of you."

52. Bring home a balloon bouquet.

53. Serve breakfast in bed.

54. Make an ornament with a picture of both of you for the Christmas tree.

55. Play tag.

56. Wash and wax your partner's car, and leave a little note on the dashboard.

57. Plant a garden together.

58. Leave a mushy message on voicemail.

59. Stay at a hotel for the night, just because.

60. Make angels in the snow.

61. Every time you say "hello" or "goodbye", seal it with a hug and a kiss.

62. Take a drive in the country.

63. Spend the evening looking at the stars -- and make a wish together.

64. Cast a playful wink any time, anywhere.

65. Think up a list of silly little pet names for times when you're alone together.

66. Read poetry to each other.

67. Celebrate your half-birthdays together.

68. Put a picture of both of you in your wallet.

69. Buy that favorite book or CD for no reason at all.

70. Send a care package to work filled with treats like food, photos, candy, a love note, heart-shaped confetti, etc.

71. Go out for the evening and tell people you're on your honeymoon.

72. Take a hike together and carve your initials in a tree.

73. Write a thank you note for all the things you take for granted.

74. Make a fire in the fireplace and roast marshmallows.

75. Tape your favorite TV show and spend the evening talking.

76. Do the dishes together, then apply hand lotion to each other's hands.

77. Write a love letter to your partner and cut it into jigsaw puzzle pieces.

78. Decide on secret signals and use them to communicate with each other in large groups of people.

79. Schedule a regular mid-week "date night" for just the two of you.

80. Do the laundry together.

81. Romance Theater Weekend: reenact each other's favorite love scene - hers on Friday, his on Saturday.

82. Call your partner at work and ask for a date.

83. Pretend you haven't seen each other for a month. Actaccordingly.

84. Send a written invitation to do something special.

85. Take turns reading to each other.

86. Stand outside the window and sing a romantic song.

87. Hide favorite candy in your partner's coat pockets.

88. Put a tape recording of your voice (saying anything) in the
car stereo and turn it on so it plays when the car starts.

89. Go to a drive-in movie.

90. Get up to turn off the last light after you're both
comfy-cozy in bed.

91. Hold each other tight during a thunderstorm.

92. Make a tape recording of favorite love songs.

93. Leave a bunch of bananas on the kitchen table with a note, "I
go bananas over you!"

94. Hide love notes in a magazine.

95. Declare your undying love via a telegram.

96. Make a romantic dinner together, and serve it on your finest

97. Surprise your partner with a big kiss on the neck.

98. Give unexpected compliments.

99. Share an ice cream cone.

100. Have a picnic on the living room floor.

101. Draw a silly picture of the two of you. Frame it.

Thursday, May 6, 2010

Working of oil wells..

I personally like such diagrams and explanations. not that an accident is required to fetch such information, but its a fact that such incidents bring about a good reason to explain the technology to us non involved people.

This document explains the handling of stopping of oild wells in cases of temporary abandonment. Its quite interesting to understand it.

Further, this page explains what should have happened against what happened at the deepwater horizon oil well which resulted in death of 11 people and loss of investment on the oil rig, not the forget the huge oil spill in Gulf of Mexico...

Its really unfortunate that such incidents happen, perhaps its a price we humans need to pay to tackle mother nature for resources. More than that, when I was reading a page about this on cnn, i had a feeling of, "Oh God, so much oil would be wasted in the spill, and we are already talking about scarcity of oil resources". From an estimate, more than 5000 barrels of oil is|was spilling from this rig into the sea. I dont know whether the spilling has since stopped or not, but its a huge waste nonetheless.

I hope they can find some way to contain the spill and save the environment from destruction of flora/fauna around the place due to oil spill in the sea. This would also save the precious oil.

I wish I could extract the images and post them here, inline, but there might be copyright issues.. Would lookup on wikimedia later and see if there is some information/photos about it...

Quite informative really...

in reference to: oil-cause-050710.pdf - By Nitro PDF Software (view on Google Sidewiki)

Wednesday, May 5, 2010

Ubuntu 10.04 is here.... Upgrade today...

Its only been a few hours since I have had the pleasure to upgrade to the latest version of Ubuntu.

And without any doubt, or any detailed analysis/investigation I can say this much for sure -

- The upgrade process was super easy. No hassles whatsoever, you just need to have a decent internet connection, few times you need to confirm the suggested decision, and done...

- The new system looks cleaner, much much cleaner. Its neat, to some extent beautiful. Its not about the background or themes or anything like that, but the overall look and feel is genuinely cool. Perhaps its to do with one thing that I have done on my part. My system font is "Lucida Grande" all across. And, for some reason the shapes and looks on this font are far better than anyone else I have encountered.

- The boot time has come down a good notch.

Well, I guess this should be a good starting point for my review on the new version, lets see how it comes across further.

in reference to: my tech playground (view on Google Sidewiki)

Friday, April 30, 2010

Implementing Cartesian Product in Informatica Mapping

As against pentaho, Informatica doesnt provide a ready made transformation for implementing cartesian product in a mapping. Although, most of us would agree that  its not often that we tend to go for cartesian product joins. [the instinct generally is to do enough to avoid a cartesian product, because its a performance killer in general]

However, when your requirements need this, there is no direct way to do it in informatica joiner transformation.  Either you do it in the db side, by overriding your source qualifier sql statement and building it in there.

However, I have seen that some designers dont like to override sql statements, in such cases you'd have to implement it inside the mapping only. Here's a workaround for achieving that. Here goes -

  1. Read both the sources using their own source qualifiers, normally.
  2. For both of them, put in an Expression Transformation after the source
  3. In both the expression transformations, create an output port with a constant value. For Example, call it dummy1 for stream 1 and assign it a value -1.  Similarly, a port would be created in the second pipeline, lets call it dummy2 and assign it a value -1.
  4. Now create a joiner transformation. Link ports [including the one that we created with a constant value] to the joiner from both the expressions.
  5. In the join condition, choose to compare the dummy columns. 
  6. The rest of the joiner configuration would have to be like any other joiner. Nothing specific.
You might want to keep the smaller source as the master in the joiner, since it would save on the caching.

Before implementing the above solution, be sure to go back and check if its actually required for your application to have cartesian product !!!!

Thursday, April 29, 2010

Hard vs Soft Parse in Oracle...

Was reading on asktom, came across this response from Tom, that seemed so direct and clear...

So, shamelessly copying.. :)

[From AskTom]

This is the first step in the processing of any statement in Oracle. Parsing is the act of breaking the submitted statement down into its component parts ? determining what type of statement it is (query, DML, DDL) and performing various checks on it.

The parsing process performs two main functions:

o Syntax Check: is the statement a valid one? Does it make sense given the SQL grammar documented in the SQL Reference Manual. Does it follow all of the rules for SQL.

o Semantic Analysis: Going beyond the syntax ? is the statement valid in light of the objects in the database (do the tables and columns referenced exist). Do you have access to the objects ? are the proper privileges in place? Are there ambiguities in the statement ?

For example if there are two tables T1 and T2 and both have a column X, the
query ?select X from T1, T2 where ?? is ambiguous, we don?t know which table to get X from. And so on.

So, you can think of parsing as basically a two step process, that of a syntax check to
check the validity of the statement and that of a semantic check ? to ensure the
statement can execute properly. The difference between the two types of checks are hard for you to see ? Oracle does not come back and say "it failed the syntax check", rather it returns the statement with a error code and message. So for example, this statement
fails with a syntax error:

SQL> select from where 2;
select from where 2
ERROR at line 1:
ORA-00936: missing expression

While this statement failed with a semantic error ? if the table NOT_A_TABLE existed and we had permission to access it, this statement would have succeeded:

SQL> select * from not_a_table;
select * from not_a_table
ERROR at line 1:
ORA-00942: table or view does not exist

That is the only way to really tell the difference between a semantic and syntactic error ? if the statement COULD have executed given the proper objects and privileges, you had a semantic error, otherwise if the statement could not execute under any circumstances, you
have a syntax error. Regardless ? Oracle will not execute the statement for you!

The next step in the parse operation is to see if the statement we are currently parsing has already in fact been processed by some other session. If it has ? we may be in luck here, we can skip the next two steps in the process, that of optimization and row source generation. If we can skip these next two steps in the process, we have done what is known as a Soft Parse ? a shorter process to getting our query going. If we cannot, if we must do all of the steps, we are performing what is known as a Hard Parse ? we must parse, optimize, generate the plan for the query. This distinction is very important. When developing our applications we want a very high percentage of our queries to be Soft Parsed ? to be able to skip the optimize/generate phases ? as they
are very CPU intensive as well as a point of contention (serialization). If we have to
Hard Parse a large percentage of our queries, our system will function slowly and in some cases ? not at all.

The way this sharing of SQL in Oracle is accomplished is via the shared pool, a piece of memory in the SGA maintained by Oracle. After Oracle parses the query and it passes the syntax and semantic checks ? it will look in the shared pool component of the SGA to see if that same exact query has already been processed by another session.

Since it has performed the semantic check it has already figured out:

o Exactly what tables are involved
o That we have access to the tables (the proper privileges are there)

And so on. Now, it can look at all of the queries in the shared pool that have already been parsed/optimized and generated to see if the work has already been done.

As has been discussed here, the soft parsing of queries makes our application faster, since it doesn't have to do everything all over again (from parsing point of view).  Bind variables come to help in this case.

For example, a query like the following -

select a,b from tbl1 where c = 2333;

would be parsed and stored under a different identifier than

select a,b from tbl1 where c = 58763;

whereas, essentially they are same queries only, the literal value being different for the where condition.
In this case, the second query would go for hard parse, instead of our expectation of a soft parse. So, what could be done to tell oracle to think that these are actually same queries and there is no need to do the hard parse again. Well, you can do that by using a bind variable, in the sense, removing the only differentiating part of query by a runtime replacement.

Look at the following query -

select a,b from tbl1 where c = :bb;

now, this query can be used for both the examples above, at the runtime (after parsing), the variable :bb would be replaced by the respective literal value, and you have your answer.  However, this gains a lot of performance, since, the second run goes for a soft parse, instead of a hard parse, so, every subsequent run, after the first one, is re-using the parsing information collected the first time.

So, simple recommendation, use bind variables wherever you see a query being reused with different literal values, and use run time substitution of the literals.