Posts

Building memory efficient JAVA applications

http://domino.research.ibm.com/comm/research_people.nsf/pages/sevitsky.pubs.html/$FILE/oopsla08%20memory-efficient%20java%20slides.pdf

REST IN PEACE - JAVA 6

According to Oracle, Java SE 6 will no longer be publicly available after this July. 

Making your PC ready to develop android apps

Learning Android is one of  my resolution of this year, don't know how far I going to make it... let's start with the first step of making your PC ready with all the bunch of installations. 1) install JDK 1.6 -- download jdk 1.6 2) install Eclipse indigo 3.7.1 -- download Eclipse 3) In Eclipse go to Help --> Install new software --> Add      Enter the below details          Name     : ADT (you can give what ever)          Location : https://dl-ssl.google.com/android/eclipse/      Click OK and Finish. 4) Restart Eclipse when it asked. While starting eclipse, it will prompt you to download the android SDK or               you can give the location if you already have in your mechine. Now your system is ready to develop android apps.....

Importing a Oracle Dataset with impdp

1)Login to Oracle with admin user(ex: system). 2)Execute the below script. create directory expdp_dir as '<directory where the dataset resides>'; 3)exit the Oracle and run the below command. impdp DIRECTORY=expdp_dir DUMPFILE=<dump file name> FULL=y LOGFILE=impfull.log Note: If you have multiple dump files to import, you can use comma(,) separated file names in DUMPFILE argument.  

Which one is Better Vector or SynchronizedList

Vector and SynchronizedList are synchronized. In case of vector the synchronization is at method level, Example: public synchronized E get(int index) { return (E)elementData[index]; } And in case of SynchronizedList, the statements within the methods are synchronized on the list object. SynchronizedList is static inner class inside collections class which implements list interface and necessary methods using synchronized blocks like below. Link to Source code Example : public E get(int index) { synchronized(colobj) {return list.get(index);} } where colobj is the collection object. When you do Collections.synchronizedList(new ArrayList()); you end up creating 2 instances of List. Whereas, in case of Vector, you are creating only one instance.

Choosing right collection

                The performance of code can be affected significantly by choosing the right collection implementation. Regarding the correct and efficient use of the Java Collection classes, a significant performance setback comes from the low utilization of implementation classes other than ArrayList and HashMap. These two implementations are used for almost everything, although different implementations would be more appropriate in some situations. The following rules should be applied to select the appropriate collection class: ·         Use ArrayList to collect data in order of occurrence (append operation only). Adding or removing elements at the bottom of the list is very fast on ArrayLists and LinkedList, but the LinkedList puts a high load on the garbage collector. This is the most common use case for lists. ·       ...

Internals of JSF

Once jsf project set up properly i.e entries in the web.xml,jsf related jars in lib folder of your web app( setting up jsf project ) we have to create a faces-config.xml to make our set up into a full fledged jsf application. Creating Faces-config.xml :: In the name itself telling us that it contains all the configurations needed for all jsf pages.In fact we don't need to create the file with the same name.We can create it with any name and we have to mention same as a context parameter in the WEB.xml ( setting up jsf project ).Now its the time to jump into the detailed view.   Fallowing are the two main components that we use frequently. 1)Managed Beans It represents a Java bean that will be instantiated dynamically at the run time by JSF container.We can achive inversion of control in JSF. Ex: Class User{ private String name; private String Address; //setters and getters for both properties } Declaration in faces-config.xml ...