Tuesday, April 20, 2010

Java object memory structure

Found an interesting article explaining how to calculate how much memory your java object takes on the heap and the structure of an object.

Wednesday, February 24, 2010

Copying files in Java using NIO

Read an article on Java IO and found out that rather than using the normal stream reader classes in Java we can use the Java NIO api which does native I/O operations rather than going throught he java memory model which significatly improves I/O calls performance. Following is an example i got from that article showing how you can do a simply file copy ;

String orig ="file.xml";
String dest = "file.xml.bak";

FileChannel in = new FileInputStream(orig).getChannel();
FileChannel out = new FileOutputStream(dest).getChannel();

in.transferTo(0, in.size(), out);

in.close();
out.close();

Friday, February 5, 2010

Installing the Firefox JRE Plugin on Ubuntu

For sometime i have been trying to make applets work with firefix running on Ubuntu. It always failed saying cannot find plugin. Today when googling around vola i find the answer in the following post
 
 
Now applets are loading perfectly on firefox on Ubuntu.

Wednesday, February 3, 2010

Want to change your normal eclipse project to a java project?

Look no further, it is clearyly explainged here on how to change your current project type to a java project. Given to me by a collegue of mine which i thought was useful enough to blog about. Btw guys look forward to some blogs relating to stored procs with Spring as well as JBOss clustering simplified... Thats the coming attractions for now ;) ...


Cheers

Thursday, January 21, 2010

A safer way to map your enums to the DB

The following post explaing how to map your enums safely to the database. I personally think this is a great idea proposed. Requires few extra lines of coding, but maintains data intergrity.

http://www.vineetmanohar.com/2010/01/11/3-ways-to-serialize-java-enums/

Less HTTP Requests Better Reponse

Have you ever used background-image url in your css? if so you know that each one means another HTTP request. To resolve this issue you can use data uri which encodes the image as base64. Only downside of this is that it is not supported in IE versions lesser than 8. The following URL shows how you can accomplish this.

http://robertnyman.com/2010/01/15/how-to-reduce-the-number-of-http-requests/

Friday, January 1, 2010

Specially For JQuery UI Fans

Going through some articles found a some what useful article describing some of the useful jQuery UI plugins which every developer would come across. I for a fact never knew jQuery supported the marquee tag which is quite obsolete now but yet supported by all current browser. The article can be found here.

Cheers