Monday, May 16, 2011

Java IO - File Size

package file_space;
import java.io.*;
public class file_size {


public long file_size_bytes(long file_size)
{
return (long) (file_size);
}

public long file_size_KB(long file_size)
{
return (file_size/1024);
}

public long file_size_MB(long file_size)
{
return (file_size/1024/1024);
}

public long file_size_GB(long file_size)
{
return (file_size/1024/1024/1024);
}

public static void sop(Object str)
{
System.out.println("File Size on Drive is "+str);
}
public static void main(String args[])
{
File file=new File("files/file_txt.txt");
//System.out.println(file.exists());
//System.out.println(file.getAbsolutePath());

//Long bytes=file.length();
Long bytes=file.getFreeSpace();
file_size fs=new file_size();

sop(fs.file_size_bytes(bytes)+" Bytes");
sop(fs.file_size_KB(bytes)+" KB");
sop(fs.file_size_MB(bytes)+" MB");
sop(fs.file_size_GB(bytes)+" GB");

}



}

Saturday, May 14, 2011

What is a test case?

Test Case


The very word "testcase" to a lay person could be expanded as "Testing" a "Case".
A Case is an occurrence of sequence of steps leading to an observation(output).

Testing is synonymous with verification and validation of the outcome of the sequence of steps.

Putting together these two definitions, we can further simplify and elaborate test case as
"A sequence of steps that performed leads to an observation that needs to be verified for its validity".



Test Case is a term coined by the field of Software Engineering. Its purpose is to drill down to a simpler units of tests. You could check for the definition defined by wikipedia over here


Example :

When you to a pharmacy to buy a drug(medicine), you verify the M.R.P(Maximum Retail Price) and the Expiry Date of the drug(medicine) purchased.

Test Cases for a Drug purchased would then look like :
1) Verify that the Selling Price of the Drug by the pharmacy <= M.R.P of the drug being sold
2) Verify that the Date of Expiry is lesser than today's date.

Saturday, April 23, 2011

As we gather in this place today - Don Moen

As we gather in this place today
Holyspirit come and have your way
Have your way
As we lay aside our own desires
Sweep across our hearts with Holy fire
Have your way


chorus:
This is your house your home
We welcome you Lord we welcome you
This is your house your home
We welcome you today

As we offer up our hearts and lives
Let them be a living sacrifice
Have your way
Be glorified in everything you do
Be glorified in everything we say
Have your way

This is your house your home
We welcome you Lord we welcome you
This is you House your home
We welcom you today
As we pray Oh Lord draw near
It's your voice we long to hear

Lord have mercy - Easter - You were sent to heal the contrite

You were sent to heal the contrite,
Lord have mercy(2)

Lo-ord have on us Lord have mercy

You came to call the sinners too, Christ have mercy (2)

Chri-i-ist have mercy
Christ have mercy

You plead for us at the right hand, the right hand of god

Lord have mercy
Lord have mercy

Lord god have mercy
Lord have mercy on us
Lord have mercy

Lord Have mercy on us - Easter Songs

You were sent to heal the contrite:
Lord, have mercy.
Lord, have mercy on us.

You came to call sinners:
Christ, have mercy.
Christ, have mercy on us.

You plead for us at the right hand of the Father:
Lord, have mercy. Lord, have mercy.
Lord, have mercy on us.

Courtesy : http://www.spiritandsong.com/compositions/16552