Tuesday, August 30, 2005  

I have been writing a number of stored procedures that return report data for a client. Each of these reports can be filtered by a date range, so I needed a simple way to check that a date was within a user defined date range.

As an additional requirement, if the user does not specify a begin date or end date as part of the date range then the earliest or latest supported date respectively should be used. In other words, if the user does not specify a begin date then the earliest date supported by SQL Server should be used as the begin date, and if the user does not specify the end date then the latest date supported is used for the end date.

My original approach was to use a BETWEEN clause in the SELECT statements. However, this made the code messy especially with the ISNULL call used to set the begin end dates when NULL. So I swapped out the code with a user-defined function.

The user-defined function fnIsInDateRange takes 3 parameters:
The function returns one of the following:
Here's the code for those who want it.

CREATE FUNCTION dbo.fnIsInDateRange
/*
Determines if the date time value is within the date time range.

Returns:
-1 if the date is before the date range.
0 if the date is within the date range.
1 if the date is after the date range.

Usage:
SELECT dbo.fnIsInDateRange('2005-08-16','2005-08-01','2005-08-15')
SELECT * FROM exams WHERE dbo.fnIsInDateRange(dtmExamDate,'2005-08-01','2005-08-15')=0
*/
(
@value DATETIME,
@rangeFrom DATETIME,
@rangeTo DATETIME
)
RETURNS SMALLINT
AS
BEGIN
DECLARE @result SMALLINT
IF @value < ISNULL(@rangeFrom,'1753-01-01 00:00:00.000')
BEGIN
SET @result = -1
END
ELSE IF @value > ISNULL( @rangeTo, '9999-12-31 11:59:59.997' )
BEGIN
SET @result = 1
END
ELSE
BEGIN
SET @result = 0
END
RETURN @result
END

posted by Kirby | August 30 01:54 PM | comments (0)


Monday, August 29, 2005  

I've always said I'm lazy programmer, which makes me a good programmer. For instance, I'm too lazy to perform the same task over and over on a computer so I write a tool. And I hate writing the same code over and over. I would rather write it once, package it up in a library, and forget the details. All I want to remember is the API.

I also believe my lack of a quality education helps me think of solutions that smarter individual may never even consider. My seemingly childish approach to problem solving helps me think of solutions to the most time consuming yet simple problems.

But Philipp Lenssen at Google Blogoscoped has really summed up why good programmers are lazy and dumb. Give it a read.

posted by Kirby | August 29 05:59 PM | comments (0)
 

Amped 3, Burnout Revenge, and Dead or Alive 4.

While I believe Burnout Revenge will also be released on the Xbox in September, I plan to wait until Xbox 360. The latest disc from OXM has a playable demo of Burnout Revenge and a video showcase on Amped 3 and DOA4. All three games look awesome.

posted by Kirby | August 29 05:43 PM | comments (1)


Thursday, August 25, 2005  

My ISP must perform some emergency maintenance on my SQL Server box. The forums site may be down for 15 minutes. Repair work is scheduled to start at 2:00 pm MST (GMT-7).

Update: All done.

posted by Kirby | August 25 04:29 PM | comments (1)


Monday, August 22, 2005  

I want to let the 2 readers out there know I will be offline for the next 48 hours. I'll catch up on emails and such Wednesday afternoon/evening. Cheers.

posted by Kirby | August 22 03:40 PM | comments (10)


Thursday, August 18, 2005  

I read a blog post that has me thinking about the trial version of SMTP Diagnostics. As the story goes, a person was unhappy with the nag screen popping up as he was trying the trial version of a software program. Annoyed at the popups, he decided to uninstall the application even though the gentleman liked the program.

The ISV that published the program in question found the blog posting and explained the company's reasoning for displaying the popup screens in the trial version. This is the part that really got me thinking about the trail version for SMTP Diagnostics.

I didn't like the trial mode model used in SMTP Diagnostics when I first released it and I still don't like it. For starters, it is too confusing. In trial mode, the software will disable itself after 10 runs or 30 days which ever occurs first. While I'm not a fan of nag screens, which I prefer to call marketing screens, I believe just such a screen makes more sense for SMTP Diagnostics over disabling the software.

I would love to hear your thoughts. What would be YOUR preferred approach to encourage users to buy the product without interfering too much with the user experience?

Here's one idea I am playing with in my head: Eliminate the current model all together and instead use marketing screens. The user will see the marketing screen every 5 times that the program is run. Also, the user will see the marketing screen every 5 times a test mail is sent within a single run. Lastly, the test mail will include a tag line at the end of each message saying something like "Sent using the trial version of SMTP Diagnostics."

The benefit of this approach is that the program will continue to work even if it has been installed for months. The current approach does not allow for that. Under the new model, users who rarely use SMTP Diagnostics can get away with running the trial and clicking OK to close the marketing screens. Users who use SMTP Diagnostics on a regular basis will hopefully agree to buy a license to eliminate the popup screen and remove the trial version tag line in the email message.

What do you think of this approach? Or is there an approach I should consider?

posted by Kirby | August 18 11:29 PM | comments (6)
 

Lake Sunapee

Last week Melanie and I joined her family for a week long vacation on Lake Sunapee in New Hampshire. Aside from no broadband Internet connection, the trip was perfect. The house we rented sits just a few feet from the water on 1 of 3 natural sandy beaches at Lake Sunapee.

The views are amazing and the water is crystal clear. Being from Memphis, the water was naturally a little cold for me but I was still able to get in the water. We rented a pontoon boat for a day to tour the entire lake, and we were able to view the ski slopes of Mount Sunapee from the water. I couldn't help but think how cool it would be to snow mobile across the lake in winter time to Mt Sunapee and snowboard for the day. Having a summer time house on Lake Sunapee would be awesome, but I imagine having a winter time house on the lake would be equally as awesome.

We didn't sit around the lake all day, every day. Melanie and I brought bikes with us and rode around. Some of the hills were killers to climb but the speed coming down was exhilarating. Our longest ride was one around the entire lake, which resulted in a 22 or 23 mile ride. In the beginning, we didn't think we could do it but next thing we knew we were back at the house.

I highly recommend Lake Sunapee for those looking for a New England vacation.

Salem, Mass

As many people already know, Melanie and I are considering leaving NYC. Our life style has changed since getting married and we want certain things in our life that are hard to obtain in New York unless you have millions in the bank, which we do not. We really like New England and will probably end up somewhere North of Boston. Salem, MA is one of the areas we are considering so we stopped by the town on our drive back to NYC from Lake Sunapee.

The day was hot, very hot. The temperature was around 95 degrees, which is way too hot for me. We had lunch at an Irish pub then walked around Salem Commons. Salem is definitely our favor place in the North of Boston area at the moment. We're planning more visits to the area this fall before making our final decision but the closeness to Vermont and New Hampshire, and the coolness of this water front town has us already dreaming of "Going from Rainbows to Witches."

DCI

Our vacation week ended with a stop to Gillett Stadium in Foxborough, MA, home of the New England Patriots, to see the DCI World Championships. This was my first DCI event in many years and Melanie's first DCI event ever. Blue Knights, Santa Clara Vanguard, and The Cavaliers were our favorites of the night. While The Cadets took home the championship with a score of 99.150, I personally believe The Cavaliers were far better. And granted I don't know the judging rules as well as I did 20 years ago but how can a corp score 99.150 when the drum major starts the show before the judges indicated that they were ready.

Short story short, The Cadet's drum major started the show before the announcer asked if the judges were ready, which is before the drum major is asked if he or she is ready, and is most definitely before the announcer tells the corp that they may take the field. But what do I know? Heck, I thought The Cavaliers were way better but they only scored a 97.625 putting them in second place for the night.

posted by Kirby | August 18 11:03 PM | comments (5)


Monday, August 15, 2005  

The latest version of SMTP Diagnostics, version 1.3, is now available. This release includes a number of enhancements including the ability to save and open the SMTP settings as a Profile. For a complete list of changes, please read the Revision History found in the SMTP Diagnostics Help file.

The latest version can be downloaded from our web site at:
http://www.whitepeaksoftware.com/smtpdiagnostics.aspx

Note: This is a FREE upgrade to all licensed users.

posted by Kirby | August 15 06:37 PM | comments (0)
 

Thanks for a patch from InstantASP the WPS Forums are back online.

posted by Kirby | August 15 10:39 AM | comments (0)


Sunday, August 14, 2005  

Apparent the White Peak install of InstantForum.NET 4.0 is tied directly to the availability an InstantASP server. Unfortunately it seems the InstantASP server is down and as a result the White Peak Software Support Forums is down as well. I am working with the vendor to resolve the problem as quickly as possible and to hopefully ensure this never happens again.

posted by Kirby | August 14 03:47 PM | comments (0)


Wednesday, August 03, 2005  

There are camp grounds in Long Island? You bet ya. Melanie and I spent the weekend camping at one of many Long Island campgrounds. We stayed at Wildwood State Park Saturday and Sunday night and had a very enjoyable time. Wildwood is about an hour and a half to two hours from Manhattan and is on the Sound side of the island.

We were a bit disappointed with the camp grounds on Saturday, rather I should say disappointed with the other campers on Saturday. There were lots of campers on that night, the grounds were near capacity. And many of the campers seemed to enjoy their cars more than the great outdoors. Music poured from car radios until 10:00/10:30 pm, people drove cars around until midnight, and car alarms could be heard throughout the night and early morning. Needless to say, Saturday wasn't what we expected.

Luckily Sunday was the saving grace for Wildwood campgrounds. The rowdy campers left (check-out time is 11 am) and grounds were probably less than 25% full. Sunday night was quite and enjoyable, a welcome change from the previous night. We chilled by the campfire listening to the strange noises made by the creatures of the night. We cooked steaks and roasted corn on the grill, and we were constantly thankful the Saturday night crowd was gone.

Overall we really liked the campgrounds at Wildwood State Park and highly recommend it to those wanting to camp in Long Island. The campgrounds are nice and the beach is only a short walk away. Be sure to bring your bike and avoid Friday and Saturday nights.

posted by Kirby | August 3 12:27 AM | comments (0)


Tuesday, August 02, 2005  

I'm happy to announce that the White Peak Software Forums are open. Please start using the forums for your questions and feedback about SMTP Diagnostics.

posted by Kirby | August 2 07:22 PM | comments (2)
Copyright © 1999-2009 Kirby Turner.
Site software written by White Peak Software Inc, a provider of custom software and software development coaching.