Sunday, December 27, 2015

Monday, May 11, 2015

ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s); retry policy is

15/05/08 01:26:12 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS) ... Bad connection to FS. command aborted. exception: Call to localhost/127.0.0.1:9000 failed on...

Saturday, May 9, 2015

Install Ubuntu Linux on Virtual Box

It is always good to have virtual box with our required OS installed, If u have windows box and want to learn hadoop, its good to have virtual box with ubuntu to learn. Prerequisites : 1. Download...

Tuesday, April 28, 2015

web service client JAXWS by maven

Generate web service client stub class by using the JAXWS maven plugin. "jaxws-maven-plugin" will generate the web service stub classes by using that we can implement client or test the web service. generated stub classes will stored under src folder and by using this service classes we can communicate...

Tuesday, April 14, 2015

Wednesday, April 8, 2015

get byte or memory size of array,list,collections in java

In java lot of time we will come across the scenerio where in which we need to find the how much memory used by given list. The ArrayList holds a pointer to a single Object array, which grows as the number of elements exceed the size of the array. The ArrayList's underlying Object array grows by about...

Monday, March 30, 2015

Generate the bar code image by itext

We can generate a bar code image by using the itext jar. Itext jar : http://sourceforge.net/projects/itext/ Download jar : http://sourceforge.net/projects/itext/files/latest/download sample code import com.itextpdf.text.pdf.BarcodePDF417; import java.awt.Color; import java.awt.image.BufferedImage; import...

Regular expression to extract the src tag details from given image tag or html source text

By using the regular expression we can extract the any data from the given input, here we are trying to get the src attribute value from the given image tag or html text data. Image 'src' attribute extract Regx: <img[^>]*src=[\\\"']([^\\\"^']*) sample code: import java.util.regex.Matcher; import...

Compare images are same by java

We can compare the given images are same or not by comparing the buffer data of the image. 1. Compare the image sizes are same or not. 2. Compare the binary data of two images are same or not. sample code : import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; import java.io.File; import...

Saturday, March 28, 2015

Reverse elements in Array

Reverse all elements in array, traditional way how we use to do is get the array and iterate through the for loop and use swap logic to move to temporary array and get the result. But from > jdk 1.5 introduced reverse() in java.util.Collections which will reverse the order of the elements, all we...