September 5, 2010

The Kinsmans

The Kinsman hiking crewThis weekend, Katy and I decided to continue our assault on the 4000 footers by taking a single day trip up to Franconia Notch to summit the peaks of North Kinsman and South Kinsman. This time, however, we brought friends. My sister, Maureen and Katy's sister Anne both took us up on our invitation to join us. When we were getting ready to leave in the morning, Maureen dubbed the outing "Take your sister to hike day".

Since Labor Day weekend is always a popular time for hiking in the White Mountains, we were hoping to get an early start. The route we selected to climb the Kinsmans starts at the Lafayette Place campground which is also the trailhead for the loop trail up Mounts Lafayette and Lincoln, one of the most popular hikes in all of New England. The lot was filling up quickly when we arrived at 8:30AM, but we easily found a spot and were geared up and on the trail at about 8:45AM. The weather was partly cloudy and in the upper 50s at the trailhead, and the forecast looked pretty reasonable for the rest of the day with only a slight chance of a shower. We were off.

Triple Ninja jumpThe first mile and a half of the hike was a repeat effort of the first section of our climb up Cannon Mountain. We hiked out to the Lonesome Lake, and this time made it to the Lonesome Lake Hut and stopped for a break and a snack. After being warned of colder weather and windy conditions at the Kinsmans' summits by one of the hut's caretakers, we headed back out and continued onward. The trail to the summits was fairly rugged and quite steep in some sections, but overall in good condition and straightforward to navigate. We reached the peak of North Kinsman at the four mile mark and were treated with some great views across to the Franconia Ridge despite the cloud cover. After a quick break and some lunch we continued on to South Kinsman at the five mile mark where the temperature was quite a bit colder and breezy, but not terribly windy. After taking in some similar views, we turned around for the trek back to the car.

We arrived back at the car after our knee pounding descent at about 4:15PM, seven and a half hours total for the ten miler. Overall it was a great day and fun to bring Anne and Mo out for their first two 4000 footers! And finally, proof that Katy and I made it up North Kinsman, and South Kinsman.

July 27, 2010

Mount Moriah

Owen on the trailA lot of things have happened since Katy and I tagged the top of our most recent 4000 footer. Most notably, we got married! After years of dating, a long engagement, and much planning, we finally tied the knot on June 12, 2010. It was a perfect ceremony, a whirlwind reception, and an incredible day. And it probably goes without saying that we've been busy over these last few months! When we originally looked at our summer and possible weekends that we could use for hiking, this past weekend was one of the few that was free. We actually had grand visions and tentative plans of doing a single day, half Presidential Traverse with Patty and Mike. However, when those plans fell through, we decided to knock off a single peak nearby instead: Mount Moriah.

Katy on the trailOn Friday night we threw a bunch of camping gear into the car and took off for the 3+ hour drive to the campground at Moose Brook State Park. The truth is that we almost didn't go at all because my knee has been giving me some significant trouble over the past few weeks. Without a lot of other hiking opportunities coming up, though, I decided to give it a shot and see how it goes. Much of the ride was done in the rain, but when we arrived at the campground after 10PM, the rain had finally stopped. We set up our tent, and tried to get a small fire going, but most of the wood in the forest was very wet, and it was hard to find dry wood in the dark. We got a small flame going for a bit, but quickly retired to sleep after that.

Owen and Katy atop Mt. MoriahBy 10AM Saturday morning, we were at the trailhead for the Carter-Moriah trail in Gorham, NH and began the 4.5 mile trek to the top. The first couple miles of the trail were moderately steep but with a very persistent incline. We reached the minor summit of Mount Surprise just over an hour into the hike. After this, though, we quickly encountered some long sections consisting of large rock slaps that required some considerable scrambling to navigate. The trail was mostly dry which was fortunate because in wet conditions the rock slabs would have been much more difficult to scale. I say mostly dry, though, because we also encountered a few sections at the higher elevations of deep mud. All in all, it was a moderate hike and we reached the summit at about 1PM.

Katy's summit ninja jumpWe ate our lunch at the peak and collected some cloudy views before heading back down the way we came. By that point my knee was quite swollen and sore but I made it down without too much issue. Throughout the whole hike we only saw two other groups on the trail, one of which asked if we were "knocking one off today". Indeed we were! We were back at the car by 4PM and enjoyed an evening by the fire at the campground afterwards to conclude our trip.

With a busy rest of the summer ahead of us, it was good to get another mountain done. Hopefully we'll find some time in the superior hiking months of September and October to knock off a few more!

July 20, 2010

Future Interrupted

I always thought of Java's Future interface as a fairly elegant and effective way of dealing with asynchronous tasks. It's lightweight, gives you a mechanism to check if a task is finished, allows you to block until the task completes and retrieve its result, and also provides a hook to attempt to cancel the task via interruption. When used in conjunction with the various thread pool services in java.util.concurrent package, it becomes a simple, yet powerful tool.

Yesterday, though, I discovered a subtle distinction about the semantic behavior of the Future interface that slightly diminishes its power. I found myself in a situation where I wanted to cancel a Future, but then still wait until its associated task has completed. Initially I thought this might be accomplished with something like this:

    // send an interrupt to the task's thread
    future.cancel(true);

    // block until the task is complete
    boolean finished = false;
    boolean interrupted = false;
    while (!finished) {
        try {
            future.get();
            finished = true;
        } catch (CancellationException ce) {
            // task has been cancelled, handle appropriately
            finished = true;
        } catch (ExecutionException ee) {
            // task completed with error, handle appropriately
            finished = true;
        } catch (InterruptedException ie) {
            // current thread has been interrupted, record and continue
            interrupted = true;
        }
    }
    // re-interrupt this thread if we've been interrupted
    if (interrupted) {
        Thread.currentThread().interrupt();
    }

Essentially, call cancel(true) on the Future in order to send an interrupt to the associated task's thread. Then call get() on the Future in a loop to ensure that the task has properly handled the interruption and completed execution before proceeding. However, the above code does not work as expected. The problem is that once you call cancel() on a Future, the task's thread will be sent an interrupt if it is running, but then the state associated with the task is completely cast aside. Subsequent calls to get() on the same Future will always immediately throw a CancellationException and there is no available mechanism to block until the task's thread has completed handling the interruption and finished its execution.

The worst part about this is that it is not immediately clear from the javadoc for the Future interface that this is the actual behavior. The description of the cancel() method is very clear that if the task has not started, it will prevent it from starting, but if it has already started, it can make an attempt to "cancel" it via interruption of the task's thread. Of course, since in Java interrupting a thread is only a suggestion for it to actually stop what it's doing, there's no guarantee about when or if the task will actually stop unless you handle the interruption properly. Therefore, I hoped that calling get() would wait for the computation to complete, and then throw a CancellationException if the thread was interrupted. After testing it and also digging through the Java source code for the Future implementation, I discovered that that is definitely not the case.

I struggled for a bit to come up with a reasonable alternative mechanism for accomplishing this behavior short of re-implementing my own thread pool and managing the threads myself. Fortunately, after speaking with a colleague, I was pointed to the beforeExecute and afterExecute hooks on the ThreadPoolExecutor. It takes a little more work then I had hoped, but using those hooks allows you to augment the functionality of ThreadPoolExecutor to achieve this type of behavior. I'll leave the details of it up to you.

Anyhow, that's my tidbit for the day. Be careful when playing with the Future!

May 7, 2010

4000 Footers Status

This post is intended to serve as a real-time status report of our quest to join the White Mountain 4000 Footers Club. Personally I've hiked probably more than a dozen of these mountains in the past, but this list will only contain dates and reports of instances where Katy and I hiked the mountain together. I will update it with links to trip reports as we continue to make progress.

MountainElevation (feet)Date of Hike
Mount Washington628807/21/2012
Mount Adams577406/30/2012
Mount Jefferson571206/16/2012
Mount Monroe538407/21/2012
Mount Madison536706/30/2012
Mount Lafayette526010/04/2009
Mount Lincoln508910/04/2009
South Twin Mountain490205/26/2012
Carter Dome483207/02/2011
Mount Moosilauke480206/23/2012
Mount Eisenhower478009/04/2011
North Twin Mountain476105/26/2012
Mount Carrigain470010/13/2012
Mount Bond469808/04/2012
Middle Carter Mountain461007/02/2011
West Bond454008/04/2012
Mount Garfield450004/07/2012
Mount Liberty445907/31/2011
South Carter Mountain443007/02/2011
Wildcat442207/02/2011
Mount Hancock442005/28/2011
South Kinsman435809/05/2010
Mount Field434010/10/2010
Mount Osceola434007/12/2011
Mount Flume432807/31/2011
South Hancock431905/28/2011
Mount Pierce431009/04/2011
North Kinsman429309/05/2010
Mount Willey428510/10/2010
Bondcliff426508/04/2012
Mount Zealand426008/04/2012
North Tripyramid418002/19/2012
Mount Cabot417007/28/2012
East Osceola415607/12/2011
Middle Tripyramid414002/19/2012
Cannon Mountain410011/15/2009
Wildcat D407007/02/2011
Mount Hale405408/06/2011
Mount Jackson405201/29/2012
Mount Tom405110/10/2010
Mount Moriah404907/24/2010
Mount Passaconaway404307/23/2011
Owl's Head402509/02/2012
Galehead Mountain402405/26/2012
Mount Whiteface402007/23/2011
Mount Waumbek400601/01/2012
Mount Isolation400405/12/2012
Mount Tecumseh400304/24/2010

April 24, 2010

Mount Tecumseh

Katy and Owen atop Mount TecumsehAfter a long winter with many changes going on in my life, this weekend it was time to get back to our new constant. Katy and I checked off another mountain in our pursuit to join the White Mountain 4000 Footers Club. This trip was actually a very spur of the moment trip. Our weekends have been very busy lately and when I noticed that we had a free Saturday, and that the weather was supposed to be nice, I suggested that we make an early season trip to the Whites to check off the shortest and easiest mountain on the list: Mount Tecumseh. I knew the trail conditions might be tricky this early in the spring, but after some minor deliberation, we finally decided "why not?" and were on the road at 8AM this morning to make the 2 hour ride to the trail head.

Katy on the trailMount Tecumseh is home to the Waterville Valley ski area and as such, the trail head is actually at the ski area parking lot. Not being a skier at all, I've never been to Waterville Valley but it turned out to be a really nice ride through the valley once we were off the highway on a perfect spring morning. With the busy winter ski season over, it was a generally empty road all the way to the mostly deserted ski area, with only a few other hikers' cars in the lot. By 10:30AM we were on the trail under clear skies and temperatures in the 60's. The first mile or so was an easy ascent on a dry trail with a few easy river crossings. Once we reached the higher elevations, though, the trail was essentially completely covered in a foot or so of hard packed snow. We barebooted all the way to the top without too much trouble, only some slipping, but microspikes probably would have been helpful on the way up. We, of course, didn't have any. We passed several groups on the way up, some wearing microspikes, some not. We reached the summit two and a half miles from the trail head in good time, just before noon, and stayed awhile to eat our lunch.

Katy's ninja pose at the summitI thought the trip down would be a little tricky with the snow pack on the trail, but I actually found it very easy to boot right down. Katy's descent tactics were pretty amusing, though, as she seemed to be in a semi-controlled slide for most of the top half of the trail. We made very good time on the way down; it probably didn't take us much more than an hour, and we were back at the car a little past 1:30PM. We stopped for some food on the way back home, and were back around 5PM.

Fun and easy five mile hike. Perfect weather. Great company. Just what I needed.

March 11, 2010

What's Next?

So what's next for me? I'm happy to say the initial trauma of being laid off is gone, but not without sentiment. Sun Microsystems is the first company that I worked for as a fresh, green college graduate, and I like to think that my experiences there took a very unique path. I started off as a QA Engineer, automating tests for hardware products used directly by paying Sun customers. From there, I transitioned into a tools developer role, developing and supporting an automation framework used by the rest of the QA team(s). My "customers" while in that role were all internal Sun employees. Finally, I moved into Sun Labs on the Project Darkstar team, where technically, as a research project, we didn't have any customers. In practice, though, we provided direct support to users through the open source community. While going through it all, it seemed like a very natural progression for my career; but looking back, I realize that it's a real valuable trifecta of experiences that not many are fortunate enough to claim.

It was very hard for me initially when Project Darkstar was canceled; it was more than just the obvious emotions that come with losing your job though. There's one other experience from my past that I can compare it to. The circumstances were different, but the feelings and the emotions were eerily similar. For four years while at RPI, I was a member of the track and field team. It was more than just an extra-curricular for me, though, it was my primary focus. I was a highly competitive, contributing member of the team, and was one of the team captains in my final season. Each of the four years that I was there, we won the NYSCTC outdoor state track and field championships; I felt like I was part of something great. The 2005 ECAC championships was my final track meet in my collegiate career. Even though I knew going into it that the meet would be my last, I was not prepared for the emotions that I would feel afterwards. For four years I was part of something great, and just like that it was over. I still remember lying in bed that night, surprised at my own tears.

With Project Darkstar, I also felt like I was part of something great. Not only was it a great project, not only were we driving towards a goal that had never been achieved before, but we were also a great team. There were such a unique set of personalities on that team that all meshed together to form a sum greater than its parts. Not only that, but we were nestled inside of Sun Labs, which is probably one of the smartest collection of people you'll ever find. The way that it was all torn away from us, so harshly and abruptly, and when we were so close to our goal, is what made it so difficult. Once again, I had established my place in something that was great, and just like that it was over.

It's time to move on, now, though. If I've learned anything from my past it's that there's always something great waiting in my future. I've accepted a new position as a software engineer at Nokia and am actually very excited to begin work on Monday. I'll be working on some scalable caching and indexing infrastructure for their service platforms, and am looking forward to a new and interesting challenge. I also plan to continue working on Project Darkstar's successor, RedDwarf Server in my own personal free time. I obviously expect my available time to devote to that effort to be considerably more limited than it has been, however.

Things are looking up, and I'm looking forward to my next great thing.

February 18, 2010

Oh LaTeX how you taunt me

Here's a good one. Since I'm currently unemployed and looking for a job, naturally I've been sending resumes out. I've used LaTeX to generate my resume for years now, and it has always worked out quite well. However, today I had a need to print out my resume, and when I did, I noticed that the font seemed slightly too small, and that the right margin seemed a bit too big. It looked fine on the screen in my PDF viewer, but not on the physical printout. Hmm. As it turns out, I accidentally generated the PDF file with A4 size paper and all of the electronic versions I have sent out thus far have been this A4 version. Grrrr!

I must have come across and handled this issue before, but at least on my Ubuntu installation, PDF documents generated by sequential latex, dvips, and ps2pdf commands default to A4 size paper. In order to get the correct US style letter paper, I have to explicitly use the "-t letter" option in dvips. After rooting around a bit, the command "texconfig paper letter" has changed my default system paper size for dvips, dvipdf, xdvi, and hopefully I'll never make this mistake again!

P.S. Metric system? One day we will give in to your logical structure and simple unit conversion. Clearly, though, that day is not today.