MY mENU


Monday 28 May 2012

Change Icons of your Desktop Objects (MyComputer, Recycle bin..)


Go to HKEY_CLASSES_ROOT\CLSID, and look for the CLSID subkey from the table above for
the object whose icon you want to change. Open the subkey and then the DefaultIcon subkey under that. To change the icon for My Computer, open the subkey HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\DefaultIcon.
Change the Default value to the path of the icon that you want displayed. Follow the same
for changing the icons of ther items as well. Exit the Registry. You might have to reboot for
the new settings to take effect. If you aren't able to change your icons still, then try editing the following: HKEY_CURRENT_USER\Software\Microsoft \Windows\CurrentVersion \
Explorer\ CLSID\, and you will be in.

Formatting Number with fmt:formatNumber Action


JSTL provides you the to format number in different forms. If you remember, with the action you can print any number such as integer or floating-point number. But with you have more controls how number is formatted and printed. The most simple basic usage of the action is as follows:

The action accepts any number in the value attribute. It does more than the action that it formats the number based on the locale which specify by the web browser setting in the client side or set by the web application in the server side. Let's take a look at an example of using :
In the above example, first we define a variable and set its value to 200.51. Then we  use action to override the locale of the browser. We set the locale to en_US so when we use the action  to format the number therefore it displays as 200.51 which is USA format. Next we set the locale to fr_FR and print the number again, now it displays as 200,51 which is France format.
Let's take a look at attributes of the in more details:
NameMeaning
valueNumeric value to be formatted.
typeDetermine the value is formatted as number, currency, or percentage.
patternSpecify a custom formatting pattern for the output.
currencyCodeOnly apply for the currency formatting which accepts ISO 4217currency code.
currencySymbolOnly apply for the currency formatting, accepts currency symbol
groupingUsedUsed to define grouping separator for formated number
maxIntegerDigitsSpecify the maximum number of digits in the integer portion of the formatted number in the output.
minIntegerDigitsSpecify the minimum number of digits in the integer portion of the formatted number in the output.
maxFractionDigitsSpecify the maximum number of digits in the fractional portion of the formatted number in the output
minFractionDigitsSpecify the minimum number of digits in the fractional portion of the formatted number in the output.
varThe variable name of the exported scoped variable
scopescope of the var variable

 Printing the percentage

Let's play with the printing percentage value.
In order to print the percentage format, you assign percent to the type attribute of the action.
Printing different currency locale  To print currency, you assign currency to the type attribute and set the locale before outputting the formatted number.
Printing number with a custom pattern Sometimes, you'll need to print number with a specific custom pattern especially number inscientific notation. In these cases, you can define your own pattern and specify it in thepattern attribute of the action. Let's take a look at an example of printing a big number with a scientific pattern:
If you run the above code you will see the number is formatted as the pattern which is46.5637E9 .
There are a lot more cases you'll need to format number and output it on screen. You can refer to the attribute table above to find what you need and exercise with it to get more familiar with different kind number formatting.