MiddleClickClose Updated For Future Safari Versions

08/31/2009 Update: For Snow Leopard compatibility, see here.

Yesterday Apple release Safari 4.0.3 which, of course, broke MiddleClickClose. Again. The problem lies in the file Info.plist that is part of the plugin. From what I read about SIMBL, good practices said that you should include a key called MaxBundleVersion whose value was the internal version number of the app you were patching. The problem is that every time Safari gets updated, Apple increments that number and SIMBL won’t load the extension any more, since it proclaims that the maximum version of Safari it should be loaded with is the previous version.

I usually play catch-up with Apple and get MiddleClickClose updated a day or two after a new Safari ships. I’ve decided to stop that and have removed the MaxBundleVersion from the Info.plist. This is, after all, a dirty hack, so why not make it even hackier?

If you re-download and re-install, you shouldn’t ever need to update it again. If you already have it installed, you can just edit the Info.plist file that will be in ~/Library/Application Support/SIMBL/Plugins/MiddleClickClose.bundle/Contents, removing the two lines that look like this

<key>MaxBundleVersion</key>
<string>5530.18</string>

Here are the new downloads

Observations From WDW

Last Saturday night we got back from our latest trip to Walt Disney World. We spent a week there, like we do every year, but this year there were several differences. First, we usually go in April/May or October, but this year we went in July. Second, we usually stay in a Disney resort, but this year we stayed off-property. The reason for both is that my parents had a condo about six miles from WDW for the week of July 18 and they asked us if we’d like to go down and use the second bedroom. We had actually decided we weren’t going to be able to afford a trip this year, but we figured since we wouldn’t have to pay for a room, we could probably swing it.

We had a lovely time, though it was hot, hot, hot, rainy at times, and far more crowded than we are used to. I made several observations while there, and I thought I’d write them down. Here, then, in no particular order, are things I observed last week.

Magic Kingdom

  • Having Space Mountain and the Tomorrowland Transit Authority closed at the same time makes Tomorrowland not as much fun.
  • I still adore the Carousel of Progress, but the “future” scene at the end needs updating. “I suppose you’re going to tell us about how you didn’t even have a car phone!”
  • Spectromagic (aka The Parade That Refuses To End) can trap you. We got trapped in certain areas of the MK three times while there.
  • Spectromagic does not need to be presented twice a night, within two hours of each other. Twice a week would be better.
  • Jack-ass teens who fake getting out of an Indy Car at the Tomorrowland Speedway, thus making my son have to wait for another car, should be bludgeoned.
  • Staring at your video camera while filming your ride on the Mad Teacups is a sure way to get motion sick and toss your cookies. (I realized what was happening just in time to keep from hurling.)
  • The Peter Pan ride always has a bizarrely long line, given that the whole ride is somewhat lame, and only about two minutes long.
  • The changes to the Haunted Mansion they made last year were fabulous. I particularly like the staircase room.
  • The Jungle Cruise is so much better at night.
  • Great skippers really make the Jungle Cruise great. “If you’ve enjoyed this trip, my name is Joseph and this has been the famous Jungle Cruise. If you didn’t enjoy it, my name is Felipé and this has been Pirates of the Caribbean!”
  • The Enchanted Tiki Room was so much better before they “improved” it by adding Iago and Zazu.
  • The frozen orange juice you can buy from the counter next to the Tiki Room is still the best and goes down so nicely on a hot day.

Epcot

  • I really don’t like most of the changes they made last year to Spaceship Earth. Jeremy Irons was a better narrator than Judi Dench and the script has been dumbed-down so much that it’s insulting. I do like seeing Woz, though.
  • The descent at the end of Spaceship Earth is a stupid exercise in killing time. There used to be scenes of “the future” of communication, but now it’s a dumb glimpse of “some amazing technologies we happen to know about.” Yeah, like flying cars and autonomous robot servants. Nothing real in that animation; just clichés from sci-fi films.
  • I liked “The Living Seas” far more than “The Seas With Nemo and Friends.” The inside was better when it was “Sea Base Alpha.”
  • Turtle Talk With Crush is amazing tech.
  • Soarin’ is one of the best rides they have.
  • On two trips now, whilst riding Living With the Land, there have been people in the lab at the end of the greenhouse. I always wondered if they actually did anything in there.
  • The old Figment ride in Journey Into Imagination was a lot better than what’s there now, even if the current ride does feature Eric Idle.
  • Ellen’s Energy Adventure still makes me laugh, especially the pre-show.
  • Even though Mission: Space is amazing tech, I miss Horizons.
  • Even though Test Track is a fun ride, I miss the whimsy of World of Motion.
  • It is absolutely criminal that in the American Adventure pavilion at World Showcase the restaurant is burgers and fries that are no different that what you can find at any counter service restaurant all over WDW. We have steaks and such in this country that would be tasty to visitors.

Disney’s Hollywood Studios

  • Disney’s Hollywood Studios is a pale reflection of the Disney/MGM Studios that opened 20 years ago this year. Yes, the Tower of Terror and Rockin’ Rollercoaster are awesome, but all the TV- and movie-making are completely gone. It’s just a movie-themed park now, instead of a working studio with rides and shows.
  • Toy Story Mania is absolutely incredible. Get there early and get a FastPass.
  • I hate that they destroyed Residential Street and most of the backlot in order to bring in the Lights, Motors, Action stunt show. It is so hot watching that show in July.
  • The American Idol Experience was kind of lame. Why is Disney/ABC paying Fox for the rights to do that?

Blizzard Beach

  • We haven’t been to Typhoon Lagoon in years because Blizzard Beach is so great.
  • If the water level is too low in the lazy river at Blizzard Beach, your knees will scrape the bottom, which hurts. A lot.
  • Young, teen-aged girls from other countries are really into wearing amazingly small bikinis, some of which can only be described as “butt floss.” Did I mention that these bikinis were amazingly small?
  • Teamboat Springs at Blizzard Beach is worth whatever wait you have to put up with. It’s a long, fun ride.
  • I’m still too chicken to get on Summit Plummet.
  • They really need more than one conveyance to the top of the mountain. It takes a long time to get on the chair lift and then several minutes to get to the top. There are staircases, but it’s a long way to the top, or even the middle where some of the rides are, when you have to take the stairs.
  • They should keep all the pavement constantly sprayed with water. In the summer, that pavement gets incredibly hot and since most of the patrons are barefoot, it hurts.

General

  • When it’s 95 degrees with 85% humidity, you sweat instantly upon waling outside.
  • If you don’t eat meals inside the parks, you can save a fortune.
  • A one-day, one-park ticket is absurdly expensive at $75.

So, that’s pretty much it, though I’m sure I missed a few things I wanted to mention. We did miss not being at a Disney Resort some, because of the perks you get. We like to use the Extra Magic Hours, and it’s nice letting someone else do all the driving. But we still had a great time, and are looking forward to our next trip, which we hope will be in 2010.

Scala Limerick

On the Java Posse mailing list, there’s a message thread consisting of limericks about Scala or other languages. While I don’t claim to be a poet, here’s my submission

There once was a lang called Scala
That was sweeter than juice from Odwalla
Whether foldLeft or foldRight
It it such a sight
To see Lists reduced down with such might!

I won’t win any prizes for that one, but I thought it was somewhat clever. Of course, ten seconds after posting it, I realized that it’s not a true limerick, because the fifth line is supposed to rhyme with the first two. Oh well. There goes my career as a poet.

The Never-Ending Project: Completed!

IMG_0350-1

The Original Satellite Spigot

A couple of years ago, I built the device shown in the photo on the right. It’s an extension to our back yard garden hose, which is down 15 stairs, up to the deck. That project didn’t take any time at all, and has worked nicely. This year, my wife wanted a similar device in the front yard. The reason it was necessary can be seen in figures 2 and 3. We have some unruly bushes that make it extremely difficult to get to the spigot. I decided to create another of my satellite spigots right next to the stairs on the front porch, which would make it very easy to use the hose.

This project started about two months ago. I went to Lowe’s to get the parts, but didn’t feel like building it that day, so I put it of for a few weeks. When I finally did get around to building it, it was one problem after another. First, there was a problem with the coupling between the hose and the galvanized pipe. That allowed me to procrastinate another couple of weeks. This past Saturday, I went to Lowe’s again to get a new coupling. I brought it home, re-taped the galvanized pipe’s threads and attached the coupling. I then attached the hose to the coupling and turned on the water. Immediately it began spewing from somewhere around the coupling. Upon closer inspection, I could see that the leak was actually in the hose. It turns out that the brass end of the hose is not a single piece of metal. It’s actually two pieces crimped together, and in my zeal to make the connections as tight as possible, I had broken that seal.

Sunday, I went to Lowe’s, again, to get a new male hose-end to fix it. I also had to re-buy the metal straps I had bought to attach it to its pole, because in the weeks since my last attempt I had lost them. (And those were not the original metal straps, either. The first ones I bought were far too large…) After I got home, I cut off the last 2 inches or so of the hose with a serrated bread knife attached the new male end, screwed it into the coupling; tight, but not too tight. Then it was time to test it out. Again.

Huzzah! It works! No leaks!

After getting the seals right, all that was left was to attach it to the metal pole I had driven into the ground. That went quickly, and the project was finally complete.

MiddleClickClose for Safari 4.0.1

A day or so ago Apple released Safari 4.0.1 and bumped the version number in the process. Safari 4.0 was 5530.17, while Safari 4.0.1 is 5530.18. After installing the update, MiddleClickClose was still loading, even with the minor version mismatch. I don’t know if Safari only looks at the first part of the number when specified in an Info.plist for MaxBundleVersion, but just to be on the safe side, I bumped it to 5530.18 and have re-released it. If it’s working fine for you, don’t bother getting this version. That’s the only change I made.

Picking the Bones At An Estate Sale

I just got back from an estate sale in my neighborhood. The people whose belongings were being sold were an elderly couple who lived just around the corner from me. I never met them, but I knew who they were. They both appeared to be quite old, but both were always working in their yard to keep it immaculate. They always had something blooming, no matter the season.

And now they’re gone. The gentleman passed away some time last year; I don’t know the details of his passing. The wife is still alive, but living in Texas in a “retirement community” near her daughter. I’m told she’s struggling with Alzheimer’s.

And so this weekend her family came to sell off everything that was left of their lives together, in order to get the house ready for sale. I don’t mean to cast aspersions on the family, as I know that these things have to be done, but while I was looking through what was left for sale, I got very sad. Scattered around were all sorts of bits and pieces of their lives that showed what they liked and what they liked to do. The wife, for example, apparently loved to quilt. She had what appeared to be about 30 – 40 years of quilting magazines in the basement. There were numerous pieces of cross-stitch and embroidery on a table, too.

It looked like the husband had been in telecom, as there were spools of wire and loads of antiquated telephone equipment in the basement. There was also a framed award from 1980 presented to him from his employer. One thing of interest to me was a booklet produced by the Travelers insurance company for their employees in 1972, detailing their policies on reimbursement for moving and living expenses. I don’t know which of them worked in insurance.

So what did I pick for myself? I have a thing for food photography from the 1950’s and 1960’s, and there was quite a collection there. I bought an almost-complete set of the Woman’s Day Encyclopedia of Cooking series from 1962; it’s missing the last three volumes. I also bought a 1972 edition of the standard Better Homes & Gardens cookbook (red and white checks) and a cookbook from 1974 called “Favorite Recipes of America’s Home Economics Teachers.” One non-cookbook also made it into my hands. It’s a book called “Papa Was a Preacher,” which was published in 1944. It’s a memoir of the youngest of six children of a rural minister. She wrote the book with the intention of dispelling the myth that being a minister’s child is a joyless existence. What was also neat about this book is that on the copyright page the publisher explained how “Wartime Books” were being printed in ways that conserved paper and copper for the war effort.

So why did this make me sad? I think it’s because these two people spent two lifetimes together collecting all this stuff. Now one is dead, the other can’t be far behind, and all of their things are being scattered in every direction. I know once you’re gone you can’t keep your stuff, and children don’t always want to keep the things of their parents, so I suppose selling it certainly beats throwing it away. Still… I felt sad and somewhat guilty to be picking through their lives.

Apple Doesn’t Seem To Want My Money

Yesterday, like six billion other people, I tried to pre-order a new iPhone 3GS from the Apple Store online. After trying multiple times getting multiple timeouts, I was finally given a message stating that they could not complete my request online, and that I needed to go to a brick-and-mortar Apple Store to complete it. This didn’t completely shock me since when I bought my first generation iPhone, I could not activate it through iTunes, and instead had to visit an AT&T store.

Shortly afterward, I received an email from concierge@apple.com, with this text

Thanks for starting your iPhone purchase online. To finish the process, come to the store you selected and look for a Concierge in an orange shirt. We’ll help you complete your purchase, activate your new iPhone, and set it up for you.

Apart from the fact that I didn’t select a store, this was in sync with what the online store told me. A pain to have to visit an actual store, to be sure, but it didn’t sound like it would be too painful.

So today, I drove to the mall and visited the Apple Store. As soon as I entered, I spied an orange-shirted “concierge” and approached her. “Hello,” I said, “I tried to preorder an iPhone 3GS yesterday online, but it said it couldn’t do it, and I needed to seek out an orange-shirted person at an Apple Store. Can you help me with this?” She looked pained as she responded, “I’m sorry… we don’t actually have a system in place to pre-0rder the 3GS.” She went on to say that they did have a pre-order system for when the 3G was launched, and she assumed they would move that system over for the 3GS, but they had nothing now, and I should come back on the 19th. She also said that “lots” of people had been coming in today, who had also been told to visit a store to complete their purchase.

That just sucks out loud.

I’m trying really, really hard to throw money at Apple and they just won’t take it. They clearly underestimated how many people would try to pre-order online yesterday, otherwise they would have had more server bandwidth to handle it. The fact that they sent me (and others) an email telling me to go to a store to finish the process, when they have no such process in place, is just sloppy. I’m not happy about this one little bit, and I want people to know about it.

Does this mean I’m not going to buy a 3GS and, instead, go with a Pre or something else? Of course not, and Apple knows this….

Scala Gets Operator Overloading Right

02/20/2010 Update: I took this blog post and turned it into a presentation to the Atlanta Scala User Group, which I gave in January 2010. The slides from that presentation are here.

05/31/2009 Update: As Mads Andersen pointed out, in the example below, I had the Complex multiplication wrong. As I was working through the example in the book, I typed it incorrectly. I could argue that this blog post was not about my mastery of complex numbers, and was actually meant to show how operator overloading works in Scala, but in the interest of all-around correctness, I have updated the code to contain the proper implementation of complex number multiplication, and I have worked out the examples by hand using the formula on the Wikipedia page to ensure their accuracy. Now, on to the original article.

I’ve been intrigued by Scala for a while now, and I’m finally taking the time to learn it. As I was reading in my book yesterday, I came to the section on operator overloading. Now, this is a topic that developers who’ve been exposed to it feel very strongly about. It’s not quite as rough a discussion as vi vs. Emacs, but it’s close. Some say that operator overloading makes for more elegant code. Some say it just confuses things. I’ve always been in the elegant camp. I think if you can provide operators for your own classes that work intuitively, you ought to be able to do it. In Java, think about how nice BigDecimal would be to use if you had + and – instead of add() and subtract(). Of course, as with anything of power, you have to be careful not to abuse it. It would make no sense to provide a + operator on a Date class, since adding two dates together makes no sense. You have to be smart about it, but having the ability to provide operators for your own classes performing intuitive functions is a good thing.

So as I’m reading the section on operator overloading, it was nice to see that even though you can override the standard mathematical operators, Scala still maintains the proper precedence that everyone is used to. By this I mean that a + b * c will execute the multiplication first, then add the product of b and c to a. The reason this is interesting is because another language that I still love, Smalltalk, does it wrong (or at least, completely differently), and not just for overloaded operators. Smalltalk has no precedence for mathematical operators at all, ever. So a + b * c will execute the + operation on a, passing in b, and then execute the * operation on that result, passing in c. Always. Thus, 2 + 3 * 5 = 25 in Smalltalk, even though it should equal 17. To get 17, you’d have to write the equation as 2 + (3 * 5). I always found that strange.

The canonical example for operator overloading is a class to represent Complex numbers. I will not break with tradition and will, in fact, steal borrow the one from the book. Here, then, is the definition of the Complex class

class Complex(val real:Int, val imaginary:Int) {
    def +(operand:Complex):Complex = {
        new Complex(real + operand.real, imaginary + operand.imaginary)
    }

    def *(operand:Complex):Complex = {
        new Complex(real * operand.real - imaginary * operand.imaginary,
            real * operand.imaginary + imaginary * operand.real)
    }

    override def toString() = {
        real + (if (imaginary &amp;lt; 0) &quot;&quot; else &quot;+&quot;) + imaginary + &quot;i&quot;
    }
}

Notice that we have overridden both the + and * operators. They each take another instance of Complex as an argument, do the proper operations and return a new instance of Complex as their result. Just as you would expect. Now, to exercise these operators, we have this

val c1 = new Complex(1, 2)
val c2 = new Complex(2, -3)
val c3 = c1 + c2

val res = c1 + c2 * c3

printf(&quot;(%s) + (%s) * (%s) = %sn&quot;, c1, c2, c3, res)

val res1 = c1 + c2 * c3 + c1 * c2

printf(&quot;(%s) + (%s) * (%s) + (%s) * (%s) = %sn&quot;, c1, c2, c3, c1, c2, res1)

Lines 5 and 9 are the interesting parts. The result of running these statements looks like this

(1+2i) + (2-3i) * (3-1i) = 4-9i
(1+2i) + (2-3i) * (3-1i) + (1+2i) * (2-3i) = 12-8i

which is exactly what you’d expect.

Now, C++ people are probably saying, “But C++ has always done it right!” Indeed. But languages like Smalltalk and Scala are far more fun to work in.

Georgia Republican Wants Obama to Make 2010 Year of the Bible

From FOX News comes this little gem Georgia Republican Wants Obama to Make 2010 Year of the Bible. According to the article, GA Representative Paul Broun has introduced a resolution calling on President Obama to declare 2010 the “Year of the Bible.”  The article makes the point that the great Ronaldus Magnus already did this back in 1983, so I guess it’s not completely unheard of. Still, this strikes me as somewhat silly and a waste of Rep Broun’s time.

A bit of the resolution reads

“The president is encouraged … to issue a proclamation calling upon citizens of all faiths to rediscover and apply the priceless, timeless message of the Holy Scripture which has profoundly influenced and shaped the United States and its great Democratic form of government, as well as its rich spiritual heritage, and which has unified, healed and strengthened its people for over 200 years.”

He wants “people of all faiths” to “rediscover” the Bible. I wonder how he would react if some other representative offered up a resolution calling upon Obama to declare 2010 the “Year of the Koran” and asked “citizens of all faiths to rediscover the priceless, timeless message of the Holy Koran.” I doubt he’d support that one. Yes, you could argue that the Bible did influence our founding fathers and that the Koran did not, but still. Calling on people of “all faiths” to read your holy book has a name. It’s called proselytizing.

When One Job Ends, Another Begins

In April of 2008, the owner of the company I worked for told me that he was, effectively, shutting down the company and that I needed to find a new job by June. I was not happy. Over the previous 3.5 years, I had been the entire tech department, I had built every piece of software the company had, and I was extremely emotionally invested in the company. I started looking at opportunities and chased several opportunities, but none panned out.

Ironically, the company I was leaving was an online job search company…

Finally, I contacted an old friend to see if his company had any opportunities. They did, and I interviewed with the team the following week. It was a *six hour interview*, during which my friend stayed out of it, to keep any personal bias from influencing the team. A few days later, they made an offer, which I accepted. Did I mention the *six hour interview*?

I’ve been with them for nearly a year and I can honestly say it’s the best fit in a job I’ve ever experienced. While I enjoyed working completely alone, as I had done for the previous 3.5 years, the team I have joined is the best, and smarted, I’ve ever seen.

Looking at it now, my previous company closing was really the best thing that could have happened to me.