iPhone Naysayers, One Year Later

Gruber point to an article that tracks down pundits who thought the iPhone would fail, and asks them what they think now.

One guy was surprised by the success. Translation: everyone else wrote that the iPhone wasn’t worth it, but fully expected it to succeed. This says something about their Jeremiah-like journalism or their complete cynicism for page views. Probably a little of both, but I’m leaning toward the latter.

It’s not until page three that someone mentions Android, Google’s big phone play. Then Enderle does, too, which is a pretty good indication that Android will fail.

Also this, from Enderle:

Apple could probably sell refrigerators to Eskimos

Well, yes, but that’s because Eskimos already buy refrigerators. They use them to keep food from freezing.

iTunes is a Network Application

Jeff Atwood thinks that iTunes is Anti-Web:

Is it so unreasonable to expect links in your browser to resolve to, oh, I don’t know, web pages containing information about the thing you just clicked on? Is there anything more anti-web than demanding users install custom software to display information that could have just as easily been delivered through the browser?

Jeff– whom I met at WWDC last month at a party and had a blast talking with– is just wrong here, because iTunes falls into a breed of application between Web Applications and Desktop Applications, which I have taken to calling Network Applications: they live in the desktop and inhabit that world, but some large part of their functionality– sometimes but not always all– is based on having a network connection. Your feed reader is a Network Application. So is your Email client. So is MarsEdit, which is the application I’m writing this blog post in.

But Network Applications live in a continuum measured by how much they do with the network. Email and Feeds are useful offline when you’re reading the stuff you’ve stored, but needs the network to get new stuff. MarsEdit is useful for writing and revising, but needs the network to post. Most networked games have a fully playable single-player mode that works without the network. Etc.

What distinguishes iTunes is that it’s a Network Application for only one part of its functionality– the iTunes Store– but that is a tiny part of the whole application. Moreover, it’s a function that a lot of competitors built on the open web. But iTunes builds the store into the application so that it can offer a more seamless experience for downloading. Should they replicate the entire store online for people who want to browse, but then force people to open the app if they want to buy? That thing we just tripped on was a seam in the downloading process.

Now a more reasonable suggestion comes later in the article:

At the very least, I might want some basic information about the media I just clicked on. Right here in my browser where I already am. Information like what the heck it is, some artwork, maybe some audio clips, how much it costs — sweet talk me. Make me want to buy it through the Apple Store. Dazzle me with your simplicity and ease of use. Beguile me with your wares!

In the case where iTunes can’t be found, this would absolutely be the right way to go. But it should be pretty minimal because you don’t want it to become a backdoor way of browsing. It should show the song or album that was linked to, and that should be it. And they should keep that big fat “Download iTunes” button that would let you see more.

Good Idea, Bad Idea

Good Idea

Setting up a family tree on Geni. It’s like a little Facebook for your relatives. You click and add your siblings, your parents, their siblings, etc. Then you can post what’s new, share photos, plan events, and all that fun stuff.

Bad Idea

Doing this when you’re my coworker from Hungary, whose wife is the youngest of thirteen children, and whose three brothers are also married to women with twelve siblings each (a bizarre coincidence, he claims). His tree is now over 400 people, and its growth is now self perpetuating. Eventually it will consume us all.

Ode to a Mug

I first met Mitchell in 1998 at my local AM PM. I’m not sure what brought me in that fateful day, but I know that I left with 52 ounces of Mountain Dew and a new companion. From the day forward, Mitchell and I would be inseparable. Here’s a picture of Mikayla and Mitchell. He’s the one in the back.

100_3737.JPG

Yes, Mitchell is my mug. He’s insulated, well-worn, has a great seal, and has been with me for just about a decade. He was named Mitchell after the MST3K version of the Joe Don Baker movie because he was huge, hold the potential to hold a lot of alcohol, and inexplicably had a woman on him.

The biggest problem in those early days was that Mitchell had no straw. For almost a year I made do with swigging, but then, on a trip to Disneyland, I found the flexible tube straw you see in the picture above. It’s the perfect size to fit into the hole provided, and it bends whichever way you want. Sure, if you leave it in the fridge it gets all stiff, but it’s fine after a few minutes. Disneyland stopped selling those straws right after I purchased one.

Mountain Dew has always been my drink of choice, and it was what I put into Mitchell the most in the beginning. 52 ounces of Mountain Dew is far more than you should drink in a day (a two-liter is 67 ounces), but I did it with frightening regularity. When Dew was scarce I would brew up some Kool Aide right in Mitchell: packet of flavor, a goodly amount of sugar, water, stir. Recently, though, Mitchell has been used almost exclusively for water. One tray of ice plus Brita water to the top will get me through the day at the office; I usually slurp the last drops out on my way to the car.

Mitchell likes to travel. Aside from riding shotgun with his handle snugly latched over the reclining trigger of my passenger seat, he has followed me on three trips to Europe, plus numerous car rides hither and yon. Fill up Mitchell and he’ll take you far. Sonja and I have made it to San Jose from Costa Mesa on one mug full. He’s been to the weddings of numerous friends.

Which is why it came as quite a blow when we lost Mitchell today. We took him out to a ball game and apparently left him outside the car as we got Mikayla and her ten thousand assorted accessories safely ensconced inside. He’s ten but he doesn’t have a cell phone to call us, and he doesn’t know his way home, so I went looking for him as soon as we figured it out.

I kept checking my speed as I drove over there; I felt like I was speeding (I wasn’t).

I looked in the area around where we parked. I looked under the cars that had taken the spots in the ensuing three hours. I checked the nearby curbs to see if some kind soul had perched him there to wait for his family. I checked the grandstands where a girl’s little league game was going on, trophies at the ready. I peered into the office to see if he had been locked inside. I looked in the trash cans. I looked in the dumpster. If I had found him in any of those locations, I would have brought him home and washed him.

But I didn’t find him. Tomorrow I’ll go back and see if maybe he was turned in after I left, or beforehand but wasn’t visible in the office. I’ll make another round and see if he’s turned up. I’ll call around to see if anyone from the game has him. But it doesn’t look good. Who would rescue a battered old mug?

Mitchell, if you’re out there, I hope that whoever did find you plans on putting you to use. You’ve been a good mug to me, and if it was time to move on, I understand. But I would have liked to say goodbye to you directly. This meager internet post will have to suffice to carry my heartfelt thanks and grateful memories. Godspeed to you.

Reinventing the Wheel: How to Average Numbers

Other the past week I’ve been writing some code for work that has to happen periodically and then re-schedule itself so it can happen again. We never want two of this process running, and we want the process to automagically expand its time window if it takes longer than we think it should, because arbitrary magic numbers are a Bad Thing™.

So I keep track of each time we run and keep an average of how long the job takes every time. But I don’t want to keep around every run time, so all I do is keep around the average, and how many times the job has actually run. From those two numbers plus our current run time I can approximate a new average and use that to schedule the next run. I came up with a nice little algorithm that pushes the average around whenever a new number comes in. It works great:

def find_new_avg(old_avg, old_count, new_number)
  weight = (new_number.to_f - old_avg.to_f)/(old_count+1)
  old_avg + weight
end

But in my tests, I noticed something; this doesn’t just approximate the average. It actually calculates the average. It’s right all the time.

I did few quick Google searches and checked Wikipedia couldn’t find anything. I looked at it again. I pared down the code to the above (it used to be a bit more complicated). I tried more tests. It still worked.

I asked my friend Nick if he had ever heard of this algorithm. He hadn’t. He pushed some numbers at it and decided it did work. We did a video conference over Skype and worked out the algebra, and we proved that it did work. I said: “It just seems insane that I could have invented–by accident– a new way to average numbers that uses less space than any other way I’ve ever seen.”

I searched online again, and finally found it. It’s from The Art of Computer Science, Volume 2, by Donald Knuth.

Knowing that I’m not the first one to discover this algorithm restores my faith in how much research has been done in the past (although my faith in Google’s capabilities was somewhat shaken), but the fact remains that, not knowing about it beforehand, I discovered a reliable algorithm that does what I need in a fraction of the space it could take. And that makes me happy, even if I did reinvent the wheel.

Getting TracRedirect to work with Trac 0.11rc1

I’m a big fan of Trac, and I use it for project management when I’m given the choice. It has a few issues, but nothing a little plugin magic can’t fix. On of my favorite plugins is TracRedirect, which allows me to make one page point to another and make the browser redirect there, so “Customers” points to “Customer”, and I can be lazy when I’m typing other pages and use whichever one makes the most sense.

But TracRedirect does not play nice with the latest version of Trac, 0.11. In fact, it makes 0.11 die. This is bad.

I don’t really know Python. I mean, I can get by, but I don’t really know it. So the prospect of patching some code for a plugin in a language I don’t know for a project whose code I’ve never seen is at once intimidating and exciting. The reason I’m a programmer is because the exciting won, and I fumbled around until I got it working. The diff between the latest svn code and my own is after the jump; it’s mostly just updating IWikiMacroProvider to take the new args 0.11 passes its way, but there’s another little fix to include the redirect stylesheet using the new method, as the old method didn’t seem to work reliably.

Read the rest of this article »

CCTV Music Video

The Get Out Clause is (apparently; I’d never heard of them before) a band in Manchester. They have no contract, and no money to put together a music video. But what they do have is time and a pretty good song. So they sung their song in front of lots of CCTVs and then requested the footage via the Data Protection Act (or maybe the Freedom of Information Act; reports vary). I’m sure it ate up a lot of time in the playing and the requesting and the editing, but it got all kinds of publicity, including getting me–half way around the globe– to write this about them, so I think that counts as a pay off.

Heads In The Sand Review

There are already approximately seventeen million reviews of Matthew Yglesias’ new book, Heads in the Sand, so I figured one more wouldn’t hurt.

Yglesias is one of my must-read bloggers; when I’m behind a few days, I’ll plow through his feed first because he makes great points, ties it into the larger picture, and doesn’t belabor the issue. All of these things are true in his book, as well.

It has been said elsewhere, but the transition from blog posts to book chapters went very well for Yglesias’ style. In large part this is attributable to the decision to tie the book into a narrative following the last decade of American foreign policy, and make the points along the way. This allows Yglesias to follow his normal method of commenting on events “as they happen,” which is why reading the book feels a lot like reading the blog or his articles.

But it’s a two-edged sword. Too often the points Yglesias is making are directly related to the background they are surrounded by, but the background tends to bury the commentary by dint of leading rather than following. This makes the principals Yglesias puts forward somewhat harder to find in the text.

The exception to this pattern is the final chapter “In With the Old,” which dispenses with the narrative and instead takes a more forward-looking view to the next administration and how they should go about foreign policy. This chapter benefits greatly from this freedom, and makes some of the best points in the book.

But enough about the structure of the book; the content is the important bit. The book as a whole advocates not new ideas, but a return to the “liberal internationalism” that Yglesias says the US followed from World War II until the current administration. Early on, the yardstick we are given to measure foreign policy decisions is:

The question, then, that must be asked of any proposed policy is… whether it brings us closer to or further from the dream of a peaceful, rule-governed liberal world order. p8

Those four attributes: peaceful, rule-governed, liberal, and world order are the keys. The first is the goal, and the rest are how to achieve it in a sustainable way. If you abandon the latter three, you will inevitably lose the first.

Yglesias establishes the heredity of the idea: Wilson as grandfather, FDR as father, Truman as mentor. The first Iraq War proves that it works; bringing an international coalition together to enforce the rules and keep the peace is a success. But then we immediately trip over Kosovo.

Western leaders of the period were, and are, often accused of a selective approach to humanitarianism, acting forcefully in Kosovo, while being less concerned with more serious humanitarian problems in Africa and elsewhere. The charge is essentially accurate but largely misses the point: that Kosovo presented a mixture of humanitarian and interest-based reasons for intervention was precisely what strengthened the case for playing fast and loose with the UN rules, making intervention a reasonable option. p17

As Yglesias has conceded, Kosovo is somewhat of an edge case, but how much of one is debatable. The problem is that Kosovo is rather obviously a use of force outside of the approval of the UN Security Counsel, but it seems right anyway. Seeming right isn’t rules governed, though.

This highlights one of the shortcomings I found with the book; in its desire to hew closely to the chronology, it spends its time on what happened and why it worked or didn’t, and misses opportunities to talk about what should have happened. In the case of Kosovo, what is the US to do if the UN won’t act? (We chose asking NATO instead, and Kevin Drum makes the point that that was good enough). But in other cases this just left me wanting a few more pages.

One such case was the (excellent) discussion of the 2004 Presidential Race. Yglesias makes a good argument that Dean fell in the primary because he “was, in various respects, a less-than-ideal candidate” (p88), and that Kerry fell in the general because he couldn’t properly distance himself from his previous pro-war stances. But none of the other Democratic candidates could have done so, either. So what should have been done?

This oversight is especially sad because it ties in with Yglesias’ view that being the opposition party means being unafraid to oppose the other party. Bush was for the war, but for political necessity, so was most of the Democratic Party. As Yglesias puts it:

The 2004 primary offered the best possible opportunity for a Democratic course correction: a change to reject the errors of the congressional leadership in favor of the greater wisdom demonstrated by the bulk of the party’s rank and file, both in and out of Congress. But that opportunity was squandered, and the Democrats would up deeper in a political quagmire of their own making. p89

This comes close to getting to what should have been done, but misses the mark by being too abstract. Who was the candidate who could have done this? How would they have avoided being painted with the Dean smears of being “a throwback to post-Vietnam quasi-isolationism and left-wing radicalism” (p98)?

Another thing that seemed to be alluded to but missing is a real strategy of how to fight al-Qaeda. Specifically, is Beinart’s idea of “democrati[zing] the Muslim world” p121 a key to combating al-Qaeda, even if it isn’t the key, and Iraq wasn’t a useful means of obtaining that goal? Yglesias comes close to an answer:

The relevant sort of resentment, however, is not resentment at the absence of democracy, but resentment at the absence of democracy’s logical precursor–self determination. p135

And with this great quote from Michael Lind:

Woodrow Wilson said “we must make the world safe for democracy.” He did not say we must make the world democratic. p143

But going against Bush’s narrative that “Democracy is on the March” is too easily painted as being against democracy or– worse– being of the opinion that Muslims can’t handle democracy. Granted that we shouldn’t accept this framing, but how does one reject the argument without tripping into it?

The beginning of an answer is there, and I think it lies in the line that “Democracy is fundamentally incompatible with the idea of empire” p144. This idea– more fully explored by Dave Meyer here– is interesting, but stands without any support in the book.

Another glimpse at the larger context for this question is elsewhere in the book:

It was fashionable for a long time for liberals… to argue that the Bush administration was right about the need to promote democracy in the Middle East but wrong in the way to go about it. What was needed, perhaps, was a new national commitment to a new method of promoting democracy. I myself wrote some articles along these lines, and there is some truth to that way of looking at things. p194

Yglesias outlines some of the ways to go about democracy promotion, and acknowledges that they’re not riveting, but still important. (And what does Yglesias think of Thomas Barnett’s rather riveting TED Talk? Too much like Max Boot’s proposal?)

One of the things that Yglesias does incredibly well, though, is present the current situation and show how untenable it is:

The Bush administration’s embrace of militaristic nationalism has not brought democracy to the Middle East and has not frightened Iran or North Korea out of conducting nuclear research, nor has it intimidated Iran or Syria out of supporting Hezbollah, spooked Pakistan into ending its support for Kashmiri radicals or into clamping down on al-Qaeda sympathizers in its border areas, owerawed China out of efforts to become a grat power, or frightened Russia out of reasserting itself. p187

Ultimately, I liked the book rather a lot. It was a quick run-down of most of the important foreign policy decisions in the last decade with good interpretations of the meanings and repercussions behind them. And I look forward to the next book, where Yglesias can answer his own challenge:

There is no panacea ere (just look at Singapore), but it is in many ways the best thing we can do. The subject lies largely outside the scope of this book, but one of the real challenges of liberal economic policy in the coming years will be rebuilding te domestic social contract in a way that once again makes further expansions of global trade acceptable– and, indeed, beneficial– to the American working class. p196

Centering a Window Via AppleScript

John Siracusa recently lamented the loss of one of his classic OS add-ons; the ability to center the current window onscreen via a global key combo.

Well, the global key combo can be had in any number of ways, but here’s an AppleScript that’ll do it for you. It finds the screen size using the technique Craig Hockenberry showed to John Gruber, then finds the current frontmost window and resizes it. Saved as a Script into my Script Menu, it seems to work fine.


on run
	tell application "System Events"
		set fma to first process whose frontmost is true
	end tell

	tell application (name of fma)
		set fmwBounds to bounds of first window
	end tell

	tell application "Finder"
		set desktopBounds to bounds of window of desktop
	end tell

	set fmwWidth to (item 3 of fmwBounds) - (item 1 of fmwBounds)
	set fmwHeight to (item 4 of fmwBounds) - (item 2 of fmwBounds)

	set desktopWidth to (item 3 of desktopBounds) - (item 1 of desktopBounds)
	set desktopHeight to (item 4 of desktopBounds) - (item 2 of desktopBounds)

	set newX to (desktopWidth / 2) - (fmwWidth / 2)
	set newY to (desktopHeight / 2) - (fmwHeight / 2)

	set newBounds to {newX, newY, newX + fmwWidth, newY + fmwHeight}
	tell application (name of fma)
		set bounds of first window to newBounds
	end tell
end run

Daniel Jacob

Daniel Jacob:

Daniel Jacob

My nephew, aged 5 days. Congratulations, Fred!

Scenes From A Taco Bell

[Inside, Lunchtime. Two men in their sixties in "San Juan Capistrano Police Volunteer" uniforms sit at a table covered in empty wrappers. Another man, just as old, stands nearby.]

Non Volunteer Old Man: It’s been nice talkin’ to y’all. Say, who you voting for?

Old Man 1: Not Hillary.

Old Man 2 shakes his head and smiles.

Old Man 1: I’m voting for McCain. And let me tell you, I’m thinking about that. Thinking real hard.

These guys are there every Friday. Even if I didn’t like Taco Bell I’d go to overhear them.

Democratic Caucus on The Colbert Report

Senator Clinton’s appearance felt a little strained, Senator Obama’s appearance was kind o funny, but EdWørds was hands-down the best of the cameos. Better introduction, better content, and much, much funnier. It reminds me of Al Gore on SNL warning about attacking glaciers; surreal enough that you know they’re in on the joke, but real enough that it’s not preachy when it turns back to the real issue. It’s Al Franken’s “kidding on the square.”

Lazy Decision Making

We recently cleaned out my parents’ garage so that it could be torn down to make room for an intergalactic expressway a storm drain. Amongst the millions of childhood memorabilia was this book, which was the first taste I got of computer programming.

It taught us Apple BASIC, and we used it to program our Apple IIc that had one external drive. We had a bunch of floppies, a few of which we loaded ProDOS onto and toiled away.

If I recall correctly, my older brother was the one who had actually purchased the book (or convinced my parents to buy it for him) so it was ostensibly his, and he assuredly read through the thing quicker than I did, and understood more of it that I did even when I had read most of it. I was, after all, 8 at the time.

But with that book and that computer we set about to write our own games. I still believe that every programmer of my generation gets into computers for the games. I wrote a little game where you could run through computer systems a la Shadowrun, breaking ICE and finding valuable files. I tried to do HiRes graphics, which was why the game never got finished.

This was before I understood anything about design. Not that you could design in BASIC, but still.

What I did was try to figure out everything I would ever need to do, I wrote it down in a big list, and then I started at the top of the list. I wrote the main screen. I wrote the login. I wrote the first bit of navigation into the fake computer system. I got overwhelmed and never returned.

I was following what is now called the Waterfall model, where you spend a whole lot of time figuring out what you’re going to do, and then you write it all down in excruciating detail and make sure that it covers everything, then you check again. Then you check again and start programming.

This model was invented when you programmed with punch cards and had to make sure that everything worked reasonably well the first time. If it didn’t, you’d have to change something, and changing things was nigh impossible, because you can’t just insert a new row on the punch card: it’s cardboard. So you do proofs and flowcharts and loop invariants and whatnot, trying to make sure that when you go to the trouble of making the punch cards, everything works out.

Contrast that with what most programmers do today, which is sometimes referred to as Extreme Programming, XP, Agile Development, or simply Iterative Development. Whatever you call it, you figure out only what the next step is and you program that. Then you test it. Ideally, you write a test for it so that the test can be run by an automated process. Then you move on to the next step.

Developers like this method because they get immediate results (and they do a lot less paperwork). Managers like it because they get lots of feedback (and they do lots less paperwork). Customers like it because it allows the developers to respond to feedback, which means the customer gets something he actually wants, instead of something he kind of wants.

Iterative Developement is part of a larger trend in the computing world toward deciding things later, because later you will have more information with which to make the decision. It’s called Lazy because you make the decision only when you need to, as opposed to Eager decision making, when you make a decision when you think of the question.

Static typing is eager decision making. You have to decide everything up front when you don’t know enough information, and if you change it later, you’re screwed.

This is one of the reasons why the trend in computing is toward dynamically typed languages, and away from static typing. It allows you to make decisions later (at runtime), when you have more information. That allows you to be freer in your programming because you’re not making decisions based on guesswork. But most of all, it allows you to skip an entire step of development (laying out a class hierarchy) that will inevitably cause you pain in the long run when class A doesn’t inherit from class B, and neither implements interface C. This step becomes a much looser and more manageable hurdle when you can just make sure that the right methods are there, or better yet just mix in a module you already have.

The obvious next question is: what other decisions are we making too early? I wouldn’t be surprised if there are some huge ones out there. Paul Graham is fond of pointing out that the startups he funds often create a completely different product than they set out to create, and that seems like a pretty large decision to make lazily.

Scenes from Chipotle

[Two men, each about 50, sit at a table over burritos. One of them is wearing a t-shirt that says "If you don't like abortions, don't get one." He is listening as the other man speaks]

Man #1: But the planes couldn’t have brought down the towers. The physics don’t work. And the Democrats are in on it. Howard Dean is not a dumb man; he’s inquisitive. He’d figure it out.

[Man #2 is not buying it. He's too smart for that.]

Man #2: But what about Castro? Who told him to be quiet? Bush and Castro have the same master.

I really, truly wish that I were making this up.

Music Pricing

Apple put out a press release last week saying that iTunes is now the number two music retailer in the US, behind only Wal-Mart. Wal-Mart, for it’s part, is making rublings:

Wal-Mart stirs CD pricing pot with multi-tiered plan - Yahoo! News:

Wal-Mart… has proposed a five-tiered pricing scheme that would allow the discounter to sell albums at even lower prices and require the labels to bear more of the costs.

(Via Andrew Sullivan.)

Wal-Mart has seen Apple beat retailer after retailer on this, and sees the writing on the wall: buying online is cheaper and faster, so there’s no reason to buy from a store. If they want to keep sellng music, they need to change the rules. And that’s what they’re proposing.

But, as the article makes clear, that’s only if they want to keep selling music, and that’s not necessarily true:

One label executive said, “This sounds like the Hail Mary pass, and if it doesn’t work, they could be out of the music business; or maybe they reduce music down to a couple of racks” from the 4,000 titles carried by Wal-Marts with larger selections.

That’s a huge play for Wal-Mart, and it sounds eminently reasonable from Wal-Mart’s perspective. Basically, the Labels have given Apple the sweet deal (cheaper prices) that Wal-Mart is used to getting, and because Wal-Mart is all about cheaper prices, they’re not able to compete. And if they can’t, then they’re willing to cut off the non-competitive part of the business. Wal-Mart is nothing if not ruthless.

Note, though, that there’s a giant gap between “non-competitive” and “not profitable,” and therein lies the interesting part. As long as Wal-Mart is making money selling music, why would they care if Apple is making more money selling music? Unless Wal-Mart is just feeling stilted about not being given the best price, it has to mean that they don’t think they can fend off Apple given the current pricing scheme. And seeing as how Wal-Mart’s online music store did have the lowest price when they were still in business, I have to guess that it’s the later.

All told, it’s great news for Apple. Wal-Mart is in a reactionary position, but if Wal-Mart wins against the labels and holds onto the number one slot, Apple can argue that lower pricing is better for sales and demand it themselves. If new pricing doesn’t keep Wal-Mart up top, it’s Apple who takes the crown. On the other hand, if Wal-Mart doesn’t get better deals and does cut their music shelf space, Apple catapults into first place, and again has more leverage.

And of course, this is really bad news for the labels, who are going to have to choose to lower their margins or lose a chunk of business, or both. Couldn’t have happened to a nicer group of guys.