Nike+ in blog form

As I alluded to in last night's blog post, I've since pulled in my Nike+ run data and shoved it there into the footer. This is where open source is as fun as it is; I found a random guy's GitHub Ruby wrapper for Nike+'s unofficial API, forked it, corrected a few issues, pushed it back to the creator. I'm still trying to really "get" git, but so far so good.

In other news, if you're a Nike+ runner and want to go head-to-head on a challenge, drop me a line and we'll toe the virtual line.

Looks and APIs

So yesterday I asked myself, "Self, why don't we refresh the blog?" And so I did. Just a quick little refresh from what I've had previously. Wanted to sort of back up and strip a few things down for a little bit.

I've also gone the API route and started to pull in Fun Things from elsewhere. Interestingly enough, things aren't going well for me. Last.fm was a breeze with Scrobbler, but I ran into problems with Twitter (pulling over JSON seems to be buggy at the moment). I wanted to try to pull down my latest runs from Nike+, which would have been fun since they don't necessarily have an "official" API, but naturally Nike's pulled down Nike+ for the night, so that will have to wait until some other day. So hey, I'll have to be trendy and web 2.0-enough with one of three services for the moment.

And I also fixed commenting. That's a nice explanation for why I haven't gotten any comments recently; hard to make them when you're completely prevented in doing so, after all.

The Audacity of MobileMe

The more I sit and contemplate MobileMe, the more impressed I am of its sheer audacity.

Apple decided to suddenly unleash this product to the world whose purpose is to keep your data in sync no matter where in the world you are, no matter which machine you happen to be using, no matter which operating system you happen to be sitting in front of. Marketing aside, pushing this data all around is one pretty heavy feat.

MobileMe: just a slicker (but still broken) .Mac?

It's not an easy thing to do. Look at MobileMe's launch, which was plagued with problems for days (weeks if you include the email issues some users faced). Amazon's tried the cloud computing for a year or two now, and they've had some well-publicized downtime. Google's just starting its own foray into the market with Google AppEngine, and they've had some issues as well, possibly to a greater extent than Amazon due to its role as the newcomer.

The problem is that the classic SLA mentality that has stuck with web hosting for the last decade or so just doesn't mesh with the idea of the cloud. Your website goes down, it sucks for you and your visitor. S3 goes down and it sucks hard for you, your visitors, your competitors, their visitors, your favorite social networking site, all of its visitors, and so on. It's the classic centralized/decentralized problem: in a decentralized model the reliability of the system is unmatched, and in a centralized system you gain in terms of efficiency and performance. On top of that, MobileMe has a special consideration: if it bombs more than a beached failwhale and things like your phone contacts get lost on your iPhone, people are going to be pissed off. Business information is one thing, but with MobileMe tackling personal information — phone numbers, photos, calendars — some really important data is at stake.

Let's talk storage

So let's assume that MobileMe will sort out the kinks and maintain a relatively workable uptime. Once it gets reliable and Apple has the ability to scale and maintain the cloud, some really interesting things can happen. One of the most audacious is ubiquitous media. My 16GB iPhone can certainly hold a large amount of music (remember, the first generation iPod started at five gigabytes). But even with that amount of space available right now, it's going to be awhile until I can squeeze my nearly 300GB iTunes library onto one device. For the last three to four years we've been playing the scaling game. First we scale hard drives (jumping from 1st generation iPod's 5GB to today's 160GB iPod Classic). Then we scale flash memory (from a 1GB iPod Nano to today's 32GB iPod Touch). We've been so reliant on the increasing expansion of storage that we've missed sight of some other bigger possibilities. With Wi-Fi built into every Touch and Wi-Fi and cellular connectivity in iPhones, we're hitting the point where you really don't need to have all of your media in pocket as long as you can access it. Last.fm has pushed out a pretty innovative iPhone app that lets you stream recommendations to you (or stream your actual library to you if you pay for their premium service). Pandora also has made a perhaps superior iPhone app that also lets you stream recommended music to your iPod. Just today, Simplify Media released their app that brings you even closer to this ubiquitous ideal; set up their software and you actually can stream your very songs from your Mac or PC at home. It still could be quite some time before Apple could reach the point of supporting such a bold strategy, but the foundations are being built: Back to My Mac keeps track of your devices and lets you talk directly to them no matter where they (or you) are, iTunes is getting better at streaming between iPhones and iPods and Apple TVs and Macs, the MobileMe cloud is starting to be reliably scaled, and with iPhone 3G we can start reaching a state of ubiquitous high speed connections for music streaming.

At that point, it's not a big stretch to imagine video, documents, perhaps even scaled-down (or full?) applications running in parallel between an iPhone and a Mac at home. Why do you need to somehow figure out a way to sync your personal finance desktop app over USB with your mobile app when you could just shoot updates between the two over the cloud? We've been struggling for decades to hit some sort of thin client utopia, but seemingly no one could figure out a good way to make the jump into mobile. Bill Gates has been pushing speech recognition and the Tablet PC for at least a decade, and even though it has produced some cool stuff, we haven't nearly met the visions that Gates and Microsoft themselves had made for the late 1990's. For years, Palm was getting closer and closer... its platform was perpetually two years away from making the leap from business mobile needs to the normal consumer, thus bringing about a revolutionary new way of life. Never happened. Even today, hundreds of whiz-bang web 2.0 sites are struggling to fill this niche that everyone knows will be conquered but at the same time no one has the slightest idea how to go about it. Microsoft had the desktop but not the mobile device. Palm had the device but not the desktop. Today's websites have the cloud but not much else.

Bringing it together

Maybe Apple's in the best position to finally crack this nut. They seem to be holding or trying to acquire all of the cards. Their mobile device is fresh, new, and most importantly, selling. Their traditional desktop business is blooming, and even if their Mac business collapses tomorrow, MobileMe works on a PC, too. And MobileMe is the cloud that, while new, aims to unify everything else. You could make even make the argument that if MobileMe itself collapses tomorrow, Apple could still be in a good position to succeed here: those whiz-bang web 2.0 sites, while mostly harmless, are onto something big. MobileSafari (and WebKit, in a broader sense) is literally pushing web development every step of the way. If Google Apps ultimately win out, or Microsoft's forays succeed, or SuprCuilBetaSpaceAwesome 2.3 comes out of nowhere and takes the world by storm, Apple is still in a good position with a solid mobile browser to build on top of the winning platform.

IBM vs. Apple is dead. Apple vs. Microsoft is dead. Microsoft vs. Apple is dead. Microsoft vs. Netscape is dead. The early part of the millennium left us broke, stagnant, and without a Great battle. The browser wars were finished, search was just starting to get re-invented, and we were a bit shell-shocked from the blistering pace of innovation during the nineties. Even four years ago you could do some digging and find a general feeling of "oh, well, things are always interesting in the technology sector, but the glory days are behind us". We might not reach the days of the bubble again (for better or worse), but it's shaping up to be a battle of epic proportions: Microsoft, Google, Amazon, Apple, the countless bright-eyed entrepreneurs in the Valley and around the world. It's hard to count anyone out at this point. Each of those four companies + startups are the type of places that tend to attract the smartest, most energetic employees in the world. They're led by bright people that understand technology who have been through rough times before. It's not Xerox pissing away PARC redux or HP ignoring Woz and his invention or IBM not really caring about the implication of a couple of nerds selling some sort of OS.

It's going to be an exciting decade.

Flash on the iPhone

Ever since the iPhone came out, there's been a mildly vocal minority who want Apple and Adobe to work together to put Flash on the phone. John Gruber has already nicely summed up some of the technical and legal reasons why it won't happen; what we should try to understand is why there's a demand for it in the first place.

There are very few times when I'm on MobileSafari and find that I can't do a certain task. Sometimes it's a case of just wanting to be on a full computer — writing a blog post, for example — but I still could get it done if I needed to. When I do legitimately run into a roadblock on my phone in regard to Flash, well, it's important to determine why I'm hitting that roadblock to begin with.

Flash is used online in three broad forms: advertising, rich content experiences, and video. I think in virtually all instances the general consumer could care less about the first two. 3G is going to be fast, but not fast enough where you wouldn't notice the extra KB loading an ad or two, or loading up some design shop's Flash-based design. As Gruber mentioned on The Talk Show, a lot of the speed difference on the iPhone is processor-based; even over Wi-Fi the iPhone does take noticeably longer to render a page than on your desktop (although it does perform extremely well in comparison to other phone s' render times over Wi-Fi). It's not a question of speed, it's a question of how fast of a processor you can really cram into a phone without compromising battery life or physical size. I can't imagine adding another layer on top of that — a Flash engine — would be anything but bad for rendering times. Even if the processing hit can be managed, the additional overhead will still have some type of impact; iPhone, for example, keeps previous "tabs" open on the phone with the content rendered until MobileSafari maxes out its share of memory. At that point it slowly garbage collects old tabs one by one until it reaches a more appropriate memory usage. That's why you can have five tabs open, but when you hit a larger page and then try to return to a previous tab you'll find that you'll have to make your request over again.

That brings us to the last form of Flash online: video content. This is the stickler, and I suspect this is the area that most people are clamoring for. I admit, it's a bit of a pain in the ass to see a link on reddit or via email or whatever, only to click on it and see that you can't run it because it's an embedded YouTube video or a different video service all together. If it's the former, there are ways to get around it. The problem is that, while iPhone's YouTube player is actually pretty slick, if the code is embedded on a page outside of YouTube.com, the YouTube app can't pick up on that. The easy option is to get a bookmarklet like iTransmogrify, which uses JavaScript to parse the current page's DOM looking for YouTube embed code. If it finds it, it writes a floating div into the page that lets you tap straight into the YouTube app. Given the current rumors surrounding iPhone 2.0, it sounds like this type of functionality will be added come July so we won't need to deal with workarounds.

We have a decent YouTube solution, and for some people that might be enough. YouTube has a commanding lead in online video. But there are still times where you might want to see a video on Vimeo, for example. How do we tackle that problem? There isn't a Vimeo app (although I suspect this might change as we move into the post-2.0 state: perhaps more and more site-specific apps will start coming out free of charge). The problem is that from the looks of it, the SDK doesn't give any hooks into MobileSafari. I believe YouTube's app is able to work with iTransmogrify through some sort of youtube:// protocol that it calls, similar to Google Maps integration on the phone. It remains to be seen whether a developer could add a vimeo:// handler, although it sounds like this isn't the case.

It leads to a lackluster state of affairs, then. Even if someone were to build a MobileFlash and got around the legal issues of doing so, there's really just not a way to hook into the SDK to make it useful. I don't think the way to build it is to mimic the desktop experience: you just don't want to have to suffer through performance degradation just to load up an ad or to play around with Flash navigation that isn't build for finger-based input anyway. Even on-page video would be frustrating: given screen real estate, you'd have to manually expand the content so that you could watch it close to full-screen rather than trying to squint to make it out on a zoomed-out page. The solution is to either build a separate Flash app similar to YouTube's app or MobileQuickTime: a "click to view" link that transports you out of MobileSafari for full-screen viewing and controlling.

The SDK prohibits code that runs code, and there currently isn't a way to link MobileSafari to new apps, so it looks like we're stuck. It does look like there's a reason to want Flash on the iPhone, it's just that it's usually outweighed by the many more situations when you don't want to have to waste time loading ads, for example. Given the limitations of the SDK, I don't think we're approaching a time where MobileFlash is feasible. Given the limited reasons of why someone would want Flash on the iPhone, I don't think we're approaching a time where Apple feels that the limitations of the SDK should be lifted.

Compiling MySQL on Leopard for Ruby

This is partially for me in the future just in case I'm stuck doing this again, and it's partially for the lone googler in the future who comes by needing a quick fix.

So, the short version:

Getting MySQL

Grab the 64bit version from MySQL ("Mac OS X 10.5 (x86_64)"). Easiest way is to grab the DMG, use the installer, and then add the preference pane.

Setting up MySQL

It's probably helpful to add an alias for mysql in your ~/.profile:

alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin

Preparing for Ruby

Grab your Leopard DVD and install Xcode if you haven't already... it'll help you compile some of the native C code involved with the MySQL gem.

Install the gem

Rock this:

sudo env ARCHFLAGS="-Os -arch x86_64 -fno-common" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

That'll build your MySQL gem for you. Most of the issues with errors like "lazy symbol binding failed" are the result of not setting those architecture flags; something with Leopard pushing multiple architectures but MySQL expecting only one.

Those are the main sticklers; if I missed a step along the way it's probably easy enough that a quick Googling would solve. Kudos to http://cho.hapgoods.com/wordpress/?p=158 and its commenters in helping figure out some of those pesky details.

last.fm recently played

nike+ recently run

twitter recently tweeted