strstr (a.k.a find sub string), is a useful function in string operation. You task is to implement this function. For a given source string and a target string, you should output the “first” index(from 0) of target string in source string. Continue reading
It is easy to check if a radio button is checked using JQuery.
<input type="radio" name="gender" value="Male" />
<input type="radio" name="gender" value="Female" />
There are multiple approaches to display double or float data with 2 decimal places in Java. The post presents a way using DecimalFormat. Continue reading
The intent of Proxy Pattern is to provide a placeholder for an object to control access to it, and add a wrapper and delegation to protect the real component from undue complexity. Continue reading
.htaccess is a configuration file for use on web servers running the Apache Web Server. Continue reading
Command pattern encapsulates a request under an object as command, and passed to invoker object. It allows the parameterization of clients with different requests, queue or log requests. Continue reading
Java properties file (with extention .properties) is normally used to store the configurable parameters or strings for Internationalization and localization. In the file, each parameter is stored as a key/value pair of strings. Continue reading
Template Method pattern defines the skeleton of an algorithm, and defer some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure. Continue reading
In Java, String, StringBuffer and StringBuilder classes are widely used. In many scenarios, any of them can be used. However, there are minor differences between these classes. Continue reading
Hibernate Session provides two methods to retrieve object e.g. get() and load() both looked quite similar to each other but there are subtle difference between load and get method.
The major difference between two methods is: Continue reading