Sunday, December 19, 2010

The Unfettered Mind


During the past month or so, I've been reading books like Sun Tzu's The Art of War and Benjamin Zander's The Art of Possibility. Reading the Art of War gave me a much deeper appreciation for Eastern philosophy and I find myself recognizing a lot of those same philosophical ideas in The Art of Possibility as well which has gotten me even more interested in continuing on with this reading trend.

From what I understand, Miyamoto Musashi, like Sun Tzu, is another man who many consider to have been a "Zen Master" and so I'll be reading his book over the holiday: The Book of Five Rings. But before I read that, I plan on first reading The Lone Samurai: The Life of Miyamoto Musashi to get a broader understanding of the man. What I really liked about the copy of The Art of War that I picked up (Understanding the Art of War by Robert Cantrell) is that the author not only included the English translation of the original text but also explanations of the history pertinent to understanding the text allowing me to soak up quite a bit more value than I would have just reading the raw English translation. Likewise, I suspect that starting with The Lone Samurai might help me later in understanding Miyamoto Musashi's Book of Five Rings.

A third book that caught my eye for the holiday is The Unfettered Mind by Takuan Sōhō, another famous Zen Master who is rumored to have advised Miyomoto Musashi among others.

Maybe one day I, too, will have an unfettered mind (right now it is quite fettered).

Monday, December 13, 2010

Assignment: Apologize to someone you have wronged

This past Friday, on our walk back from lunch, Miguel told me about the latest assignment given to him by his teacher and mentor, Benjamin Zander, the conductor of the Boston Philharmonic. The assignment was to pick someone you have wronged and apologize to them.

For those who don't know, Benjamin Zander is the author of the book, The Art of Possibility, a book which I have been reading the past week or so. The idea of this book is to change your perspective on life by teaching you to see things in a positive light and thus present you with a world of possibility where you can accomplish anything you set your mind to because you are no longer held back by negative thinking (fear of failure, criticism from others, and most importantly, criticism from yourself).

To continue on with my story, as I was laying in bed last night after having read a few more chapters in The Art of Possibility, I was reminded of Miguel's assignment and I began to wonder: if I was given this assignment, who would I apologize to?

I thought of 1 person in particular and a community of users and decided to apologize to them all.

Lennart Poettering

Some of you might recall a series of rants about PulseAudio that I wrote a couple of years back. While it was not my intention to insult Lennart personally, it is obvious that I did. I had let my anger and frustration rule my actions and ended up attacking PulseAudio in ways I should not have. I should have, instead, been more respectful, more understanding and more patient. Attacking someone's project often results in that person feeling personally attacked. I should know this as well or better than anyone because I'm one of the authors of the most widely attacked projects in the Free Software community: Evolution, Mono, and Moonlight.

These days PulseAudio has been working well for me and that is a testament to how hard working Lennart and the other PulseAudio developers are.

Thank you, Lennart, for your hard work on Pulse Audio and please accept my sincerest apology for attacking your project and in so doing, insulting you. I was wrong. I should have, instead, come to you (or the bug tracker) and explained the problems I was experiencing in a polite and respectful manner rather than unleashing my frustrations on the project.

I hope we can meet in person at a future Linux or GNOME conference where I can give you a hug (and who knows, maybe even a beer).

Evolution Users

In the course of the 6+ years that I worked on Evolution, there were a number of occasions where I took criticisms in bug reports and the mailing-list as personal insults and lost my temper, attacking back. At one point, Nat Friedman reminded me that I should not take criticism of Evolution so personally and that the reason users criticized Evolution was because they cared.

In the early part of 2007 I moved over to the Mono team, giving me a fresh start. I decided that I was going to be a new me and really take Nat Freidman's words to heart. I'm happy to report that not only have I been successful in not taking criticism as personally and seeing criticism of projects I work on in a new, more positive light, but I have also been a much happier person because of it.

For those Evolution users out there who I have mistreated, I am truly sorry and I hope that my actions over the past 3 years has demonstrated my sincerity.

Wednesday, October 27, 2010

Lessons in Freedom

In the first episode of the second season of Kung Fu, there exists a dialog between a young Kwai Chang Caine and one of his instructors, Master Po which I think teaches an important lesson in freedom and what it means. I think there are a number of people in the Free Software community who are in desperate need of learning this particular lesson.

Master Po: What have you found?

Young Kwai Chang Caine: A spider, master. It has trapped the fly. Should I destroy his web?

Master Po: Why?

Young Kwai Chang Caine: So that it will not make a prison for other living things that were free.

Master Po: Look more closely, grasshopper. Were you to destroy this web, would not the spider, knowing no other way, build another?

Young Kwai Chang Caine: Yes, but I cannot kill the spider.

Master Po: Look more closely still. Is not the spider also trapped by its own web?

Young Kwai Chang Caine: Yes, but if I do nothing, it will capture more living things, make them prisoner, and kill them.

Master Po: You are concerned, then, with the fly to which nature has given wings so that it might move around freely?

Young Kwai Chang Caine: It is cruel to see it made a prisoner.

Master Po: Ha ha ha. Still you do not see. Which is truly the prisoner? The fly, which, moving freely enters unknown danger? Or the spider, which, having spun its web, remains, never knowing the pleasure or the danger of the fly?

Thursday, September 2, 2010

Microsoft Double Rainbow!

Microsoft has just created a new commercial for its Windows Live Photo Gallery software that plays on the "Double Rainbow!" stoner guy. I have to give them props for trying to be hip and cool, but I'm too busy laughing my butt off right now. You've got to see this:

What I want to know is what kind of camera is that guy using? Never seen anything like it. A friend suggested it was this antique digital camera, but I'm not convinced. If you have any idea what that camera is, let me know in the comments - it is gonna bug me for days until I know what that was!

Tuesday, August 17, 2010

One Week With Android

Well, it's been just over a week since I got my Samsung Captivate (which is selling for $50 right now!) and I figured I'd share my experiences switching to it from my old iPhone 3G. Sadly, I have to say it's still a bit rough around the edges. I've had a number of problems with it, but none of them have been insurmountable.

The Good

Even though I'm still on Android 2.1 (FroYo, aka 2.2, won't be pushed on my phone until September or so), I've had no problems at all with performance. Everything starts up pretty quickly for the most part (occasional lag spikes, but I got those on my old iPhone as well). The 2.2 update will supposedly make my phone even faster, so I'm excited about that.

All the apps I cared about are available in the Android Market (things like a twitter client, Amazon shopping app, Google Maps (duh), Fandango and a handful of others). I was also able to find apps like Adobe Reader and Quickoffice for loading pdfs and MS Office documents (which is handy and something that I never found on iPhone).

Likely due to a higher-resolution screen, the YouTube video quality on my Samsung Captivate also exceeds that of my old iPhone 3G. Not sure how it compares to the iPhone 4.

What I really like about the Android is that editing my Google Contacts auto-updates my phone within seconds of making the changes which is really nice. I didn't pay for the MobileMe service for iPhone (which supposedly adds this feature), so it's a nice bonus that has saved me a bit of time and trouble already.

The Bad

While the music player on Android isn't bad (it's quite usable), it lacks some finishing touches that Apple put into theirs. For example, iPhone's music player remembers the most recent audio track and position you were listening to when you launch it. No amount of browsing your music collection will confuse it. This is not true with Android's. A "Go back 30 seconds" button would also be a really nice addition to Android's music player that iPhone has and I've found to be quite useful over the past 2 years.

When making a call, the iPhone's display is much much nicer than Android's and the Contacts app itself is more intuitive. I don't even understand what most of the tabs are in Android's Contacts app, for instance.

The Ugly

The following 2 problems are the absolute worst usability problems I have encountered, and they are pretty bad.

It took me a while to figure this out, but when you plug your Android phone into your PC, the PC won't see your Android device over USB Mass Storage at all until you open up your phone's "Notifications" area and tap on the notification saying something about connecting via USB. Once you do that, it opens up a dialog with the option to mount the drives. Only after you take these steps does the Android device show up as a USB Mass Storage device on your PC. This is just awful. Why are these manual steps even needed at all? If I have edited my phone's settings and selected "USB Mass Storage", it should just assume that's what I want to do when I plug it into a PC. There's no good reason for it to make me manually go through those steps. It also seems I'm not the first to be confused by this as there are a number of users complaining about this on various Android forums. From what I've seen, things have gotten better in Android 2.2 (it no longer makes you navigate to the "Notifications" area, but it still requires you to interact with a Mount/Cancel dialog).

The above photograph is what happened when I tried to place a call to about half the people in my contacts list. Yea, that's right, it crashed. After a bit of fiddling, I was able to figure out what it was about those contacts which caused the problem and submitted a bug report. Luckily, the workaround that I found was trivial and so I just loaded a web browser and edited the Birthday field info for those contacts and waited a second or two for the Android to auto-sync. Had I not been able to find a solution to this problem, I would have returned my phone and gone back to iPhone.


Android has a lot of room for improvement (buggy, unpolished), but if you are a Linux Desktop user like myself, you'll probably feel right at home.

Tuesday, August 10, 2010

Using Git

Now that Mono has moved to GitHub, a number of contributors (including myself) have been somewhat lost, not knowing how to properly use Git. So today, I'm recommending a book to help all the lost souls out there get comfortable with using Git.

As many long-time programmers probably know, O'Reilly books are top notch. Most probably also would not be surprised that O'Reilly has a book covering Git: Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development.

Don't let the bat scare you.

Friday, August 6, 2010

New Phone (Android)

Ever since the first Android phones came out back in October 2008, I've been keeping an eye on their progress. I didn't care for the original HTC Hero, but the newest phones based on Android 2.1/2.2 look very impressive. Now that my iPhone 3G contract is up, I decided I'd get one. Since I'm on AT&T and wanted to stay with that provider, I went with the Samsung Captivate and a screen protector for it. My friend/co-worker, Michael Hutchinson, recently bought a Samsung Vibrant (he's on T-Mobile) and has been very happy with it. Another friend/co-worker, Gonzalo has also been happy with his switch to the Captivate on AT&T, so I expect that I'll be pleased as well.

One of the reasons I decided to get an Android phone is that the Mono team is working on MonoDroid, a port of Mono to Android phones. While I'm not on the team working on the port, I am interested as a potential Android developer in using MonoDroid to write some of my own applications for Android phones.

10 years ago, when I first started working for Helix Code on the GNOME desktop for Linux to help make Linux usable for average Joes, I never expected that I'd ever have a phone that ran Linux! Especially a Linux-based phone that is taking the smart-phone market by storm! These are very exciting times for me, and I'm sure for the Google folks working on the Android project!

After I get my feet wet for a week or so with using my new Captivate phone, I'll try to write up a review of what I think, so stay tuned!

Wednesday, August 4, 2010

Sleeping Bags for Backpacking

Some friends and I have been talking about going on a multi-day backpacking trip (first one will likely be an "easy" trip, where we'll almost be able to drive up to the camp site, just to test everything out, etc). Most of us don't have the proper equipment (anymore) and things have changed a lot since the last time (in my boy scout days, oh-so-long ago) I've been out on a multi-day camping trip (never really done the backpacking thing before), so I've been doing a bit of research.

First and foremost, I knew I'd need a sleeping bag so the first step was deciding what kind of temperature rating I'd need my bag to meet. Did a bit of reading and discovered that starting this year, most sleeping bag makers in the US have switched over to the European standard for rating sleeping bags. This was comforting news (hah, bad joke) in that comparing sleeping bag temperature ratings would be a lot more like comparing apples to apples (previously each manufacturer had their own method of measuring this, so comparing bags from different makers was impossible to do).

Since my friends and I will likely be sticking to the North East, and probably in the late-spring to early-fall time frame, I estimated that I wouldn't want a bag rated for anything warmer than 30 degrees. Even in mid-summer, the North East can get down to the low 50's and so a 40-degree bag would barely be warm enough. Note that the temperature rating on a sleeping bag is often the "survivability" rating as opposed to the "comfort" rating, and I prefer to be comfortable! Since I'm prepping for the possibility of backpacking trips in the spring and fall as well, I figured a 20-degree bag would be a safer bet.

Next, I had to decide on the type of filling so I read up on the difference between synthetic and down filling. To sum up, here's what I learned:

  • Down is often lighter, especially the higher the fill rating (e.g. you might see things like 650-fill or 800-fill - the higher the fill rating, the less down you need to occupy the same space, resulting in a lighter weight bag).
  • For down-filled sleeping bags, duck vs goose doesn't really matter, what matters is the fill rating.
  • For damp environments, synthetic is often a better choice because synthetic-filled sleeping bags only lose 15% of their effective warmth when wet, while down-filled would lose 100%.

I wanted to keep my expenses below $200 if I could, so with that in mind I did some searching to find some sleeping bags in that price range with good reviews and I came up with the following bags:

Both bags were very highly rated in various magazines and online reviews that I had seen and both were around $160 for the Regular size (up to 6') and $170 for Long (fitting up to 6'6", which is what I needed). There are some cheaper bags, but most of them aren't as lightweight (under 3 lbs!) as either of these 2 bags and/or they didn't get as good a review (or didn't have any review that I could find). If you want cheap, you could go to Walmart and find sleeping bags for as cheap as $10, but I'm not sure I personally trust that any of those bags will be a good long-term investment. Maybe I've just been bitten once too many times by the lure of the uber-cheap.

In the end, I decided to go with the Kelty Light Year as it was a little lighter (4 oz) and packed a little smaller. While the dampness drawback did/does concern me a little, there are easy ways around that. Wrapping your sleeping bag in a plastic (or otherwise waterproof) bag while it is packed away in your backpack and not pulling it out until it is inside the tent should suffice in preventing it from getting wet, even if you have to pitch your tent in the rain.

Thursday, July 29, 2010

Re: Red Hat, 16%. Canonical, 1%.

While some people are busy complaining that Canonical doesn't contribute as much as others, I'd like for everyone to take a step back and ask themselves, "what would Gunny say?"

I'll tell you what he'd say. He'd say,

Hmm, that's interesting. Do you know what makes me sad? YOU DO! Maybe we should chug on over to mamby-pamby land where maybe we can find some self-confidence for you, you jack-wagon! Want a tissue?

After he finished ripping someone a new one, he'd point out that in that very same GNOME Census slide deck, I am ranked #8 in the top contributors list and I haven't contributed much of anything to any of the core GNOME components in about 5 years.

Yeah, that's right you cry babies, I put all y'all to shame.

On a more serious note, for better or worse, we all knew what we were getting into when we decided to take up the Free Software baton and start running with it. This is just how Free Software works. Don't like it? Cry me a river.


Update: It seems my post here has been misinterpreted. Allow me to try and rectify this. I'm not pissed off at Greg for voicing his opinion. We all do it. I'm just making a mockery of the whole situation because I was itching to trollcat and because I wanted to pat myself on the back for being #8 on the individual contributors list in terms of commits (as meaningless as that is). Also because I was up late last night and saw that Geico commercial with R. Lee Ermey which just cracks me up every time I see it.

Monday, June 28, 2010

Early Morning Sunrays

IMG_1886, originally uploaded by jstedfast.

Took this photograph around 6:30 in the morning on June 18th. The way the sunlight could be seen streaking through the trees and the complete stillness of the water was surreal, so I had to take a photograph of it ;-)

Friday, June 25, 2010

Dawns of June

Dawn at Wollaston Beach, MA on June 4th.

Dawn at Core Creek Park in Bucks County, PA on June 7th.

Dawn at Milton Pond, NH on June 17th.

Dawn at Milton Pond, NH on June 17th.

Saturday, May 22, 2010

Reflecting on 10 Years at Ximian

IMG_1047, originally uploaded by jstedfast.

Today marks my 10th anniversary since I was hired at Helix Code to work on Evolution.

In that time I've gotten to work closely with and learn from some of the most talented developers in the Free Software community including Michael Zucchi, Miguel de Icaza, Federico Mena-Quintero, Chris Toshok, Larry Ewing, Michael Meeks, Dan Winship, Radek Doulik, Joe Shaw, Vlad Vukićević, Dave Camp, Dan Mills, and many others (too many to name!).

Back in the early days of Helix Code/Ximian, we all worked tirelessly to put together the very best GNOME distribution we could and make Evolution the very best groupware client we could.

We had big dreams and I like to think we succeeded. GNOME has become mainstream and the Linux Desktop can most definitely be measured as a success.

Of course, we couldn't have done it without all the help and hard work from the entire GNOME community.

Today, a younger generation of hackers are taking up the reigns to make GNOME awesome with things like the Paper Cuts project by David Siegel's team at Canonical and the work being done by Red Hat on the new GNOME-Shell.

I'm still working with a couple of my old Evolution teammates like Larry Ewing and Chris Toshok on the Moonlight project in the hopes of making it possible for Linux Desktop users to view Silverlight content on the web. We've been making great progress with implementing Silverlight 3.0 and 4.0 features in svn and I've got some accomplishments on that front that I should really blog about but I've just been so busy.

Much love to all you GNOMEies and thanks for all the support and love over the past decade!

Saturday, January 30, 2010

Weird bugs due to gcc 4.4 and strict aliasing

I was just running the unit tests for GMime and I got a couple of failures on my openSUSE 11.2 machine that I have never gotten before. I started debugging and I noticed something very odd. One of my functions that returned a linked-list of 'word' tokens was returning NULL for something that it should not be returning NULL from, especially since I had just stepped through that method and seen with my own eyes that it was creating and appending nodes to my linked list as it should!

At this point I split out a tiny test case:

#include <stdio.h>
#include <stdlib.h>

typedef struct _node {
    struct _node *next;
    int value;
} Node;

int main (int argc, char **argv)
    Node *list, *node, *tail;
    int i;
    list = NULL;
    tail = (Node *) &list;
    for (i = 0; i < 10; i++) {
        node = malloc (sizeof (Node));
        node->next = NULL;
        node->value = i;
        tail->next = node;
        tail = node;
    if (list == NULL)
        printf ("oops, list is null???\n");
    return 0;

I then built this test program using gcc -Wall -g -o list-test list-test.c. When I ran the program, no error.


Luckily I thought to rebuild with -O2. This time when I ran my test program, it printed out the error I expected. The list was NULL.

Doing a bit of research suggests that gcc 4.4 has decided to enforce strict aliasing for -O2 and higher, which explains why it works without -O2.

Oddly enough, I get no strict aliasing warnings from gcc even when I use -Wall -O2.

So be warned... gcc 4.4 may break your perfectly valid code in mysterious ways.

Update: Looks like MySQL had similar problems and according to this article, it is suggested that the gcc developers have interpreted the c99 specification far too strictly.

Update 2: Josh's comment had an excellent explanation of the problem this code hits, so I thought I'd add it to my blog post for anyone who may otherwise miss his comment:

I imagine that gcc's aliasing thinks that dereferencing a Node* can only write to Node objects, so it won't have any effect on Node*s like list. Thus it thinks that list is never modified in that function, and it propagates the NULL constant throughout.

I also liked Josh's explanation of why the above code works (since a number of people have been confused by it already, I'll post that too):

The only reason it "works" in the -O0 case is because the next field happens to be the first field, as Fabian pointed out. The first time you write to tail->next, you're writing to &list with no offset, so list happens to get the value of node. When next does have an offset, then the value of list is not changed, but something else on the stack after it will be clobbered.

Code Snippet Licensing

All code posted to this blog is licensed under the MIT/X11 license unless otherwise stated in the post itself.