Friday, February 29, 2008
Thursday, February 14, 2008
Getting ArrayIndexOutofBounds exception while removing selected indices from a list through a loop????
Consider this scenario..u have a list containing some "n" elements and u want to remove some elements say with indices 3,6,12 ,...
See the following code:
int indices[100] ; // indices array contains list of indices of elements to be removed from list
indices[0]=3;
indices[1]=6;
indices[2]=12;
for(int i=0;i namesList.remove(indices[i]); // namesList is a list that contains // //elements
}
Now if u feel that above code is fyn...u r in a soup ;-) Try executing it ...U will get ArrayIndexOutofBoundsException...
Wonder yyyy??????Its silly actually.
The key is when u remove an element from a list...the remaining elements will push each one a level forward.. say u removed an element with index 5 , now 6 element will become 5.. and 7 th element will become 6 element ..
So while removing items in a loop the logic should be chosen accordingly...
See the following code:
int indices[100] ; // indices array contains list of indices of elements to be removed from list
indices[0]=3;
indices[1]=6;
indices[2]=12;
for(int i=0;i
}
Now if u feel that above code is fyn...u r in a soup ;-) Try executing it ...U will get ArrayIndexOutofBoundsException...
Wonder yyyy??????Its silly actually.
The key is when u remove an element from a list...the remaining elements will push each one a level forward.. say u removed an element with index 5 , now 6 element will become 5.. and 7 th element will become 6 element ..
So while removing items in a loop the logic should be chosen accordingly...
Monday, February 11, 2008
Miscallaneous Study material links
Best site for XML,XSD,DTD ,XSLT material
http://www.w3schools.com/schema/default.asp
http://www.w3schools.com/schema/default.asp
Friday, February 8, 2008
Wednesday, February 6, 2008
Eclipse articles: Really helpful for ppl working in eclipse
Ulimate site for eclipse articles:
http://www.eclipse.org/articles/
Community :
http://eclipse.dzone.com/
http://www.eclipse.org/articles/
Community :
http://eclipse.dzone.com/
Eclipse plugin architecture:
- http://www.acmqueue.org/modules.php?name=Content&pa=showpage&pid=425
- http://www.eclipse.org/articles/Article-UI-Workbench/workbench.html
- http://www.eclipse.org/swt/snippets/
- http://www.eclipse.org/articles/Whitepaper-Platform-3.1/eclipse-platform-whitepaper.pdf
Layouts in SWT:
JFace tree viewer:
Eclipse views:
Actions:
Properties page:
- http://www.eclipse.org/articles/Article-Properties-View/properties-view.html
- http://www.eclipse.org/articles/Article-Tabbed-Properties/tabbed_properties_view.html
UI Forms:
Extension Points:
- http://www.eclipsezone.com/eclipse/forums/t93753.html
- http://www.eclipsezone.com/eclipse/forums/t97608.rhtml
Selection Service:
Building & Testing:
Adding Help:
GEF:
- http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html
- http://www-128.ibm.com/developerworks/opensource/library/os-ecl-gmf/
- http://dev2dev.bea.com/pub/a/2006/08/eclipse-cheat-sheets.html
- http://www-128.ibm.com/developerworks/opensource/library/os-gef/
Java Standard Material
http://java.sun.com/docs/books/tutorial/reallybigindex.html
http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html
http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html
Christian Music Downloads and passages
http://www.godlychristianmusic.com/GodlyChristianMusic_files/Believers_in_Grand_Rapids.htm
http://www.biblegateway.com
http://www.biblegateway.com
Subscribe to:
Posts (Atom)