Tuesday, August 21, 2007

iPhone features I'd like to see

OK, I'm thiiiis close to getting an Apple iPhone. I'd have to break my contract with Verizon. But there have been so many times that I've been out and about and wanted to quickly look up something on the web. Or check my email to see if I've been outbid in the last 10 seconds on a digital oscilloscope auction, again.

I've used my friends' iPhones and played with them in the store. As a result, I'm tempted to wait until software updates or a new iPhone model comes out. There are some nifty features missing on the current version that it desperately needs to be really, really usable.

GPS

Think about it: how many times have you been in an unfamiliar town (or even a familiar one) and wanted to know something like "where are the Italian restaurants nearest to me right now?" or "where's the nearest Post Office?" With the current iPhone, you can bring up Google Maps, which is great, but you still need to know what city or ZIP code you are in. What if you don't know your exact current location? You're screwed, because either you can't search at all or you get way too many results.

What I'd like to see is a way for the iPhone to know its current location. GPS would be great, as it would give your location to within 10 feet or so, but for Google maps an exact location isn't necessary. Even knowing your approximate current location would be good enough. I don't know much about cell technology, but I imagine that each cell tower knows its own location. The iPhone could do some triangulation to figure out where it is in relation to the towers, at least well enough to make Google maps searching incredibly useful.

Voice Dialing, Done Right
I use voice dialing when I'm driving. With my headset on, I just touch a button on the phone and ask it to dial one of the people in my contact list. Here's how the conversation with my phone usually goes:

Me: Call Brenda
Phone: Did you say, "Call Brenda?"
Me: Yes
Phone: Which number?
Me: Mobile
Phone: Calling...

My phone has a voice-recoginition system that doesn't need training ("voice-independent recognition"). That is, out of the box, it's able to listen to the user's voice and match it with a name in the contact list. But because the voice recognition isn't tuned to a specific voice (mine), it needs to double-check the match. Hence, the question "Did you say...." What gets me is that it is always correct!

Phone manufacturers, unfortunately, have decided that implementing voice-independent recognition is inherently a binay decision (either it's used for all contacts, or it is not used at all) and, if voice-independent recognition is not used, training it is inherently modal. That is, in order to train the phone to recognize names, the user must go into a special "training" mode.

What I want is a phone that learns.

When I answer "yes" to the query "did you say...", the phone should immediately remember what I just said. The next time I ask to call that name, the training will have already been done. That should be the extent of training the recognition system -- totally transparent to the user.

Games
I need my Tetris and Bejeweled!

VOIP
That's Voice Over IP or, in layman's terms, Skype. Not going to happen, though. The purpose of a mobile phone is to make the carrier rich by charging for minutes of airtime.

On the other hand, T-Mobile is rolling out a new service called T-Mobile Hotspot @ Home in which a WiFi-enabled mobile phone can make free call when in the presence of a WiFi hotspot.

So who knows, maybe we'll see Skype on the iPhone yet.

Saturday, August 18, 2007

Airport Extreme Cripples Write Throughput

There is a major problem with the Apple AirPort Extreme involving its "AirDisk" feature. I have the "older" 100BaseT model to which I have attached a USB hard drive to share among my various Macs. There have been many postings on the Apple Discussion Boards about poor disk performance when the Airport Extreme is used to share disks. While some users report slow throughput, others claim to have no issues at all.

I have confirmed, through testing, that some USB disks do indeed exhibit very poor write throughput when compared to other USB disks. This could have a serious impact for anyone using a USB disk with an AirPort Extreme, especially when used for its intended purpose: to do unobtrusive backups.

Background
This problem was first brought to my attention when I purchased an Other World Computing (OWC) Mercury Elite Pro "Quad Interface" enclosure. In it I placed a Seagate Barracuda 3.5" 400GB SATA drive. This enclosure, which sports four types of interfaces (USB 2.0, FW400, FW800, and eSATA) for attaching to a computer, performed admirably over FW800 when connected directly to my PowerMac G5 tower. But when I connected it to my Airport Extreme, throughput suffered. Writing to the drive was especially bad.

The drive enclosure is manufactured by Newer Technologies. Many emails with their technical support division turned up no solutions. In fact, Newer's tech support denied that there was any kind of performance issue.

In desperation, I connected up an old "generic" USB enclosure with an even older 20GB IDE hard drive. To my surprise, throughput was quite good. Clearly, there is some bad interaction between the AirPort Extreme, the USB enclosure and its internal driver circuitry, and the hard drive.

Ultimately, I wanted a nicer enclosure that would fit under my AirPort Extreme. I settled on the miniStack v3. Like the Mercury Elite Pro, the miniStack v3 is also a quad interface enclosure. It, too, is manufactured by Newer Technologies. I also purchased a 500GB Hitachi SATA drive. After hooking everything up, the results were the same: write performance through the Airport Extreme was poor.

Finally, at wit's end, I decided to settle this once and for all and run some tests. I suspect that there's something about the Newer Technologies driver circuitry that is reducing throughput. I wanted to pit the miniStack against the cheapest USB enclosure I could fine. In the tests, I attempted to eliminate as many variables as possible. The only variable would be the USB enclosure. I also tested a direct USB connection to the Mac to obtain baseline figures.

The Hardware
Two enclosures:
Newer Technologies miniStack v3 with quad interfaces ($120, from OWC);
AverTech SATA HDD Enclosure with only a USB 2.0 interface ($35, at Fry's).

One hard drive:
Seagate Barracuda 7200.10 3.5" 400GB SATA hard drive.

Two connection types:
Directly connected to the Mac via USB cable;
Via the AirPort Extreme, using 100BaseT Fast Ethernet (not wireless). AirPort Extreme running v 7.1.1 firmware.

Methodology
I ran eight tests. Four were "read" tests and four were "write" tests. All tests used the same 600MB mix of files and folders. The files ranged in sizes from under 1K to over 200MB. Before each write test, the drive was reformatted as HFS+ with journaling using the Apple Disk Utility.

The results are as follows (click for larger version):


In all tests, the miniStack is no faster than the "cheapie" USB enclosure. In fact, it's always slower. But most alarming is the write throughput via the AirPort Extreme. The miniStack is takes almost twice as long!

Also worth noting is the noise the drive makes when performing the tests. In seven of the eight tests (all except the slow write test noted above), the drive is nearly silent. All I can hear is the motor and a very quiet clicking as the heads move back and forth. In contrast, during the AirPort Extreme write test using the miniStack, the drive is very loud. The heads can be heard noisily clacking back and forth. Something different is clearly happening with the miniStack.

Conclusion
The OWC Mercury Elite Pro "Quad Interface" and the Newer Technologies miniStack v3 both behave nearly identically. I suspect that the internals of both enclosures are pretty much the same, as they are both made by the same manufacturer (Newer Tech) and both are quad interface devices. Both enclosure exhibit very slow write throughput and create lots of noise when connected to my Mac via the AirPort Extreme.

The AverTech USB enclosure (the cheapest thing I could find at my local Fry's) is identical in performance to the miniStack except when writing files via the AirPort Extreme. In that test, it is much faster and much quieter.

I suspect that there is some kind of bad interaction between the Apple AirPort Extreme and these "multi interface" enclosures. A no-name USB-only enclosure soundly beats a name brand multi-interface one. Someone, either Apple or the USB drive enclosure manufacturers, needs to explain these dismal throughput numbers.

I've learned one thing for sure: spending more -- a lot more -- on an enclosure doesn't necessarily get you better quality or higher speed.

Update (7:35 pm)
Just for grins, I included two more enclosure and drive combinations in my tests. All told, they are:

Newer Technologies miniStack v3 with Seagate 400GB SATA drive
AverTech "generic" USB with Seagate 400GB SATA drive
CompUSA "generic" USB with Quantum 20GB IDE drive
OWC Mercury Elite Pro Quad with Seagate 400GB SATA drive

Results (click for larger version):


Interestingly, the old Quantum IDE drive fared better in the AirPort write test than any of the others! I can't account for that, but I do know why its read speeed over direct USB is slower: it has a longer rotational latency and therefore takes longer to access data.

The whole point of the graph is to show that the Seagate SATA drive performs poorly in the Airport write test whether its in the miniStack or the Mercury Elite. Something is definitely wrong with this picture.

Update update (Aug. 21, 1:15 AM)
A reader suggested turning off HFS+ journaling on the external drive. I did so and clocked the fastest AirPort write time yet: 125 seconds for the 600MB of files. Throughput rises to an astonishing 4.8 Mbytes/sec! USB 2.0's maximum practical throughput is around 30 MBytes/sec. Fast ethernet can pump data at approximately 12 Mbytes/sec. Who knows what the internal disk transfer speed is of the Seagate drive, as Seagate does not publish that spec. I would expect performance of the overall system to be 6-9 Mbytes/sec.

Still, this points to a problem with the AirPort firmware: writing to HFS+ journaled multi-interface external disks is extremely slow. HFS+ with journaling is the default for newly-formatted disks, so there should be no reason why an ordinary user would need to turn it off.

Saturday, August 11, 2007

Mobile phone myths

I've been a mobile phone user since 1999. I started own on Pacbell PCS, which later became Cingular. In 2004 I switched to Verizon.

Over the years I have learned some of the ins and outs of the mobile phone trade. These are all based on my personal experience and from reading the fine print. Here are four myths about mobile phones and their rate plans. I'll debunk each myth with the plain, simple truth.

Myth 1: My carrier requires a 1- or 2-year contract.
Carriers use contracts to help guarantee that you'll remain a customer for at least the length of the contract, not necessarily to extort money out of you. By doing so, they can generally offer lower rates than a pay-as-you-go customer would pay, knowing that they've got you as a customer for at least 12 or 24 months. To get the best of both worlds (lower rates without a contract), simply buy your phone at full retail price and opt for a month-to-month plan. The upfront cost will, obviously, be higher but the rate plan will be the same as the ones for contract. You can cancel at any time. Some dealers will even unlock your phone for you, allowing you to use your phone with other carriers.

Myth 2: My phone was free! (Or nearly free.)
Of course it wasn't. Look at the receipt from your phone purchase. You paid sales tax on the full retail price of the phone. In other words, you bought the phone for full price. But then they gave you an instant rebate. Notice how the rebate amount is approximately the same as the "early termination" fee? If you cancel early, the carrier wants you to pony up the amount that you "saved" by signing a contract. In other words, the early termination fee is the money you would have paid had you bought the phone at full price.

Myth 3: I'm locked into a contract.
No one is ever locked into a contract. Contracts can be broken at any time by either party. All you have to do is pay the "early termination fee." Can't afford the fee? Well, that's your problem, not the carrier's. They're not locking you in; you are. See Myth 1 for a way to avoid contracts in the future. Side note: some carriers wil prorate the termination fee during the last year of the contract. For example, if you cancel your contract after 18 months, you'll need to pay only half of the termination fee.

Myth 4: I can't change my rate plan.
That depends on what state you live in and which carrier you are using. Here in California, Verizon allows me to change my rate plan at any time without penalty. Cingular was the same way. In some other states, I've heard that any change in your plan results in a new contract. I would complain to the dealer or carrier and try to get it waived. By agreeing to a new contract, but not getting a new phone in the process, you're giving the carrier free money. See Myth 2.

And now some real truths about mobile phones.

The user interface sucks and the phone is falling apart.
Yup. You see, the phone manufacturers are in the business of selling phones. They build them to last about 18-24 months under normal use. By the time the thing is on its last legs, it's time to renew your contract and get a new phone. The user interface, too, is designed to irritate you just enough that you'll want to dump your current phone at the earliest opportunity. You've heard of "planned obsolesence," right?

Cell phone rate plans here in the US are more expensive than in ___.
Yes and no. In some countries, such as the UK, rate plans are actually more expensive. It may be why text messaging is so much more popular there; it costs less to fire off a few 100-character text messagse than it is to talk for two or three minutes. That said, in some countries, such as India, rate plans are dirt cheap. However, the consumer generally buys the phone outright. In other words, the phone manufacturers and carriers are not as closely tied togehter as they are in the US. Because the consumer is free to switch plans at any time, the carriers compete ruthlessly for business. Consequently, rate plans are very cheap.

There you have it. Contracts, phones, and plans in the US generally suck. But that's the truth. Any comments?

Sunday, August 5, 2007

A new teaching tool for CS

I have been teaching full-time for five and a half years. Before that, part time for a couple of years. I love interacting with students and inspiring them to learn more than they expected. It's been a wonderful experience and I wish to continue it.

My area of interest, as you can imagine, is in education. Specifically, how to inspire a new generation of students who have grown up using iPods, playing 3D video games, and chatting on the Internet. It's a different world than when I was going through the MS program.

I am interested in new pedagogical approaches to CS education, specifically in the area of programming. Introducing new students to programming, especially ones raised on a diet of the above-mentioned technologies. Today's introductory programming classes need to be interactive, graphical, and support a wide variety of teaching and learning preferences.

I've been attending the annual SIGCSE conference regularly for five years. I've heard from countless professors that today's CS1 and CS2 courses lack a compelling, rigorous programming environment for teaching and learning. BlueJ, Alice, DrScheme, and others are all good, solid attempts to bring modern IDEs and pedagogically-appropriate languages to beginning students. But they aren't enough. They all have their strengths and weaknesses. I have taught CS0 and CS1 courses with several of the teaching tools and have come to form my own opinion about what a good teaching tool should be.

I believe that what students need is a language and IDE that grows with them. Beginning students -- even those in primary and secondary schools -- can use a drag-and-drop interface similar to Alice. As they advance, the IDE can change to support more typing with less dragging with corresponding advances in program design flexibility. At its most advanced level, seasoned professional programmers could use the IDE to write production-quality programs.

It's an ambitious project, for sure. I intend to start simple and reuse existing technologies: XML, XSLT, CSS, virtual machines, and the like. In fact, the programming language specification is nothing more than an XML DTD file. The IDE is just an engine that interprets and builds correct XML files. The compiler is an XSLT engine that interprets an XML file and targets... well, anything. For starters, it would target an existing virtual machine, such as the JVM or Parrot.

In short, my idea is influenced by a well-known acronym: MVC (model-view-controller). While the MVC design architecture has been around for decades, it has not, to my knowledge, been applied to a programming language.

Model: an XML file with DTD specifying the "grammar."

View: an interchangeable view of the XML file. It could be graphical (like Alice), textual, 3D, flow charts, whatever. The view can also accommodate different user interface languages: English, Japanese, etc.

Controller: the user interface. Like the view, it is interchangeable. Users could choose a drag-and-drop interface, a more traditional text interface, or a hybrid of the two. Or even something completely new, yet-to-be-invented (but simmering in the back of my mind).

Once the prototype has been built, I imagine it would need to be tested in the classroom. A curriculum using this new language/IDE would be designed and tested against existing pedagogical approaches: BlueJ, DrScheme, Alice, Karel, etc. Quantifiable measurements would be test scores and how well the students performed in subsequent classes that used traditional programming languages.