Welcome to my blog !

Singleton Design pattern

November 18, 2011 ·  2 min read

Singleton design pattern It is one of the design patterns to maintain the single instance of an object in a system. whenever object created using the new Object() code, one new instance created, if we call these, multiple instances are created in heap memory. Over the time the calls to the new objects grow, the size of the object size grows in the heap memory and it will cause performance overhead....

Linux and Unix PS commands Examples

November 15, 2011 ·  4 min read

process status command Unix/Linux Examples PS abbreviated as process status command list information about the active process running in the Linux/Unix machine. this command list out all the active running process of a shell. We will see frequently used ps command examples in below sections. All these commands execute in the Linux/Unix command line ps command without arguments Ps command without arguments list out all the process of a current shell...

How to avoid ConcurrentModificationException for map or List

November 11, 2011 ·  1 min read

ConcurrentModificationException exception is occurred because of while one thread is iterating the collections and other thread trying to modify the object in collections. This will be happened for below map and list of collections. 1. Modifying state of any key or value in map implementations(example,HashMap,HashTable,LinkedHashMap) during iteration of Map objects 2.Adding/remove(Iterator.remove) the object in a collections class while iteration of collection of objects at the same time. you can use ConcurrentHashMap for avoiding this exception but there is no guarantee of all your objects are iterated....

zgrep and zcat ussage

February 18, 2011 ·  1 min read

finding content in uncompressed files (extension, gzip). In a directory, there are many .gz files, how do we search for a particular word in those files. one solution is to unzip the .gz file and use the grep command. Here are the steps gunzip filename.gz grep "searchword" file The other and better solution is using zgrep command in unix zgrep "search word" filename.gz grep command work on text files, zgrep works on compressed logs....

Maven dependency example explained

February 3, 2011 ·  2 min read

One of the features of Maven over ant tool is dependencies management for software projects. When you are using maven in your project, you need to define the dependencies in pom.xml, once the dependencies are defined, these will be downloaded into your local machine from repositories. To configure the dependencies, you have to use the dependency plugin which manipulates the artifacts when you are installing with maven So here is sample code snippet for configuring spring-core to your project...

You'll get a notification every time a post gets published here.