Archive for the 'Technology' Category

Follow this category with a feed.

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.

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.

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

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.

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.

Supporter Videos

¡Viva Obama!:

Personally, there are some things about silly season that I like.

How is it that this is so awesome and this and this are so terrible?

The lack of cheesy 90s graphics is a definite difference, but the music is the deciding factor. The Obama video is fast and happy and loud, the Clinton video is cloying and saccharine, the Huckabee video is like a bad 80s sitcom opening or a lounge act. But that describes the campaigns, too.

Your Daily Dose of Cute

kitten vs. frontrow:

(Via Tim Bray.)

I have lost files doing very similar things.

Fractal Africa

TED Talks: Ron Eglash:

I’ve always been fascinated by fractals, even though the math is far beyond me. But here’s a guy who not only is finding fractals all over, but puts up all these little applets to play with them!

Alan Kay’s ‘97 OOPSLA Keynote

JavaScript is the new Smalltalk:

Regular readers are quite tired of me pointing to this video, Alan Kay: The Computer Revolution hasn’t happend yet. Keynote OOPSLA 1997, but I think it’s quite fundamental to understand that Alan Kay had a vision for the web, and though his understanding of the role of HTML in the world of 1996 was flawed, it seems the collective web has spent the last ten years building exactly what he described, with HTML/SVG being the display substrate and JavaScript being the code to drive that display.

(Via BitWorking.)

I admire Alan Kay for a lot of the things he did, but this video is one of the slowest, most meandering talks I’ve ever listened to. He is talking about incredibly important things that I’m genuinely interested in, but it’s really hard to plow through.

He is very obviously whip-smart and well-read. He cites academic papers and historical incidents with ease. He uses things like cystic fibrosis as metaphors. It all makes perfect sense, but the pacing and the delivery are so deadpan that my attention is wandering.

It does have some kickin’ quotes in it, though:

  • I made up the term object-oriented, and I can tell you that I did not have C++ in mind.
  • There is no idea so simple and powerfule that you can’t get zillions of people to misunderstand it.
  • At the very least, every object should have a URL.
  • It’s very easy to grow a baby six inches. They do it a couple dozen times in their life and you never have to take them down for maintenance.
  • One of the reasons why this meta stuff is going to be important… is this whole question of how do we really interop over the internet five and ten years from now?
  • Let’s not do it in Smalltalk; that’s too slow. Well let me tell you something: there’s nothing more inefficient than spending ten years on an Operating System that never works.

All told, it is a strong argument against “Worse is Better.” His point is similar to extreme programming, whereby you build a small thing (Smalltalk) that works, then use that to bootstrap the system and slingshot yourself forward. But he comes at it from a classic “MIT approach” of figuring out a good design for the bootstrap, and then using incremental development from there. That all sounds perfectly great– and indeed it seems to be what the web has ended up as (as Joe Gregorio was pointing out)– but it sure as heck didn’t work for the things Mr. Kay was trying to do it with. Why is that?

YouTube - Superfriends meets Friends

Superfriends meets Friends:

(Via Boing Boing, via Laughing Squid)

One of the best scenes from Friends, dubbed into one of the worst shows ever. Classic.

Macworld Reality

MacWorld Reality.png

And this is what actually happened. Yeah, a little bit with the too-optimistic for me.

Things I got wrong:

  1. I called the Mac Pro based on John Siracusa’s (who made the game, and the rules) assertion that it’d count “if and only if the new Mac Pros are mentioned in the keynote.” I figured they would be, and they were, but it’s not marked in this “official” what-happened version.
  2. The displays haven’t been updated in forever. It seemed a shoe-in.
  3. I was skeptical of the MacBook Thin, which turned out to be the MacBook Air, the major announcement of the keynote.
  4. Having just got a new MacBook Pro, I figured Apple would announce a new version to spite me. It’s happened every other time I buy something, so it seemed a reasonable guess. I was happy to be proven incorrect.
  5. Jobs didn’t use any of his catch-phrases. I think it was an intentional effort to spite Bingo players. He used the word “Zhoom” for crying out loud.
  6. I expected a new iPhone, and SDK details. Mostly this was just hope on my part, since I want to buy an iPhone, and play with the SDK.
  7. Schiller got a mention, but no appearance. I miss that guy.
  8. Vista got by without any mockery. And really, I think that it came down to the fact that Jobs couldn’t come up with anything new; it’s all been said. Over and over.

So obviously, I’m not too great at this. When I posted my predictions before, I almost went back and updated my bingo chart (I had done it almost a week before my post), but decided to go with my first impressions. Big mistake; my second guesses (no iPhone, no Blu-ray, no One More Thing) were far closer to the truth.