Wednesday, August 15, 2012

Flashing Screen followed by Windows Hang or Crash


I switched to Windows 7 from XP two years ago and have never experienced one system crashing since then, but until recently I began to be haunted by a Windows 7 system crash, or precisely, a crash caused by the NVidia video card driver.

My Dell T3500 had its original video card replaced with NVidia Quadro NVS 295 not too long ago. Unluckily, I have never got a change to enjoy the performance that would have come with this video card. What I have experienced on the contrary has been continuous system hanging, then crashing, or even (at times) BOSD since the replacement!

Symptom: Initially, the screen suddenly becomes flashing (glowing colorful dots and lines) with blurring resolution for no reason (for 3~60 seconds); then the whole screen goes frozen (for 20 ~ 60 seconds); finally it is blacked out forever, but the CPU and power indicators are still on.

Attempt: 1. I have checked the event viewer each time it crashes but found no clue. And I also attempted to reinstall the video card driver using Windows device manager which still did not help at all;

2. Installed the Windows Debugger (link) and examined the system dump file at C:\Windows\MEMORY.DMP, which said:

Defaulted to export symbols for nvlddmkm.sys -
Probably caused by : nvlddmkm.sys ( nvlddmkm+7b73bc )


So the Windows kernel mode driver nvlddmkm.sys file may be the culprit.

The interim solution I have so far is to disable the nView and dual monitor to use a single screen. I have two DPI ports on the video card, and I guess the overhead when using both of the ports of the video card at the same time may cause the issue...

Same with other users experiecing this issue. No official solution found so far...

a. http://en.kioskea.net/faq/6210-handling-nvlddmkm-sys-crash
b. http://voices.yahoo.com/techtips-nvidia-blue-screen-death-nvlddmkmsys-5316783.html
c. http://en.community.dell.com/support-forums/desktop/f/3515/t/19436822.aspx
Ref.: 1. Handling "nvlddmkm.sys" Crash, http://en.kioskea.net/faq/6210-handling-nvlddmkm-sys-crash;
2. How to solve Windows 7 crashes in minutes, http://www.networkworld.com/supp/2011/041811-windows-7-crashes.html?page=1;

Tuesday, August 14, 2012

Using `awk` to Convert CSV Format Data

The awk utility provides a handy way to extract and transform data.

In many application scenarios, we wish to quickly convert a form of tabular data to another tabular form that 1) is separated using a different character, 2) contains a subset of all the fields, or 3) contains a reordered set of fields. The awk utility can be very helpful in these situations by calling only its print command.

1.       To CSV

For example, the table1.txt contains data in tabular form of:

1    a1   b1
2    a2   b2
3    a3   b3
4    a4   b4

And the command below:

$ awk '{print $3","$1;}' table1.txt

will extract the 3rd and the 1st fields of table1.txt which are separated by tabs (or spaces), and generate the results in the comma separated format:

b1,1
b2,2
b3,3
b4,4

2.       From CSV

Or you can also specify the separator in the file by the `-F` argument. For example, the table2.txt contains comma separated data of:

1,a1,b1
2,a2,b2
3,a3,b3
4,a4,b4

And the command of:

$ awk -F, '{print $NF"\t"$2"\t"$1;}' table2.txt

states that the separator of the fields will be `,`. And it will convert the fields in table2.txt into the tab separated form (NF means the number of last field):
b1 a1 1
b2 a2 2
b3 a3 3
b4 a4 4