Found Some Code…

# check for missing fields
if (!$var1) {
        return 'missing_var1';
} elsif (!$var2) {
        return 'missing_var2';
} elsif (! $hash->{val1}) {
        return 'missing_hash_val1';
} elsif (! $hash->{val2}) {
        return 'missing_hash_val2';
} elsif (! $hash->{val3}) {
        return 'missing_val3';
} elsif (! $hash->{val4}) {
        return 'missing_hash_val4';
} elsif (! $hash->{val5}) {
        return 'missing_hash_val5';
} elsif (! $hash->{val6}) {
        return 'missing_hash_val6';
} elsif (! $hash->{val7}) {
        return 'missing_hash_val7';
} elsif (! $hash->{val7}) {
        return 'missing_hash_val8';
} elsif (! $hash->{val9}) {
        return 'missing_hash_val9';
} elsif (! $hash->{val10}) {
        return 'missing_hash_val10';
} elsif (!$var3) {
        return 'missing_var3';
} elsif (!$var4) {
        return 'missing_val4';
}

[identifiers changed to protect the innocent, but otherwise this is verbatim]

Gee, I wonder if this could be simplified?  I really don’t see the pattern…

Sadly, I see code like this much to often.  Most of the time it’s old and the developer(s) moved on long ago.  I stopped reading TheDailyWTF regularly because it hits too close to home nowadays.

Old Sturbridge (April 2014)

It’s been a beautiful spring weekend after a stormy March.  A trip to Old Sturbridge Village is in order.  Its the last day we can bring Butter the dog until autumn.

The Quinebaug River is pretty full after all the storms:

Quinebaug River Dam
The water was a full foot higher than the top of the dam
Megh and the kids playing pooh sticks on the Quinebaug River
Megh and the kids playing pooh sticks on the Quinebaug River

Some of the fields are flooding too.  Fortunately the flooded parts aren’t regular exhibits.

Flooded OSV fields
Flooded fields (plus you can see the moon)

Of course, we’re expecting another inch of rain tomorrow night, so this might be even more flooding in a couple of days.  Sadly we won’t be around to enjoy the carnage.

We went with our friends Sam and Joanne, and their son.  The kids tire each other out quite effectively.  I didn’t get a photo of them playing in the dirt.

Beta works the pottery churn
Beta channels Conan the Barbarian while working the pottery churn

While there, we accidentally ran into our friends Pat and Kelly.  We haven’t seen them since before we moved, so we skipped lunch and caught up instead.  Afterwards, when we finally got food, the kids were clearly hungrier than we were but they hadn’t complained while the Pothiers were around – too much fun to notice little things like your stomach gnawing on your backbone.

Alpha and Alpha-Pothier played like it hadn’t been five minutes since the last time they saw each other – they’ve known each other pretty much since birth.

The Pothiers
The Pothiers and their Pothiettes (plus some random kids that happened to be there)

We did get the children to sit still for a couple of seconds to take a group photo.  This is the only ‘straight’ photo, the dozen or so others have various rabbit ears and everyone cutting up.

Joneslings, Pothiettes, and Gaileys
Joneslings, Pothiettes, and Gaileys

 

AGSS Albacore

When the weather outside is rotten, the logical thing to do is find some indoor activities.  Today was such a day so we went to visit AGSS Albacore, an experimental research submarine, in Portsmouth, NH.

Alpha child in a bunk
This is one of the more spacious bunks. Some were in dark corners with equipment dangling over the bunk – close enough that if you rolled over you would knock it with your shoulder or hip.

The main museum is the submarine, with a nearly-full-access self-guided audio tour.  By full-access I mean lying in the bunks, playing with the dive-plane controls, flipping switches, and turning dials.  The engine room is completely open (visually, if not physically, since some of the more dangerous bits have barriers).

Crew's mess; Alpha child fixing her shoe
The crew’s mess doubles as a recreation area. Backgammon and checkers; I don’t think anyone had time to play chess (not a reflection on submariners – I’ve known a few that could beat me handily at chess)

It was cool because it gave an idea of how the crew lived.  Tight quarters everywhere and no wasted space.  Fifty guys shared a couple of toilets; I can’t imagine the smell.

Itty-bitty toilet
Why did they tile the floor?

The submarine itself was an experiment and was refit several times over its lifetime with enhancements like new propulsion, including an uncommon twin screw design.

Twin screws
I read up on submarine design before the trip. Twin counter-rotating screws like this are unusual, but several Soviet-Russian submarines sported them as well. This is one of the only examples in the American fleet.

The experience is much better than touring the USS Nautilus.  The Nautilus is ok if you’ve never seen the inside of a submarine, but everything is off-limits so the tour takes five minutes (or less if you have small children).  The guys in the museum office “don’t talk about the Nautilus” and felt quite a bit of pride in the openness of the Albacore vs. the Nautilus.  We were in there for nearly three-quarters of an hour, and another half hour in the museum shop (including a video of how the got the submarine to it’s present location).

Hiking @ HP

Meghan, Alpha, and I have started hiking the Harold Parker State Forest today.  It’s pretty big, it should tide us over for the spring.

Our first leg was beautiful.

image

Apparently there are beaver in that pond:

image

This tree has seen a little more beaver-love:

image

The trails in the HP connect with a ring of trails around metro Boston, the Bay Circuit.  It’s 200 miles from end to end, so we’ll be hiking it for a few years to come.

Its a nice replacement for our old hiking project, along the Hop River Trail.  The four of us hiked from Willimantic to Manchester over the course of a year, the Bay Circuit should take a bit longer.