Thursday, December 22, 2005

The Griffin RadioSHARK


I found a RadioSHARK from Griffin Technology at the thrift shop Mabel volunteers some time at, and picked it up for US$2.50 (it retails for US$69.99). The RadioSHARK is an AM/FM radio tuner that connects to the computer via USB, and the accompanying software can play or record the broadcast. Think TiVo for radio. I intended to use it for the odd broadcast that hasn't heard about podcasting. (Pay attention, Car Talk, nobody wants to pay Audible, and nobody wants to use RealPlayer. And as long as we're wagging fingers, get with the times, MLB)

The set-up was pretty easy. You plug the unit in, and ignore the CD-ROM that came with it. The software on accompanying CD-ROMs are inevitably outdated, and you're always much better off just downloading from the manufacturer's site. In general, it worked as it claimed to, and I'm quite happy considering the price I paid for it.

One neat feature of the RadioSHARK is that you can leave the computer in sleep, and it'll wake up automatically to record something according to your schedule. Unfortunately, the correct user has to be logged in at the time of sleep, which can be a small irritation. Worse, it wakes up the computer and bypasses the password entry screen, so unless your computer is in a secure location, the RadioSHARK can wake it up and give anybody access to your desktop. The software is also unable to put the computer back to sleep, and leaves the monitor on. Other than that, it works quite well.

The RadioSHARK also allows you to pause and rewind live radio, which is nifty if you're trying to catch the title of a song, or perhaps an announcement from the DJ. It has modest requirements on the host computer, and our 733 MHz G4 handled it just fine.

Now, the first downside is clear: it doesn't know about the radio stations in your area, so you'll have to tune and assign favorite stations manually.

We've also had some problems with reception. We ended up putting the RadioSHARK on top of a 7-ft. bookshelf, which needed the USB extension cable that Griffin thoughtfully put in the box. Even then, we couldn't find an orientation for the antenna that tuned well to all FM stations.

Another minor gripe I have is with the LED status light on the RadioSHARK, which is usually blue but turns red while recording. The software allows you to turn it off, and that does work, but the setting doesn't stick when you reboot the computer.

None of these little problems really detract from the value of this product. I'd gladly pay US$2.50 again for it, but its full retail price of nearly US$70 is simply not appealing enough, given the diminishing amount of exclusive content on radio.

Tuesday, December 13, 2005

To Stupidity and Beyond!


The British television show Space Cadets is a new "reality" show that pretends to launch several unwitting (or witless) participants into space for five days. They were flown out at night, and circled for hours before arriving at a disused military base in Suffolk dressed up to look like Star City in Russia. They were trained there and placed inside a modified set from the Clint Eastwood movie Space Cowboys, complete with launch noises, vibrations, and a distant earth outside their windows. They were also told that they will not experience weightlessness thanks to gravity generators installed underfoot.

Some viewers have suggested that the hoax might actually be on the public, since the participants could just be actors pretending to be dumb. That may well be, but I personally believe that stupidity has no lower bound.

Oxymoron

When NBC anchor Brian Williams asked President Bush about earlier administration claims that US troops would be welcomed as liberators, the President replied, "I think we are welcomed. But it was not a peaceful welcome."

Monday, December 12, 2005

Alive, Alert, Awake, Enthusiastic


As I kissed Mabel goodbye this morning, she asked me if I had my badge. I patted it and said yes. She asked me if I had my phone. I patted it and said yes. She asked me if I had my wallet. I patted it and said yes. She asked me if I had any money in it. I thought for a second and said yes. So I came to work.

And left my laptop at home. I think I'm mentally already snowboarding.

Counting Bodies


President Bush said today that although the war in Iraq cost about 30,000 Iraqi lives, even with the benefit of hindsight he would make the same decision again, because "removing Saddam Hussein makes this world a better place and America a safer country."

It would be funny if it wasn't so chilling. Saddam Hussein is considered responsible for 300,000 Iraqi deaths over his 24 year reign, which comes to an average of some 12,500 lives a year. The US is averaging 11,244 lives a year (according to Bush's stated estimate of 30,000 Iraqi dead since the war) in the last 32 months, or 12,048 (add another 2,140) if you count American lives lost in Iraq.

Now, I'm not comparing the intentions of anybody in the Bush government to that of Saddam, who is simply a menace. I'm also not comparing the life of a murdered political opponent of Saddam to the one of a suicide bomber. I'm just saying that when your body count approaches the handiwork of a menace, perhaps it's time to be less sure that this was the best course of action. I think a healthy level of self-doubt is a sign of intelligence.

Thursday, December 8, 2005

The Meaning of Life


I have no illusion that this is the first word on the meaning of life, or that it will be the final word. In fact, the point is that this isn't really a word on the meaning of life.

What bullshit, I hear. Yup. Well, I was just browsing from link to link when I came across some musings about what life should ultimately be about. He's right that it shouldn't be about a good job or a good wife, much less a good car or a good house. But he then concludes that it should be about love - nay, it should be measured by love.

Bullshit.

Life is about love and relationships. But it's also about experiences like learning to snowboard after 30, like moving to a different country, like kissing somebody for the very first time, like seeing the Grand Canyon. It's even about driving a car really fast, if you're into that sort of thing, or jumping out of an airplane. It's also about somebody breaking your heart, and every religious experience you've ever had (or not had). It can even be about finding a good bowl of ramen on a cold night. But that doesn't answer the question, you say.

That's right. It doesn't answer the question because life isn't ultimately about any one thing. It's about the totality of things that you've done or could've done but did not. If it was just about love, did Adolf Hitler not love Eva Braun? He probably did, but the totality of his life includes the genocide of millions. Life isn't an equation to be simplified down to one variable. If you're lucky enough to be part of the industrialized world, you're talking about an average of seventy years worth of experiences. Assuming you sleep ten hours each day, that's still 21 million minutes of an average waking life.

Why is there such a dire need to simplify 21 million minutes down to a single word? Oops, you just wasted one or two of those reading this, and I'm not giving them back. So there.

Monday, December 5, 2005

One of Those Weeks


Decided wrongly to leave my laptop at work, so came back here to pick it up over the weekend, during which I left my badge. Came here this morning and was able to get into the office to find my badge sitting on my desk, and then realized that I left the laptop in the car.

It's going to be one of those weeks.

Saturday, November 12, 2005

KNUK EH


Saw that on a license plate.

Wednesday, November 9, 2005

Put Out the Red Light


A (presumably male) Australian teacher was surprised to find a female co-teacher working at a legal brothel while visiting. Unable to keep his mouth shut, the news got out and she was suspended for engaging in activities inconsistent with her day job requirements. After having agreed to quit her night job, she was allowed to transfer to a different school but continue teaching. The poor woman was later seen by a parent, and subsequently fired.

There's nothing wrong with firing her. She agreed to stop doing it, she got caught doing it, she paid for it. The problem is, if working at a brothel is incompatible with teaching, why would visiting it be somehow okay? If it's okay for a parent and a teacher to visit brothels, how awful can it be to be working there? After all, there will be no supply without demand.

Alternatively, what if she was simply a "slut" and had a different boyfriend every night, would that still be incompatible with being a teacher and therefore grounds for dismissal? Does it really just come down to her taking money for sex?

Tuesday, November 8, 2005

Thanks, Kansas


The Kansas Board of Education voted 6-4 to allow Intelligent Design into its science curriculum. Following the electoral fiasco in Florida, California's election of Arnold Schwarzenegger into office had made it the butt of many jokes. I'd like to thank Kansas for taking our place as the stupid state.

Intelligent Design is many things - it's not a bad guess, for one - but it has no place in science. It assumes the existence of a intelligent creator being because some things are inexplicable. Science is the exact opposite of that approach, because science acknowledges what we do not know instead of assuming a solution. Intelligent Design is to science what insistence on the material proof of the existence of God is to religion: a fundamental mistake.

Dumb dumb dumb dumb dumb.

Tuesday, October 25, 2005

Dog Ate It


Since when did "we do not comment on ongoing investigations" and the like become an answer in itself? When asked a question answerable by yes or no, one could answer yes, no, or refuse to answer. In the third case, the audience draws whatever conclusion it draws. What we're seeing more and more often are flimsy excuses tossed out to manipulate the audience when they take the third option.

When Rafael Palmeiro tested positive for steroid use, he refused to go into details, citing confidentiality concerns. That doesn't make any sense, because confidentiality agreements are meant to protect him from disclosure by third parties, and will never restrict him from revealing something personal. This isn't a gag order from a judge.

Similarly, when Vice President Dick Cheney was asked if he has mentioned the identity of former CIA operative Valerie Plame to his chief of staff, he is entirely free to answer. Since when does telling the truth interfere with an investigation?

Monday, October 24, 2005

My Poor Uncle Fadi!


Received this via email:

Dear Friend,

Let me start by introducing myself. I am Mr. Cheung Pui director of operations of the Hang Seng Bank Ltd. I have an obscured business suggestion for you.

Before the U.S and Iraqi war our client Major Fadi Basem who was with the Iraqi forces and also business man made a numbered fixed deposit for 18 calendar months, with a value of Twenty Four million Five Hundred Thousand United State Dollars only in my branch. Upon maturity several notice was sent to him, even during the war early this year. Again after the war another notification was sent and still no response came from him. We later find out that the Major and his family had been killed during the war in bomb blast that hit their home.

After further investigation it was also discovered that Major Fadi Basem did not declare any next of kin in his official papers including the paper work of his bankdeposit. And he also confided in me the last time he was at my office that no one except me knew of his deposit in my bank. So, Twenty Four millions Five Hundred Thousand United State Dollars is still lying in my bank and no one willever come forward to claim it. What bothers me most is that according to the to the laws of my country at the expiration 4 years the funds will revert to the ownership of the Hong Kong Government if nobody applies to claim the funds. Against this backdrop, my suggestion to you is that I will like you as a foreigner to stand as the next of kin to Major Fadi Basem so that you will be able to receive his funds.


Do you folks think I might pass off as Iraqi in front of a Chinese judge?

Saturday, October 22, 2005

Artrageous!


I've always been fascinated by the simulation of traditional media brushes by the likes of Fractal Design Painter, but since Deluxe Paint II I've clearly realized that I still can't draw or paint. So I was happy to find the free ArtRage from Ambient Design, which is more toy than tool, and comes with a nifty "tracing paper" feature for people like me. Here's my first real attempt at oil painting (okay, tracing) a shot of McWay Cove of the Big Sur coastline, one of the most beautiful places on earth.

McWay Cove (oil on canvas, ha ha)

Yes, the thumbnail looks better than the full-size drawing. That's why I write software for a living.

Wednesday, October 12, 2005

Cat Is Out of the Bag


Apple just announced the new iPod, which I've been working on for most of the last few months. I got to attend the "One More Thing..." special event in San Jose, and it's fun to watch the product of your hard work unveiled with ceremony. I think most software engineers work on such intangible things that this sort of personal reward is particularly nice. The new iPod is basically the same size as the old ones, but comes with a really nice color screen and is much thinner. It looks exactly like the big brother of the Nano that it is.

Steve Jobs also said that we had sold a million iPod Nanos in 17 days. That's nearly 41 per minute.

So go buy one now, and help pay my salary.

Monday, October 3, 2005

Amateur Night


I must applaud here President Bush's persistent refusal to discriminate against appointees on the basis of qualifications. If a lawyer for the International Arabian Horse Association can serve successfully as the Directory of the Federal Emergency Management Agency, then certainly a lawyer who has never been a judge can serve just as well as a Supreme Court Justice.

Unfortunately, this has a little more consequence than letting William Hung on American Idol. Harriet Miers may well be a competent justice and maybe even a nice person, but could he really not find anybody of her caliber among sitting judges? Or are judges really meant to conclude that political connections are far more important than performance on the bench?

Tuesday, September 20, 2005

New Guy


The iPods have to be physically taken apart for JTAG debugger contacts to be attached, after which they no longer close. As you can imagine (or have seen in one of the numerous dissect-an-iPod websites), the components inside are connected by thin ribbon cables and other delicate attachments. When I handed one such iPod to a colleague, he chuckled and said: "You're new here. You're still careful."

Competition Looms


The mobile space is about to get interesting. Access - maker of the NetFront mobile browser - recently bought PalmSource and Palm OS. They could just be after the experienced embedded systems engineers, but as Access is based in Japan, a US-based off-shore development center really doesn't make that much sense. More likely, the intention is to combine the two products into a complete mobile phone application suite.

Today, Opera announced that the desktop version of their browser will be free. This suggests a new focus, likely in the mobile space, and possibly even a contract with Nokia to become Symbian's default browser. Opera alone is still a small player in the space, but if they get on a good number of Nokia GSM handsets we're talking some real numbers.

What's Openwave going to do? The company still puts its browser on hundreds of millions of phones each year, but customers have not embraced V7 as quickly or as much as it has hoped. The new browser, internally codenamed "Hikoki", will probably determine the company's stance in the next several years. Hikoki was a lot of fun to work on, and I hope it holds up in the face of competition.

Tuesday, September 6, 2005

Leaving New Orleans?


The debate at hand has now moved to whether New Orleans should be rebuilt in place. On the one hand, the historical and sentimental ties to the land are important, but on the other the threats against future safety are also important.

In this day and age, we need to consider not only another hurricane as powerful or more powerful than Katrina, but also malevolent humans. The resulting damage from the levee breaks, not to mention the disruption to rescue efforts caused by a few snipers, is practically a road map to terrorists. I've never been to New Orleans, but as far as I can tell from photographs, the levees are right next to roads and neighborhoods, and seem difficult to defend against a truck bomb.

People like to compare New Orleans with San Francisco, but there is one important difference: the terrorists don't have a way of triggering an earthquake. Blowing up dams and levees, on the other hand, is neither rocket science nor nuclear engineering.

Monday, August 29, 2005

Just Plain Unintelligent


Came across another line of argument against "intelligent design" recently:

If the existence of complicated organs and organisms necessarily implies a designer, then the existence of such a designer must imply another designer, which must imply yet another designer, and so on. If there exists one ultimate designer in that chain who wasn't designed, then either the organisms on earth could've similarly be undesigned, or you accept that an organism that is simple enough not to require design to exist is somehow able to design intelligently.

This also means that you cannot believe in the infinitely complex Christian God if you believe in intelligent design, because somebody else must have created Him.

Wednesday, August 24, 2005

Take Out?


Pat Robertson is so lame. He's the kind of hypocrite not generally worth talking about, but this one is just delicious.

On Monday, he said in his program, "If he thinks we're trying to assassinate him, I think we really ought to go ahead and do it. It's a whole lot cheaper than starting a war." Anybody who understands English grammar will know that both instances of "it" refer to assassination.

He later feebly clarified, "I didn't say 'assassination.' I said our special forces should 'take him out.' And 'take him out' can be a number of things, including kidnapping; there are a number of ways to take out a dictator from power besides killing him." Never mind that kidnapping a head of state is a great deal harder and more dangerous than just killing him.

But let's see what Pulp Fiction has to say:


VINCENT: Well, Marsellus is leavin' for Florida and when he's gone, he wants me to take care of Mia.

JULES: Take care of her? (Making a gun out of his finger and placing it to his head.)

VINCENT: Not that! Take her out. Show her a good time. Don't let her get lonely.


which is proof that even gangsters don't always mean it that way. Certainly a deeply moral man such as Robertson must be granted benefit of the doubt.

Today he finally wrote "Is it right to call for assassination? No, and I apologize for that statement." Perhaps he should also apologize to the AP, which he accused of misinterpreting him.

But that's not the end of the "apology". He then cites the example of Dietrich Bonhoeffer, who collaborated in an attempt to assassinate Hitler. As he says, Bonhoeffer is "deserving of our respect and consideration," but the difference between Robertson and Bonhoeffer is that the latter didn't apologize for wanting Hitler dead. Either way, it doesn't sound like he's all that sorry.

Monday, August 8, 2005

Media in the News


Nightline recently did a story on Shamil Basayev, widely considered a terrorist for masterminding the Beslan school massacre. The program came under intense pressure, including an official ban from the Russian government, for airing the interviews. I find it curious that a media outlet that finds the courage to suspend judgement amidst constant accusations of bias still faces criticism. Be careful what you wish for, folks, if it is for the media to self-censor based on what it considers moral or immoral. If Fox News can trumpet its "we report, you decide", why shouldn't Nightline just report?

Another blow was the loss of Peter Jennings to lung cancer yesterday. His contributions will never be fully measurable, but one thing I remember was his calming influence in the wake of September 11, 2001, when government seemed to be in confusion and disarray. A distraught nation saw that at least one person rolled up his sleeves and got right back to work, despite it all.

Wednesday, August 3, 2005

Enabled by Photoshop


Just saw that a welfare organization based in Taipei has completed the training of several disabled persons in removing the background portion of images using Photoshop. Background removal is often a tedious but necessary step in further image processing. The graduates - each with about a year's experience - are now offering their services for about US$2.50 or US$3.00 per image, depending on the complexity of the job.

Unfortunately, it's not very easy right now to pay from outside Taiwan, and they are not a business yet so they cannot issue a proper receipt. But this idea is strikingly innovative, and I hope they iron out the kinks and do well.

Wednesday, July 27, 2005

Best Wishes, Discovery!

About two years after the loss of the Space Shuttle Columbia, NASA finally launched the Discovery. After the initial euphoria of a successful launch, cameras spotted that a piece of debris fell off the external tank and may have struck the shuttle. In response, NASA has grounded the entire fleet pending further investigation.

It is time to let it go. Absorb the lessons learned from the space truck that never really fulfilled its purpose of cheap space flight, and take a decade off to carefully build its replacement. If even after two years of careful study and rework they still cannot prevent debris from falling off and possibly striking the shuttle, then this strongly suggests to me that the core design is deeply flawed. I'm not one of those people who think space travel should be 100% safe, but I don't like the pointless loss of brave lives, either.

Meanwhile, I wish the crew of Discovery a fruitful mission and a safe trip home.

Saturday, July 9, 2005

Job Change


Okay, the dust has settled all around now. I'll be leaving Openwave at the end of next week, and will be starting with Apple's iPod division working on their graphics software. I'm happy to be leaving three telecommunications jobs behind, although current co-workers are joking about getting sent to work on the mythical iPhone (they're just bitter that I left them plenty of work.)

Whee! I'm really excited. Unfortunately, at best I'll only be the third most famous Steven at Apple.

Saturday, July 2, 2005

I'm Almost a Genius!


Your IQ Is 135

Your Logical Intelligence is Genius
Your Verbal Intelligence is Genius
Your Mathematical Intelligence is Genius
Your General Knowledge is Exceptional


RIP, Luther Vandross


The singer finally succumbed to a stroke he suffered earlier, and died at the age of 54. To paraphrase a local DJ, if you've ever been in love in the past 20 years or so and have not heard of Vandross, you were probably doing it wrong.

Thursday, June 23, 2005

The Throes of Success


Vice President Cheney recently commented that the insurgency in Iraq is in its "last throes". He later clarified that:

"If you look at what the dictionary says about throes, it can still be a violent period, the throes of a revolution. The point would be that the conflict will be intense, but it's intense because the terrorists understand that if we're successful at accomplishing our objective -- standing up a democracy in Iraq -- that that's a huge defeat for them."


First of all, consulting the dictionary is so Clintonesque. Secondly, the problem is not what "throes" means, but what "last" means. If there's still going to be a significantly long period of violence ("a lot of bloodshed", in his own words), then it's not in its "last" anything. Thirdly, perhaps the Vice President has secret sources of information, but the commoners don't have a way to distinguishing intense violence because the terrorists are about to lose from the intense violence because the terrorists are winning. So excuse our cynicism.

And if that's not enough, he added: "We will succeed in Iraq, just like we did in Afghanistan." You can't make this stuff up. Afghanistan is probably much better than it was, but if today's Afghanistan is his measure for success in Iraq, I would just have to remain speechless.

He also doesn't know when to stop. Take, for instance:

"There isn't any other nation in the world that would treat people who were determined to kill Americans the way we're treating these people."


which I might agree with. But that's not enough, because he adds:

"They're living in the tropics. They're well fed. They've got everything they could possibly want."


Cuba is indeed tropical, but the prisoners are not exactly living in Club Med suites, sipping cocktails with little umbrellas. They might be well fed, but what moron will say that they have everything they could possibly want? If the prisoner is innocent, surely one of the things he would still want is freedom and justice. If the prisoner is a real terrorist, surely he still wants to see even more dead Americans. If they already have "everything they could possibly want" there, why are some of them trying to get released?

Running for a Brown Tie


I forgot to write about the fun run. We (well, mainly Mabel) signed up for the 5K fun run, which comes with lunch and tickets to an A's game. I have plenty of excuses, including flat feet, but the truth is I rarely run more than a mile even on the treadmill. I wasn't really concerned, because I was sure I could walk five kilometers, but not wanting to embarrass my lovely wife too much I worked out harder than usual in the preceding weeks. Mabel has finished a 7K run a few months ago, so she's not going to be the problem.

Anyway, after slowing maybe three times to a walk, we finished the run in just under 39 minutes. That was much faster than I thought I'd be, so I'm quite pleased, even though we were much slower than Mabel otherwise could be. Later, I also found out that we'd been running against domestic violence, so that's like killing two birds in the bush or something. We also got a tie personally designed by pitcher Barry Zito... who should stick to pitching. Oh, and there was a T-shirt.

Lunch was a small burrito with some stale chips, so we chowed down, changed, and headed to the Coliseum. Being one of the first 10,000 or so fans, we were offered the tie again on entry, which we politely declined. The first-come-first-served seating we got was right behind the section usually filled with the most rabid fans. You know, the people who have all the gear, flags, and sometimes even body paint. The A's won, which was great. I had planned to tan a bit, so I rolled up my sleeves and hiked up my shorts. Unfortunately, I put on suntan a bit too late, so I got burned in several places. I was lobster red until yesterday.

Lesson: don't sunburn body parts that are meant to stretch, such as elbows or knees.

Tuesday, June 14, 2005

Coaching the Uncoachable


Phil Jackson will return as the coach of the Lakers, earning a reported $10 million a year. Now that's a scam of a job, because I can coach the Lakers. Here's are some of the things I will say while coaching:

"What do you think, Kobe?"
"Pass the ball to Kobe."
"Screen for Kobe."
"Get the offensive rebound if Kobe misses, and pass the ball to Kobe."
"What should we do, Kobe?"
"Can I give you a foot rub, Kobe?"

Jackson is a whore to return to a ball club that still employs Kobe Bryant, an "uncoachable" player in his own words. But at least he's an expensive whore.

Thursday, June 9, 2005

Bug Report of the Day


"Expected result: test case should pass."

No, really?!

Tuesday, June 7, 2005

Plan B


Apple announced yesterday that due to problems with IBM's delivery of faster and cooler G5 chips, they will be switching to Intel chips within the next few years. There have been all sorts of reactions to this news, so I just have to chip in my two cents.

Winner: Apple Pro Apps. In an arena where "render time" is still a four-letter word, and with the public crossing into HD-land, Apple needs to ship some of the best machines that money can buy in order to keep customers. Despite the badmouthing of a former Quicktime engineer I now work with, the move will allow the power users to pick which platform they like, and not be forced to use Windows for hardware reasons.

Loser: VirtualPC. VirtualPC lived because although VMWare was faster, it could not run on a foreign CPU like the PowerPC. On an x86 Mac, VirtualPC will basically have zero advantage over VMWare.

Loser: YellowDog. They make Linux distributions for PowerPC Macs, and when that disappears, they need to find a new line of work.

Winner: Users. On a dual-booting Mac, software inefficiencies inherent to either Windows or MacOS X will be inexcusable. This should lead to better benchmarks and performance improvements in both operating systems.

Loser: Developers. Especially those who spent time optimizing for AltiVec or G5. Some developers like Adobe or Microsoft may be happy to better unify their cross-platform product, though. The Mac-only developer who doesn't actually need the extra CPU power, however, incurs only additional cost.

Loser: ISA Purist. The unspeakably ugly x86 instruction set has conquered the final competitor on the desktop. The world, for many developers, will now really be just the x86. Endianness and misaligned accesses shall mean even less than they do today.

Winner: Programming Teachers. Without high level languages, the transition would be magnitudes more painful. Write clean, portable code, and you may survive such a switch.

It's clear that this isn't Apple's happiest day. I'm sure they would rather have announced 4 GHz G5 PowerMacs and 3 GHz G5 PowerBooks, but that just wasn't going to happen. Rather than slip again in performance, they are taking a bold step to keep up. Interesting times.

Thursday, June 2, 2005

Have PDA, Will Travel

Over the past decade, the hoopla was about not having to travel, and the technologies in question were teleconferencing and videoconferencing, not to mention the long distance telephone. These past few years it seems to be about being just like at the office when you're travelling, with technologies like VPN and mobile email access taking the spotlight. Properly prefixed with "enterprise" this and that, of course.

<cynic>Did the pointy-haired class finally figure out that phone calls don't come with frequent flyer miles and expense accounts?</cynic>

Moneycode?


The fascinating Michael Lewis book called Moneyball offers a look inside the Oakland Athletics major league baseball team, and how they remain competitive against teams with thrice their resources. The basic problem is that baseball insiders have built their teams on subjective criteria, with the underlying belief that it's hard to tell how each ability of each player is more important than others. The A's have taken a different approach, and can almost determine the value of a player down to a single number.

The important thing is that it doesn't mean that the A's can therefore get all the best players, because that still takes resources. It means that the A's can get the best players that they can afford. It also means they can get some grossly underrated (and therefore undervalued) players. As obsessed as baseball is with statistics, Moneyball contends that they are obsessed with the wrong statistics, and the A's are exploiting that cognitive gap. While the A's have struggled in the playoffs, where each game is unusually important and statistics fail because of small sample size, they have excelled in the regular season over hundreds of games in the past few years. The A's are a good team even when you don't consider the size of their wallet.

Software has some of the same problems, and some different ones. For one, the goal of software is not as clear as baseball: winning 95 or 103 games a season by scoring more runs that you give up to your opponent. Is software meant to produce maintainable code, on-time code, fast code, or what? Are software engineers as interchangeable as baseball players? Can software engineering expertise really be quantified? One thing is for sure: I'm so not smart enough to figure this out, especially since I very nearly flunked statistics in college.

Will there be a day when management can plug into an equation, asking for 45% maintainability, 35% on-time, etc., and get a number back as to how many resource units are required? Can they then go into the job market and assemble a team of engineers who can sell them those resource units? This would almost be the holy grail of predictable management, and despite the grossly dehumanizing feeling of being reduced to a number, can be what keeps jobs from being outsourced if you are provably a good value to your employer.

How many lines of code per dollar are you? ;)

Tuesday, May 31, 2005

Learning from Baseball


Watched an A's game last night, which featured a most satisfying 11th inning comeback for the home team, snapping their second eight-game losing streak of the month. The victory made the post-game fireworks show that much sweeter. The fireworks were really cool, partly because it's the closest I've ever been to one. The bangs strike you right in the chest (Oakland gangs must be going nuts wondering who's shooting at them), and the light effects filled your entire field of vision.

Also started reading Moneyball yesterday, which is a book about baseball scouting myths and how unscientific the establishment can become when drafting young players. Reminds me a bit about how software engineers are hired, actually. While baseball is plagued with many of the wrong metrics, software engineers can't even be measured. In baseball you can legitimately argue whether RBIs are more important than on-base percentage, in software we don't even really distinguish between skill levels in the C++ programming language. And we call it a science!

I wonder if a revolution is coming... and of course, whether there's money to be made in that revolution.

Tuesday, May 24, 2005

Bad Code of the Day


I don't have to paste it. It involves using recursion (and not even tail recursion) to traverse a linked list. Granted, it was not in a performance-critical portion of the code, but it doesn't take a minute to write it properly. Why be the kind of programmer who won't take a minute to do the right thing?

Tuesday, May 17, 2005

A Missing Complaint


The back story is that Mexican President Vicente Fox had made a comment that Mexicans were taking on jobs that "even blacks" won't do, which is just a silly thing to say. CNN reports later that:

On Monday, State Department spokesman Richard Boucher called the remark "very insensitive and inappropriate" and said the U.S. Embassy in Mexico City had raised the issue with the Mexican government.

But Aguilar said Mexico had received no formal complaint from the State Department, repeating the president's position that his remarks "were misinterpreted."


Was it sent via FedEx? Maybe there's a tracking number for the complaint. Seriously, what I don't understand about the media is that when it is clear that one party must be lying, they dig no further. Either the US State Department complained, or it did not, or the Mexican received a complaint but it wasn't "formal". Whatever, find out. This is obviously not a very important issue, but all the more reason for public servants of either country to be kept truthful.

Sunday, May 15, 2005

What Would Mohammed Do?


Muslim clerics in Afghanistan are demanding that the US hand over for trial the military interrogators who have allegedly desecrated the Quran by placing it on toilets, and in one instance even flushed it down the toilet. Despite how foolish the acts were in terms of international relations, the threat by the clerics to launch jihad is deplorable. Are we to do only things that are not considered offensive by anybody, anywhere in the world? If putting the holy book on a toilet is offensive, then what about violating all sorts of laws written in the book? Similarly, if having multiple spouses is offensive (and indeed illegal in many countries) to us, will Muslim countries extradite all the offenders for trial?

Friday, May 6, 2005

She's Going the Distance


A thought just occurred to me while driving to work. The car is almost ten years old, with a bit over 100,000 miles on it. If I had averaged 30 mph over that distance, the car would've been driving for 200,000 minutes. If I had averaged 2,000 rpm, then the engine would've turned 400 million times. (Don't worry, I didn't do the math in my head while driving.)

We tend to think of these as astronomical numbers, but some very impressive numbers are also very close by.

Thursday, May 5, 2005

The Price of Liberty?


Just took a look at the Windows Task Manager, and among the top five memory users I find gcasDtServ.exe, which is part of the Microsoft AntiSpyware Suite, and FrameworkService.exe, a part of the McAfee Internet Security Suite. In fact, each uses more RAM than MSDEV.exe, which is Microsoft Visual Studio, the main reason I use this computer. Each consumes more RAM than I had in the entire PC ten years ago.

The number one disk user, by far (8x more than the second placer), is UpdaterUI.exe, another part of the McAfee software. Two other of the top five disk users is also from McAfee. Together they keep my disk chirping constantly.

The Windows environment has gone mad. I'm devoting more computing resources to be able to keep on working than on actually working.

Oh, and happy 05/05/05.

Thursday, April 21, 2005

Death of a Spider


Dramatic title, huh?

A spider died today. It had slipped into the bathtub in the spare bathroom a few days ago. I watched it fail once or twice to climb back out. I didn't kill it to put it out of its misery, nor did I try to capture it and take it outside. A life, and I couldn't be bothered to end it or save it, even if it took barely more than lifting a finger.

Shall we ever understand the choices and non-choices we make?

Thursday, April 14, 2005

But This One Goes to Eleven


For a company that prides itself in the simplicity and elegance of its products, Apple sure finds itself in some counter-intuitive situations. During the long, tortured tail end of the G4 processor, Apple found itself trying to convince customers that MHz didn't matter. It was true that Intel sacrified nearly all else to pump up the clock speed of its processors, without achieving a performance improvement proportional to the clock speed differences. But that didn't matter, because 3 GHz is better than 2 GHz as far as most people were concerned.

Looking back even further, we can see Apple struggling with the image that its computers were more expensive than PCs. Truth is, what should matter to consumers is the value of the product, not the sticker price. Value, unfortunately, can be counter-intuitive. The Power Mac that we bought three years ago, plus various upgrades, probably cost us US$1,500. On eBay today, we should be able to get at least US$500 on the box. In other words, if I sold it today, the machine would've cost me about US$1,000 over three years. On the PC side, Microsoft Flight Simulator 2002 has a minimum system requirement of a 300 MHz CPU. How much could you sell that PC for today? To be a bit rude, could you even give one away today?

If you're a home user, the comparisons might stop there. However, if you're using the computer for work, then you need to figure the time you spend not making money off the computer. Viruses are the obvious thing here, but even subtle differences like battery life can have a important impact on what the machine is worth to you. Power consumption is another somewhat invisible issue.

Ironically, the same people understand the math in other areas. Many understand that buying a house is a good investment as long as you can sell it for a difference less than what you would otherwise pay in rent. In the bay area, for example, where rents are easily US$15,000 a year for a one-bedroom apartment, a house you own for five years was a great investment even if you lose US$50,000 when you sell it.

But between the "MHz myth" and the apparent price premium, Apple gets stuck defending the counter-intuitive. Now, this isn't an ad to say that Apple computers have better value, but that most people don't even think at the level Apple needs them to be. Over the years, PCs have begun to catch up in many areas, and of course the Mac has gotten a beefier G5 processor, so the terms are all different today. However, the equation hasn't actually changed, and one must chuckle to observe a marketing department trying to impart a complicated story, even when it may actually the truth.

Tuesday, April 12, 2005

No Speako Inglese


West Virginia lawmakers were surprised to find that they had passed a law that made English the official language of the state. The provision was slipped into a bill "addressing the number of members that cities can appoint to boards of parks and recreation", according to CNN.

Why voters tolerate this sort of nonsense, I don't think I'll ever understand. Whether or not you think it's a good idea, surely you would agree that it's an important issue. Surely you would agree that it's an issue that should be openly debated, and voted on.

"I just told the members that the amendment clarifies the way in which documents are produced," Bailey, a Democrat, said Monday.


In other words, Bailey is a liar.

House Majority Leader Rick Staton [...] said he was unaware of the substance of the amendment until asked about it by The Associated Press Monday evening.


In other words, Staton is incompetent and doesn't even read the laws that he is partly responsible for making. Laws that he was elected and paid to make.

The title, by the way, is what a friend allegedly said to the highway patrol officer who pulled him over.

Friday, April 8, 2005

Zero to Sixty!


Mabel got me a surprise gift today. She found three decks of Super Trump cards: Formula One, Sailing Ships, and Space Rockets. That sure brought back memories of grade school. Some of the cards sported the USSR hammer and sickle flag, and the decks were made in "West Germany".

Boy, that was a long time ago.

Thursday, April 7, 2005

On Losing


If you read Slashdot, then you might have known that the US did not place in the 29th ACM International Programming Contest. Far lesser known would be the fact that Ateneo defeated my alma mater UP in two programming contests organized by the latter.

Taken by itself, defeat in programming contests is not indicative of the quality of education at all. In the real world, programs are "judged" mainly by how well they respond to market needs (even free software have markets). To be responsive to changing needs, the software must be built on a solid architecture, and be easily maintainable even by people who are not the original authors. Having joined my share of programming contests, I find it safe to say that the artificial environment does not encourage good programming. Generally speaking, you want to submit the minimally capable program in the absolute fastest time. Requirements can be expected to never change, and the essence of time is amplified far beyond the normal "first to market" pressures in industry. Some contests even spare you from error-checking by promising to only test your submissions with valid input.

But there's nothing funny about losing. If you choose to join a contest, you join to win. A contest that you can be bothered to participate in is never entirely pointless, particularly when you lose it. Moreoever, while defeat doesn't necessarily tell you that they are better, it should conclusively tell you that they are at least not far behind. Accept the results with as much grace as you can muster, but get right back on the treadmill or the defeat will become both real and permanent.

Tuesday, March 22, 2005

Snowboarding at Yosemite


Mabel and I spent a long weekend at Yosemite, mainly trying to snowboard at Badger Pass. We like the place because it's small and relatively inexpensive, so we don't spend too much money just to realize we'll never learn to snowboard.

We were supposed to leave early on Friday, but earlier in the week Mabel had taken the car to the shop for me, and a needed part couldn't make it in until Friday morning. It was about 3:00 pm when we actually left, and quite dark when we got to Curry Village in the valley. Curry Village is a small city of tents, and one of the most affordable ways to stay inside the park. The one we got was one of the few equipped with a heater, but it's basically a small wood-frame covered in white sheets.

I am, by the way, very attached to my creature comforts. This means that having to walk two minutes to the toilet, and maybe five or seven to the bath house, makes me whine. Suffice to say, the tent was small, the beds were squeaky, and if you have the misfortune of inconsiderate neighbors, very noisy. We didn't get good sleep at all the first night.

We woke up at 6:00 am the next day, had breakfast, and caught the shuttle bus to Badger Pass. We arrived at about 9:30 am, and headed straight for the slopes after renting our gear. I basically spent the whole day going straight downhill and trying not to die. Mabel spent the day practicing what our teacher at Squaw taught us last year. Needless to say, we were quite sore from having to prop ourselves back up from falling all the time. It's very clear to us now that snowboarding is the kind of sport that is hardest on beginners. I also remembered my snowboarding lessons much more vividly, and realized that I was doing all the don'ts. The good news is, we were able to sleep much better that night, although some shuffling sounds did wake Mabel up. We found out the next day that the sound was snow falling off the tent, and the valley had gained a thin white carpet.

We decided to take Sunday at a more leisurely pace to go easy on our sore muscles, so we went on a Ranger-led snowshoe walk near Badger Pass. A snowshoe, for those of you in the tropics, is like a skinny tennis racket you attach to your boots. As Ranger Dick told us, it doesn't actually prevent you from sinking into the snow, but it prevents you from sinking as much. Now, to get to our real starting point, we'd have to cross the ends of the ski runs, which consists naturally of packed snow from everybody walking on it. However, I was panting by the time we crossed the "easy part", before we headed uphill in fresh snow. Again, for those who don't know, it's hard to walk uphill, and fresh snow is very soft and fluffy. I lagged the group, beating only a family from Florida suffering from the flu, while Mabel was keeping up just fine with the Ranger. She waited for me a few times, looking at me with loving pity.

Anyway, we eventually made it up the hill, and it turns out that the payoff was that we'd get to race downhill. Some people slid and tumbled, but it was a lot of fun for everybody. Except possibly the poor ill Floridians. The feeling of stomping on snow so soft you sink into it up to your knees - and that's wearing snowshoes - is really indescribeable. We left Badger Pass early, and spent the rest of the day walking around the valley. Unfortunately, it was still rainy and visibility was very poor. We decided, however, that we'd try to snowboard again on the last day of our trip.

So we were up even earlier, because we had to load our stuff back in the car and check out. We got to Badger Pass a bit later, and discovered that unlike the fluffy snow that impeded us the first day, the slopes had been groomed and were much slicker. But we were finally getting the hang of it, and despite being impeded by not having well-fitting boots, Mabel was very much in control of her descent. In other words, we were only falling down because we were trying to practice something specific, which is a huge leap from just falling down randomly.

I'm afraid I can't say much about Mabel's snowboarding, because we generally went down the hill together, and I was concentrating on my own runs trying not to get killed. I did manage a clean run on the second to the last attempt, but was promptly rewarded with a bad fall (don't worry, no injuries) the next time to remind me how alert I would have to be. I must remember that.

And then we headed home, as the afternoon rain began to move in. It's still raining now.

Thursday, March 17, 2005

Check Out the Big Brain on Dubya


President Bush weighed in on the controversial Terri Schiavo case, noting that the courts "should have a presumption in favor of life" in such matters. Schiavo has been in a persistent vegetative state for 15 years, and her husband and guardian says she would've preferred to die. Her parents disagree, and thinks she can be rehabilitated.

All else aside, Bush is also the man who said that the federal government can't be trusted to invest social security funds properly, which is why he is pushing for private accounts where taxpayers can select their own investments. Listen carefully: the government isn't smart enough to invest properly.

But it's smart enough to override the assuredly painful decision of a husband, who turned down million-dollar offers so that he can properly execute what he said was his wife's wishes.

But It's Digital


You know how some books are overly specific these days? I used to think that computer books were the worst, basically putting two buzzwords (say, Java and XML) together and resulting in a waste of paper that covers neither topic adequately. But I probably just saw the ultimate one. What is so different about using a digital camera to photograph nudes I didn't bother to find out.

Tuesday, March 15, 2005

Please Play Again


We like the Pepsi-iTunes promo, and did pretty well the last time they ran it. This time around, we've gotten two free songs out of 18 bottles, which is only a third of the expected average winnings of one in three. The sample size we have is approaching statistical significance.

Has somebody figured out how to read the inside of the bottle caps without opening it? Is Pepsi cheating? Surmise!

Saturday, March 12, 2005

Dragons, Pig, Microsoft, and Me


Much as I like to make fun of Microsoft, I actually have some respect for some of their products, and plenty of respect for their people and ex-people (that is, ex-Microsoft people, not Microsoft ex-people). It amuses and saddens me how we can be individually intelligent and upstanding, but as a collective end up corrupt or generally harmful to society. Even the one or two people I know who have been involved with the much hated Internet Explorer are not sociopaths.

I'm not just talking about Microsoft. I'm talking about my 401(k) retirement investments, for example. I'm not the type to look at how much I have to retire on every week, but I do get antsy if I seem to be buying into funds that are not making a lot of money. The problem is, I don't know why those companies aren't making money, and I don't know how the ones who are make their money. I don't have the time or inclination to find out where the faceless mutual fund manager decides to put my money, as long as it gives okay returns. That makes me part of the problem, but there must be plenty of people like me around. We are the facelss stockholders in whose name corporate executives do shameful things to their employees, not to mention use to rationalize their own decisions so they can look their children in their eye.

The Chinese deprecate themselves jokingly as "individually each little dragons, collectively a giant pig" to describe how they can't work together. Something like that.

Friday, March 11, 2005

Eight Dot Three


I'm not completely sure whether this falls under "technical" or "general", because while it is about computers, it's also about common sense.

I'm the type of person who keeps copies of installer programs that I download in a separate directory. If I actually get to it, I would burn them onto CD-ROMs so that if I ever need a specific version of something I can still reinstall it. This means that my "Downloads" directory piles up after a while, and I'm now spending a few minutes sorting through it.

Can people not think of the obvious advantages of naming their installer programs properly? I've now looked at programs named gdnUS871, js56nen, tmsetup, PureWin132, and several others, and I couldn't figure out what they were without trying them. Just because the acronyms make perfect sense to you doesn't mean it does to anybody else. If memory serves, even Windows supported long file names of up to 255 characters by 1995, so cut it out already.

Saturday, February 26, 2005

On Good Code

A long time ago, I believe in a back issue of Compute! magazine, I came across an article by an author I can no longer name about writing code. This, by the way, were in the final days when magazines would publish the source code of entire programs (usually ported to several distinct personal computers), and readers would type them in. The article described three basic criteria for good code: clarity, brevity, and speed.

Clarity refers to how easily your code can be understood. There are at least two factors today that make this even more important. One, software projects are much bigger. As of 2001 or so, Linux consisted of about 30 million lines of code. Windows XP hits about 40 million. There should be no doubt in any programmer's mind that nobody will understand it all. Two, few engineers ever work for the same company, much less on the same project, for their entire careers anymore. It is a virtual certainty that any code that lasts more than three years will change hands, often with very short notice.

Brevity refers to how small your code is. On the face of it, this would seem unimportant in the age of hard disks in the hundreds of GB, and RAM in the GB range.

Speed refers to how quickly your code runs. Similarly, this seems less important today in the face of GHz processors, although there are still lots of processors running in the tens or low hundreds of MHz.

The job of the programmer, then, is to build software that strikes the right balance among the three. Principles are nice, but it's not enough to go on. How do we actually monitor and change the way we write code? Here are some concrete details:

Clarity
Code should be unsurprising. What it reads like it should do is what it should do. You're trying to be understood, not showing off how much smarter you are than the person who inherits your code. Unsurprising code comes primarily from following idioms in the language. We are all familiar with language features like for loops and if statements, but those are just analogues of words in a human language. An idiom is a well-known and complete thought, such as loop that iterates through every element of an array. Every language has its idioms, and it's important to learn to write in them. For example, in C, such a loop is written as:



for (i = 0; i < max; i++) {
a[i] = b[i] * c[i];
}



If you change that to for (i = 1; i <= max; i++), then you've broken the idiom and opened up a possible off-by-one bug later. Nobody cares how it's done in your favorite language. If you're writing Fortran, write in Fortran. If you're writing C, write in C.

Idioms do not end at that level. A state machine, for example, is also a computer science idiom. There are several ways to design and implement such machines, but your readers will expect one of a handful. Follow rules and conventions, even when they seem arbitrary. State machines, by the way, are customarily expressed as nested switch statements, an array of function pointers indexed by state and event, or a variation. These sorts of well-known code structures are sometimes referred to as "patterns".

You should also document your code. I personally don't see the point of documenting the inputs and outputs of every last function, because that becomes a burden for maintenance and may even have negative value if it becomes wrong. As a maintenance programmer, what I generally find is that I can easily understand what the code is doing, but not what it was meant to do, or why we're trying to do that. Well-written code is indeed self-documenting in the sense that any reader competent in the language should know what it is doing. But it's much harder to figure out what the original programmer wanted to do and why, so that's what deserves a couple of lines of text.

Remember always that your writing has two primary audiences: the maintenance programmer who will inevitably have to change something, and the compilers that have to translate it.

Brevity
Why is brevity still important in this age of cheap memory? For one, if you work in embedded systems, then not having enough memory is still a fact of life. Even if you didn't, how concisely you can express your thoughts is a very good indicator of your skills. If you didn't understand either the problem or your solution to it, then your code will be redundant, full of special cases, and probably buggy. I'm not calling for terse code or short variable names at all, but code that is direct and to-the-point. Redundant code are harder to optimize, and will frequently contain the same bug in several different forms repeated all over the place.

The lesson is unsurprising, but bears repeating. Separate complex tasks into small, clearly-defined ones. If you find that you're having trouble thinking of an appropriate function name, it's probably doing too much. If you find that you're about to name it processThing(), you're in some trouble. The inability to pick a good name is a sign that you don't know what it's supposed to do.

When I was building Nonplus, a clone of Boggle, I had to include a list of English dictionary words to score the game. With a little bit of thought, I was able to store the 74,742 word dictionary in an average of 2.6 bytes per word. This is about 10% smaller than what gzip could do, and nearly 25% smaller than bzip2, yet the algorithm I used can be described in about two paragraphs. It's not so relevant in this particular example, but in a real project being able to avoid using large complex algorithms or libraries can save you from plenty of bugs. Complexity and mess are your enemies.

Speed
As with the concept of brevity, writing fast code seems like such an ancient concept. Indeed, we are well past the age of writing everything in assembly language. The best advice for programmers today remains to optimize only when necessary, and only after profiling to identify the "hot spots". Most projects settle for "fast enough" instead of "fastest possible", and that's a good thing. Optimizations lead to many bugs, and usually late in the project.

However, that doesn't mean we should simply write sloppy code. For example, this is a common beginner C error:


for (i = 0; i < strlen(s); i++) {
s[i] = toupper(s[i]);
}


The problem here is that the compiler generally can't know that the strlen(s) is invariant, and so will compute the length of the string s in every iteration of the loop. What is an O(n) algorithm became an O(n2) algorithm. This is something I've seen in production code, and there is no excuse for this because the fix is so trivially simple.

I hope I've driven the point home. The three criteria of clarity, brevity, and speed remain relevant today even after processors have increased in speed literally more than a thousand-fold since that article was written. What does change is the relative weight a programmer should place upon each criteria, but what constitutes good code hasn't changed that much since.

Tuesday, February 22, 2005

Unintelligent by Design?


Some political skirmishes have been launched in the US by advocates of "Intelligent Design" against the teaching of Darwin's Theory of Evolution. The main contention of ID is that some organisms and organs are so complex that it could not have occurred as a result of random mutation. The remaining explanation, they point out, implies some form of design and some sort of designer, though ID advocates generally shy away from identifying whether the designer is the God of any particular religion.

I had originally thought that the fallacy of ID could not be challenged, because was not even science: it assumes far beyond what it can even begin to prove. It was religion using pseudo-scientific terms as far as I was concerned, so could not really be debunked by science just as religion could never be. I was wrong, as Jim Holt writes in Unintelligent Design:

While there is much that is marvelous in nature, there is also much that is flawed, sloppy and downright bizarre. Some nonfunctional oddities, like the peacock's tail or the human male's nipples, might be attributed to a sense of whimsy on the part of the designer. Others just seem grossly inefficient. In mammals, for instance, the recurrent laryngeal nerve does not go directly from the cranium to the larynx, the way any competent engineer would have arranged it. Instead, it extends down the neck to the chest, loops around a lung ligament and then runs back up the neck to the larynx. In a giraffe, that means a 20-foot length of nerve where 1 foot would have done. If this is evidence of design, it would seem to be of the unintelligent variety.


Holt then goes into further detail, citing factual evidence such as high mortality rates, useless (as warning, because they are already too late) pains caused by terminal cancer, and extinction rates that all point to a horribly inefficient designer if one does exist. This is a designer who threw away more than two-thirds of conceptions, inflicted pain needlessly, and discarded perhaps 99% of species that has ever existed.

This is a most beautiful line of argument. ID advocates assume the presence of a designer because of complexity, and therefore must answer why this supposedly intelligent designer is so bad at designing organisms that so few species are left. Holt is brilliant, because once you remove the "intelligent" from ID, it's terribly difficult to argue that there was some sort of design at all, which takes us right back to Darwin.

Monday, February 14, 2005

Barbarians here and there


What brutal times we live in, and I'm not even talking about Iraq.

A couple of days ago in Hwalien, a rural municipality of Taiwan in which my parents happen to reside, the friends of a grieving father who lost his six-month old son in a car accident dragged the driver of the other car out of the hospital, and beat him in front of his mother at the funeral home. The driver died later from the beating, although the mother of the dead infant was driving without a license, and did not secure the child in a safety seat as required by law.

Yesterday, the Abu Sayyaf claimed responsibility for three bombings, one on a bus near the high school I attended. The Makati area is probably the richest area in the entire Philippines, but the wealthy people would never take a bus. The likely victims are blue collar workers and lower level white collar workers. People just trying to get by in a metropolis. The group's spokesperson said on radio, "this is our Valentine's gift to the President." It's hard to find a trace of humanity in that glibness.

About 2,500 years after Confucius coined the Golden Rule, and some 2,000 years after Jesus asked his believers to love their neighbors, we remain brutal, uncompromising, and full of hate. When I was younger I was briefly but genuinely worried that the sun was going to extinguish itself and humanity would be doomed unless we managed to build giant space ships first. Today, I can't even identify with Hollywood movies that begin with the assumption that humanity is worth saving.

I don't think we'll be missed. Happy Valentine's Day.

Tuesday, February 8, 2005

Broken glass, broke and hungry


Our car (and at least two others on the lot) got broken into last night. Somebody smashed the rear window and took my gym bag (old shoes, old shorts, old shirt, a radio, and a gym card that will take US$5 to replace). Naturally, the police declined to even come out to take a look, which reminds me of the one time that somebody's car caught fire and we got "911, please hold."

We filed a police report, and our insurance company tells us we have a US$250 deductible, which is insurance speak for "call us only when really big things break." Amusingly, I was informed that the gym bag would be covered under homeowner's insurance if I had one. Even though it was lost while it was in my car.

This little incident took me about half an hour cleaning up, probably a couple of hours trying to get somebody to come fix it, not to mention about US$200 in glass repair, and benefited the thief or thieves probably to the tune of US$30, tops. They didn't even bother trying for the stereo. Talk about petty theft.

The lesson, of course, is not to leave anything in the car overnight.

Monday, February 7, 2005

Happy New Year


It's almost time for Chinese (lunar) new year again. To reduce the risk of fire, the National Fire Agency in Taiwan is providing free downloadable firecracker sound effects. I hate to make fun of an innovative idea, but at times you really wish culture can change more quickly. The little island of Taiwan is tightly packed with some 23 million people, so you'd think people would be more considerate of each other already.

Wednesday, February 2, 2005

Torvalds v. Tanenbaum Revisited


In early 1992, Professor Andrew Tanenbaum began what later became a series of back and forth comments on the merits of the infant Linux operating system. Linus Torvalds, creator of Linux, obliged the professor with responses, and I thought it might be interesting to revisit the old conversation and take a look at what has happened since.

Tanenbaum's criticism centered on two main points: Linux was monolithic, and it was not portable. Torvalds admitted readily that the monolithic architecture was not aesthetically pleasing, but felt that having something working was more important. On the portability issue, Torvalds basically thought that it was not important. This is evident in:

There is no idea in trying to make an operating system overly portable: adhering to a portable API is good enough. The very /idea/ of an operating system is to use the hardware features, and hide them behind a layer of high-level calls.


and in a later posting:

Simply, I'd say that porting is impossible. It's mostly in C, but most people wouldn't call what I write C. It uses every conceivable feature of the 386 I could find, as it was also a project to teach me about the 386.


As of September 2004, however, Linux has been ported to 19 processor families1, including ones that are very different from the 80386. The Debian distribution has released ports of Linux (along with thousands of applications written for Linux) to 10 processor families2. Today, Linux is used in everything from internet servers to small embedded systems. This means that modern Linux did become very portable, but it doesn't mean that Tanenbaum was right. If Linux had tried to be portable initially, it might not be where it is today. I'm simply not interested in divining alternate realities here, so this isn't about whose decision should've been followed at the time, but whose opinions more accurately predicted where Linux would be or would need later.

What about the question of monolithic architecture? Well, about three years later, circa version 1.2, loadable kernel modules3 were introduced into Linux. The kernel modules are small chunks of code that could be connected and disconnected from the rest of the kernel while the system is running. Initially the work centered on the more obviously modular parts like device drivers, but by 2000 large parts of the kernel could be loaded and unloaded at run-time. Linux is still not a microkernel by any definition, but its support of kernel modules gives it many of the advantages usually associated with microkernels. It would seem that Tanenbaum was right again here that a strictly monolithic architecture wouldn't cut it.

But the professor wasn't always right. What Tanenbaum failed to see when he wrote:

If a group of people wants to do this, that is fine. I think co-ordinating 1000 prima donnas living all over the world will be as easy as herding cats [...] Anyone who says you can have a lot of widely dispersed people hack away on a complicated piece of code and avoid total anarchy has never managed a software project.


was the remarkable organization skill and charisma that Torvalds was able to muster. I have no firsthand knowledge of the temperament of Linux kernel contributors, but the clear fact after all these years is that Torvalds did what Tanenbaum would not. Tanenbaum's Minix declined many contributions because he wanted to keep it simple enough for students, and in the meantime Torvald's Linux embraced contributions and is now an industry workhorse. This cannot have happened entirely by accident. Torvalds must have been the right person for the job, even though I don't think he's ever managed a software project before Linux.

As I mentioned, I have no interest in keeping score in this old debate, but perhaps we can learn lessons from this history. The two major criticisms offered by a professor were ultimately fixed in due time, but I suspect even the good professor could not say what would've happened if Torvalds had listened to everything he said. The world needs young people (that is, Torvalds at the time is younger than I am now) to strike out on their own paths, but also the guidance of maturity. There's also something to be said of extremes. As with the CISC v. RISC debate, the better path turned out to lay somewhere in the middle. It is clear today that a microkernel was not necessary, however irksome Linux is to the beholder. It is also clear that while the heavy 80386 orientation was ultimately misdirected, it also wasn't nearly bad enough to sink Linux.

Monday, January 31, 2005

Creative Testing


Had a nice dinner with a former colleague whom I have not seen in a couple of years. He works for a Canadian company, and their QA department lead expects software to be "shipping quality" by the time it leaves engineering. His department would not be responsible for functional testing (also known as making sure it does what it's supposed to do), but only for "creative testing". The term apparently refers to just playing with the product randomly to see if anything breaks.

Brilliant! This is in about the same league as a former boss of mine scheduling unit testing for Friday, subsystem integration testing for Saturday, system integration on Sunday, and shipping on Monday. Ignoring the expectation that we work through the weekend, his rationalization for the demand consists of the observation that if we had done our jobs right, there wouldn't be any bugs to find. Of course, if he already knows that no bugs would be found, why bother even testing?

Tuesday, January 25, 2005

Chain Letters


An old classmate from high school just forwarded yet another chain letter to the batch mailing list. Could it be that in 2005, people still don't understand that these things are annoying? Just because it takes only a few seconds to send and a few seconds to delete doesn't mean that you're not building your own superstitious hopes of getting something for nothing upon inconveniencing other people.

This particular one even threatens: If you delete this after you read it .. you will have 1 year of bad luck! Oh, so there's a curse in it as well? Why, thanks, friend.

Look, if this thing doesn't work, then you're just wasting all your friends' time. If it actually works, then you're getting something without having worked hard for it, so you hardly deserve it. Where exactly is the upside? While I'm well aware that I've spent far more time writing this post than ignoring the chain letters, why is it so hard for us to be more considerate of other people?

Anyway, as Louis Pasteur observed, Chance favors the prepared mind.

Sunday, January 23, 2005

New Expression


I learned a new expression today from Paul Murphy: "like throwing water on a duck", as in:

Pointing out to him that the Linux administrator could accurately predict his next service shutdown several weeks in advance while the Wintel people can barely limp through a day without a reboot was like throwing water on a duck -- it generated vague resentment but no behavioral change.

Monday, January 17, 2005

Unmoving Company


A friend of ours recently moved to North Carolina, and made use of one of those cheaper movers who leave a small crate for you to fill. They apparently picked up the crate without even telling her (a call would've been nice, since most of her belongings were in there), and just called her to let her know that the crate has arrived.

They informed her that they can place it in storage, she can pick it up at their warehouse about two hours away, or they'll deliver it to her for an additional US$450. Regardless of what the fine print says, I think most customers expect that when they deal with a moving company that picks up the cargo at your old place, they will deliver it to your new place. Legal or not, this is a scam. Caveat emptor.

Wednesday, January 12, 2005

Charitability


We just donated some money to UNICEF's relief fund for the tsunami in Asia. It took us a while, because I wanted to make sure that my company will match the contributions.

Deciding to give was easy. Deciding how much to give was not. There's the question of "saving up" money in case some other bad thing happens, and there's the question of how much you can afford. But how much can we afford? We're not quite ready to donate all our worldly possessions and go live in the mountains, so just how charitable are we? Is $100 enough? Is $1,000 too much?

A while ago, I realized that Mabel and I were making decisions that our parents used to make. I took my first real job in 1996, but those decisions seemed like pretty obvious choices. Objectively evaluate the offer, the nature of the job, the location, and all that. It was just like deciding which school to attend. Later on, we started making some decisions like whether to fly back to Asia to visit family this year. A friend we haven't spoken to in a while gets married, so should we send a gift or maybe just a card? The answers to this sort of questions are surprisingly non-obvious. Where do they teach you how to answer these?

I guess we could all give literally every spare dime we have (and maybe take a second job on the weekends) to the tsunami victims. We could also spend literally every waking hour and every penny to try to be with family and friends. But at some point we probably have to say this is all we have to give, and it's really pretty hard to decide how selfish - for lack of a better word - one is to be.

Bad Code of the Day


Spent perhaps half an hour struggling with StuffIt Expander. The app would launch, but would appear to hang with no error messages or indications on what's going on. The tech support site is either non-existent or very slow. StuffIt is freeware, but it's important freeware that people rely on. I went through downloading the newest version, deleting preference files using the command line, and finally...

It turns out that StuffIt checks automatically for updates on start-up, and hangs if something goes wrong. The solution was to switch off networking, start up StuffIt (coming on instantly), and disabling the automatic update check. This is lousy programming. Never assume that network servers will be available, and if you really must, at least let the user clearly know what's going wrong. StuffIt failed on both counts.

Tuesday, January 11, 2005

MacWorld SF 2005


Surprisingly, all the rumors were true. Apple unveiled a US$499/US$599 headless G4 Mac, a US$99/US$149 flash-based screen-less iPod called the "iPod shuffle", and a word processor now bundled with Keynote to form iWork. There was a lot of excitement on the floor, and we even spotted a guy wearing the iPod shuffle around his neck on the BART train home.

The iPod shuffle is very light, and comes in 512 MB or 1 GB (about 240 songs) varieties. It doesn't have a screen, so you mainly have to rely on the "shuffle" feature. Because of its solid-state construction and light weight, this will likely be a hit among joggers, even those who already own iPods. The white cord around the neck will probably be the next iPod status symbol. Surprisingly, the computer interface is USB 2.0, which distances itself from older Macs like ours. It doesn't come with an AC adaptor, so it'll generally charge off the computer.

The Mac mini is the computer you would've bought your mom. Even the $499 model has a 1.25 GHz G4, 40 GB hard disk, and 256 MB of RAM (which is surprisingly large, given that Apple gives the low-end PowerMac G5 the same default amount). The catch is that the price doesn't include keyboard and mouse, but the software bundle easily exceeds those of cheap Dell boxes in both quantity and quality. I was half expecting it to come with an infrared remote control. It is just a little bigger than a hard disk and a CD-ROM drive stacked on on top of another, and doesn't seem to be noisy.

The new word processor, dubbed "Pages", is no Word killer. The emphasis of the product seems to be template-based content creation, and probably lacks some of Word's more professional features. However, when bundled with the computer, this can relieve the need of many users from having to buy Microsoft. Following many years of silence on the AppleWorks line, this descendant neither blows everybody away nor disappoints. I think it will be a solid addition to the Apple software bundle, since the $79 price tag for both Keynote and Pages is even lower than what Keynote used to sell for by itself.

The interesting thing is that many of Apple's apps are beginning to look alike. Pages looks like an iDVD targeted at print, while Keynote is looking more and more like it can just become iDVD's menu creation front-end. I wonder if Apple will head in this direction.

Sunday, January 9, 2005

Belkin Camera Link for iPod


Before leaving on our three-week trip around Asia, we realized that we would need a solution to store all the digital photographs we were planning to take. We would be staying at six different places, and didn't want to bring a laptop.

The competitors for our needs were:

  • More Memory Sticks, which cost about US$50 for 128 MB.

  • Belkin's Media Reader, which has a list price of about US$100.

  • Belkin's Digital Camera Link, which has a list price of about US$80.


The professional portable hard disks for cameras were not really in contention, because they typically cost several hundred dollars each. In terms of storage capacity per dollar, getting more Memory Sticks was not a good deal, although it would be the solution with the least hassle.

It came down to the Media Reader versus the Digital Camera Link. The Media Reader supported CompactFlash, SmartMedia, SD, and MMC cards in addition to Memory Sticks, but it was a feature we did not need. Our camera is a Sony DSC-F717, which supports only Memory Sticks. The Media Reader is also about 50% bigger than the Digital Camera Link. In the end, after going through various on-line reviews, we chose the cheaper Digital Camera Link because we didn't need the Media Reader.

Over the trip, we transferred over 400 photographs in roughly a dozen "rolls" to the iPod, and experienced no problems. The device worked as advertised, and there were no real surprises, since we already knew about the serious downsides:

  • Transferring 128 MB takes about five minutes. On the camera-side, the link is limited to 650 kbps to 750 kbps, depending on the format of the iPod.

  • Transferring 128 MB consumes about half of the iPod's battery charge.


Because of these limitations, the device only really works at the end of the day, when you can immediately recharge your iPod. Belkin failed to provide a Firewire plug through which the iPod can be powered by a wall socket, which would have made the transfers less worrisome. The battery life supplied by the two AA cells lasted the device through the entire trip, and the battery consumption at the camera end was not a real concern.

In the end, this was a good purchase for us, first of all because Mabel already has a 3G iPod. The iPod itself costs at least US$300, so at a total cost of US$380 you may as well look for a professional solution if the iPod's music-playing features are not important to you. Secondly, we didn't mind not being able to transfer in the field (speed and battery life are both serious concerns for that need). Thirdly, our camera was listed as being compatible. Absent any one of the three, you will not be happy with this product.