I've been working on a few little programming projects geared towards my new hobby of triathlons. Sometimes I get spare time in-between projects and use this time to practice and improve my programming skills.
Note, all of these projects were created using Netbeans 7.1. This means that to run any of these programs you will need to have the newest Java Runtime Environment (JRE). Download it from
Oracle's site. If you feel a bit frisky, you can download the JDK or Netbeans, then ask me for the project files so that you can modify any of the programs for your unique needs.
RaceEvent
Google Drive location
The first item I created was a listing of races by regions. I use www.runningintheusa.com alot to find races I want to do. Mostly, running events are listed here but you can also find triathlons. The issue I had with this site is that I wanted to see all races in my area but only for certain counties (e.g. Harris and Galveston). The site didn't allow this way of selection. That is the reason for this project I call RaceEvent.
Currently I have preset locations under Texas, but it could be modified uniquely for each user.
Here is the application at initial start up.
By default, the Starting Date is set to today's date and the Ending Date is left empty which signifies to use the last day of this year. If you double click on either of these date fields, it will set to today's date.
Race Type can be any of the following:
Once you have your date(s) and race type selected, you can then select or multiselect the locations you would like to see races for. Here I'm selected races that are only in Galveston and League City cities and anything in Harris county.
Pressing the Search button now will command the program to data mine the web site for races with your defined criteria.
You can now click on any of the Race Name active links in the main display window to view the web page for that race. Note, displaying of these web pages might be better done in your native browser, as my application doesn't handle all HTML very well :-).
Note, once you click on a Race Name link, if a USATF map is found in association with that race (the race name, city, state need to be as found on usatf's database), then the USATF Map button in the upper right hand corner will become enabled. Click on this button will bring up a new window where you can view all the images of the route submitted to usatf for certification.
You can press the Races button to return to the list of races from your last search.
BikeFitter
Google Drive location
Google Drive location of library needed (only jmf.jar is actually needed)
BikeFitter was my way of figuring out how to self bike fit myself on
my Cervelo S1. One of the issues with bike fitting is that you need to
measure some angles while sitting on the bike. This is difficult to do
for a couple of reasons. 1) You need to have a tool that measures
angles between two point (e.g. between the knee and the ankle). 2) You
need to make these measurements while trying not to modify your sitting
form.
BikeFitter is a basic program that allows the
user to either snap pictures from within the app or open an already
saved image. Once the image is captured and opened, then using the
mouse, the user can draw two sets of lines and BikeFitter will display
the angle between these two lines.
Here is an image of BikeFitter with an image opened.
Note, the Webcam menu item is disabled because the computer I'm running BikeFitter on, doesn't have a webcam attached.
Now I can draw two lines to find angles. Note, by default, the line color is Pink and the text color is Blue and the curve color is Blue.
Since
the colors are a bit dim on this image, I can change the text to Green
and the curve to Orange, and darkening the shades of the curve then
right click the image to bring up a menu which allows me to clear all line and redraw the same lines. More than one set of lines can be made at a time.
The
user can rotate the image once. Here I rotate the image 90 degrees.
Note, the current drawings stay on the image until the user right clicks
the image to clear them all.
TriEstimate
Google Drive location
Google Drive location of parsed race files
Google Drive location of library needed (everything but jmf.jar is needed)
Note: directory structure needs to be as follows.
- triestimate.jar (any location, for example your Desktop)
- lib/jcommon-1.0.17.jar (in lib folder; lib/ is located at same level as triestimate.jar)
- lib/jfreechart-1.0.14.jar (in same lib folder as above)
- triestimate/Races/* (all race files in Races/ folder which is in triestimate/ folder; triestimate/ is located at same level as triestimate.jar)
TriEstimate was create to help me determine what time I should expect to complete any triathlon distance. I was looking for a good app on the iPhone, and at the time there was none. I decided that this is a fairly easy task to get the distances for the race, then the known pace from the user in swimming, biking and running. Then I try to factor in the other little variables, such as choppy waves, wearing a wetsuit, pool swim over open water, etc.
As I had more and more time to spend, I added additional functionality. One was to have the ability to not only determine the predicted finish time, but to then see where that would place me in a given race (if that race's results are available in this tool).
Since I was getting race result data for this tool, I created a python extraction tool to make data mining race results much more convenient.
On start up, here is TriEstimate.
And here are the other tabs (T1, Bike, T2, Run and Place).
Once the user enters all their information in Swim, T1, Bike, T2 and Run, they can then go to the Place tab and select a Race and an Age Group then press the Place Me button.
As you can see from the image above, I would place 309 Overall (which is in the 83.06% of all racers). I would place 34th place in the M40_44 Age Group (which is in the top 89.47% of this age group).
Another additional feature I have added, is the ability to view the race data and to do searches within each race file (e.g. if you want to search for your times) or to search for a keyword in all the race files. This allows the user to find all of his/her race times. Note, the keyword entered can be a regular expression pattern. This allows a more powerful search option. So if I wanted to search for "O'Neal" and some races have it spelled as "ONeal" and some as "O'Neal" and others as "O Neal", then I can use regular expression to search for "O'?Neal"; without the quotes. This says the " ' " is optional ? (0 or 1 occurrences).
Here is the search results for "O'?Neal". Note, I only have certain race data available. More can become available as time permits.
Or a search can be done on an individual race. When this is done, the tool will highlight the first occurrence of the keyword and the title will show you how many matches were found (in this case only 1).
In addition, graphs of the race data can be viewed by selecting a race and pressing the Graph button. Within the graph window, selection can be made for the Average Finish Time, Average Swim Time, Average Bike Time, Average Run Time per age group.
The last new functionality I added was the ability to have the user enter their own configuration values. In this application I had to determine what it meant (with respect to time) to have rough or very rough waters, or to wear a wetsuit, or to have head winds, or positive elevation. This was mostly a guess. So I added a new window to allow all these values to be modified.