Friday, March 25, 2011

Perl check for empty string

To check if string is empty (with multiple spaces)

my $product =" ";

if(defined($product) && $product!~( /^\s*$/ )){

print ("This is Not a balnk product");

}else{

print ("This is a balnk product");
}

Friday, March 18, 2011

All about Heart

All about heart

I have been reading this book called Human Body : Cardovascualr system. This book is basically journey inside your heart. Heart is one most crucial organs of the human body it is the #1 killer in united states.

If you heart cannot function or cannot pump blood, you body will shutdown. Human body is made up of 2 trillion cells and they constantly need
oxygenated blood supply to be able to do their job. This book made so many things clear about heart. You will find fascinating facts about
open heart surgery, bypass graft surgery, Valve replacement, Heart Attack, ECG / EKG, MRI, Arrhythmia, blocked arteries, angiography, Pace makers, ICD's, heart lung machine etc.
Do you know our heart produces electricity (in sinoatrial node).. to make your heart beat..!!! Amaaaaazing..!

Here is some key differences between Pacemakes and ICD's

1. ICDs stay inactive until it detects fibrillation of the heart thus it is activated only in urgent need while the pacemaker can consistently and continuously stimulates the heart electrically to beat in a regular rhythm.

2. Pacemakers are predominantly used to treat slow heart rhythms while ICDs are used for patients who are at risk of sudden cardiac death.

3. ICDs are slightly larger in size, and rather more advanced, compared to pacemakers.

4. Pacemakers aim more to make the patients feel better while ICDs – without bi-ventricular pacing capabilities – will not improve patients’ function because it will only act as protection from sudden cardiac arrest.

Friday, March 11, 2011

Show hidden files on windows

To see hidden files:

1.
On the Tools menu in Windows Explorer, click Folder Options.

2.
Click the View tab.

3.
Under Hidden files and folders, click Show hidden files and folders.


Note To access Windows Explorer, click Start, point to All Programs, and then click Windows Explorer.

Friday, March 4, 2011

Unix cut and count

Unix cut and sort on a column and count number of instances.. very handy

cut -d "|" -f3 pbt_pending_trans.out | sort | uniq -c > uniq_tran_count.txt

Thursday, March 3, 2011

Edit Plus sort and remove dups

This is the the most useful function in Edit Plus. I was using unix cut and sort commands to sort and remove duplicates from a file, however this is convenient from the editor.

Copy and paste the list of rows you would like to remove dups from and
from the main menu, select

Tools -> sort -> check remove duplicates