2009 West Bloomfield Rock and Road

by Frank Perez May 17, 2009

Today I ran my best 10K race (6.2 miles) at the West Bloomfield Rock and Road. My official time was 54:43 (mm:ss), which was 8:15 (mm:ss) faster than my previous record. Almost a 15% improvement in the span of one year.

This was my second year running this race, and I will probably run it again next year. I like this course because it is a mixture of roads, hilly trails, flat trails, and grassy hills. Plus it always seems to rain a day or two beforehand. So the opportunity to get some mud on your shoes and legs are pretty good.

Keywords:

Filed Under: RUN

Martian Marathon 2009

by Frank Perez April 5, 2009

Today I completed my first marathon (26.2 miles) with a time of 5:03:36 (hh:mm:ss). Not quite the original estimate of 4:45 (hh:mm) I made back in December. But when I consider that less than 1% of the population ever completes a marathon, it is something I can be proud of.

To train for my first marathon I chose Hal Higdon's Novice Training Program. The program is 18 weeks long, consisting of four training runs a week, ranging from 15 to 35 total miles per week. This was the first time I used any kind of program to train for an event. My half marathon training program was more of a just run as much as you can and as often as you can system. Overall, I liked having a schedule. It helped prevent me from over training in the first weeks, and under training in the final weeks.

The hardest part of my marathon training was the time of year I chose. Michigan had some record setting snow fall this winter, many sub-zero degree days, and I am an outdoor runner. Fortunately, I spent twelve years living in Fairbanks, Alaska and have experienced much worse weather conditions. But it still takes a lot of dedication to get up on a Saturday at 5:00AM, with three inches of fresh snow on the ground, -10 degrees Fahrenheit (-25 if you include the wind chill factor), and go out for a 15 mile run.

Despite the early reports of bad weather (rain and a couple inches of snow), race day was beautiful. It started out around 30 degrees and reached a high of 50 degrees with lots of sunshine. The course was a mostly flat, out and back run along Hines Drive, with a start and finish at Dearborn's Ford Field Park. There were aid stations every few miles with water, Gatorade, and GU Energy Gel. If you like a marathon that is somewhat secluded and feels more like a run through the park, I would recommend it.

In the end, what helped me the most with my first marathon was having a running partner, and an awesome group of running friends. If I had tried doing this on my own it would have been far too easy to skip a training day just because it was cold outside or just because my legs were sore. But when you have someone to train with, well it's not as cold out, and the pain is only half as bad. So you get up and do it, because your friend probably feels the same and needs your support.

Now that my first marathon is done, the big question is would I do another? YES. My plan is to do some smaller races over the summer (10Ks and half marathons), and find a marathon for the fall. Right now I am signed up for the half at The Trail Marathon on April 26, 2009. It’s a tough course with a lot of hills, so I don’t expect a PR (personal record). But it will be a lot a fun. :)


Links:
Hal Higdon's Marathon Training Guide http://www.halhigdon.com/marathon/Mar00index.htm
Martian Marathon http://www.martianmarathon.com/
Trail Marathon http://www.trailmarathon.com/

Keywords:

Filed Under: RUN

Always Select or Specify a Work Area

by Frank Perez December 14, 2008

Just the other day I got burned by what I consider a rookie mistake. I was working with a Visual FoxPro application (compiled as a multi-threaded DLL) that records application events to a Visual FoxPro table. To limit the size of the log table, the application re-used records after 500,000 events by updating the oldest record instead of adding new records.

As a general rule I know that I should always use a SELECT command before performing any command or function that processes a work area. For example, in the following sample code the SCATTER command is used to copy data from the current record to an array. Because this command processes the current work area only, I should always select the desired work area first.

* create a cursor with a single record
CREATE CURSOR "CURSOR01" (character1 C(10))
INSERT INTO "CURSOR01" (character1) VALUES("VALUE01")
* create another cursor with a single record
CREATE CURSOR "CURSOR02" (character1 C(10))
INSERT INTO "CURSOR02" (character1) VALUES("VALUE02")
* before calling the SCATTER command, select the work area
SELECT("CURSOR01")
SCATTER NAME loValues
* this should display "VALUE01"
WAIT WINDOW loValues.character1

The exception to this rule is any command that has an IN clause or alias parameter. For example, in the following sample code the REPLACE command can safely be used without selecting the desired work area first.

* create a cursor with a single record
CREATE CURSOR "CURSOR01" (character1 C(10))
INSERT INTO "CURSOR01" (character1) VALUES("VALUE01")
* create another cursor with a single record
CREATE CURSOR "CURSOR02" (character1 C(10))
INSERT INTO "CURSOR02" (character1) VALUES("VALUE02")
* this should display "CURSOR02"
WAIT WINDOW ALIAS()
* change the value in CURSOR01 cursor
REPLACE character1 WITH "NEWVALUE" IN "CURSOR01"
* this should display "NEWVALUE"
WAIT WINDOW CURSOR01.character1

In this particular situation, I was using a LOCATE command without specifically selecting the work area first. In an application compiled into an EXE, executing the LOCATE command when the current work area is blank would cause an Open File Dialog similar to the one below to appear.

However, in an application compiled into a DLL, the LOCATE command appears to be ignored if the current work area is blank. An error does not get thrown and the program simply executes the next line of code. :(

Fortunately, I was able to track down and fix the problem quickly. I'm sure that this is one of those mistakes that we all make at one time or another. I'm just hoping that by blogging about it, I will be less likely to make it again {g}.

Keywords:

Filed Under: VFP

Training for My First Marathon

by Frank Perez December 1, 2008

This week I begin my 18 week training program for the Martian Marathon April 5th, 2009. The Martian Marathon is a two day event that begins with a 5K (3.1 miles) and 10K (6.2 miles) on Saturday. The Full Marathon (26.2 miles) and Half Marathon (13.1 miles) take place on Sunday.

For this race I will be using Hal Higdon's Novice Training Program. This program consists of four training runs per week, averaging 15 to 25 miles each week. I don't have any strong reasons why I chose this program over others. I can only say that it worked with my schedule and that it filled the need to have specific goals every week.

Based on my recent Half Marathon results, my goal is to complete this race in 4:45 (hh:mm). That's an average of 10:50 (mm:ss) per mile. Although, since this is my first Full Marathon, just crossing the finish line will be in itself a personal victory.


Links:
Martian Marathon http://www.martianmarathon.com/
Hal Higdon's Marathon Training Guide http://www.halhigdon.com/marathon/Mar00index.htm

Keywords:

Filed Under: RUN

Southwest Fox 2008 - Day 4

by Frank Perez October 19, 2008
Southwest Fox 2008 - Day 4

My last day started with Christof Wollenhaupt's "Optimizing and Debugging" session. In this presentation Christof demonstrated many good debugging and optimizing tips. Some of my favorites are:

  • When building a new application, work on the data migration before the forms and reports. This way you will have good sample data to test the forms and reports with.
  • Design to match complexity. For example, N-Tier is a good idea for enterprise systems, but probably overkill for a hobby application.
  • Avoid defensive programming such as parameter checking. It can promote bad coding practices.
  • Forms make horrible progress bars because they change focus (Activate and Deactivate events), which can interfere with debugging. Use a toolbar instead. This also has the benefit of always being on top.
  • Use a hotkey to turn the Coverage Profiler on and off.
  • When using Coverage Profiler, keep in mind that the time it takes to log an event can make a line of code that normally executes quickly appear much slower due to the overhead.
  • Use SCAN FOR instead of REPLACE FOR whenever possible because the REPLACE FOR command has to do a table lock, versus a record lock.

My last session of the conference was Craig Boyd's "VFP Fundamentals: Creating a Professional VFP Application from Start to Finish". Craig began with how he likes to setup his project folders, how he uses Subversion for version control, and sub-classing the base classes. He also discussed user interface best practices, such as using one font, using colors sparingly, avoid creating a battleship (black, white, and gray only), and being consistent in how you layout and size things.

My favorite part of his demonstration was an awesome grid that he created. It had really cool features such as column sorting, incremental search and filtering (very similar to Microsoft Excel), export capabilities, and the ability to save and restore how a user customizes the grid (i.e. column re-ordering and re-sizing).


Links:
Subversion http://subversion.tigris.org/

Keywords:

Filed Under: VFP

About Frank

Frank lives in West Bloomfield, Michigan with his wife and three children.  When he is not writing code, he enjoys long distance running and riding his motorcycle.

Month List

Tag Cloud