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...




Monday, February 11, 2008

Miscallaneous Study material links

Best site for XML,XSD,DTD ,XSLT material
http://www.w3schools.com/schema/default.asp

Friday, February 8, 2008

Eclipse news

http://www.eclipse.org/webtools/news.php#permalink109

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/

Eclipse plugin architecture:

Layouts in SWT:

JFace tree viewer:

Eclipse views:

Actions:

Properties page:

UI Forms:

Extension Points:

Selection Service:

Building & Testing:

Adding Help:

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

Christian Music Downloads and passages

http://www.godlychristianmusic.com/GodlyChristianMusic_files/Believers_in_Grand_Rapids.htm

http://www.biblegateway.com