Blokus
Another game that we've really gotten into lately is Blokus. We first noticed the game from all the awards that it had accumulated (Mensa Select, Parent's Choice Gold Award, and 20 others).

The rules are simple so even our younger children can play. Our 4 year old can follow the rules for putting down pieces and even though he doesn't have much strategy he is effective at messing with the strategy of the other players. Even with the simple rules the game is very challenging and gets your brain working.

All four players have 21 tetris like colored tiles to play on the 400 square board. The pieces come in 5 different sizes, covering from 1 to 5 squares. The first piece you place must touch your assigned corner of the board. Every subsequent piece you play must touch a corner (and not a side) of one of your previously played pieces. Your pieces can touch other players pieces in any way. That's it. The player with the least number of squares in his unplayed pieces wins the game. Bonus points are given for using all your pieces and for using your 1 square piece last.

Every time we sit down to play this game we end up playing it half a dozen times. It's addicting and it works my brain trying to block off sections of the board so that I have room to play my remaining pieces without giving the other players access.

I've also noticed that it really helps the younger children learn some spacial relationships by having to rotate and flip their pieces to fit them into open spaces on the board. At first they had trouble seeing that a large piece could not fit into some of the smaller openings, but after a while they were able to visually figure that out without having to actually try to fit the piece in the space.

I totally recommend this game.

Podcasting...
If you don't know what podcasting is, you need to check it out. Most of you out there by now have an iPod or some other mp3 player right? Well, there's a lot more out there to check out than music. Podcasts are essentially a radio show that is available on a subscription basis (through an RSS feed) that you can directly download onto your mp3 player or computer with some handy software (designed to subscribe to the RSS feed).

Now the nifty thing about these podcasts is that there are literally tons of them out there, so you're more than likely to find a few that are right up your alley. Check out sites like PodcastAlley or the iTunes directory to see some listings. There are many podcasts out there on obscure topics with small audiences that might focus on your favorite hobby. There are others that have a fairly impressive size audience. One nice thing is that most of them don't feature any ads and if they do they are mostly short snippets at one end of the show.

I've found some great podcasts that I'm addicted to now that satisfy my need to talk radio - without all the garbage and commercial breaks that you get fed on the airwaves these days. Let's face it, radio sucks!

Here's my recommendation for you to check out --> Croncast. This is a small audience show hosted by a husband and wife that live with their two kids in a suburb of Chicago. They put out a half hour show three times a week from their basement studio. Kris is a computer geek and Betsy is a garage sale addicted ebay queen. Both of them have a great sense of humor, tell wonderful stories, and always have witty and interesting conversations. Like I said, I'm addicted.

Here's a bonus... if you'd like to check out their show, click on the Croncast banner on the left of my main page or at the bottom of this post, fill out the form and you will be entered into their contest to win an iPod. (I get an entry too for recommending you.) As I said, this is a small audience show, so the chances of winning are really very good - they are giving away 4 iPods when they get 300 new listeners, so you've pretty much got about a 1 in 300 chance. Don't forget to follow their instructions to hook up the RSS feed - just email Kris if you have problems. He's a great guy and will hook you up.

And let me know if you find any other podcasts out there that you'd think I'd like!

Snorta!
I've been looking for some family games to play with my wife and kids that everyone would enjoy. Granted that this is not an easy task as my six kids range in age from 4 to almost 13. The older boys and I were having fun taking on some of the more mature games and I was quite looking forward to introducing some of the more complicated strategy games as well as some old favorites of mine like Cosmic Encounter. We had already played Kings and Things quite a bit, which the 7, 10, and 13 year old enjoy and ask for frequently. The two older boys have also started playing some card games like Canasta and most of us can play Hearts.

But, it's a bigger problem to find something that my four year old can play as well as my two girls (9 and 11 - they were adopted from Liberia earlier in the year and don't understand all the rules of the complicated games.)

Three nights ago a game called Snorta! arrived in the mail. I had read some favorable reviews online and it looked promising. Let me just say that we've played it three nights in a row and everyone has had a blast! Mission accomplished.

The gameplay is simple. Everyone (up to eight players) picks a small plastic animal out of a bag - horse, chicken, pig, snake, etc. and each player makes the sound of their animal in turn around the table. Cards are dealt evenly face down to each player. The players then place their animals in their own small barn so that only they can see what animal they have. Once again, each player makes their animal noise in turn.

Play then begins with each player turning over a card face up on the table one at a time. The cards each contain an animal picture. When a card is turned over that matches another player's face up card, the two players with cards that match race to make the sound of each other’s hidden animal. The hard part is both to remember the hidden animals of seven other players and not make the sound of the animal that you're looking at on your matching cards.

The player to correctly recite the sound of the other player's hidden animal wins and gives all of his face up cards to the losing opponent to be placed in their hand. The game is won when a player plays the last card in his hand.

Take my word for it, this game is a blast to play with your family and we're planning to take it to a adult party tomorrow night where I think it'll have the same reception. I definitely recommend it.

SQL Server: Paging through database records
Providing navigation buttons (prev, next, etc.) on the client side to page through a set of database records is a common task and one that I've had to implement numerous times for different customers. The current customer that I'm working for is using XML based transactions to access data and business logic through the middleware and requires only forward paging through the data. The implementation allows you to pass the maximum number of records you would like back and a cursor indicating what page you are on. The response passes back the actual number of records returned and the cursor to the next page of data.

This works fine as long as you are only asking for forward paging and your data has a sequential key to cursor on like a date or a SQL id.

I'm currently working on a website statistics package for our hosted clients and need to implement paging to allow viewing of the page view data. The data is obviously sorted by date so I do have a sequential cursor that I could use and initially I started to implement the paging code using the date as the cursor. I ran into headaches however as I needed to allow forward and backward paging. This requires remembering the previous cursor and was getting to be a big pain trying to pass those cursors back and forth through my stateless client web pages.

I did some searching and found this page at Microsoft's MSDN website showing a paging technique that I hadn't really considered. They are using nested queries with the SELECT TOP operator to returned back the data pages. The advantage of this technique is that no cursor is required, only the page number that you would like to view - allowing for navigation to the next, previous, first, last, or specific page numbers.

Here's a simplified example of the SQL I'm now using returning my data in descending order (newest record first).

SELECT * FROM

(SELECT TOP [pageSize] * FROM

(SELECT TOP [pageSize * pageNumber] * FROM table

ORDER BY createDt DESC) AS T1

ORDER BY createDt ASC) AS T2

ORDER BY createDt DESC

Although it looks complicated, the overhead of the three nested queries doesn't seem to add much processing time. The inner query returns a descending set of records including the first page through the page I'm attempting to retrieve. The next query retrieves the records for the page I'm requesting, by reversing the order and taking the top pagesize records. The outer query simply reverses the order again back to the descending order that I am looking for.

Unfortunately, Microsoft's implementation of SELECT TOP does not allow variable substitution for the TOP operator. So we're forced to build the SQL statements into a string and use the EXEC() command to execute the query. This does add a performance hit, but I couldn't tell you how much. If someone does the analysis I'd appreciate a look at the numbers.

My final implementation of a stored proc (based on the Microsoft example) that takes the page number and page size as parameters is below.

CREATE PROCEDURE retrievePage

@page int,

@pagesize int

AS

DECLARE @rowsToRetrieve int, @SQLSTRING nvarchar(1000)

SET @rowsToRetrieve = (@pagesize * @page)

SET NOCOUNT ON

SET @SQLSTRING = N'SELECT * FROM

(SELECT TOP ' + CAST(@pageSize as varchar(10)) + ' * FROM

(SELECT TOP ' + CAST(@rowsToRetrieve as varchar(10)) + ' * FROM table

ORDER BY createDt DESC) AS T1

ORDER BY createDt ASC) AS T2

ORDER BY createDt DESC'

EXEC(@SQLSTRING)

GO

Looking for something...
I get a trickle of visitors to this site as I post infrequently and have really only built up a little content. I started the site as a place to save my coding solutions in case I need them again and in the hopes that someone else might find a solution to the same problem I was having. Lately it's evolved into posts about any interesting geeky/techy subject I've run across.

I get a surprising number (to me at least) of hits from people looking to clean up their scratched DVDs. People from Australia to Austria visit on that topic and hopefully they are coming away with some information even though I wasn't able to come up with a perfect solution myself.

What made me at first laugh this morning and then get a bit quesy was the visit from someone in Wichita Falls, Texas looking for pictures of dead bodies. This post of continued ramblings of mine about Amazon's Mechanical Turk site contains one of those drive-by pictures from MTurk that shows some people laying on the grass in front of a building. In the post I wryly wonder if they might be dead bodies.

Apparently my post appears on the 5th or 6th page when you do a Google Image search for "dead bodies". Woohoo! Not quite the demographic I was looking for and I'm sure this post won't help but boost my rankings a bit. But, all I can say is who doesn't enjoy a good dead body picture now and again while trying to repair a scratched DVD?

Here is the referring search link. Be forewarned though as the other pictures in the search aren't quite so tame as mine.

Southern Cooking in SC
It's strange to be posting a restaurant review, but I just had to give this place a plug. We'd been up to South Carolina for a combo family reunion and birthday and had just about enough of eating the usual chain restaurant fare. I spotted signs for Jasper's Porch - Lakefront Dining as we were nearing Hilton Head and decided to pull off and check it out. We were all very much glad that we did.

The restaurant is just off I-95 on exit 21 in Ridgeland, SC (map). This is just north of Savannah over the South Carolina line. At first when we pulled off I-95 to find it we were a bit suspicious as you have to drive behind a gas station and a Comfort Inn and we were wondering if it was going to turn out to be just another hotel-attached restaurant. We were very much surprised as we turned the corner and came up on this charming building backing up to a 3 acre lake surrounded by trees.

The food is real deep south cooking - real southern fried chicken, greens, and everything very fresh and homemade. The decor is nice with a southern feel, with lots of indoor dining as well as a large seating area on the screened in porch overlooking the lake (filled with turtles, carp, and an alligator or two.) We hit it just right as we caught the tail end of their Sunday buffet. As they readied a table for our party of six we took a stroll on the nature walk around the lake, which was a treat after sitting in the car all morning. The restaurant is adjacent to the Blue Heron Nature Trail and Learning Center. The Nature Trail starts right at their front door.

I've got this place on my list now as a "must stop" whenever we're traveling north up I-95. I suggest you look for it too if you're passing that way. It's well worth the stop if you'd like a more relaxing meal on your road trip. The prices were definitely not bad for what got. The Sunday buffet was priced around $10 for adults and I believe that meals from the menu were below that and around average for what you'd be paying for anywhere else along the road and definitely a better value.

Copyright © 2006 William R. Lefler