While working on one of the application, I had to manage users who logged in to the application and manage their details. In order to manage user's avatar, I had to create a form where user can upload a picture and this photo will get stored on server.Imagine as a user you have to manage ...
Hope you all have heard that behind-the-scene progress of the new version of HTML, is cruising through. There are some good news for those preachers of web standards who give importance to the semantically correct web.With the the new version of HTML (HTML 5), still gazing towards the recommendation stage (the specification is not yet complete and ...
The basic part is very easy. To do this, we will use the Runtime’s exec method. The code would be like:Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("ping localhost");The command (I’ve used “ping localhost” ) can be anything that your command prompt recognizes. It will vary on UNIX and Windows environment.Now comes the bit where you would ...
Web 2.0 – It was a huge step forward for the www, where we saw and continue to experience various ways of information sharing which in turn has resulted to a proliferation of content / data, be it user generated or not. This second generation of web has already changed the way a netizen browse the ...
GMail has
released today another cool feature under GMail labs. Now you can automatically translate any of your email written in different language into language of your choice. Not only this, if all the parties invloved in communication are using gmail, then you can have entire conversations in multiple languages with each participant reading the ...
The java IDEs (eclipse, IRAD etc) contribute a scrapbook facility that can be used to try and evaluate Java expressions (such as code snippets). Java scrapbook errors are shown in the editor. Snippets are edited and evaluated in the Scrapbook page editor. In the editor you can select a code snippet, evaluate it, and display the result as a string in console.Creating a Java Scrapbook ...
Reading runtime information about Java is useful sometime when your application is struggling in getting resources. System Memory is one of the main resource that an application developer has to consider while managing the application.Hence sometimes it is beneficial to see what amount of memory is your application using and what is the free memory ...
Ever thought why would one need to fetch random rows from a database table? You may want to display some random information (like articles/pages/links) to your user. I had a requirement wherein I had to fetch 10 random rows from MySQL database and display it on screen. I used following simple query for retrieving random records ...
I think I am late for writing about varargs. The feature of variable argument has been added in Java 5 since its launch. Still I will write something about varargs. varargs has been implemented in many languages such as C, C++ etc. These functionality enables to write methods/functions which takes variable length of arguments. For example the ...
Following are few very useful Java code snippets for Java developers. Few of them are written by me and few are taken from other code reference. Feel free to comment about the code and also add your code snippet.1. Converting Strings to int and int to StringString a = String.valueOf(2); //integer to numeric string int ...