My phone is smarter than I am

I finally did it: walked into a Verizon store and picked out a smart phone. I’d been dragging my feet for a variety of reasons, ranging from a dislike of the slab-like form factor to just plain laziness. But oh my, was I missing out! Things have changed since my last phone purchase in 2006!

I’m not an impulse buyer. I was just going to see what the latest offerings were. And if or when I did get a smart phone, I vaguely assumed it’d be an iPhone, which is the only one I’ve played with before. But the Verizon employee who met me as I walked in immediately steered me to the Android side of the store. “That’s what we all use,” he confided. And here I’d thought Verizon was over the moon to be offering the iPhone, which is selling so fast that you can’t get it in black anymore online (or at this particular store), only white.

I handled a bunch of these phones and gradually narrowed it down to two that were the least chunky and slippery. I was persuaded that I might as well opt for a 4G phone, since although only 3G is available here in Corvallis, I’ll be moving back to L.A. soon where it seems 4G is all the rage, and 10 times faster. I really liked the Verizon guy who was helping me; he was extremely knowledgable, fielded every single one of my questions, and was up front about what was a useful attribute and what was a buzzword. I later learned that he was the store owner.

I converged on the Pantech Breakout, a phone I otherwise knew nothing about, but it felt the best and since they all had the same OS, form factor apparently was the deciding angle. It was just a bit smaller than the other 4G phones, with a slightly grippy back, and felt better in my hand. The thing has a 1-GHz processor, weighs less than 5 ounces, and has about a billion features I won’t need but came along for the ride (like how it can act as a “hotspot” and relay net access to other devices). I was going to go home and think it over, per usual with large purchases, when I realized that at $50, what exactly was I going to deliberate?

Verizon guy: “I guess you probably don’t want the phone insurance option. After all, you managed to hold onto that phone for FIVE YEARS.”

He threw in a car charger and a screen protector with a nice discount, and I was on my way. A whole new way! I’ve got the future in my pocket!

Here are some of the awesome things I’ve discovered this “phone” can do:

  • Voice translation. Like, you speak in English, it turns that into text, translates it into French, and then speaks the French aloud. Your French friend can then do this in reverse and suddenly, you’re communicating across the language barrier. I sat in the Verizon store entranced, having a conversation with myself in two languages, and it WORKED! I imagine you could also use this to learn the foreign language, at least to some initial rudimentary level.
  • Voice dictation. You can dictate text messages, emails, search queries, memos, etc. The accuracy of its dictation (relayed to a server, not local to the phone) is startling. I can say “wikipedia oregon trail” and google does the right thing! I can say “post office” when I’m looking at google maps and it pops up pointers at all the right places! The pain of typing texts is gone! (As a bonus, the “swype” method for entering texts on the keyboard is a nice advance in itself, and good for settings in which you don’t want to speak your texts out loud.)
  • Yelp. Google docs. Geocaching. Disc golf maps and scoring. My ravelry knitting projects. An exoplanet counter. Angband.
  • Amusingly gratuitous: animated desktop wallpaper, such as little flowers that sway and bob when you swipe left or right, or ponds that ripple when you touch them. Amusing for about 30 seconds, then deemed not worth the battery life they require and deactivated.

At the store’s recommendation, I attended their “smart phone training session” which took place the next day. It was me and six octogenarians. Another Verizon employee led the class. He began with a glowing paean to all things google, which concluded with “It’s okay to share all of your data with google, because their motto is ‘do no evil.'” I did get more familiar with the OS and was able to ask some questions. So far, so good.

Any favorite Android apps you’d like to suggest?

For loops in bash

Iteration: it’s such a powerful tool. Automating the repetition of tasks can save so much time and keystrokes and tedium. This capability is one of the reasons I love bash, my command shell of choice. I used to employ tcsh, but switched to bash years ago mainly because most linux system scripts use bash, and I wanted to just focus on one syntax so that my own scripts and the system ones would be equally readable. But bash also opened my eyes to the beauties of command-line for loops. (Tcsh makes them interactive, which initially seems nice, but then is annoying if you’d like to re-do an earlier loop you typed in.)

So now I regularly use for loops at the command line for all sorts of things: resizing a collection of images, creating a collection of symbolic links, renaming a series of files by some standard convention. It’s great for any task in which you want to do the same operation, but the individual commands differ slightly, and in which you can’t just pass in a wildcard list of inputs. But for the longest time, I thought there was only one form of the loop syntax:

for i in choice1 choice2 … choiceN ; do
… [some task with $i, the current choice]
done

Thanks to this great collection of for loop examples, I’ve learned that bash now also supports sequence iteration! So you can do

for i in {1..5}; do
… [some task with $i, a number from 1 to 5] …
done

Previously, I would have written

for i in 1 2 3 4 5 ; do
… [some task with $i, the current choice] …
done

which gets very clunky with larger ranges, involving nested loops, one per digit. Ugh!

Newer bashes (version 4.0+) even support increments, e.g.

for i in {1..5..2}; do
… [some task with $i, an odd number from 1 to 5] …
done

And wow, there’s even a C-style syntax:

for (( i=1; i<=5; i++ )); do
… [some task with $i, a number from 1 to 5] …
done

For loops just got easier.

I used this today to generate a file that contained 16 1’s followed by 16 2’s followed by 16 3’s… all the way up to 16 30’s. Exactly the kind of thing I don’t want to do manually. And yes, I actually needed this file in order to get some research done. So it goes!

Von Neumann’s first computer program

What would you do with a brand-new computer of unprecedented capabilities? Ada Lovelace demonstrated the theoretical capabilities of Babbage’s Analytical Machine with a program to compute Bernoulli numbers (1843). J. Presper Eckert and John Mauchly’s first program for ENIAC was a ballistics calculation (1946). Alan Turing used the Manchester Mark 1 to compute Mersenne primes (1949). When John von Neumann had the chance to explore the abilities of ENIAC’s successor, EDVAC, he focused on something quite different: data sorting.

Donald Knuth wrote a fascinating 1970 paper, “Von Neumann’s First Computer Program,” which analyzes the original 23-page handwritten document where von Neumann recorded his planned program. Von Neumann conceived of a merge sort algorithm and wrote out an implementation of the merge part of it, which Knuth examined and reported on. Knuth noted the insights von Neumann achieved and then respectfully, humbly, pointed out places where von Neumann’s code could be optimized as well as an unfortunate bug in the program. As Knuth noted, not bad for programming without having the actual machine yet to test it! (I do not know how Knuth found the error, whether by hand-examination or by running the program through a simulator.)

There were some very pressing reasons why ballistics and numerical simulations were the top priorities for the electronic computers just coming into existence in the late 1940’s. Von Neumann’s foray into “a nonnumeric application for computers” foreshadowed the generation and growth of information processing and a landslide of other associated activities and applications in use throughout the world today.

Still talking when there’s Science to do

I recently had the pleasure of playing Portal for the first time. It’s precisely the kind of puzzle-game I like: progressively more challenging levels that require innovation, and even after you’ve solved a level, there’s often further cleverness to be employed in finding faster or more efficient ways to solve it. I blazed through the first 13 levels in about an hour and a half, and felt a little disappointed when I learned that there were only 19 total. But then I got to level 14, which was the first time that the goal itself had to be divined, not just the way to achieve the goal. And other players’ comments about the levels getting exponentially harder are now starting to make sense. :)

I’ve been fascinated by the process of adjusting to “physics” in a world where you have a teleportation gun. You can open one portal in a nearby wall, and another at a far-off wall, then walk through them to avoid the gaping chasm that lies between. But you can also open a portal beneath your own feet to avoid having to walk to portal 1, or open a portal under some object to make it drop in front of you (instead of having to walk through the portals to retrieve it). And then some crazy stuff starts happening when you pair portals together and bounce between them — or open one in the roof and one in the floor and fall forever between them — or look through a portal and see your own profile from across the room. Mind-bending fun!

Lack a PS3? You can play the flash version, which retains many of the same mechanics but provides a 2D side view rather than a first-person 3D view. The puzzles are different, too.

Portal was first released nearly 3 years ago… and Portal 2 isn’t due until February, 2011. It will feature a two-player cooperative mode! As with so many types of media, I’m glad that my slow adoption rate means I don’t have to suffer through years of waiting. (It may take me a while to solve the last five levels!) Now if only I could finish season 1 of Battlestar Galactica, or season 3 of The West Wing, and catch up with the present!

Engine-ering

As kids, I think the first encounter most of us have with the idea of an “engineer” is “the person who drives the train”. By the time I started my undergraduate studies, however, I knew that the College of Engineering wasn’t just about driving trains. But I always wondered how a purely functional role could have the same name as what I now saw as an engineer: someone with a very active role in design and problem-solving. Or as wikipedia puts it, “An engineer is a professional practitioner of engineering, concerned with applying scientific knowledge, mathematics and ingenuity to develop solutions for technical problems.”

Recently I picked up some books at the library on steam locomotives and other fascinating train topics. And suddenly, I realized why the train-driver could also lay claim to the title of engineer. Historically, at least, the railroad engineer did not just drive the train. He (these were generally men) also had to be a top-notch engineer, familiar with all of the inner workings of his engine, as he was continually required to maintain, lubricate, tend to, and sometimes even repair the engine. One book noted that the “iron horse” was just as temperamental and required as much attention and grooming as the organic horse it had replaced.

Today, it seems we have a very different view of machines and their users or operators. Most of us who drive cars do not expect to have intimate knowledge of how they work; instead, we hire car mechanics to deal with the details and fix problems. No doubt today’s train engineers are also much more removed from their engines than those of the 1800’s. Computers likewise (or our attitudes about them) have evolved as well, so that users need not understand operating systems and file systems and network protocols, disk scheduling and memory allocation and pipelining, kernels and shells and scripts. Instead, one can hire an IT expert to maintain the machine and fix it when it breaks.

Is this trend a result of the growing sophistication and complexity of these machines, or a shift in our social attitudes towards the desirability of being involved in details? Or both? If it’s an evolution in the machine, are there other machines out there in their infancy and still requiring that the engine be a part of the engineer?

I can see the allure of both the low and high levels on this abstraction spectrum, for computers. I personally enjoy tinkering with the configuration of my computers and knowing what’s going on under the hood, even up to spending hours buried in an ancient Linux machine to get a wireless card working—but sometimes that loses its appeal when I just want things to work. And in truth, when the machine is reliable enough that I don’t need to be checking and tinkering constantly (as with my Mac), I’ve found that I stop doing it. Yet I still feel a tug of curiosity about other machines as well—I’d love to take a basic automotive mechanics course, and learn more about how trains work, and I’m fascinated by pulleys and linkages and astoundingly clever machines of all kinds. But then, I’m an engineer by inclination—or perhaps, I have a wish to be (in a friend’s charming coinage) an “engine-er”: someone who knows and tends and cultivates the engine, akin to a farm-er or a sail-or.

« Newer entries · Older entries »