Can you notify me when the run is over?

18 06 2012

It is not directly an OR related post. I am writing this, because it may help you some others, who have same problems as me.

While I’m getting a simulation run from Java (it is a simulation for a heuristic in my thesis) I’m surfing on the internet, because it is boring to wait. It is not certain when the run will over. So I looked for a solution and came up with an idea; playing a sound file!

First of all I have found a simple “beep” file, which you can download here. I placed the wav file into my desktop. Then in Java I used the following codes;

AudioClip song;
URL songPath = null;
try {
songPath = new URL(“file:///”+System.getProperty(“user.home”)+”/Desktop/beep.wav”);
} catch (MalformedURLException e1) {
e1.printStackTrace();
}
song = Applet.newAudioClip(songPath);

…. stuff goes here, calculations, etc,etc…

song.play();

Well, you see, it is easy as pie. In most programming language, there is a simple way to play sound file. In this text it is for Java programming language in Windows 7. I think it is suitable for most platforms though. AudioClip and URL are included Java API. So you don’t need any other library for this job.

Hope your calculations be faster!

Advertisements

Actions

Information

2 responses

26 07 2012
Tim Hopper

Ben Deaton sends himself a text message when his simulations are complete: http://jbdeaton.com/2012/send-yourself-an-sms-via-python/

28 07 2012
Sertalp Bilal Cay

I think I need to learn Python to create such fancy things. Thanks for the link Tim, you are my first commenter! :))

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: