Wednesday, August 25, 2010

How to: Re-create the Show desktop icon on the Quick Launch toolbar in Windows XP

http://support.microsoft.com/default.aspx?scid=kb;en-us;190355

or

To re-create the Show desktop icon yourself, follow these steps:
  1. Click Start, click Run, type notepad in the Open box, and then click OK.
  2. Carefully copy and then paste the following text into the Notepad window:
    [Shell]
    Command=2
    IconFile=explorer.exe,3
    [Taskbar]
    Command=ToggleDesktop
  3. On the File menu, click Save As, and then save the file to your desktop as "Show desktop.scf". The Show desktop icon is created on your desktop.
  4. Click and then drag the Show desktop icon to your Quick Launch toolbar.

Information for advanced users


The Quick Launch toolbar uses the files in the following folder:

%userprofile%\Application Data\Microsoft\Internet Explorer\Quick Launch

Tuesday, August 10, 2010

how to use regular expression to replace tag info but preserve XML value in UltraEditor

I recently exported the data from Oracle DB thru Oracle SQL Developer for testing, the extracted data is as follow

<>
<>
< name="ROWNUM">999< /COLUMN>
< name="CONTENT_UUID">0< /COLUMN>
....
< /ROW>
<>
< name="ROWNUM">1000< /COLUMN>
< name="CONTENT_UUID">0< /COLUMN>
...
< /ROW>
...
< /RESULTS>

How do I change it to using Ultra Editor
<>
<>
<>999< /ROWNUM>
<>0< /CONTENT_UUID>
...
< /ROW>
<>
<>1000< /ROWNUM>
<>0< /CONTENT_UUID>
...
< /ROW>
...
< /RESULTS>

  1. Go to Tool bar, Search -> Replace
  2. Check the "Regular Expressions", and select "UltraEdit" from Regular Expression Engine below
  3. At the Find What section, enter "< name="ROWNUM">^(*^)< /COLUMN>" , where ^(*^) is the wildcard
  4. At the Replace With section, enter "<>^1< /ROWNUM>", where ^1 is the first value, you can have more than one wildcard value, you can use "^1", "^2"... for replacing any wildcard according to find what sequence

reference:
http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regular_expressions.html#tagreformat

http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/tagged_expressions.html

Monday, April 12, 2010

Thursday, April 1, 2010

Synchronized block vs Synchronized method

Both the synchronized method and block are used to acquires the lock for an object. But the context may vary. Suppose if we want to invoke a critical method which is in a class whose access is not available then synchronized block is used. Otherwise synchronized method can be used.

Synchronized block is used when we use code which we cannot modify ourselves like third party jars
//Synchronized block
class A {
public void method1() {...}
}

class B{
public static void main(String s[]){
A objecta=new A();
A objectb=new A();

synchronized(objecta) {
objecta.method1();
}
objectb.method1();
//not synchronized
}


Synchronized methods are used when we are sure all instance will work on the same set of data through the same function
//synchronized method
class A{
public synchronized void method1() { ...}
}
class B{
public static void main(String s[]){
A objecta=new A();
A objectb =new A();

objecta.method1();
objectb.method2();
}