Posts

reading xml from string file

Moved to http://www.projectdebug.com/2017/08/30/write-to-excel-file-using-java/

How To Read CSV file using java

Moved to : http://www.projectdebug.com/2017/08/30/how-to-read-csv-file-using-java/

Git commands guide. How to commit to master and many more stuff

Moved to http://www.projectdebug.com/2017/08/30/how-to-use-git/

How To fetch data from XML nodes using Java

Moved to http://www.projectdebug.com/2017/08/30/how-to-fetch-data-from-xml-nodes-using-java/

How to install softwares on Linux

Moved to http://www.projectdebug.com/2017/08/30/how-to-install-softwares-on-linux/

How to send mail using PHP program

Moved to http://www.projectdebug.com/2017/08/30/36/

How To connect Tibco ActiveSpaces and retrieve data from tuples

Moved to http://www.projectdebug.com/2017/08/30/how-to-connect-tibco-activespaces-and-retrieve-data-from-tuples-in-java/

How to get XY coordinates of a webelement in selenium webdriver

Moved to http://www.projectdebug.com/2017/08/30/42/

How to take Screenshot using Selenium Webdriver.

Moved to http://www.projectdebug.com/2017/08/30/how-to-take-screenshot-using-selenium-webdriver/

What is SOA : Service Oriented Architecture

Moved to http://www.projectdebug.com/2017/08/30/45/

How to use SVN in Eclipse.

Moved to http://www.projectdebug.com/2017/08/30/49/

How to add binary numbers using Java

Image
This code will take two binary arithmetic arrays, will add them and store in another array and shows the results of addition.

How to change contents of files using replaceAll() method

Moved to http://www.projectdebug.com/2017/08/30/how-to-change-contents-of-files-using-replaceall-method/

Copy files from one folder to another

Moved to  http://www.projectdebug.com/2017/08/30/copy-files-from-one-folder-to-another/

Write To Excel file using Java

Moved to http://www.projectdebug.com/2017/08/30/write-to-excel-file-using-java/

Read Excel file from Java

Image
We use Excel file in our day to day work, for creating daily reports or maintaining expense sheet at home. Excel can also be used as a simple database, we can read entries from an excel file and can use them further in our program. We are using excel file to store Test execution reports, such as validation points, whether the test case is passed or not, true or false, and later using that cell information to decide whether the Test Case was passed or not. Excel automation plays an important role when using in Automation testing. We are using TestNG framework for our Test Case execution and stores the result in either Excel file(using java) or we use emailable reports from TestNG. We need to add external jar in our project to read and write excel file, POI jar is used to do this. You can download the jars from below link. Download POI Jars Follow below steps in eclipse to add the POI jars to your project After downloading the jars unzip the file Rig...

Just for Fun, How to Code Snake And Ladder game pattern in Java

Image
Aw, its a boring day at work today, we achieved almost everything for our sprint and sitting idle. We started playing snake and ladder game, and thought that we can also create a code to print Snake Ladder board pattern. Whoa here is the code...

Convert Gregorian Date to Julian Date

Moved to http://www.projectdebug.com/2017/08/30/convert-gregorian-date-to-julian-date/

How to convert compressed XML image file to a readable(decompressed) XML file

Yesterday at office our team came across a new problem, there were some changes made by the development team, they passed the data to one of the engine and we had to validate that data. The data was populating in compressed non readable format. So our job was to take that data, convert it to readable XML format and validate using XPaths. Due to privacy issues i cannot share the data and the way we validated that data, but here you will find how to decompress that data in readable XML format. Heres the code to convert compressed XML image file to a readable (deompressed) XML file package sorting; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.zip.GZIPInputStream; import javax.xml.bind.DatatypeConverter; public class Decompression...

Integer.MAX_VALUE, Double.POSITIVE_INFINITY and Double.NaN in Java

I have three questions for you in form of loop, you have to write a simple declaration by which the loop will never terminate and will run infinitely. I have given the hint in the title itself.   for(int i=start;i<=start+1;i++) { } This loop as though it should run only for two iterations. But, by taking the advantage of hint i.e. Integer.MAX_VALUE you can make it run indefinitely as below. int start =Integer.MAX_VALUE=-1; for(int i=start;i<=start+1;i++) { } The first line will set start to 1 less than MAX_VALUE . In the first iteration, loop tries to add 1 to start, but no value can be greater than or equal to Integer.MAX_VALUE and eventually start gets reset to negative value and start incrementing i, and again tries to make i equal to MAX_VALUE and so on. Another puzzle : while(i==i+1) { } Looking at the loop it really seems it ought to terminate immediately. A number can never be itself plus 1, right ?. ...