Sunday, April 3, 2011

File - java.io.File

The following program displays the Free Space in various sizes of measurement Byte,KB,MB and GB for a particular drive.

package file_pkg;
import java.io.*;

public class file_cnt_words {

    public static void main(String args[]) throws IOException
    {
       
       
        File file;
        file=new File("D:/2011/Java Examples/files/file_txt.txt");
        //D:/2011/Java Examples - getPath(); - get the path shows "PACKAGE FOLDER"
       
        //file=new File("files/file_txt.txt");
        sop(file.getAbsolutePath()); // Complete path
        // Find Space on HDD
        sop("Free Space in Drive is : "+file.getFreeSpace()+"Bytes");
        sop("Free Space in Drive is : "+file.getFreeSpace()/1024+" KB");
        sop("Free Space in Drive is : "+file.getFreeSpace()/1024/1024+" MB");
        sop("Free Space in Drive is : "+file.getFreeSpace()/1024/1024/1024+" GB");
            
       
       
    }
    static public void sop(Object input)
    {
        System.out.println(input);
       
    }
}

Thursday, March 31, 2011

Gospel : Be Not Afraid

You shall cross the barren desert, but you shall not die of thirst.
You shall wander far in safety though you do not know the way.
You shall speak your words in foreign lands and all will understand.
You shall see the face of God and live.

Chorus
Be not afraid.
I go before you always.
Come follow me, and
I will give you rest.


If you pass through raging waters in the sea, you shall not drown.
If you walk amid the burning flames, you shall not be harmed.
If you stand before the pow'r of hell and death is at your side, know that
I am with you through it all.


Blessed are your poor, for the kingdom shall be theirs.
Blest are you that weep and mourn, for one day you shall laugh.
And if wicked men insult and hate you all because of me, blessed, blessed are you!

Saturday, March 19, 2011

Lent Song: O Cross Erected Above The World

O Cross Erected Above The World
Cross of our Saviour King! (2)

Fount from which gushed the waters
Straight from the wound in his side
Filling our lives with his gift of grace
Cross of our Saviour King

O Cross sublime and refulgent tree,
Cross of our Saviour King! (2)

Jesus through thee has saved us,
Great was the price that he paid
Thou art the folly of love divine
Cross of our Saviour King!

O Cross, thou channel of grace divine,
Cross of our Saviour King! (2)

Tree on which death was conquered
Thou the first altar of love
Jesus, the Lamb gave his life to thee,
Cross of our Saviour King!

O Cross Erected Above The World
Cross of our Saviour King! (2)

Tuesday, March 8, 2011

Sunday, March 6, 2011

Problem Solving : Compund Interest

Write a Java Program to calculate Compound Interest for the following cases.
  1. A customer invests Rs 1000 in a bank that offers a ROI(Rate of Interest) of 8% per annum.
  2. Calculate the Amount at the end of the 1st year
  3. Calculate the Amount at the end of the 3rd month.
  4. Calculate the amount at the end of 20 days.
  5. Calculate the number of months/days/yrs when the amount would double, triple and four times.
  6. Calculate the amount,years/days/months the Customer would have to invest to earn Rs 10,000.
  7. Calculate the Principle Min-Max Rate of Interest(ROI) at which the customer would be able to earn 10,000 for each year over a period of 5 years.
  8. Investor invests(tops up) 100Rs every month, calculate the amount at the end of year,2 months and 50 days Rate of Interest 8%.

Tuesday, February 22, 2011

top Glory to God songs

My Picks for Glory to God Songs from Youtube
We Sing a version of this song in our church


Others:

 

Monday, February 21, 2011

top Hosanna, Holy Songs

My Picks from youtube for Hosanna Songs sung in Church.

My Fav  among the ones we sing at church






Friday, February 18, 2011

Tuesday, February 15, 2011

Quote of the day

Quote of the day :

For rebellion is as the sin of witchcraft, and stubbornness is as iniquity and idolatry.
Bible : 1 Samuel

Friday, February 11, 2011

Humorous Quotes for the day

Quotes for today :
  • "Better to remain silent and be thought a fool than to speak out and remove all doubt."
- Abraham Lincoln 

  • "Early to rise, Early to bed, Makes a man healthy but socially dead."
    - The Warner Brothers (Animaniacs)

  • Courtesy

Monday, February 7, 2011

Iterator,Set and Encryption Example

import java.security.Provider;
import java.security.Security;
import java.security.MessageDigest;
import java.util.Iterator;
import java.util.Set;


public class cipher1 {
    public static void main(String args[]) throws Exception
    {
        // Get the Provider List
        Provider p[]=Security.getProviders();
        // First record of Providers
        // Get the Keyset
        Set v_set=p[0].keySet();
       
        // Get the Iterator to operate upon
        Iterator itr=v_set.iterator();
       
        // Key and Value String Variables
        String v_key;
        String v_value;
        while(itr.hasNext())
        {
            v_key=(String)itr.next();
            v_value=p[0].getProperty(v_key);
            System.out.println("Key is "+v_key);
            System.out.println("Property Value is "+v_value);       
        }
        // Use the key value as input
        // Example :
        // Key of type Key is MessageDigest.SHA-512
        // Name would be DSA (contents after the dot(.)
        System.out.println("SHA-1 Encrypted Code "+encrypt("Ajith","SHA-1"));
        System.out.println("MD5 Encrypted Code "+encrypt("Ajith","MD5"));
        System.out.println("MD5 Encrypted Code "+encrypt("Ajith","MD5"));
        System.out.println("MD2 Encrypted Code "+encrypt("Ajith","MD2"));
        System.out.println("SHA-256 Encrypted Code "+encrypt("Ajith","SHA-256"));
        System.out.println("SHA-512 Encrypted Code "+encrypt("Ajith","SHA-512"));
       
    }

    // This function takes String to be encrypted and encryption alogrithm name
    // and returns the encrypted byte Array
   
    public static byte[] encrypt(String v_str,String v_alg_name) throws Exception
    {
        java.security.MessageDigest d=null;
        d=java.security.MessageDigest.getInstance(v_alg_name);
        d.reset();
        System.out.println("Bytes are "+v_str.getBytes());
        d.update(v_str.getBytes());
        return d.digest();
    }
}

Humourous Quotes for the Day

My Picks of Quotes for the day :

Don't worry about the world coming to an end today.  It is already tomorrow in Australia.



"Man is the only animal that laughs and weeps; for he is the only animal that is struck with the difference between what things are, and what they ought to be."


"Three things can't be hidden: coughing, poverty, and love."


"No man is truly married until he understands every word his wife is NOT saying."
( Well Said )


"It is not uncommon for slight acquaintances to get married, but a couple really have to know each other to get divorced."
( I like this one specially, so true)

Saturday, February 5, 2011

Humourous Quotes for the Day

Picks for Weekend Quotes

  • My way of joking is to tell the truth. It's the funniest joke in the world.
     

  • Give a man a fish and he has food for a day; teach him how to fish and you can get rid of him for the entire weekend. 


  • Humor is emotional chaos remembered in tranquility.


  • Everything is changing. People are taking the comedians seriously and the politicians as a joke




  • Angels can fly because they take themselves lightly; devils fall because of their gravity.

Thursday, February 3, 2011

Humourous Quotes for the Day

Few B'day Quotes

  • Inside every older person is a younger person – wondering what the hell happened.

  •  When I was born I was so surprised I didn’t talk for a year and a half.

  • Few women admit their age. Few men act theirs.

  • Marriage is the alliance of two people, one of whom never remembers birthdays and the other never forgets them.

  • Birthdays are nature’s way of telling us to eat more cake.

Wednesday, February 2, 2011

Search Voter ID,Name

Useful Link to Search your Voter ID and status.

http://ceo.ap.gov.in/Search_2011/

Humour Quotations Quote of the Day

Quotes of the Day

  • The average woman would rather have beauty than brains; because the average man can see better than think.

  • The road to success is always under construction

  • "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."
      by, Albert Einstein 

Tuesday, February 1, 2011

Humourous Quotes for the Day

 Quote of the Day
  • “Life isn't about finding yourself. Life is about creating yourself.”  George Bernard Shaw 

  •  "Humor is one of the most serious tools we have for dealing with impossible situations."
    - Erica Jong

  • "A little nonsense now and then is cherished by the wisest man."

Sunday, January 30, 2011

Humour Cooking Quotations of the Day

The very thought of not knowing how to cook but relishing every morsel of my meal made me choose a few of my fav  humorous quotes on cooking

  • The two biggest sellers in any bookstore are the cookbooks and the diet books. The cookbooks tell you how to prepare the food, and the diet books tell you how not to eat any of it. --Andy Rooney
  • There is no sincerer love than the love of food. --George Bernard Shaw (1856-1950)
  • Nachman's Rule: When it comes to foreign food, the less authentic the better. --Gerald Nachman

  • We didn't starve, but we didn't eat chicken unless we were sick, or the chicken was. --Bernard Malamud (1914-1986)
  • Only Irish coffee provides in a single glass all four essential food groups: alcohol, caffeine, sugar, and fat. --Alex Levine
Courtesy :
http://www.homemade-dessert-recipes.com/cooking-quotes.html

Friday, January 28, 2011

Text Matching in Open Script

http://oracleats.blogspot.com/2011/01/text-matching-in-open-script.htmlText Matching in Open Script

Text Matching can be performed from TreeView and Code View.

The text matching for a String "India" on a google page would like

web.document("/web:window[@index='0' or @title='Google']/web:document[@index='0']").assertText("MatchText", "India", Source.DisplayContent, TextPresence.PassIfPresent, MatchOption.Exact);
http://oracleats.blogspot.com/2011/01/text-matching-in-open-script.html

Wednesday, January 26, 2011

TIP How to remove mapped network drive

TIP How to remove mapped network drive ?


  • Goto Start > Run
  • Enter "regedit" and click ok
  • Navigate to  
    • \HKEY)CURRENT_USER\Software\Microsoft\windows\CurrentVersion\Explorer
    • Click on the key "Map Network Drive MRU"
  • Select the drive names and press the "Delete" key
Restart your system for the changes to afffect.

To immediately reflect the changes ( not recommended )
  • Launch Task Manager 
    • Right Click beside the Start Button
    • Click Properties to launch a Menu
  • Click "Processes" tab
  • Select "explorer.exe"
  • Click the "End Process" button.
  • Confirm "Yes" in the Task Warning Window that is displayed.
  • Note : the windows title bar wher the start button is located disappears. Do not panic.
  • Follow the Steps below to re-launch the process. 
Now Relaunch "explorer.exe" process
  • Click File>"New Task (Run...)" in the "Windows Task Manager" window
  • Enter "explorer.exe" and Click OK.
  • Note that the windows title bar appears.
  • Open My Computer
  • Notice, the mapped drives have been removed.
HTH
Ajith

TIPS why is my system slow?

Today morning, like many of you I switched on the system.
The same old frustration, the same old problem with my computer
  • Delay in mouse click response
  • Delay in switching between windows
  • All of a sudden you feel "Why does it happen?". Everything worked fine 5 mins back.
  • You try to kill processes. You try all geeky stuff to avoid loosing your working data and session.
All of us know the simple tricks but we forget to apply them as time flies by.

Few TIPS as a reminder are listed below :
Disk Cleanup ( Think about it, You knew it but never took time for it. If you don't read on. )
  • Run Your disk clean up
    • Open My Computer
    • Click on Drive C:
    • Right click the mouse over the drive select "Properties" from the menu.
    • Click "Disk Clean Up" Button on the "General" tab.
    • Wait for the "Disk Clean Up" Progress bar to complete.
    • On Completion a Disk Clean Up Window with the summary of the disk details is displayed
    • "Check" the check boxes for the following options
      • Temporary Internet file
      • Recycle bin
      • Temporary Files
      • Compressed Files
    • Click on OK button. 
    • Confirm the dialog box with the option YES to allow the system to clean up the files.
      • This might take some time depending on the amount of files to be deleted.
      • Your data (e.g., word documents) on your drives aren't lost lost in this process.

Perform the same operations listed above on the remaining drives.
Restart your system, if possible.

Temporary Files and Internet Files are those files that pile up on your system when we :
  • Visit a website ( Images, flash content, cookies are stored on your computer ).
  • Watch a Video, Animation, read a pdf document online or offline.
  • Forget to permanently delete files that pile up in the "Recycle bin"(On your desktop).
Other Checkpoints :
  • Its' a good practice to avoid "Shut Down" in hibernate mode.
    • The snapshot of your Session windows is stored on the disk.
  • Make it a point to "Shut Down" and "Restart" the system, at least once a week.
Taking an hour's break to clean your system helps you avoid frustration for the next week.
Next time you seem frustrated with your computer.
You know what your "Check Point".

Restart your computer after Disk Clean Up.
You will feel the change.

Do add your personal tips and tricks for a better Browsing & Working Experience.
If you have a lot of data stuffed on your disk, You should also look at "Disk Defragmentation".

HTH
Ajith

Tuesday, January 25, 2011

Search Engine Optimization (SEO) cost for web site


Search Engine Optimization (SEO) cost for web siteA very informative article on SEO, one of my very good picks for readers.

Search Engine Optimization (SEO) cost for web site

Putting up your web site online is one thing and getting it to rank high for chosen keywords is another. If you have a web site but it's not getting the desired traffic, you may be thinking of search engine optimization or SEO - how to get it to rank high on search engines for a chosen set of keywords. Most people ask for search engine optimization services from a professional because it is kind of complex and ever changing. However, basic SEO can be implemented quickly and can yield fairly good results. So let us see how much will search engine optimization cost for your web site.

Is your web site already optimized for search engines?

Read the complete article taken from the Source : http://www.webdevelopersnotes.com/articles/search-engine-optimization-cost.php