How to Make Emacs SSL Work on Mac OS X

If you find yourself on Mac OS X having problems getting SSL working for Emacs under Mac OS X, you might try installing GnuTLS and telling emacs to use that instead.

Why would you need this? In my case I was just trying to get Wanderlust (the best email client for emacs in my opinion) to connect to server that only support an SSL connection.

To Install GnuTLS

In general I recommend the MacPorts package as way to install GnuTLS (and many other useful packages).

Once you have MacPorts installed, you can then install GnuTLS with this command:

sudo port install gnutls

Tell Emacs to use GnuTLS

After that it is simply a matter of telling emacs you want to use GnuTLS by adding something like this to your .emacs:

(setq ssl-program-name "gnutls-cli"
      ssl-program-arguments '("--insecure" "-p" service host)
      ssl-certificate-verification-policy 1)

Odds are excellent it will work with the above setting, but that carries a security risk that someone might be “spoofing” the far end of the connection, but you wouldn’t know about it. For security reasons, you should therefore removed the "--insecure" part, but if you are dealing with self signed certificates that is certainly the lazy way out.

Workaround for dansguardian and iTunes 9.1

The recent iTunes 9.1 update from Apple came with a bug that breaks compatibility with the Dansguardian web content filter and results in an Can’t Connect to the iTunes Store error message from iTunes.

What is happening is that iTunes requests a URL with a dot after the hostname:

http://ax.init.itunes.apple.com./

And dansguardian rejects it as a malformed URL (since it is).

You can test it by typing:

http://apple.com./

into a browser (note the period/dot after com).

If you get a Dansguardian Malformed URL page and running iTunes 9.1, it is very likely your problem.

In any event, here is a quick and dirty source code workaround to sidestep the issue: iTunes.patch.

Note that this workaround only helps a system administrator/IT type who can rebuild dansguardian from source and install it into your production environment.

I tried to take an approach where Dansguardian would see the URL internally as the non-dotted version so that URL regex’s would not be thrown off, but it is possible that my patch breaks some host or URL matching/filtering within Dansguardian (content filtering should be unaffected).

WARNING: Use the above patch at your own risk.

Google Reader’s dirty little secret? You can’t tell when your subscriptions are broken.

Google reader is probably the best all around feed reader there is. Its easy-to-use interface works from just about any device and it makes keeping tracks of many websites a “one stop shopping” experience.

Imagine my surprise when I decided to try out an competing feed reader only to discover a number of my subscriptions had been broken for a long time, and Google Reader never bothered to alert me.

This is a huge issue; Google Reader’s only job is to reliably deliver updates from the websites you choose, and it doesn’t tell you when it fails? The equivalent would be sending emails and not getting “bounce” messages back if the message couldn’t be delivered.

Why were my subscriptions broken? After I subscribed, some of the websites had upgrades that changed the address of the subscription. Then when Google Reader tried to retrieve updates the requests failed and Google Reader was silent. I never knew my subscriptions weren’t being delivered.

This reminds me of the whole Seinfeld “What is a reservation?” routine:

The workaround is to use the Google Reader Trends functionality and and look under the Inactive Tab under Subscription Trends heading. If you have a subscription that hasn’t been updated in more than a few days it probably broken.

You have been warned.

Breaking up with Singleton

Have you ever secretly come to really dislike someone?

 

At first you think they’re great. You might even want to get closer. Then, after spending time with them, you realize they are a little obnoxious. Then, bit by bit, you start avoiding them whenever you can.

Finally, the day comes, when a friend quietly whispers “You know, I can’t stand that person”.

Reaction: Relief

Suddenly you realize you’re not crazy, it isn’t you. It’s them. Really.

Well that day has come for me and the Singleton design pattern. In Steve Yegge’s Singleton Considered Stupid I found a friend to confirm my now near hatred for the so called singleton design pattern.

Singleton and I used to be close. When I first started seeing, and, I’ll admit it, using singleton I quickly began feeling a growing unease. I found myself callously using singleton to allocate an instance, and then never speaking to singleton or the instance again.

Then things went from bad to worse. Once I started testing singleton I noticed how self centered singleton was. How could someone insist that they always be “the only one”?

Finally I started cheating; using backhanded methods to use and discard whole series of singletons. I even always took care to keep each one ignorant of the other. I told myself it was just for “unit testing”, but I knew better.

Now I realize I can’t live like this. It’s over.

Now I will only be design patterns who don’t have to be the center of universe. No more cheating, no more lying.

I hope I never see another singleton again.

A Gentle Introduction to using RSS

I know many people who have never tried RSS, so here is my attempt at a gentle introduction…

The problem: Too Many Places

Too many website to keep an eye on.

If you are like most people, the internet is both a blessing and a curse. A blessing because of the wealth of data available, a curse because it is easy to waste valuable time and get nothing in return.

For example, if you have a single website you love, maybe you check it several times a day. Easily done.

Sometimes you check a website and there is a new article worth reading, but sometimes there is nothing new. A few minutes wasted.

But what if you have three site you love…then it starts to get tedious, you go to one site for the weather, a second for news, a third for your hobby, a fourth for your grandchildren’s school.

The solution: Just one place

What if, instead, you could check one place and see updates appear from any of the sites you are interested in? Then instead of checking three places, or five, or ten, you could check only one but still get the information you want.

This concept is called “RSS aggregation” (RSS is a a kind of a file format — you probably already know what aggregation is).

But no matter what you call it: RSS is a way to know when new articles appear.

Nothing special about it really.

RSS contains the following information:

  • Links to the most recent articles on the site
  • Titles, descriptions, and other details of the articles and the website

How it works

The good news is that you never have to edit or save an RSS file, that is the job of the website, they keep their RSS file updated with the list of the latest articles. All you have to do is tell your RSS client software (more on that later) to do the website checking for you. You do this telling your RSS software the web address (URL) to the RSS file on the website you want to keep tabs on.

The RSS software then checks the website at regular intervals (usually every hour) so you don’t have to.

How to spot an RSS link

What RSS practical, is that most sites now supply RSS. This trick is knowing that is is there.

RSS files come in several “flavors” among them various versions of RSS and Atom. The term XML is also sometimes used to indicate an RSS or Atom feed (technically speaking XML is a much more generic term that also includes a huge number of other things).

So to make a long story short, look for links or icons on web pages labeled like the following:

  • Atom

RSS Client Software

There are many many choices and this article will not cover any specific choice.

Regardless of the RSS software you choose, they all do the same thing: give you the ability to get your updates at one place instead of many.

There are two broad categories: websites and applications.

RSS Client Website

This type of website collects feeds and displays them. The checking happens from the remote website, and the remote website keeps up to date even if you computer is off or disconnected from the internet.

Pros:

  • Accessible from any computer on the internet.
  • No installation needed.

Cons:

  • If you have intranet (not accessible from the internet) RSS feeds, this software will not be able to access it.
  • You must be connected to the internet to even read the headlines.

RSS Client Application

This is software you download, install, and run on your computer like any other application.

RSS Clients that run on your computer

This software runs on your computer and is usually installed as a stand alone application or may even be available as part of your web browser.

Pros:

  • Can read headlines and sometimes even the articles themselves while disconnected from the internet.
  • Can access intranet RSS feeds.

Cons:

  • Runs only on the computer(s) you installed on.

Getting Started

The best way to start is to try one of the many RSS Clients. A list is available at blogspace.

If the above list seems overwhelming, the Google Reader as a good place to starting getting familiar with an RSS Client.

For your first feed, try mine at http://rmore.net/planet/rmore/rss10.xml.

Whatsa matter buddy? Yous gotta problem with Javascript?

After more than 10 years as a professional software developer I have decided that you can write good code in any language…or bad code.

I’ve seen great assembly language, bad Java, scintillating Visual Basic, poor Python, ludicrous lisp, crisp Hypertalk, and even some very good Javascript.

David Chelimsky asks What’s the Problem with Javascript and all I can do is nod my head and state “I concur”.

Javascript allows you to create classes, subclasses, and even has studly regular expression support that would make a Perl user feel right at home.

Many languages suffer from what can only be considered “the AOL” effect. When AOL really took off, (slightly) longer time internet users considered AOL users to be worthless. Some of it was that they didn’t understand [http://www.dtcc.edu/cs/rfc1855.html netiquette], but it was also that their entry onto the internet was considered too easy. They weren’t smart enough, or technical enough, or elite enough to count like ”’real”’ internet users.

Programming languages are the same way. Lisp and C++ users regularly look down on programmers using almost any other programming language because the barrier of entry to Lisp and C++ is high. Mastering difficult languages, and anything else with a high barrier of entry, should result in feelings of pride, but they also often result in feeling of superiority over others.

When I started doing web development, I felt the same way about Javascript. I had mastered C++, Lisp, and many other languages. Perhaps I would do a little client side validation in Javascript, but certainly nothing more.

It turns out Javascript is a pretty nice language. It has a fairly modern runtime: easy, built-in arrays and mapping types, garbage collection, a well designed library, and the ability to manipulate almost anything in a client browser. With a little more study I discovered that the prototype based object system was very handy for developing classes and subclasses and the syntax for doing so was only slightly more awkward than Smalltalk, Java, or C#.

These days I am asked to, and am willing, to write code in many languages I once thought beneath me.

Today if someone were to say about me “Writes good code regardless of language.” I would proud.

Any developer worth hiring should be.

Work Recognition

Right before I left my old job, I got an award for being an “outstanding contributor” in our engineering group. To be honest it felt good to be given an award, and even better it comes with an iPod, an iTunes gift certificate, and a plaque.

You can tell a non-technical person wrote the award letter though, because it didn’t say what kind of an iPod it was. That is like telling a wine enthusiast they will be getting a bottle of “red wine”.

In any event, I was very surprised, and pleased, and yet it immediately brought to mind the times in the past I had not won similar awards. Not that I expected to, but I can always dream can’t I? Part of the reason I left soon after was that they were putting in a new “incentive” system which requires that the vast majority of workers will be told they are average and be awarded accordingly — how is this an incentive system?

As usual [http://www.joelonsoftware.com/articles/fog0000000070.html Joel on Software has a bead on this issue].

Somehow I think that management is caught up in the idea that managing software developers is just like managing a sports team; that the pursuit of excellence is all about “winning the big one”. Maybe there is something about winning it all, but that isn’t how players or teams become great.

Players and teams become great because they love playing the game. They love the feeling of a performing well, or making a great play, or maybe even just tackling someone.

You can read what makes players tick in the old [http://www.findarticles.com/p/articles/mi_m1208/is_35_225/ai_77811426 Sporting News article] from 2001.

To me hockey players are the ultimate love of the game group:

“Growing up we always played baseball, football and basketball. One day, the guys said we should try hockey. Wow! What a blast! You had the hand-to-eye coordination of baseball, the hitting of football and the stops-and-starts stamina of basketball. I thought to myself, `Why should I fool around with the other sports when hockey gives me all of the best of the other sports?’”

–Islanders goalle Rick DIPietro

Every year the [http://live82.ihwc.net/english/ IIHF World Championship] is held. Think of it as a mini-Olympics for hockey. The best hockey players play in the IIHF World Championship every year, even during an era when the US Olympic baskball team can’t even attract players who actually are interested in playing.

Even though I stumble around on my recreational league hockey team, I still love it.

And any decent software developer is the same way. They love writing software. Sure, they work at your company because they need the money, but they write great software because they love doing it. Period.

So as far as I am concerned all these corporate incentive plans, plaques, and awards for working weekends and cranking out ugly code can go into the trash can, the recycle bin, or /dev/null.

But I’m not giving back the iPod.

The Truly Ecumenical Pope

As usual Orson Scott Card says something better than I could ever hope in his World Watch column Why I Miss Karol Wojtyla:

John Paul II, more than any other Pope, united, in feeling if not in fact, Christians who take the divine Redeemer seriously. That’s the “ecumenical movement” that means something, in my opinion.

Even though I am not a Mormon or a Catholic, I feel the greatest kindred spirit with those Christians whose faith demands (quoting Orson Scott Card’s column again)

…some real and rational degree of sacrifice, obedience, and adherence to faith…

so to Karol Wojtyla and Orson Scott Card I can only follow with an simple Amen.

Self critique and the surgeon

How the best surgeons realize they make mistakes and try to figure out how to improve is the subject ofa recent article by the always engaging Dave Thomas of Pragmatic Programmers fame.

As a software developer I find that on every project I look back and I am disappointed by some design decision or implementation choice that didn’t turn out as cleanly as I had hoped.

In my current role as a software architect (a title and position I ironically am not a fan of) I worry that it is easy to unravel the feedback loop as more time is spent in meetings, design sessions, and writing emails. Once you start down the path of less hands-on work how do you truly understand the consequences of the design decisions that have been made so you can improve?

Even the most fundamental truths about software development are easy to forget, like that software development is rarely easy, and shouldn’t be. Just seeing the results from a management point of view, which must happen from time to time in order to effectively delegate implementation, the process looks much smoother, like a mountain range at 30,000 feet. But the smoothness is an illusion.

Management uses phrases like “keeping you hand dirty”, but I still think in terms of being a “real software developer” so I can help make better software.

I only want to work with other developers who are constantly trying to improve. The developers that cause me the most grief are those that are content to do things the same way over and over again regardless of the results.

The good news is that most of the excellent team I work with share my passion for improvement. In the past two years we have gone from non-repeatable builds and misuse of source code control to a smooth build process and logical branch management. Recently we have added RSS feeds of both builds and CVS checkins. To top it off we now have lava lamps to keep tabs on build results (as a mature product we have several active branches/supported versions so we need lots of lamps).

Autopilots off, feedback loop closed, self critique ongoing — who’s with me?

Robert Martin hits the nail on the head about craftsmanship

Robert Martin, of XP fame, really hit the nail on the head in this [http://www.butunclebob.com/ArticleS.UncleBob.TheNextBigThing article].

His basic premise is that what the industry needs is more craftsmanship and professionalism, and not another silver bullet to go chasing after.

I may post his last paragraph to my cube wall. Part of it reads:

I hope the next big thing is the growth of professionalism and craftsmanship, and the realization that these are the attributes, not documented process or raw manpower, that will make our industry productive, accurate, and respected.

Amen.