2010

Neighbor

Yesterday evening, I received sorrowful news. My neighbor had passed away in her sleep, to the surprise of everyone who knew her. An active grandmother, her personality exuded a quiet energy, a presence that brightened your day and made you smile. The loss is palpable.

Rest in peace, Joyce. You will be missed.

Android is Open

I am biased. But hopefully I can still be insightful and argue this point. This was sparked by a thread on Hacker News, in which someone commented:

Android is all but open.

I’m calling this out. Android, as a software project, is completely, 100%, open. It’s released by Google with the Apache license, which is recognized by OSI and the FSF as a Free/Libre, Open Source license. The Android code itself is freely available, freely redistributable, and can be compiled and flashed onto any compatible device.

However, there is a significant portion of the Android ecosystem that is not “open” by the same definitions above:

  • Device drivers for individual phones are open or closed depending on the device and the individual chipsets in question, but that is a moot point in my opinion as there are plenty of people who use Free desktop operating systems with closed “binary” drivers. Therefore I will leave this topic for another discussion.

  • All of the Google-branded applications — including the Market, Gmail, and Maps — are closed-source and must be licensed with Google to be included on a phone. This means that Cyanogen is not allowed to include these apps when he releases his amazing CyanogenMod firmware. Other services that Google then builds on top of these closed applications are also closed by nature, including their proprietary “push” communication model.

For some purists, this is a major problem, and I would generally agree. But unlike Apple and iOS devices, none of these Google-branded apps are “privileged” applications; they don’t get special treatment from Android, and they don’t have access to anything that “normal” applications can’t access through the SDK.

But more importantly, these apps are not Android, and they are not necessary to delivering an Android phone or firmware. Developers can write and release competing or nearly indentical applications that replace these closed system apps, and indeed, there are multiple competing “app stores” for Android, with Amazon rumored to be creating yet another. There are even better alternatives for Chrome to Phone already available. And if you insist on not using — or have a phone without — the Android Market, Android is perfectly capable of “side-loading” software packages, and nobody needs to pay Google for the rights to do so.

What is all this proclaimed openness worth if it still boils down to exploiting security systems if you want to run that system you just modified?

That is the real problem, and in my opinion the blame is firmly with the carriers; not Google, and certainly not Android. I specifically purchased a Nexus One because it supports the ability to flash the phone with unsigned firmware. I can download the Android source code, compile it, and flash that resulting firmware to my phone, without needing to root, exploit, or jailbreak my phone. I could do that with my Openmoko Freerunner, and I can do that with my Nexus One.

If enough people insisted on purchasing phones with this capability, then the carriers and manufacturers would pay attention and deliver. Or perhaps Google should be standing up to carriers and demanding that all Google-branded and licensed Android phones have this capability. But even if they could get away with that demand, they can’t enforce it on all Android devices; the very definition of Free Software allows carriers and manufacturers to take Android and do what they want with it if they don’t like Google’s terms.

Maybe the real lesson is that Free Software is a double-edged sword, and if you want corporations to join in, you have to be willing to play their game too.

Dvorak

(Originally posted by myself on Hacker News)

I’ve been typing with the Dvorak layout for about three years now. I personally can’t fully touch type, and never have been able to, although these days I’m getting pretty close if I stop thinking about it and just start typing. My typing speed has slightly increased, but is more or less limited by the speed at which I can think about what I’m trying to type. The real benefits are in the related experience.

I’ve noticed a dramatic reduction in wrist strain at the end of the day, mainly due to the shorter movements for the majority of keystrokes, as well as the proper alternation between hands. Both are hallmarks of the Dvorak layout’s primary design requirements.

Regarding impact on programming efforts, My biggest complaint is that the brackets are on the number row instead of just above the home row, but when I’m writing Python code, I use them far less, so it’s not much of an issue; when I’m writing PHP, C, or Java code though, it can get a bit annoying, but it’s a good trade-off since the +/= and -/_ keys are now closer at hand.

For my editor, I’ve been using Vim for longer than I’ve been using Dvorak, but I’ve never used the hjkl keys for normal movements; I bought keyboards that specifically have the arrow keys right under the Enter key, so moving to use those is very simple, and allows me to use Vim without having to remap any of the normal movement keys.

In all, I highly recommend the switch, especially for anyone who plans to do a lot of typing in their daily routine. The benefits have far outweighed any of the drawbacks. And purchasing a purpose-built Dvorak keyboard will be one of the best investments you can make. I personally love and highly recommend the TypeMatrix keyboards, not only for their great layout, but because it has a physical toggle switch for moving between Qwerty and Dvorak layouts, which is priceless when you want to be able to play games that aren’t friendly to non-Qwerty layouts.

If you’d like an entertaining way to learn more about the Dvorak layout, DVZine has a very informative comic book about the history and benefits.

PHP Bugs Me, or Where Type Coercion Causes Bugs

I really like PHP as a technology, both for its extensibility and its deployment style. I think it is the quickest and most straightforward platform to create web applications with, and frameworks like CodeIgniter make it even better.

I’ve long been on the fence regarding PHP’s type coercion and comparison issues, but a recent bug in Mantis Bug Tracker has made me /facepalm for the first time in my long history of working with PHP:

When I click on “Edit” next to 1.2, mantis shows me the 1.20 properties. When I click 1.1 it shows me 1.10!

The offending snippet of code:

foreach( $g_cache_versions as $t_version ) {
   if ( ( $t_version['version'] == $p_version )
      && ( $t_version['project_id'] == $c_project_id ) ) {
      return $t_version['id'];
   }
}

At first glance, it seems perfectly normal… and then you read the commit log, emphasis mine:

This is due to an incorrect version name comparison in version_get_id whereby the following check between strings was occurring:

if( "1.1" == "1.10" ) { ... }

PHP evaluates this expression to true because 1.1 and 1.10 are treated as floats. We however need to preserve the string type during this comparison, thus we need to use the === comparison operator instead.

I thought I’d seen it all…