Sunday, October 01, 2006

Day 17 - WPM Tray

Tonights application is a Words Per Minute meter in your systray. The algorithm used to determine a word is VERY simple (a space, tab, or return separated by anything else).

It's a green box for 0-99wpm, a gold box for 100-199wpm, and a red box for 200-299wpm. For 300+ it turns all white. No one types THAT fast, do they? The colors were used to avoid handling 3 characters in that tiny icon.

At the last minute, I added a history graph. It records the last 15 mins of typing on a graph. Double click the icon to see it, double click the graph to hide it. The graph IS resizeable even though the resize handles don't show. I didn't have time to play with the cursor, and I implemented a custom padding for resize because .NET's form borders are just plain ugly.

This is easily going to become one of my favorites so far! Source code has a great example of overriding the onPaint method of a custom control to paint a graph. That control was just written by me - NOT ripped from anywhere else ;).


Digg!
  Download the app here
  Download the source here

May the source be with you.

22 Comments:

At 2:01 AM, Anonymous Anonymous said...

awesome! you're great!

 
At 10:03 AM, Anonymous Anonymous said...

Doesn't seem to run for me. Fails to initialize properly... Perhaps I am missing something...

 
At 11:01 AM, Anonymous Anonymous said...

This is useless if your measure of WPM doesn't follow any commonly accepted standards (which it doesn't).

Try this:

http://en.wikipedia.org/wiki/Wpm

 
At 11:55 AM, Blogger JG said...

Checking this out. The example code from these projects is very useful!

 
At 11:59 AM, Blogger sam said...

Hello! I can't believe how cool your projects have been (i've only read the descriptions - i haven't tried any yet, though). I was wondering (probably a dumb question) whether the apps are for linux, mac osx, or windows. I've looked all around the site for the info but I can't find it (which is what makes me think that I should know). Thank you!! :)

 
At 3:40 PM, Anonymous Anonymous said...

After seeing this, I came up with an idea for your next app! How about a click counter! My co-workers always tell me I am extremely click happy and click to much, perhaps it can generate the amount of clicks per minute, per day, per month, per year..etc. Perhaps keep a tally of total clicks and even compete your clicks with other peoples click's around the world to see who clicks most on a daily bases! What do you think?

 
At 3:46 PM, Anonymous Anonymous said...

Even better, how about combining WPM tray, CPM(Clicks per Minute) tray, and MDT (Mouse Distance Traveled) Tray, all in one app! That would be freaking awesome! :-) I Would use it all the time.

 
At 5:25 PM, Anonymous Anonymous said...

It won't launch for me either :(

XP Pro, just installed the latest .NET Framework.

 
At 6:13 PM, Anonymous Anonymous said...

Whoever said they wanted a click counter, check out WhatPulse.org. It counts keystrokes, clicks, and mouse distance travelled. You can then upload these statistics to the site, which will tell you where you rank compared to other people.

 
At 6:26 PM, Blogger Jamie Frost said...

Just got the first crash from an AAD program - illegal operation, I copied the error codes but it didnt let me paste them - next time I guess.

Fun program though!

(it was in the graphic update something or other)

 
At 8:46 PM, Anonymous Anonymous said...

It wont load for me either, says something about .NET framework.

 
At 2:57 AM, Blogger Jamie Frost said...

Anon - you need the dotnet installed for the programs to run. My error was a crash, happened sometime during the screen saver.

 
At 8:36 AM, Blogger JG said...

Yea, I got an error too after it was running for several hours. I didn't get a chance to look at it real close but a very cursory look seemed to indicate some kind of resource leakage.

 
At 8:43 AM, Blogger ClickNathan said...

Yeah - your aps are great, but having to install .NET stuff is a real turnoff...

 
At 11:40 AM, Anonymous Anonymous said...

Ever thought about creating this program as a sidebar gadget for Vista? I really like the idea of it and I think it would go great in the sidebar.

 
At 12:37 PM, Anonymous Anonymous said...

Looks like it doesn't like coming back from screen savers. Mine crashes consistently when I let my screen lock and return.

 
At 4:28 PM, Anonymous Anonymous said...

.NET framework download page :)
http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en

 
At 5:03 PM, Blogger SS said...

very nice blog.

I like some of apps here.

keep up the great job.

Sid
http://4techies.blogspot.com

 
At 10:06 AM, Blogger wordcountertool.com said...

Hey nice blog and nice app. Check another word counter app> http://www.wordcountertool.com/

 
At 12:31 PM, Blogger roncli said...

This comment has been removed by the author.

 
At 12:37 PM, Blogger roncli said...

For those getting errors, it's due to a memory leak.

To fix, add this using statement:

using System.Runtime.InteropServices;

Add this to the list of declared variables:

private static IntPtr hIcon;

Add the following code in the class:

[DllImport("user32.dll", EntryPoint = "DestroyIcon")] static extern bool DestroyIcon(IntPtr hIcon);

And then change this line:

_icon.Icon = Icon.FromHandle(_bmp.GetHicon());

to these three lines:

DestroyIcon(hIcon);
IntPtr hIcon = _bmp.GetHicon();
_icon.Icon = Icon.FromHandle(hIcon);

This fixes the memory leak.

 
At 5:06 PM, Blogger Anubis said...

To the commenter who says this is inaccurate, well duh.

But it's a nice ball park figure.

 

Post a Comment

<< Home