Few common POSIX Regular Expression

Gallery

Following POSIX Regular Expression will be needed commonly while developing application, ALPHA_REG_EXPRESSION = "[a-zA-Z ]*" ALPHA_UNDERSCORE_REG_EXPRESSION = "[a-zA-Z_ ]*" ALPHA_NUMERIC_REG_EXPRESSION = "[a-zA-Z0-9 ]*" ALPHA_NUMERIC_UNDERSCORE_REG_EXPRESSION = "[a-zA-Z0-9_ ]*" ALPHA_NUMERIC_UNDERSCORE_DASH_REG_EXPRESSION = "[a-zA-Z0-9_[-] ]*" DECIMAL_REG_EXPRESSION = "[0-9]*[.][0-9]*" INTEGER_REG_EXPRESSION = "([1-9][0-9]*)|0" ADDRESS_REG_EXPRESSION = "[,.#_a-zA-Z0-9- … Continue reading

Development discuss on .com

Person A: Do you know??
Person B: about what??
Person A: From where I can contribute and learn .Net, Java, etc compiler….???
Person B: … <difficult question…> …
Person A: answer is so simple… go on http://discuss.develop.com/ and join Rotor group, GenX group, Java-Security group, .Net-CLR group and many other informative information are there.

Best Of lUck!
.

How we can get size of Object in Java?

How we can get size of Object in Java?

Bellow code will give you size of Object in java.

public static byte[] sizeOf(Object obj) throws java.io.IOException
{
ByteArrayOutputStream byteObject = new ByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteObject);
objectOutputStream.writeObject(obj);
objectOutputStream.flush();
objectOutputStream.close();
byteObject.close();

return byteObject.toByteArray();
}

How we can get pid of own application?

How we can get pid of own application?

Below code will give you some important information, which can be helpful for you.

    public static void main(String[] args)
    {
        System.out.println(ManagementFactory.getRuntimeMXBean().getName());
        System.out.println(ManagementFactory.getRuntimeMXBean().getBootClassPath());
        System.out.println(ManagementFactory.getRuntimeMXBean().getClassPath());
        System.out.println(ManagementFactory.getRuntimeMXBean().getLibraryPath());
        System.out.println(ManagementFactory.getRuntimeMXBean().getManagementSpecVersion());
        System.out.println(ManagementFactory.getRuntimeMXBean().getSpecName());
        System.out.println(ManagementFactory.getRuntimeMXBean().getSpecVendor());
    }

But

System.out.println(ManagementFactory.getRuntimeMXBean().getName());

It will give you own application pid.