Ready for the world: ARegistryFor.Us

December 9, 2009 11:55 pm

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.

Fa la la la LAAAAAAAAAAAAAA…

December 6, 2009 7:19 pm

Saturday was the first Saturday of December, so it was time to kick off the Christmas season! We started by sleeping in (this is our preferred way to start all Saturdays). But then we got going by decorating Albert!

decorating the tree! DSCN4476 DSCN4477

(Why yes, Mother, that is the angel that usually hangs on the wall. But we couldn’t find a tree-topper we liked, so Kyle made her a cardboard petticoat and now she’s sittin’ pretty atop Albert!)

By this time, Kyle had gotten online and seen that Livermore was having some cool stuff downtown, so we headed off to see the SNOW they had brought in/had made/who knows how they conjured it for the kiddies to play in. Safely fenced in, of course:Yes, the city brought in snow for the festivities.

Honestly, I was so excited to see the snow, but when we got there, it was one of the strangest things I’ve ever seen. Snow as holiday treat/freakish oddity.

After that, we had two hours to burn before the parade started, so we wandered around the downtown area for a bit looking at shops and such before we got dinner. (We also stopped in at the famed Donut Hole Wheel (Hole? Jess is ridiculous -Kyle) for an appetizer. Tasty! (And we learned that they sell frozen cotton candy, so you know we’re gonna be going back for that.)) We ate at an Italian restaurant we’ve been meaning to try, which was pretty good, and then went back for the parade.

Okay, so it’s not exactly Utah-winter-cold here. But after the sun goes down, it’s pretty chilly. And, actually, it’s quite extra colder than usual this week, so yeah, it was cold. But we found a good spot and only had to wait 20 minutes or so before the parade started. At first it was fairly lame, but it got better. My favorites were the lighted tractors, lighted motorcyles, and all the old cars from the Altamont Cruisers. There were a ton of those, and almost all had put lights on their cars, too, which was neat. Here are a couple pictures of the motorcycles: DSCN4495 DSCN4492

Oh! And Waste Management had a surprisingly awesome bit, including motorized garbage cans and miniaturized trucks. Trust me, it was way fun.DSCN4490

After over an hour, Santa finally arrived atop a fire truck. He climbed down and lit the tree, which meant we could finally go home. I’ll admit that that’s what I really wanted at this point.

DSCN4503After we got home, it was definitely time for hot chocolate. And popcorn, to watch The Muppet Christmas Carol! I was so stoked. I love this movie a ton. And it didn’t disappoint (how could it?). Man, that’s some good stuff. (Don’t worry, all you Charlie Brown fans out there; we watched A Charlie Brown Christmas last night.)

So that’s how we kicked off our Christmas festivities. It was a lot of fun, and it’s feelin’ really Christmasy around here now…

O Albertbaum, O Albertbaum

December 3, 2009 10:36 pm

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.

Thanksgiving!

December 1, 2009 2:43 pm

Kyle and I went to Frisco, TX to see my family for Thanksgiving. We flew out Tuesday evening (our flight was delayed for mechanical problems, so we got in VERY late) and came back early Saturday morning. We would have liked to stay longer, but it would have cost big bucks to stretch it any longer. Insane. But we really enjoyed our quick trip anyway.

Part of the reason it was such a priority to get out there was that Chance, Rachael, and Maddox hadn’t yet gotten to meet Kyle! But they all finally got to meet, which was good. It took Maddox a while to warm up to Kyle, but by the time we left, he had acknowledged him as a human being. Sometimes with a name! “Uncle Kyled,” he calls him. Here’s Chance and Rachael:P1000494

We spent Wednesday just hanging around the house, mostly. We played Mario Kart and Guitar Hero with Colton (who actually beat Kyle pretty bad at GH!).P1000482

Chance, Rachael, and Maddox came over and I got to play with him and try to remind him that he already knew me, so he didn’t really need to be afraid of me. The process was significantly sped up by playing with old McDonald’s chicken nuggets toys. Also reading video game manuals. Basically, we all goofed around most of the day. It was lovely.

P1000492 P1000486On Thanksgiving morning, Chance, Colton, Cameron, and Dad went to the ward Turkey Bowl, but Kyle chickened out on the grounds that he hadn’t brought anything warm enough to play football in that early in the morning. We were already up at this point, though, so I dragged him into the office and made him watch while I rediscovered a bunch of my favorite childhood books. This was definitely a highlight of the trip.

Later on, everybody came back and we got ready for dinner. Mom and Dad had invited Shelley and Robbin Holley to join us, so they came over, too, which is always fun. Dad barbecued the turkey, and we had all the classic sides, just like I like (though Mom says every year that we need new stuff, ‘cuz it’s boring…blah blah blah). And delicious pies for dessert! We played cards and Scattergories later on, and talked all afternoon. It was a great time, and I’m so glad we were there. Here’s a couple of random pictures from that day:P1000493 P1000490

Friday was our last day in Frisco, and again, we didn’t do a whole lot. (Actually, all this time, Kyle was doing quite a bit of work on the registry website, but I’m sure he’ll post about that some time far more intelligently than I could, so I’ll leave it at that.) I took one of my completed cross stitch projects with me so that Mom could “help” me make it into a bell pull. See, I know how to cross stitch, but I can’t really sew. Plus, I don’t have a sewing machine. But Mom does, and she’s a genius! And a benevolent one at that. So she agreed to “assist” me with this (I’d like to avoid having every single one of my cross stitches get framed so they all look exactly the same, y’know? And since this one is actually designed to be made into a bell pull, it seemed ideal for doing something else with.) Anyway, she made it into this:

Mom madet this cross stitch I did into a bell pull over Thanksgiving break.And isn’t it great? Now I just need to find some kind of hanging hardware (which is being slightly more difficult than I thought it would be). I’ll probably end up getting a dowel rod and finials and staining them; I just don’t want to stain them. Call me lazy.

Anyway, we all went out for dinner Friday night at the restaurant I used to work at, which was slightly odd just because I have all these vivid memories of working there, but it’s been ten years, so nobody remembers me at all. Which is fine. Just slightly odd.

And then it was before the crack of dawn Saturday and time to go. It was so good to see and get to talk to everybody! I miss you guys.

Grails: Querying across associations

November 24, 2009 9:45 am

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.