My review of the iPhone 3GS

Disclaimer: This post is entirely my personal opinion. I also own an HTC T-Mobile G1, which runs Google’s Android operating system.

I picked up the new iPhone 3G S this Friday and I thought I’d jot down a few thoughts:

The Good:
– The iPhone 3GS is considerably faster than the iPhone 3G. Especially in the browser, you’ll notice pages render faster. JavaScript-heavy pages (such as the mobile web version of Gmail) execute much more smoothly. The iPhone 3GS feels less like an underpowered mobile phone and more like a powerful pocket computer that can keep up with its owner.
– The built-in video camera is very cool. I expect a corresponding spike in home videos. For example, here’s my cat Ozzie playing with a toy:

More seriously, within about five years, for any group of 10 or more people, at least a few will have a video camera built into their phone. That’s a very powerful trend in a lot of ways.
– I tend to agree with Michael Arrington that no one with an iPhone 3GS needs a Flip video camera now. Cisco bought Pure Digital Technologies, the makers of the Flip, for almost $600 million dollars about three months ago. That might prove to be good timing on Pure Digital’s part.
– Lots of small changes in OS 3.0 are quite nice, such as showing outgoing vs. incoming calls in the “Recents” list.

The Bad:
– Apple’s iPhone philosophy has always seemed to me to be about simplicity. The single button forced a constrained elegance on the iPhone’s interface. In providing some newer features, the iPhone 3G S feels less like an iPhone and more like someone shoveled in a lot of features. I didn’t really need copy/paste, and it seems to pop up at random inconvenient times: double-tap a word if you’re not in the browser; in the browser, hold your finger on some text. Except the copy handles don’t seem to show up on the web pages I want, and sometimes unwanted copy handles appear when I’m just scrolling with my finger.
– The iPhone 3GS is not the huge leap that the iPhone or the iPhone->iPhone 3G was. I do think that leaves some opportunities for Android, Palm, and other competitors.
– Battery life has been worse so far for me. I’ve been using the phone more and it’s only been a few days, so I’m not going to jump to conclusions on this yet. Apple also recommends that you let the phone run down completely at least once a month, and I haven’t done that yet. I expect that battery life will be better for most people.
– Not a great name; the “GS” part makes me think of Ghostscript. A few days ago, I would have said that the “iPhone Video” is a much better name, but it’s true that the speed bump is more noticeable than the video. I still think Apple could have come up with a better name than “iPhone 3G S” though. I’m sure someone who knows about Mercedes Benz cars knows the difference between the E class, the SLK class, or the GL 420 CDI, but most normal people don’t know what a bunch of letters and numbers mean.

The Ugly:
– On my previous iPhone (the 3G), the metal band around the front matched smoothly with the black plastic back. On the new iPhone 3GS, I can feel the seam where the band meets the plastic. On the front of the phone, when I flick my finger off the glass, I can feel the seam of the metal band there too.
– In my personal opinion, someone miscalculated in charging iPhone 3G owners $200 extra to upgrade. New iPhone 3G S customers pay $199 (16GB) or $299 (32GB); many early adopters would have to pay $399 (16GB) or $499 (32GB) to upgrade. The CPU speed bump and video abilities aren’t enough to counteract what many early adopters will perceive as a bit of a slap in the face. Last year, the line for the iPhone 3G at Valley Fair stretched outside the building most of the day. When I went to get my iPhone 3G S on the release day at Valley Fair this year, there was no line at all.

And remember that early adopters often give their previous phones to family members. In my case, two other relatives are taking our older iPhone 3G phones and moving from a different carrier to AT&T. By charging early adopters more, AT&T ensures that more people will hang on to their old phones instead giving them to other people, many of whom would then become AT&T/iPhone customers. By limiting the “trickle down” effect as older iPhones go to family members, AT&T is missing a chance to gain more marketshare by acquiring additional new customers.

I’ll be interested to see how Apple and AT&T react. AT&T has already allowed some (but not all) iPhone 3G owners to upgrade without paying an “early adopter penalty.” And Apple can move quickly and decisively when needed–remember the $200 iPhone price drop in 2007 just a short time after the iPhone was released? Of course, it’s possible that penalizing early adopters is all part of some four-dimensional chess game that Apple is playing. If Apple decides to terminate its exclusive U.S. deal with AT&T in a year or so, maybe it didn’t want a bunch of people signing up for two-year contracts this time around? Right now I’m puzzled by what appears to me to be a misstep, but the folks at Apple are smart, so I’d be willing to believe that Apple has good reasons for what they’re doing.

Should you upgrade? That’s something only you can answer. If you still have a non-smartphone or an original iPhone, it’s probably worth it. If you have an iPhone 3G (especially if you’re not eligible for the discounted upgrade yet), you might try OS 3.0 and see if that’s enough. I decided to get the 3G S and I’m glad that I did. I fill all sorts of idle moments with surfing, tweeting, and checking my mail. The iPhone 3G S makes all those activities much faster and more pleasurable. Overall I’m quite happy with my iPhone 3G S.

Android barcode scanner in 6 lines of Python code

After my last video about using a barcode scanner to add and search books in your library, I was feeling pretty happy. Bar code scanners are pretty cheap–mine cost about $65. But then Google released the Android Scripting Environment (ASE) and it turns out that you don’t even need a bar code scanner. Instead, you can use an Android phone such as the G1.

Just as a proof-of-concept, here’s a barcode scanner written in six lines of Python code:

import android
droid = android.Android()
code = droid.scanBarcode()
isbn = int(code[‘result’][‘SCAN_RESULT’])
url = “http://books.google.com?q=%d” % isbn
droid.startActivity(‘android.intent.action.VIEW’, url)

Thanks to fellow Googler Vijayakrishna Griddaluru for sending me this sample code. Visiting the resulting url offers the option to add that book to your library:

Android bar code scanner

Pretty easy, huh? You can read all about the new scripting environment. Not only can you scan bar codes, you can use text-to-speech, make phone calls, send text messages, read sensor data, and find your location–all from easy scripts. One person wrote a script to go into silent mode when the phone is placed screen-down on the table. It took less than 20 lines of code, and that’s including comments!

The Android Scripting Environment should make fun projects even easier. Brad Fitzpatrick wrote about using his Android phone to open his garage door automatically when his motorcycle gets close to home. Now those sorts of projects are even easier to write. 🙂

Search your bookshelf with a $65 barcode scanner

(Okay, if TechCrunch wrote about my video then I should probably at least do a blog post too.)

Last year I suggested potential Summer of Code projects and one of my favorite suggestions was “How about a good open-source program to manage your book library? Something like the Delicious Library program, but that works with Linux?” In the blog comments, Colin Colehour left an excellent comment: “Matt, Can’t you use Google Books to keep track of your book library at home? You can add books that you own to the ‘my library’ list and then export that as an xml file and they have RSS feeds.”

The suggestion was so obvious that I smacked my head. Why install software at all when a website will store the data for you? The only problem was how to tell Google which books I own. Well, there’s a neat hack for this too: Amazon carries the Adesso NuScan 1000 bar code scanner for $65.44 with free shipping. I’m sure you can get barcode scanners for cheaper (anyone remember the CueCat scanner that was free?), but the Adesso had good reviews.

With that, adding your books to Google’s My Library feature is simplicity itself–the Google Books team has tweaked the workflow so that you can barcode scan and add lots of books very quickly. Here’s the video to demonstrate:

Why would you record which books you own in the first place? The immediate reason is that you can run full-text searches against the books in your library. That’s right: just by scanning bar codes, you can search over the text of books you own. Down the road, I can easily imagine other uses. Wouldn’t it be great if you could upload your list of books to Amazon, and it would automatically suggest other books you should read? Or avoid suggesting books that you already own? Josh Lowensohn mentions another great reason to do this: it creates a record for insurance purposes.

Once you have your book list, there are social networks for book lovers such as Goodreads and LibraryThing. And please note: this isn’t the only way to scan your books. Delicious Library 2 is $40 commercial software for the Mac that can use your Mac’s built-in webcam.

Special thanks to Michael ‘Wysz’ Wyszomierski for recording and producing this video. I love that he showed the computer’s screen and showed an “action shot” of scanning the books.

Use a Wii Balance Board with Linux

In this post you’ll learn how to make a working Bluetooth weight sensor + fast real-time graphical display with about 200 lines of Python code. You can code any Nintendo Wii-like video game for Ubuntu/Linux and the Nintendo Balance Board very easily. Here’s a video demonstration:

This post assumes that you can already communicate with a Wiimote on Linux. See my earlier post if you haven’t done that.

You’ll need Subversion and autoconf installed if you haven’t already installed it. I think the official/full list of packages to install is

sudo apt-get install autoconf autogen automake gcc bluetooth libbluetooth2-dev libgtk2.0-dev pkg-config python2.5-dev flex bison subversion

You must also install the development package for BlueZ, which is the official Linux Bluetooth protocol stack:

sudo apt-get install libbluetooth-dev

Make a directory to hold your code:

mkdir ~/wiibalance
cd ~/wiibalance

Check out the CWiid (get it? CWiid? Seaweed?) library using Subversion:

svn co http://abstrakraft.org/cwiid/svn/

When I checked CWiid out, it was up to version 183.

Compile the library, e.g.

cd ~/wiibalance/svn/trunk
autoconf
./configure --libdir=/usr/lib (according to this page, you need the libdir parameter on Ubuntu)
make
sudo make install

Now apply the patch to CWiid to add the Balance board. Go to http://abstrakraft.org/cwiid/ticket/63, click on balance.diff, then at the bottom of the resulting page, click on “Original Format” to download the diff as a raw text file. Do the same to download the “weighdemo.py” file. Now apply the balance.diff patch:

patch --dry-run -b -p0 < balance.diff (this command tests that everything would apply without errors)
patch -b -p0 < balance.diff

Finally, compile the code and install it:

make
sudo make install

Then you can play with the weighdemo.py script. You’ll want to change the line “sys.path.insert(0, ‘/home/tbble/code/cwiid/svn/cwiid/python/build/lib.linux-x86
_64-2.5/’)” to point to the right place on your system, e.g. /home/youraccountname/wiibalance/svn/trunk/python/build/lib.linux-i686-2.5/ . And you may need to disable the “if wiimote.state[‘ext_type’] != cwiid.EXT_BALANCE” if statement. I also added a few lines to print out the values and calibration numbers for the four sensors. Here’s what I get when I run my program:

$ ./weighdemo.py
Put Wiimote in discoverable mode now (press 1+2)…
Type q to quit, or anything else to report your weight

right_top 2249 [2293, 4004, 5725]
right_bottom 1467 [1449, 3155, 4874]
left_top 12471 [12476, 14238, 16015]
left_bottom 6822 [6848, 8581, 10325]
-0.58kg
Type q to quit, or anything else to report your weight

right_top 3618 [2293, 4004, 5725]
right_bottom 3983 [1449, 3155, 4874]
left_top 14208 [12476, 14238, 16015]
left_bottom 9621 [6848, 8581, 10325]
82.18kg

In this run, the first example is weighing with nothing on the scale. The second example is with me standing on the scale.

Here’s what you need to know. First, absorb this info from the Wikipedia entry:

Although the Japanese packaging states that it is designed to support people weighing up to 136 kilograms (300 pounds) and the “Western” Balance Board up to 150 kg (330 pounds), they are actually the same board. The packaging differs due to laws in Japan and other nations regarding weights and measures. While the board only displays weight readings up to what is printed on the packaging, the actual physical structure of the board can withstand much greater force equivalent to around 300 kg (660 pounds).

Okay, so the Wii Balance Board is certified for 300 pounds (136 kg) in Japan and 330 pounds (150 kg) in the U.S. The Wii Balance Board has four sensors, so each sensor is certified for up to 136 kg / 4 = 34 kg per sensor in Japan or 150 kg / 4 = 37.5kg per sensor in the United States. Now that you’ve been schooled on that, the following Wii Balance Board calibration information from WiiBrew will make more sense.

Each sensor returns 2 bytes of data and also has six bytes of calibration data. Think of it as a 16 bit number and three calibration numbers, that are also 16 bits apiece. The three calibration numbers correspond to the sensor reading for 0 kg, 17 kg, and 34 kg (those numbers should look familiar if you look at the previous paragraph). So if sensor #1 gives a value of 5725 and the 34 kg number is also 5725, then that sensor is reporting exactly 34 kg of weight on it.

The WiiBrew page says “Calculating the weight on each sensor simply involves interpolating between the two calibration values your reading falls between (or using the higher two values if your reading exceeds the highest calibration value), and the total weight on the board is the sum of these [four sensor] values.”

With that info, let’s go back to one of my sensor readings and convert it to actual kg. Take the reading “right_top 3618 [2293, 4004, 5725]”. The sensor value is 3618, which is between the 0 kg calibration number of 2293 and the 17 kg calibration number of 4004. So the weight on the right_top sensor is 17kg * (3618-2293)/(4004-2293) or 17kg * 0.7744 or 13.2 kg. I tend to put my weight on the back of my feet, which is why 13.2 kg is a little lower than my total weight (82 kg) divided by the four sensors, which would be 20.5 kg per sensor.

If your eyes haven’t completely glazed over, the upshot is that the Balance Board has four independent weight sensors, each calibrated to kilograms, and you can read those sensors in real-time over Bluetooth. Translating the sensor values into weight only takes four lines of Python code. From there, you can do anything you want with that data. Play a game, hook your Wii Balance Board up to Google Earth, or you can even automatically upload your weight to a Google Spreadsheet.

For example, you can run the command “sudo apt-get install python-pygame” to install pygame. Then go back to this page and download the scalesgui.py and system.ini files as you did before (click on them, then click on “Original Format” at the bottom of the resulting page). Make scalesgui.py executable with “chmod a+x scalesgui.py” and comment out the “EXT_BALANCE” if statement, then run “./scalesgui.py” and this is what you’ll see:

Scalesgui program

This is a snapshot, but the program runs just as fast as any video game. You can lean and move the circle around really fast. And in the bottom right, you can see that I weigh 81.74 kg, which is about 180 pounds.

I know this is a long post, but the upshot is that with 10-15 minutes of work, you can use a Wii Balance Board as a real-time sensor with Linux. I hope you have fun!

My 8.7M pixel display

A while ago I wrote about Synergy and showed a picture of my desktop as of July 2007:

My desktop in July 2007

That’s two 24″ Dell monitors (one for a Windows computer, the other for a Linux computer). I’ve had that setup for a couple years and I recently decided it was time to upgrade. So I bought a 30″ Dell UltraSharp 3008WFP monitor. Now my desktop looks like this:

My desktop in April 2009

The two left monitors are Windows XP, the right monitor is Ubuntu. From left to right, I have seven browsers open showing my blog, the Google webmaster blog, Techmeme, Friendfeed, Twitter, Google News, and the Google homepage. I love how much screen real estate this setup gives me (a little over 8.7 million pixels).

css.php