Friday, July 23, 2010
ExtJS - adding a asterisk '*' sign in red color for all required or mandatory field.
Here is the code which adds a * (asterisk) sign in red color to the field label while rendering for all the required fields in your application.
// This code adds the * sign for all the field labels if the fields are mandatory
Ext.apply(Ext.layout.FormLayout.prototype, {
originalRenderItem: Ext.layout.FormLayout.prototype.renderItem,
renderItem: function(c, position, target){
if (c && !c.rendered && c.isFormField && c.fieldLabel && !c.allowBlank) {
c.fieldLabel = c.fieldLabel + " ((c.requiredFieldCls !== undefined) ? 'class="' + c.requiredFieldCls + '"' : 'style="color:red;font-size: 11px;"') +
">*";
}
this.originalRenderItem.apply(this, arguments);
}
});
Monday, March 1, 2010
Differences ....
Iterator Vs ListIterator
Iterator iterates only in forward direction
List iterator can navigate bidirectional
ServletRequest Vs ServletContext RequestDispatcher
ServletRequest RequestDispatcher can take relative path
ServletContext RequestDispatcher cannot take relative path
Clob Vs Blob
Clob stores huge character type data like xml,txt, etc files
Blob stores huge binary type data like jpeg files, etc
Threads :
yeild() - returns to ready state
sleep() - returns to wait state
notify() - invoke wait state thread to ready state
notifyAll() - invoke all wait state thread to ready state
Sleep Vs Wait
sleep holds the thread till the time specified and cant be revoked within that time whereas wait holds the thread till specified time but can be revoked in the within time.
DB Cursor Vs RefCursor
Cursor :
No return type
Static
Can assign to single query
RefCursor :
Has return type
Dynamic
Can assign to multiple queries
List :
Ordered
Contain duplicates
Vector :
Growable array
Synchronized
Multi thread
Default size to 10
Set :
Unordered
No duplicates
Hashtable :
Key-value
Synchronized
No NULLS
Ordered
Use enumerator
Arraylist :
Heterogeneous
Unsynchronized
Allow NULLS
Uses array structure to store
No default size
Map :
Interface
Associate key with Value
Hashmap :
No order
Unsynchronized
Allow NULLS
Use Iterator
Default size is 8
LinkedList :
Faster to insert/delete in between.
Thursday, August 6, 2009
How do you know whether the index is analyzed or not in a table ...?
- To find if an index is analyzed, check the "COLUMN_LENGTH " column of the USER_IND_COLUMNS table. If it is non-zero, the 'analyze' or 'dbms_stats' command has been run at least once on this index.
But why do we need to analyze the indexes or tables ??
Because oracle uses the cost based optimizer to give the best performance in most of the cases. And the cost based optimizer needs data to decide the access plan, and this data is generated by the analyze command or the newer dbms_stats package.
So always analyze or dbms_stats the table and indexes.
If you analyze a table, then its current indexes are automatically analyzed too. If you analyze a index, then the table is not analyzed.
Monday, August 3, 2009
JBoss still uses old .class files even after replacing them with new class files....
I tried every possibility like redeploying the ear, clearing the cache of jboss, etc but it didn't helped out. But if updating the class which is 'implementing' the interface, it would then refer to new .class files.
The possible reasons could be
- Jboss compiler is possibly failing to recognize the changed interfaces as the implemented class is not been updated.
- The Jboss is not cleaning it weekly hashmapped reference of the classes.
But the point what i learned is that defining constants in an interface is a bad practice as you can end up in such trouble. Interfaces are meant to expose the method definitions.
Tuesday, June 9, 2009
Changing the ip address on Oracle server.
If your system's ip address have been changed then you got to test whether your oracle db is properly starting up or not and whether your applications which connect to Oracle are able to connect to oracle.
If you got a problem then you got to change the ip address of Oracle.
For changing the ip address on the oracle server, we need to change the following 2 files.
1. tnsnames.ora
2. listener.ora
You can find both the files in "oracle\product\10.2.0\db_1\NETWORK\ADMIN" path.
Replace the old ip address to new one.
Tuesday, June 2, 2009
URL Encoder.
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
In this site, you got a live encoding converter too which tell whether the char is safe string or need to encode :)
Thursday, May 21, 2009
Getting "registry editing has been disabled by your Administrator" error ?
When you try to Start -> Run -> regedit and if you get this error the just go to the following link and follow the steps :
http://www.online-tech-tips.com/windows-xp/registry-disabled-by-administrator/