A tryst with a first year :)

(08:51:38 PM) lucky: hi..

(08:51:44 PM) sahil: hi

(08:51:48 PM) sahil: who are you?

(08:52:01 PM) lucky: which year?????

(08:52:08 PM) sahil: who are you?

(08:52:13 PM) sahil: one year …

(08:52:17 PM) sahil: from 1 to 4

(08:52:23 PM) lucky: i am a nittian

(08:52:29 PM) lucky: 1st yr..

(08:52:29 PM) sahil: probability of 0.25 being in each year

(08:52:32 PM) sahil: really?

(08:52:36 PM) lucky: ya

(08:52:51 PM) lucky: which hostel???

(08:52:53 PM) sahil: coz I thot irc address delta.nitt.edu is also available to non nittans

(08:52:56 PM) sahil: why?

(08:53:07 PM) sahil: that information shouldn’t affect our conversation

(08:53:09 PM) lucky: just like that…

(08:53:18 PM) lucky: plzzz tell

(08:53:24 PM) sahil: age, sex, color … are no indication of a person’s true knowledge

(08:53:32 PM) lucky: k

(08:54:09 PM) sahil: what’s your name?

(08:54:24 PM) lucky: rajan

(08:54:35 PM) sahil: ece?

(08:54:41 PM) lucky: ya…

(08:54:50 PM) lucky: how do u know..??

(08:54:58 PM) sahil: I guessed.

(08:55:09 PM) lucky: wat’s ur branch????

(08:55:12 PM) sahil: ice

(08:55:23 PM) lucky: which state????

(08:55:46 PM) sahil: http://delta.nitt.edu/doku/doku.php/delta/core_delta

(08:56:02 PM) sahil: heryana

(08:56:05 PM) sahil: haryana

(08:57:05 PM) lucky: k it was a pleasure talking to u…. bye tc…

(08:57:43 PM) sahil: you too :)

(08:57:47 PM) sahil: ;)

Stereoscopy

Today is a great day!!

For the first time I was able to cross view. And only today I found out the type of stereograms I used to play with were parallel viewing. To find the difference between them go here or here. (Gosh! wikipedia articles for cross view and parallel view don’t exist. I could create one someday!)

Read more

Normal forms

Sitting here in Morgan Stanley, it’s hard to find free time. Things are always on the run.

But one day, I did find free time, and did what I had wanted to do for a very long time - learn about Normal forms in RDBMS.

Here is what I gathered from these websites :

  1. No multivalued attribute

    StudID Course
    12345 3100,3600,3900
    54321 1300,2300,3400
    (Wrong)
  2. No repeating group

    StudID Course1 Course2 Course3
    12345 3100 3600 3900
    54321 1300 2300 3400
    (Wrong)
  3. Presence of atleast one unique identifier (addn of ID field)

    StudID Course
    12345 3100
    12345 3600
    54321 1300
    54321 2300
    (Right)

There needs to be one composite key atleast. (One or more fields that can be used to distinguish every row uniquely). In the above example, if it was possible for the same student to take the same course twice, then we would have to add another uID field to bring the DB to the first normal form.

2nd Normal Form:

The DB is in this if all non-prime attributes are completely dependent on a candidate key. (and not on a part of it).

i.e. no repetition of key detail in one detail

StudID CourseID StudNm ProfID ProfName
123456 310000 April00 6789 David
123456 410000 April00 2345 David
123456 210000 April00 6789 David

Candidate Key = StidID + CourseID

But StudNm (student name) depends only on StudID (and not on StudID + CourseID)
Had prof been just a function of course, even that would have to be removed.
Hence it is not in 2nd NF.
The ProfName-ProfID dependency is removed in the 3rd NF (where no attribute can be dependent on a non-key attribute in that table).
No part key dependencies can exist in 2nd NF.

None of the non-prime attributes of the table are functionally dependent on a part (proper subset) of a candidate key; in other words, all functional dependencies of non-prime attributes on candidate keys are full functional dependencies. For example, in an “Employees’ Skills” table whose attributes are Employee ID, Employee Address, and Skill, the combination of Employee ID and Skill uniquely identifies records within the table. Given that Employee Address depends on only one of those attributes – namely, Employee ID – the table is not in 2NF.

  • Candidate key: A candidate key is a minimal superkey, that is, a superkey for which we can say that no proper subset of it is also a superkey. {Employee Id, Skill} would be a candidate key for the “Employees’ Skills” table.

  • uperkey: A superkey is an attribute or set of attributes that uniquely identifies rows within a table; in other words, two distinct rows are always guaranteed to have distinct superkeys. {Employee ID, Employee Address, Skill} would be a superkey for the “Employees’ Skills” table; {Employee ID, Skill} would also be a superkey.

  • Non-prime attribute: A non-prime attribute is an attribute that does not occur in any candidate key. Employee Address would be a non-prime attribute in the “Employees’ Skills” table.

  • Primary key: Most DBMSs require a table to be defined as having a single unique key, rather than a number of possible unique keys. A primary key is a candidate key which the database designer has designated for this purpose.
    Some thoughts :

  • In and after 2nd NF, all tables have only one candidate key. -> FALSE

  • All candidate keys in a table map to each other one to one. -> TRUE

  • What normalization stage ensures that only one candidate key is remaining?

    • None. Beacause normalization aims at reducing data duplication and inconsistencies. Candidate keys in a table causes no redundency.
  • If a table in 1st NF has no composite candidate keys (candidate keys consisting of more then one attributes), then it is automatically in 2nd NF.

3rd Normal Form:

No non-transitive dependencies:
A non-transitive dependency is one in which an attribute is dependent on a non-key attribute in that table.
For example, in the ProfID example given above, to bring it to 3rd normal form, ProfName and ProfID would have to brought to a separate table. Because ProfName is a non-transitive dependency.

  • In 2nd Normal form, all candidate keys become mutually independent. FALSE
  • In 2nd Normal form, any candidate key is a candidate key (i.e. is a sufficient and necessary dependency) for all other attributes. FALSE - this happens in 3rd NF.
  • In 3rd Normal form, non-prime attributes become dependent on a candidate key. TRUE

A few notes on exposure

Exposure refers to the amount of light falling onto the camera sensor. It is governed by two things :

High Exposure

  1. The sensitivity of the medium the light is falling on (the ISO setting of your camers).
  2. The length of time for which the shutter the open and the apperture size (the brightness setting of your camera.
    So, if you want a bright image, either increase the ISO sensitivity or increase the brightness. Increasing ISO sensitivity reduces image quality by increasing noise. Increasing brightness reduces the image quality by reducing the shutter speed.

For a great special effect reduce the ISO sensitivity and increase the brightness to get the same effect you would get by moving the “levels” center controller in any image editting software to the left. This is because of the increased exposure time.
Reduced ISO

For a natural looking image reduce the brightness and increase the ISO sensitivity.
High ISO

A digital photographer's heaven

The more I use digiKam, the more I appreciate it. I can’t imagine managing my photos without it! (sorry windoze user :P )

The one feature the really struck me was the advanced search features. In digiKam you can create complicated search queries and can store the resulting photos as a group! Neat…
In the many chronologically arranged albums I had, I tagged the pics I liked with the tag “Cool shots”. Then to get all the cool pics at once, all I had to do run a search for all pics tagged “Cool shots” and it would show up all the nice pics all at once. The combinations are endless. For example, you might want to look at only the “nice” pics from the shots of your cousin you took.


One more great thing about digiKam is all its cool plugins. One really utilitarian plugin is the red eye removal plugin. It does work.

A dream come true

I had always wanted to take photos since I was a child. This wish was fulfilled during these holidays.
I had gotten my mother a Sony DSC-W70 last time I had come for holidays after the IITB project. But that had been only for 2 weeks and I had barely gotten a day with the camera.
But this time….. things were different (with an evil smile). I got all the time I wanted with the camera. I played with it to my heart’s content. Here are some of my shots :

A painting on the wall
My little bro Jay
Me, nani, and mummy in a car
Me... in the mirror.
The driveway

My sister, my inspiration

Pooja

A lot happened when my closest sister Pooja came to Delhi to her nani’s house. She had come to collect the fittjee scholarship she had gotten because of coming within the top 50 all over India in one of fittjee’s scholarship test.
It all started while Pooja, Sagar and me were sitting on the bed playing Uno. A thought occured to me of teasing her. So I simply asked her - what would be the probability of one us winning a cards game in which one and only one of the players win? Probability is topic in standard X and she was in standard XI. She immediately replied -1, while my bro kept thinking. I was impressed by her sharpness.
Then I asked them a few more probability questions (my favourite topic ;) ) and she answered most of them! I was awe-struck. She had joint fiitjee coching in IX and had improved by leaps and bounds! No wonder she came within India’s top 50..
Meeting her made me feel ashamed of myself. How I had wasted my self. She had the determination of a winner. While I get very easily distracted (whenever I work that is). I do everything but study on the study table! Think about everything that’s not related to study. Every half-completed work that got left uncompleted for some reason has to be completed then. Every movie that I wished to see has to be seen then. What an ass-hole I am!

I got a new monitor!

My old monitor : LG 775FT

LG 775FT

My new monitor : Samsung 940BW
Samsung 940BW

It’s HUGE. And so now the home theatre system is almost complete (still have to mount the 5.1 speakers on the wall).

Using digiKam for managing photos.

Today I discovered one of the coolest softwares to manage photos from a digicam! The software’s name is digiKam.

The thing I liked the most about the software is the date view and the album view.

I own a Sony W70. It has 2 modes of connecting to the computer (both use the USB connecting cable provided with the camera). One is the “USB Mass Storage mode” and the other is the “PTP/IP Camera” mode. I asked my camera to show itself using the PTP.. mode (through the camera menu interface) and selected the import option in digiKam. Importing photos in digiKam really is easy.

After the photos get imported, in the date view all the photos show up in a cool chronological order. In the album view you can arrange the pics according to your preference. You can have albums, sub-albums, sub-sub-albums… in a folder tree fashion.

digiKam lets you resize, crop, rotate your images and apply simple color filters, adjust levels etc. It also has a cool feature of displaying the “EXIF” data of an image. That is basically information like focal length, digital zoom, exposure, ISO level and other details about the snap itself.

Coming back home

Now I am back home after what seems to be a very long time. (During the last sem hols I was doing a project at IITB and could come home for only 2 weeks. The hols before that I had come for 2 weeks but those had gone by in training at ABB. So this is one time when i am really home.)

One reason I am delibrately writing this blog is Hari’s suggestion of writing blogs regularly.

I got the tickets for bengaluru today for the hpic conference. I also took the gre diagnostic test today – it simply shook my feet. I got 1010 out of 1600 in the test. 310 in verbal and 700 in quantitative. That’s … bad. I havn’t yet written my CV. Could cause me great deal of trouble later.