Indian Photographers II: Raghu Rai

Having talked about Lala Deen Dayal I want to move on to a more contemporary photographer: Raghu Rai. He was born in 1942, and is a photographer and photojournalist since 1965. He joined The Statesman in 1966 and was awarded the Padamshree in 1971.

A photograph by him:

Sleep
Sleep

Some more photos featuring him:

Raghu Rai
Raghu Rai

A gallery of his photos is available here.

(Photographs are copyrighted, except for the one labelled ‘Raghu Rai’, which is under CC-NC-ND)

Share

Drawing on Palm

When I purchased my Sony Clie handheld, I was quite happy about the ability to create scribbles/drawings. This method, I found, was much better than writing on paper and scanning because the result had fewer colors and all sorts of transformations – like rotation, conversion to B&W etc – were much easier. Also the results could be saved as GIF because it had fewer colours – with the additional benefit of having a transparent background.

This is a landscape scene that I drew back then:
Picnic

Of course, the Clie is no longer working, and I am currently without a replacement. I do miss my Clie!

Share

When NOT to normalise the database

database
When talking of Database Normalisation, textbooks often talk of BCNF, fifth and higher normal forms. However, in practice (in large software/ERPs) I have rarely noticed normalisation beyond Third Normal form. In fact, there is a certain degree of redundancy that is desirable.

While doing database design, I believe there are two critical aspects that should be kept in mind but I see ignored in a lot of common software.

The first is the time aspect of data. First – an example from finance. Consider a company having multicurrency invoicing. The tables can be designed as:

INVOICE: InvoiceID, ..., Currency, BaseCurrency, TransactionDate, ...
CONVERSIONS: FromCurrency, ToCurrency, EffectiveDate, RateMultiplier

This is a design having no redundancy. On the basis of the three fields in the INVOICE relation, we can always find out the latest row from the CONVERSIONS table having EffectiveDate less than TransactionDate. Hence we can determine the RateMultiplier.

Consider another design:

INVOICE: InvoiceID, …, Currency, BaseCurrency, TransactionDate, RateMultiplier, …
CONVERSIONS: FromCurrency, ToCurrency, EffectiveDate, RateMultiplier

Here, the system determines the value of the RateMultiplier at the time of invoice creation and records it permanently within the INVOICE table itself. To me this would be more mature design. Why? Because a lot of data in the INVOICE table would actually depend on the RateMultiplier: for example the VAT details. If on 1-JAN-2009 we know that the exchange rate is 1.1. However, on 3-JAN-2009 we come to know that the rate was incorrectly recorded. Someone changes the CONVERSIONS table to reflect the new exchange rate, of 1.2. All the details in the INVOICE table for the invoices created between 1-JAN and 3-JAN become inconsistent since the BaseCurrency is now inconsistent with the RateMultiplier.

Now consider an example from HR appraisal systems. A table stores what stage an appraisal process is at for a particular employee. This is then used to decide what access he has.

STAGE_CURRENT: EmpID, Stage

Note that this has no Date, or Year field. An employee is trying to see records for the previous year appraisals, yet is unable to see some of the data, because current appraisal process is still in initial stage.

The next problem is that of storage of “under calculation” fields. For example, consider the training department maintains the scores of each student trained. The test administered is of 100 marks, but has a weightage 40. Proposed design:

SCORES: CandidateID, TestID, Score, Flag

At the time of recording, the Flag is set to N. Thereafter a process runs that multiplies the score by 0.4 and sets the Flag to Y.

In my opinion a better design would be to retain both the scores even though the pre-weightage score is not relevant to the business process, because a process can also terminate in between due to erroneous data being supplied. Hence if the process ends after setting the flag to Y, and before changing the score; or in reverse order: after changing the score and before setting the flag then we end up with inconsistent data. Improved design:

Scores: CandidateID, TestID, Score, WeightedScore

At the time of recording, Score is entered and WeightedScore is set to zero. Thereafter a process runs that multiplies the Score by 0.4 and stores the value in WeightedScore.

The central idea is to retain all information permanently so that even if the process fails, we know what data existed.

Share

Bloggers NOT for Advani

BloggersIts election time in India once again, and Mr. L.K.Advani, of the BJP has asked for support from Bloggers. However, nowhere on his blog he mentions why they should support him.

His own party condemned him for his views on Jinnah, he has competition from the likes of Modi and the party does not have a clear leader.

The campaigning is all negative: finding faults with the Congress government, with NO mention of a vision for the country or what he will do if brought to power.

Last of all, he is foolish enough to say “it should be legislated that a PM should be a member of the Lok Sabha”. Anyone can understand that he said this because Manmohan Singh is not a LS member. Is he so afraid of competing against Manmohan Singh? He knows he cannot win any other way: so outlaw the candidature of current PM!

Share