Advertise with Us

Find Duplicate Records MySQL Query

Friday, August 22, 2014

Hi All

I know that this is not related Liferay but i came across this useful thing during my development where you can find duplicate record from table and can delete if you need.

SELECT tablename.name FROM tablename
INNER JOIN (SELECT name FROM tablename
GROUP BY name HAVING count(name) > 1) dup_record ON tablename.name = dup_record.name


Read Files From Folder

Wednesday, August 20, 2014

Hi All,

You can use below code to read files from specific folders :

import java.io.File;
public class Test {
    /**
     * @param args
     */  
public static void listFilesForFolder(File folder) {
       
        for (File fileEntry : folder.listFiles()) {
            if (fileEntry.isDirectory()) {
                listFilesForFolder(fileEntry);
            } else {
               
                System.out.println(fileEntry.getName());
            }
        }
        System.out.println("Total :" +folder.listFiles().length);
    }

Malicious code vulnerability - Java Programming

Thursday, August 7, 2014

Malicious code vulnerability - Field is a mutable array
Malicious code vulnerability - Field is a mutable Hashtable
Malicious code vulnerability - Field isn't final and can't be protected from malicious code
Malicious code vulnerability - Field isn't final but should be
Malicious code vulnerability - Field should be both final and package protected

Performance - Java Programming

Performance - Could be refactored into a named static inner class
Performance - Could be refactored into a static inner class
Performance - Explicit garbage collection; extremely dubious except in benchmarking code
Performance - Huge string constants is duplicated across multiple class files
Performance - Inefficient use of keySet iterator instead of entrySet iterator
Performance - Maps and sets of URLs can be performance hogs
Performance - Method allocates a boxed primitive just to call toString
Performance - Method allocates an object, only to get the class object
 

Members

My Followers