Christmas Vacation Part 1

Jess says it’s my turn to blog, so we’ll see what we can do here.

We got to the airport about 2 hours before our flight. Which was good, because we were apparently going to need most of that time. We went to the American Airlines self-check-in, walked up to a computer, punched in our information, got our boarding passes, and then waited for someone to come down, put the luggage tag on our bag, and place it on the conveyor belt. And we waited. And we waited. We watched while the guy who hates his job wandered up and down the line throwing people’s bags onto the conveyor belt. We watched while other employees walked into the back room and disappeared for several minutes at a time. We watched while people piled up at the kiosks and the line. After something like 30 minutes of standing there someone finally came around to take our bag.

Then we got into the security line. Something like 7-10 TSA employees to run a single line. By the time we got halfway through from where we started, the line was twice as long as when we got in it. They eventually opened a second line which sped things up considerably. I won the security-theater lottery and got patted down. Nothing like having your 4th amendment rights violated to make the holiday season cheery. However, TSA seems to be making some intelligent improvements. Further in front of us a mom and a dad were both holding small children when they got to the front of the line. The TSA employees allowed them to go through the metal detectors while holding the kids. Previously I’ve seen the employees demand that the children walk through by themselves, so the screaming, crying kids who have no idea what’s going on get pushed and prodded through the detector. So I’m glad someone with intelligence decided it wasn’t any less safe to let parents carry kids.

When the plane started boarding, the airline was offering $500 travel vouchers for people willing to bump to another flight. Which seems pretty decent, but that wouldn’t have covered the cost of the flight for our tickets; we might have considered it except for our hotel reservation and the plans for the next day.

The flight itself was uneventful, though American Airlines didn’t give us anything but a couple cups of soda during the 5-hour flight (you could, however, purchase a small sandwich for $10, or crackers and cheese for $5).

We arrived in JFK and went down to get our bags. For unknown reasons, the baggage claim signs weren’t providing any information at all, but the captain had announced which carousel our luggage would be at. That took forever. We did finally get the luggage and meet up with our pre-arranged car which took us smoothly to our hotel.

After checking in around 1:00 AM we asked if there was somewhere to find food. We were directed to a 24-hour deli on the corner which was acceptable.

The next day we checked out and left our bags at the hotel while we wandered around the city. When the rest of the family arrived (after a delayed train) we further wandered around the city ending up at Macy’s. We walked through their “Santaland” and then had dinner at one of the several restaurants in the store (there are something like 3 or 4 Starbucks inside Macy’s!).

N08_secondary-banner_colorOnce we finished up at Macy’s we booked it back uptown to see The Nutcracker performed by the New York City Ballet. It was fun. Jess didn’t cry and was able to enjoy the show. After the show we went back to the hotel and got our bags and then headed towards Grand Central. Jess had a battle with the subway again. She was being too nice to the ticket reader and it kept telling her to re-swipe. Once she flicked it through nice and quickly, it let her in.

The train ride back was fine, although we had to switch trains because there was some concern about whether our train was in proper working condition or not. I also spent most of the train ride fixing the Board. There were a few minutes when Mom and Dad called me over to solve a logic puzzle for them (which was part of an ad on the wall).

The next day we did nothing: our muscles and joints were a bit sore (did I mention that we walked around NYC for 6 hours?). Today we also did mostly nothing. We went over to the high school for a few minutes to say hi to some of my old teachers. Due to vehicle scheduling conflicts we then had no ride back home. So we walked home, pausing at Subway for lunch and to warm up again. This evening we went up to the Trinity College campus and watched It’s a Wonderful Life on the big screen, which Jess had never seen.

That’s been our vacation thus far.

Mini-Christmas: Your Pictures, Our Frame

Jess’ parents sent us a Christmas present (of the afore-mentioned eyes-closed-wrapping fame). We were told we could open it before we left for Connecticut. So today we had Mini-Christmas. We got up, turned on the Christmas tree, put on the Christmas music, and opened our present while wearing our pajamas.

We received an Internet-enabled digital picture frame! We’ve been having fun playing with it and getting it all set up and such. One of the nifty features is that you can email pictures to a service which the frame will then grab and display for you. It actually provides two different services you can pick from which offer this feature. The first one we tried “MemoryFrame.com” is having some technical issues, but then we discovered the other one, “FrameChannel.com”, and it’s tons better. It allows you to monitor RSS feeds and all sorts of things.

So now we have some information gathering to do.

Do you have an account with a photo-sharing website? If so, we can probably connect our frame to your shared pictures so we can see your pictures right in our own picture frame! So let us know.

If you don’t have a photo-sharing setup, you can still share your pictures with us easily by emailing them to KBD_JHD ( at ) framesend dot com. But, you know, make that look like a real email address. Hey, you can even send us messages by writing something in Microsoft Paint and emailing that to us!

We’re hoping to get enough feeds from our friends and family set up that the frame will act kind of like a digital window to all of you.

I will admit, I’m quite impressed with the simplicity and quality of integrating the FrameChannel website with the frame itself. The combination of the two basically fulfills all the awesomeness that digital picture frames promised.

So far Christmas is off to a great start. Hopefully the gimongous snow storm on the East Coast won’t cause us any trouble.

Ready for the world: ARegistryFor.Us

As many of our readers know, I built a registry website which we used for our wedding registry. The main reason for going through this hoopla was that there wasn’t a good online wedding registry website that didn’t also solicit the people visiting your registry for their email address. I found this to be unacceptable and thus created my own (harvesting emails to send ads to my friends and family is just not cool).

At the time, I had made the visitor-side look fairly nice and clean, but hadn’t spent any time polishing up the user-side. I’ve been working on finishing this up since the middle of November and now things have come together pretty well. So, go ahead and take a look at the site: ARegistryFor.Us. But, bear in mind that I’m not a marketing goon, so the “marketing” material on the home page is probably pretty low-quality. If you’ve got suggestions, or are a marketing goon and would like to give me some tips, feel free.

Also, if you know anyone who’s getting married and might be interested let them know of this option.

Oh, also, please let me know if it doesn’t seem to display properly for you. I don’t really have access to a bunch of different browsers and operating systems to test on.

O Albertbaum, O Albertbaum

Today was the day we added a Christmas tree to our living room. Needing an authentic experience I found a cut-your-own tree farm in Castro Valley. So after work we zipped on out there to get a tree before dark. With my trusty GPS we found the place without trouble, obtained a trusty saw, and drove off into the wilderness. This tree farm isn’t like we have them back in Connecticut where you park and walk around the property with a little cart. It’s more like property which is up against the Chabot Regional Park. So you drive along an access road to the various lots which go out a couple of miles down the road. We drove out towards the back and found some good size trees to look at. We got out to take a look around, but left the camera in the car, so we don’t have any pictures until we got Albert back to the car. Yes, sometime between cutting it down and carrying it to the car Jess named our Christmas tree Albert.

Anyway, there was a bunch of trees and they were all incredibly well pruned and full. I don’t think we would have, growing up, spent hours in the cold if our tree farms had trees like these. They all had almost perfect shapes. I was very impressed.

So, we picked out Albert which only took about 5 minutes, cut him down, and carried him to the car. We came prepared with a tarp to put down on the roof to help prevent scratching up the paint, and some rope.
DSCN4465
Jess was skeptical of my ability to secure the tree to the car properly. But I knew the secret of the tow anchor points (or whatever they’re called).
DSCN4466 DSCN4467After some adjusting and tying and knotting and such we had things ready to go:
DSCN4469Albert enjoyed his last stint of freedom and gave us no trouble on the way back (which involved a rather roundabout path in order to avoid the highway, I didn’t think 70 mph would be much fun with a non-baled tree strapped to the roof).

We got the tree home and into the tree stand. On Jess’ insistence we are not allowed to decorate it until Saturday when we will decorate it and then watch The Muppet Christmas Carol.
DSCN4470I told Jess that I wasn’t sure our tree trip would count since we could still feel our toes and fingers when we finished, and there wasn’t 3 feet of snow, and no one was crying; but she claims that it will count anyway.

Grails: Querying across associations

Another nerdy post. Grails is a pretty good framework. I’m a python guy, so I prefer Django, but when forced to use Java-like things Grails is better than the alternative. However, it’s still young. Django and Grails are both currently on their 1.1.1 releases, but Django is much more mature for its age.

In Django it’s really easy to query across related objects (they’re called “related objects” in Django and “associations” in Grails). Grails is still struggling with this. (Grails is also struggling with good, in-depth documentation, but that’s not the purpose of this post.)

After much searching all I could find was some forum posts by the project lead of Grails, Graeme Rocher, from 2007 saying that nested associations aren’t currently (as of 2007) supported.

Nested Associations: Suppose I have 3 classes: Person, Family, and Country. Suppose the classes are designed such that each person belongs to a family and each family is linked to an origin country. Now suppose you want to get a list of all persons whose family is from England. Persons don’t have a direct link to that information, so you’d need to hop through the family to get to the country.

Based on the current setup you’d expect to be able to do something like:

Person.withCriteria {
family {
country {
eq("name", "England")
}
}
}

And you can. So for anyone searching for how to do this and finding that old post from 2007 saying you can’t: it’s wrong. You can.

But now let’s pickup where I left off in my previous post with separating out query pieces for re-usability and adherence to the DRY principle.

We need to build a criteria object specifically and separate out the criteria to a separate closure:

def someView = {
def critBuilder = Person.createCriteria()
def critClosure = { filterByEngland.curry(critBuilder)() }
def results = critBuilder.list(max:params.max, offset:params.offset, critClosure)
def totalCount = results.totalCount
}

def filterByEngland = {critBuilder ->
critBuilder.family {
critBuilder.country {
eq("name", "England")
}
}
}

And now we can combine that with other pieces of modularized code. I have my queries broken up so that I can easy sort using different functions based on what kind of output the data is going to be used in. So you can have something like this:

def someView = {
def critBuilder = Person.createCriteria()
def critClosure = {
filterByEngland.curry(critBuilder)()
sortForCSV.curry(critBuilder)()
// sortForXML.curry(critBuilder)()
}
def results = critBuilder.list(max:params.max, offset:params.offset, critClosure)
def totalCount = results.totalCount
[results: results, totalCount: totalCount]
}

def filterByEngland = {critBuilder ->
critBuilder.family {
critBuilder.country {
eq("name", "England")
}
}
}

def sortForCSV = {critBuilder ->
critBuilder.order("lastName", "asc")
critBuilder.order("firstName", "asc")
critBuilder.order("age", "asc")
}

def sortForXML = {critBuilder ->
critBuilder.family {
critBuilder.country {
order("name", "asc")
}
order("id", "asc")
}
}


Since this nested association querying isn’t documented anywhere (that I could find) and the only mention is that it _doesn’t_ work, it was a pain in the butt figuring it out.

Other gripes with Grails. I can’t define a relation to another class unless it is based on the primary_key of the classes. A less-than-usual case for sure, but there really isn’t any good reason to disallow such a situation.