Yay for kdiff3

March 21, 2011

This weekend I reviewed some old trac tickets and found one that had a fix in a support script, released over a year ago, and a related change that would provide a performance improvement to the web application.  The change, which was never tested, was in a diff file created in the containing directory, so it had no path or file info in it.  The diff was attached to the ticket.  Once I figured out what source file it was, I desperately wanted to have the old Teamware Filemerge from Solaris which afaik no longer exists.  I tried the Apple Filemerge, but if it knows how to do a three-way merge, it wasn’t obvious to me (not that I read any documentation).   I googled and found mentions of a rewrite of the old fm in python but it had been abandoned some years ago.  I googled some more and found a few other tools to try, one of which turned out to be perfect:  kdiff3.

I am so grateful to whoever wrote this tool!  (Joachim Eibl) I’ll have to go back and see if it is shareware or something and send them money if it is. (Done.) It is exactly what I was looking for, and performed the three-way diff, correctly auto-merging the parallel changes when I gave it the common ancestor copy of the file, the version used to make the patch (which I got by applying the patch to the old version referenced in the ticket), and the current version of the file from trunk.  Plus, the interface was easy to use.  I could step through the diffs and select the version that I wanted to keep in the merged result in a way that was very clear.  The task can be inherently confusing, so getting the interface right is quite an accomplishment.

It may not win any visual design awards, but I give it a gold star for user experience.

In case you do not appreciate the significance of a three way merge, where one file is known to be the common ancestor (kdiff3 calls it the “base”), the advantage is that the tool can tell you what lines were added and what lines were deleted.  When you compare just two files, it is not possible to tell whether one file added a new line or the other file deleted that line.  When you compare each to a common ancestor, you can tell definitively what happened.

Share
0

Biking Creek Trails

March 13, 2011

Since I did not exercise even once this week, I decided to see how far I could get biking up the Los Gatos Creek Trail before taking a few streets to get to the Guadalupe River Trail and then seeing how far I could take it towards the Bay Trail.  I got a late start, maybe after noon, took water and a few snacks and money so that if I went too far I could hop on the light rail to get back most of the way home, within 4 miles.  I mapped out my ultimate route on Google Maps before starting, hence the late start.

I am not a serious biker, but I am tempted to see what is just around the next bend, so I went pretty much all the way.  I was tired near the end – when I stopped it was 19.5 miles on my iphone Runkeeper app – but determined to get a glimpse of the bay waters.

The Los Gatos Creek Trail was smooth and friendly, as always.  I’ve biked it in each direction before, it is not that long.  The connection to the next segment was no big deal, but the segment was isolated and not as nice as the main trail.  Then I took a lovely ride through a neighborhood on Willow, then made my way towards Guadalupe River Trail.  This is where it got industrial, very isolated, and I was really glad it was a sunny afternoon.

Finally made my way to Guadalupe River Trail, only to have it blocked a short way towards the Bay by construction and a well-marked detour.  I was game.  Some of it was odd, but there were a few people about, and all the homeless ones seemed happy and friendly, maybe due to the warm sun.

But then the trail dumped out onto a gravel path next to the airport.  And what a stench! I vaguely recall some complaint about a smell near the airport, but wow.  What is going on in the creek there, I wonder?  And why have I never noticed it driving around the airport.

At this point, I kept going in hopes that it would get better.  Surely there is more pavement somewhere?  Nope.  The gravel continued all the way to the Amtrak rails, a short way past Gold St.  There was NO crossing, I could see the bay water, and that is my commute line so I was in familiar territory.

I was exhausted, made my way back south to Tasman where I got on the road and hopped on a light rail back to Winchester, just 4 miles from home.  I wont be doing that ride again.

However, when I looked at the map to see if maybe I’d missed something, I found that I had been tantalizingly close to San Tomas Aquino Creek Trail, which looks like it connects up more tidily to the Bay Trail and also appears to be paved. I had noticed a bike trail parallel to HW237 and followed it on the map to San Tomas Aquino Creek Trail.

So my next adventure will be either (a) the route mapped to the right on google maps with the bike trails shown in green or (b) take lightrail to the Great America station on Tasman and then take the Creek Trail to the Bay Trail and explore the bay, then bike home or take the light rail, depending on how tired I am.

In looking for information about these trails, I found this lovely Walking San Francisco Bay blog.

 

Share
0

Bonobo Handshake

March 5, 2011

I read Bonobo Handshake (on my Kindle) after hearing the author interviewed on some radio show that I cannot recall or find online.  She totally cracked me up describing how she refused to pet the penis of a male bonobo who was waving it around demanding attention before he would participate in some research.  She said something like penis petting was not part of the study protocol.

Bonobo Handshake Bonobo Handshake: A Memoir of Love and Adventure in the Congo is an excellent book, but I did not appreciate just how good it is until near the end.  Woods portrays herself as a shallow adventuress who has gotten in way over her head by following a self-absorbed greek god sort of fiancé into the Congo.  I’m not a fan of shallow adventuresses, but the bonobo subject matter was fascinating.  The human horrors of violence in the Congo and elsewhere, not so much.  Why did she keep switching back and forth from the cool science to the base violence of society?  Couldn’t I just have the science part please?

I never read or watch horror fiction because I have an overactive imagination, and I generally avoid reality horror as well.  But when someone you respect calls you to read some reality horror, and by now Woods had my respect, I feel duty bound to accept the responsibility of knowing.  I did not skim, I read it.  I counseled myself that the book is a memoir, and she obviously experienced this juxtaposition of science and war-torn society.

By the end, I received a truly unexpected gift.  The ear-temperatures study which indicated that chimps and humans react to strangers with fear, while bonobos react to strangers with pleasure, pretty much explains for me the sum total of human history, including all the major religions of the world and the concept of free will and developing good habits to lead you in the right direction when you are too stressed to exercise good judgment.    All that violence is sadly unavoidable as long as we have people freaking each other out and reacting in bizarrely creative and terrible ways.

It makes sense to react to a tiger with fear, but to another person?  We expect the worst and then, sometimes, revise our expectations.  Could we not expect the best instead and then revise our expectations the other way, when indicated?  Apparently that is what bonobos do.

The possibility that people are wired to love the familiar and fear the strange, rather than doing so out of pig-headedness, stupidity, or an unfortunate upbringing is oddly comforting to me.  It explains the uphill battle for goodness.  It does not spell doom.  It prescribes forgiveness.  It elevates the personal quest to form good habits and do good work.  Love thy neighbor because we are all easily motivated by fear and in need of a reassuring gesture and a kind word.

 

Share
0

Fun donation

December 25, 2010

For Christmas this year, I am mostly giving donations in honor of each person instead of giving them stuff.  For one of my nephews and my son, I decided to give to the Libri Foundation, a nationwide nonprofit organization that has donated over $4,000,000 worth of new, hardcover children’s books to more than 2,800 rural public libraries in the United States.

That would have been sufficient, just to give money and hopefully send an ecard saying I had done so on their behalf (some sites do this easily, some do not) but as an alternative to giving money, Libri has an Amazon wish list where you can buy books they have requested in order to stock the libraries!  The list had only 23 books on it, and each had a quantity, usually 5, 10, or 15 copies, and a note saying how many had been purchased to date.

I picked a couple of books that were near the bottom of the date ordered list, meaning they had been on the list the longest.  The first book was a no brainer – a little kids’ Carl book.  Who does not love Carl books?  My kids are 15 and 17 and yet I still fondly remember “reading” Carl books with them when they were toddlers.

The second book appears to be a middle school version of a great book that I read a while ago, I might even own a copy.  The book that I read was Rough Crossings: The Slaves, the British, and the American Revolution, by Simon Schama. Really an excellent read, worth reading a second time if I can lay my hands on it again.

The book on the Libri Foundation wish list is Liberty or Death: The Surprising Story of Runaway Slaves who Sided with the British During the American Revolution. I wonder if my own library has a copy?  I might like to read it, too.

There was no fancy gift card option for this, but I sent an email to the boys explaining what I’d done.  This was one of the most fun donations I made this season.

Share
0