IdleSun's Weblog

February 8, 2010

Windows 7 blue screen with ndis.sys error

Filed under: Windows7 64bit — idlesun @ 6:21 am

Blue is one of most scary colors when it comes to Windows and it is still true for Windows 7 64bit. Yesterday, I got the blue screen right after uninstalling evaluation copy of Norton Security software from my new VAIO laptop. Windows did boot up only in safe mode without network. Luckily, with help of the messages in the blue screen and a couple of related posts on the Web, I managed to fix it. Here are the steps I did:

  1. Boot Windows in Safe Mode (without network).
  2. Open Device Manager and disable all network adapters.
  3. Reboot Windows in normal mode and see if it boots up this time (If it doesn’t boot up, too bad).
  4. Open Device Manager and enable network adapters one by one starting from most suspicious one. In my case, the blue screen came up again when wireless network adapter is enabled.
  5. Boot Windows with only good network adapter enabled. update or reinstall the driver of problematic network adapter from its vendor’s Web site (In my case, I could use Internet using Ethernet cable).
  6. Reboot Windows. No blue.

This procedure may not work for all ndis.sys related blue screen, but the point I learned is “identify the problematic device driver first and then update or reinstall it“.

February 6, 2010

About Usability Testing

Filed under: Quote,User Experience — idlesun @ 1:35 am
Tags:

“Testing one user is 100 percent better than testing none.”

“Testing one user early in the project is better than testing 50 near the end.”

from “Dont’t Make Me Think” by  Steve Krug

January 27, 2010

CCRC – When it hangs

Filed under: Source Control — idlesun @ 12:04 am

Sometimes, pretty often in my case, CCRC hangs when I do update resource or check-in/check-out multiple files on Windows. Once it hangs there is no progress. And, you can not cancel the task nor close the Eclipse. Only way is to kill Eclipse, which is kind of heavy weight solution. Light-weight solution that I found is killing attrib.exe using Windows Task Manager as shown below

If you kill attrib.exe then the hung task will go on again. Sometimes it fails with some error and in that case the specific file that caused hang may be in out-of-sync state in terms of file attribute. You can change the file attribute using file property window. So there is a risk, but this risk is there for killing whole Eclipse too. Anyway, those who have this hang problem you may want to use this trick… at your own risk.

January 13, 2010

Single, or Double: That’s the question.

Filed under: JavaScript,JSON — idlesun @ 7:01 pm
Tags: ,

In JavaScript, single quote (‘) and double quote (“) are “kind of” interchangeable. So, the following two lines are all fine:

var helloText1 = 'Hello "Alice"'; 
var helloText2 = "Hello 'Alice'"; 

But, they are not the same in terms of actual string content in each variable because quotation marks are different.
This confusing difference can cause code errors when you try to combine strings to build a JSON object using a parser or eval() function. So, in the following code neither of last two lines will return a JSON object.

var name = "'name':'Alice'";
var phone = '"phone":"111-222-3333"';
var contact1 = eval("{" + name + "," + phone + "}");      // error
var contact2 = JSON.parse("{" + name + "," + phone + "}");   // error

Note that json2.js is used for JSON parser. Anyway, it is because different types of quotation marks can not be mixed in a string that represents a JSON object. That means the following code is fine:

var contact = JSON.parse("{'name':'Alice','phone':'111-222-3333'}");
var jsonText = JSON.stringify(contact);

One thing to note is that re-converted jsonText will contain double(“) for string quotation mark instead of single (‘). So, it will be like this if you check the content of jsonText:

{"name":"Alice","phone":"111-222-3333"}

As I mentioned in the beginning, it is confusing and can cause code errors. One way to avoid is to use one type of quotation mark consistently for JSON handling. My recommendation is “single outside and double inside“, which is like this:

var jsonContact = '{"name":"Alice","phone":"111-222-3333"}';

This way, it will be less confusing when you compare original input string with re-converted string from a parsed JSON object.
However, it is also important to understand the differences between quotation marks as wrapper code of string literal and quotation marks just as characters in a string. The confusing came from the thing that a quotation mark as character becomes wrapper code when string is eval()ed or parsed.
To understand better, take a look at the following code that shows how JSON object can be directly defined various ways including mixing quotation marks:

var contact1 = {"name":"Alice","phone":"111-222-3333"};
var contact2 = {'name':'Alice','phone':'111-222-3333'}; 
var contact3 = {'name':"Alice","phone":'111-222-3333'}; 

Note that all three lines are fine and create basically the same JSON object. So, if you converts all three objects to strings back, those strings will be the same with double quotation mark. Again, mixing is not a good coding practice and using double inside seems better and less confusing.

January 12, 2010

Gson – Complex Java Object with enum and list to JSON

Filed under: Java,JSON — idlesun @ 6:08 pm

Google GSON is pretty powerful with serializing a complex java object to json in one shot. This example shows the serialization  of a complex object that has a enum type member and nested list of simple objects:

public class TestMain {
	static enum Gender {Male, Female, NotKnown}

	static class Entry {
		public String name = "";
		public String phone = "";
		public Gender gender = Gender.NotKnown;
		public int birthYear;

		Entry(String name, String phone, Gender gender,int birthYear) {
			this.name = name;
			this.phone = phone;
			this.gender = gender;
			this.birthYear = birthYear;
		}
	}
	static class Contacts {
		public String name = "";
		public List entries = new ArrayList();
		Contacts(String name) {
			this.name = name;
		}
	}

	public static void main(String[] args) {
		// build contacts object
		Contacts contacts = new Contacts("My Contacts");
		contacts.entries.add(new Entry("John Doe", "123-234-3456", Gender.Male, 66));
		contacts.entries.add(new Entry("Jane Doe", "234-345-4567", Gender.Female, 67));

		// convert the contacts object to JSON string
		Gson gson = new Gson();
		System.out.println(gson.toJson(contacts));
	}
}

Here is the output:

{ 
  "name":"My Contacts",
  "entries":[
    {"name":"John Doe","phone":"123-234-3456","gender":"Male","birthYear":66},
    {"name":"Jane Doe","phone":"234-345-4567","gender":"Female","birthYear":67}
  ]
}

Nice, huh? Of course, check Gson User Guide for more details.

January 10, 2010

When IE doesn’t run on Windows 7 64bit

Filed under: Windows7 64bit — idlesun @ 10:26 pm

My new Sony laptop came with Windows7 64bit. Surprisingly, Google Chrome was set as default browser, which is not bad. I installed my favorite browser, Firefox. It didn’t work. Later, I found that Firefox issue on W7-64 is known. But in my case, IE didn’t run either. I could run IE only after I removed the Firefox installation.

October 18, 2009

What’s Very Dangerous

Filed under: Quote — idlesun @ 8:09 pm

“What’s very dangerous is to not evolve, not invent, not improve the customer experience…”

Jeff Bezos, CEO, Amazon

Hear yourself: What’s dangerous.

CCRC – where is the view information?

Filed under: Source Control — idlesun @ 7:43 pm

One of my colleagues at work had gotten hard disk booting failure. Luckily, the HDD was attached to other PC and readable. The issue was that there were CCRC views with checked out files. The files couldn’t be checked in or undone unless the views were properly recovered. However, when all the CCRC and CCRC views  were copied over to newly built PC, the views were not visible in CCRC. CCRC doesn’t recognize the local CCRC views folders even though everything was copied to the exact same location as before.

The key to resolving this issue is to find out where the view information is stored locally on PC. Not in Windows registry. Not in the CCRC program folder. It is in the ‘.ccase_wvreg‘ file in user home folder. Once you find and open it in a text editor, you will get pretty good idea.

For more detail on .ccase_wvreg file, see About the CCRC .ccase_wvreg file.

.ccase_wvreg

CCRC – How to fix “undo checkout” failure

Filed under: Source Control — idlesun @ 7:13 pm

As far as my experience is concerned, CCRC (ClearCase Remote Client) is not that stable on Windows (It was much more stable on Linux).
One of the problems I faced was the “undo checkout” failure with the “Unable to find checked out version” error. I guess it happened because of some network issue when I tried undo initially. Again, my guess is that undoing was done on server side but it was not reflected properly on my CCRC client.
This ghost checked-out file is a real problem because you can not update or check in anymore. Luckily, I could find a solution myself.

The solution that I found involves manual editing of “.copyarea.db” file in the directory where that checked-out file is. So do it at your own judgment and risk. Here is the procedure:

  1. Make “.copyarea.db” file writable and open it using a text edit of your choice.
  2. Find the line with the problematic file name and modify the number in the end of the line from ‘1’ to ‘0’.
  3. Save modified “.copyarea.db” file and change back it to ‘read-only’.
  4. Open CCRC and find that the file is not marked as ‘checked-out’ anymore. (It may be marked as ‘hijacked’ already. Then skip next step)
  5. Do “update resource” on the file. And find that file turns into ‘hijacked’ state.
  6. Do “undo hijack”. Once it is done with no problem, the file state is synched and good to go.

April 2, 2009

Risk of Hidden Agenda

Filed under: Quote — idlesun @ 5:10 pm
Tags:

“If a fortress(selfishness among teams) exists within your organization, destroy it. If you don’t, it will destroy the organization.”

– David Aaker –

« Previous PageNext Page »

Create a free website or blog at WordPress.com.