Java

Java – Hashtable vs HashMap

In this short article we shall discuss about similarities and difference between Hashtable and HashMap of Java Collection Framework (JCF). Similarities Both Hashtable and HashMap are collection which implements Map interface. Both of them maps keys to values.Both of them are having put, get, remove and containsKey methods which provide constant-time performance.Insertion order of the… Continue reading Java – Hashtable vs HashMap

Java

Java – StringBuffer vs StringBuilder

In this article we'll first look at some important characteristics of String. Subsequently we'll have a look at how StringBuffer and StringBuilder helps on String operations and also we'll discuss about similarities and differences between them. String - Important characteristics String is immutable. So it is suitable to be used in multi-threaded environment.String is a… Continue reading Java – StringBuffer vs StringBuilder

ATG Platform

ATG SingletonSchedulableService

ATG Scheduler service provides a framework to execute tasks periodically. Please refer post on ATG Scheduler for details. SingletonSchedulableService is an abstract subclass of SchedulableService, which allows a cluster of ATG servers to run the same scheduled service guaranteeing only one instance of the service will perform the scheduled task at any given time. SingletonSchedulableService… Continue reading ATG SingletonSchedulableService

Gradle

Gradle – maintain version number in properties file

Build version number and dependency jar versions are generally specified in the Gradle build file - build.gradle What if you want to maintain the versions in a separate properties file, so that the build file need not to be modified for any version number change? You can make use of gradle.properties file to handle this… Continue reading Gradle – maintain version number in properties file

Maven

Create Jar with dependencies in Maven

Apache Maven Assembly plugin can be used for creating Jar with dependencies using Maven. Assembly plugin's prefabricated descriptor jar-with-dependencies serves this purpose. Below is the required configuration in pom.xml <project> [...] <artifactId>example</artifactId> [...] <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>com.example.MyMainClass </mainClass> </manifest> </archive> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution>… Continue reading Create Jar with dependencies in Maven

How to Guides

Windows – Copy file to remote system with different user

If you need to connect to a remote system in network which needs user name and password to login, different from current windows login, then windows does not allow you to copy file from your local drive to that network drive. Strangely windows does not display an informative error message, but while you are trying… Continue reading Windows – Copy file to remote system with different user