Wednesday, November 14, 2007

HEROES ....


Heroes -- is an American science fiction drama television series created by Tim Kring. It is a serial saga about people all over the world discovering that they have superpowers and trying to deal with how this change affects their lives. As you discover the nature of each hero's powers, the heroes, themselves, are discovering what having superpowers means to them as well as the larger picture of where their superpowers come from. The series is about how these heroes are drawn together by their common interest of evading the series' antagonist who wants to harvest their super-DNA for himself. Their ultimate destiny is nothing less than saving the world!

I just read that when the series premiered in the United States, it was the night's most-watched program among adults aged 18-49, attracting 14.3 million viewers overall and receiving the highest rating for any NBC drama premiere in five years. The first season consists of 23 episodes. season 1 began on 25 September 2006 and aired the last episode on 21 May 2007. It is said that Season 2 will comprise of 24 episodes, 8 of which have already been aired. So Keep Watching !!

Friday, November 2, 2007

Gtalk Tips and Tricks

Here are some of the tips and tricks for all the Gtalk Users:
  • 1. How to write a text in BOLD --
    • Simply put in an asterisk (*) in front of the text and at the end of the text --
    • example : *Hello*
    • Same can be expanded to a sentence. Place an asterisk at the start and end of the statement.
    • example : *The statement is bold now*
  • 2. How to write a text in ITALICS -- This is very similar to the Bold part ... just replace the asterisk with underscore (_)
    • example : _Hello_
    • example : _The statement is in tialics now_
    • -- use combination of both to print text in bold and italic both ..
  • 3. Have many accounts and want to login with all of them ... Here's how you can do that --
    • go to Start/Run and type --- "path where gtalk is installed" /nomutex
    • example : "c:\program files\google\google talk\googletalk.exe" /nomutex

Monday, October 29, 2007

Shell Script TIPS ::

--> If you have a file with Header and Trailer records (1st and last records respectively) and want to create a file without the Header and Trailer; can you use the following commands
1. rec_cnt=`cat file_with_hdr_tlr | wc -l`; rec_cnt_head=`expr $rec_cnt - 1`; rec_cnt_tail=`expr $rec_cnt_head - 1`; head -$rec_cnt_head file_with_hdr_tlr | tail -$rec_cnt_tail > file_without_hdr_tlr

2. sed '1d;$d' file_with_hdr_tlr > file_without_hdr_tlr


--> If you have to replace a character which occurs after a specific string pattern and then place the output in a new file
ex:-- 
if you have 
PATTERN_ABC=Y
PATTERN_PQR=N
PATTERN_LMN=N
PATTERN_XYZ=Y

Desired output
PATTERN_ABC=N

PATTERN_PQR=N

PATTERN_LMN=N

PATTERN_XYZ=N

Then use
cat filename  | sed "s/PATTERN_\(.*\)=Y/PATTERN_\1=N/g" > newfilename

-- courtesy my friend Majid


--> To get the decimal points after diving following can be used

1. echo "scale = 2; $var/100" | bc -l 
2. echo a | awk '{b=12345/100;print b}'­   --> [courtesy my colleague Kaushik]


--> If there is a file which is say PIPE delimited and there are fields which are blank i.e. having spaces and you want to replace those spaces with a string; say NULL (helpful when you have to insert the data into a table); use the command: sed "s/| *|/|NULL|/g"
-- courtesy my friend Majid

--> If you are using a file within your script; specify the complete path of the file. This is very important if the script is going to be used in cron.

--> One important command that can be used is 'echo $?' which will return '0' (zero) if the previous command was executed successfully. This can be used in 'if' condition.

--> The 'awk' command comes in very handy within the Shell Scripts.