Tuesday, November 28, 2006

Character Of a Happy Life


Character of a Happy Life
HOW happy is he born and taught
That serveth not another's will;
Whose armour is his honest thought
And simple truth his utmost skill;


Whose passions not his masters are;
Whose soul is still prepared for death,
Not tied unto the world with care
Of public fame, or private breath;

Who envies none that chance doth raise,
Or vice; who never understood
How deepest wounds are given by praise,
Nor rules of state, but rules of good;

Who hath his life from rumours freed,
Whose conscience is his strong retreat;
Whose state can neither flatterers feed,
Nor ruin make accusers great;

Who God doth late and early pray
More of His grace than gifts to lend;
And entertains the harmless day
With a well-chosen book or friend;

This man is freed from servile bands
Of hope to rise, or fear to fall;
Lord of himself, though not of lands;
And having nothing, yet hath all.

Sir Henry Wotton

A Simple Midiplayer

Google Search






// A Simple Midi Player

import java.io.*;
import javax.sound.midi.*;

public class PlayMidi {
public static void main (String[] args) {
PlayMidi mini = new PlayMidi();
mini.play();
}

public void play() {
try
{
Sequencer player = MidiSystem.getSequencer(true);
// provide midi filename or path between double quotes
File midifile= new File("filename.mid");
Sequence seq=MidiSystem.getSequence( midifile));
player.setSequence(seq);
player.open();
player.start();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}