java replaceAll error

March 12, 2008 · Posted in java · Comment 

public String replaceAll(String regex, String replacement)

This method works fine if replacement string does not contain ‘$’ or ‘/’ characters.If replacement string contains these characters, the results can be in-accurate.

Fix: Use Matcher.quoteReplacement(replacement)

public String replaceAll(String regex,
        Matcher.quoteReplacement(replacement))

Edit Windows Vista Hosts File

March 9, 2008 · Posted in Windoze · Comment 

1. Open Notepad with Administrative privileges by clicking Start, All Programs, Accessories, and then right-click Notepad and select to open as Administrator.

2. Browse to (C:\Windows\System32\drivers\etc) in Notepad and open the hosts file.

Now you can edit and save the hosts file.