Controlling JPEG Compression
The JPG graphics format supports varying level of compression and quality. Although it isn't readily visible, the Image.Save() method allows you to control this level. Here's a sample C# method that demonstrates how.
By Jonathan Wood •
Created on Friday, May 18, 2012
|
Approximate String Comparisons Using Levenshtein Distance
Here's some code for testing the degree of similarity between two different strings. The Levenshtein distance algorithm returns the number of edit steps needed to make one string the same as the other.
By Jonathan Wood •
Created on Sunday, February 27, 2011
|
C++ High-Resolution Timer
This simple class uses the highest-resolution timer available under Windows. It's perfect for finding bottlenecks in your code or for simply comparing different computer tasks.
By Jonathan Wood •
Created on Wednesday, December 22, 2010
|
A Friendly DateTime Formatter
Many websites have the ability show a date and time formatted as "2 minutes ago", "1 hour ago", or "Yesterday at 2:30P". Here's a class I wrote to format dates and times this way. It even supports dates and times in the future.
By Jonathan Wood •
Created on Friday, March 25, 2011
|
A Random Image Rotator Control
Here's a web user control that will randomly rotate images from a list of image files. Each image file in the list can be flagged as active or inactive and the control will only display images flagged as active. Simply edit the file list to change which images are displayed on your website.
By Jonathan Wood •
Created on Saturday, October 27, 2012
|
A Simple CSS Parser
I recently encountered a question on stackoverflow about parsing CSS. Although I've written a bunch of parsing routines, I'd never thought to parse CSS. I've never had a reason to do so. Still, I had a bit of time and thought it might be interesting to put something together.
By Jonathan Wood •
Created on Thursday, August 22, 2013
|
An Error Message Control
All web applications should check for errors. But what's the best thing to do when one occurs? This handy little class makes reporting errors easy.
By Jonathan Wood •
Created on Monday, January 3, 2011
|
Generating and Parsing Roman Numerals
Here's a handy class that contains methods for converting integers to Roman numerals, and Roman numerals back to integers.
By Jonathan Wood •
Created on Monday, April 11, 2011
|
Reading and Writing CSV Files in MFC
Here's a handy class for working with comma-separated values (CSV) files.
By Jonathan Wood •
Updated on Friday, December 17, 2010
|
A Tic-Tac-Toe Game Engine
Here's a fun C# project I put together that allows you to play Tic Tac Toe with the computer. Tic Tac Toe is a very simple game but I still found this project interesting, and I found there are actually a couple of tactics that the computer can employ when playing the game.
By Jonathan Wood •
Created on Saturday, October 20, 2012
|