MySQL database provides a wonderful feature of Autoincrement Column
index. Your database table can define its primary key as Autoincrement number and MySQL will take care of its unique value while inserting new rows.
Each time you add a new row, MySQL increments the value automatically and persist it to table. But sometime you may want ...
JavaServer Tag library is one of the most used JSP tag library out there. I have used it almost in all of my JEE based projects. The best feature probably is the Iterator API in JSTL tag library.
Here is a small code snippet which you might not know. Its very easy to iterate Lists using JSTL. For example:
List<String> cityList = new ArrayList<String>();
While writing code in jQuery, I often use .text() method to get the content of any element from DOM. This function is straight forward, it strips off all the html element from a selected element and returns the remaining text.
So for below element the .text() method will return "A quick brown fox".
A quick brown fox
While working with Doubles and Long numbers in Java you will see that most of the value are displayed in Exponential form.
For example : In following we are multiplying 2.35 with 10000 and the result is printed.
Double a = 2.85d / 10000;
System.out.println("1) " + a.doubleValue());
a = 2.85d * 100000000;
System.out.println("2) " + a.doubleValue());
Thus you can see the result is ...
Update: The plugin is now on GitHub: https://github.com/viralpatel/jquery.shorten
Facebook user updates has a great functionality. If the comment text is larger than few characters, the extra words are hide and a show more link is presented to user. This way you can keep long text out of the view to user and stop the ...
As a Java developer, lot of times I have to play around with file system. Sometimes I have to copy files/directories from one location to another; sometimes have to process certain files depending on certain pattern. In one of my test program, I wanted to calculate available disk space using Java. Lot of code snippets are ...
Here is a small but very useful tip that every Java programmer should be aware of. Have you ever tried sorting arrays in Java? Well, java.util.Arrays class has built in method to make your job easy. You can use following method to sort any array in Java.
Arrays.sort (int )
Arrays.sort (float )
Arrays.sort (long )
Let us check an example were we will sort an array of ...
Most of the times, production data is not available in development environments. Here, I would like to share a single sql command which can generate random data. But before that, let's address another issue faced by a lot of new oracle users. We need to generate a sequence of numbers using a sql statement. This will generate a number sequence. ...
Deleting duplicate rows from tables is one of the common task oracle developers come across. The data might get duplicated because of missing primary/unique key on the table or batch file getting loaded multiple times. Here I have tried to summarize different ways of deleting this duplicated data. Please note that this is not an extensive list ...