Defective Battery

MacBook Pro battery, with cells inflating like a balloon

MacBook Pro battery, with cells inflating like a balloon

Our laptop worked fine for its first three years, but this summer it started having trouble charging and it wouldn’t hold its charge. We bought a new battery, and it still refuses to charge most of the time. So once the new battery charged this weekend, we decided to charge the old one as a backup. This is what we found it had done in the last several months. (We’re recycling it right away.) In the picture, the normal looking cells on the left are perfectly flat, rather than puffed up like a balloon and buckling the enclosure.

Hooray for the living dead: GNUStep

Back when Steve Jobs was CEO of NeXT, and it wasn’t clear that the company was going to survive, open source developers cloned the company’s crown jewel, OpenStep, with GNUStep. Then OpenStep morphed into Mac OS X, and GNUStep was largely forgotten.

But the great thing with open source software is that nothing gets completely lost. Sony’s working on a software platform using GNUStep on top of Linux.

There are good technical reasons to use GNUStep, and for a long time the biggest reason not to was that having to to learn an obscure new language (Objective-C) scared away a lot of developers. My guess is that the fact that Apple has convinced so many programmers to use Objective-C for iPods made an impression on Sony. That and the fact that Apple has shown that Objective-C works well on low-power devices.

Several years ago, if you wanted to write portable code, you used C. If you were careful, it could run on Macs, Windows, and all the servers and mainframes. Typically, the UI would be a native app, and everything else would be cross-platform. With cell phones, that’s no longer the case. On Android, you have to use Java. On Palm/HP’s WebOS, it has to be JavaScript. And until a few months ago, iPhone apps would be automatically rejected if not originally written in C/C++/Objective-C. This made it impossible to write even a few lines of code that run on multiple machines.

This makes me suspect that Sony has decided that if they can get cross-compatibility with only one platform, it’s Apple’s.

Why taxing the rich isn’t a viable strategy

One of the leading candidates in the upcoming gubernatorial election has a simple message for fixing Minnesota’s budget woes: tax the rich more. Specifically, raise the income tax for those with the highest incomes. That’s not exactly the same as taxing the rich, and therein lies the problem.

When I was little, rich people (measured in income, not wealth) tended to get a lot of perks. The corporate car, the corporate golf club membership, three-martini lunches, and so on. Back then, income taxes were very high for the wealthy, so the wealthy avoided high incomes. Why buy your own car when it was much cheaper to convince your employer (who might be yourself) to lend you a car? Once Reaganomics caught on, it became more efficient to give people cash, so incomes rose as perks disappeared. The point is, incomes at the high end are fungible. It’s easy to trade cash for perks, and those who give high salaries have a great deal of incentive to find creative ways to be tax efficient. So if you tax perks, incomes rise, but if you tax incomes, perks rise. Tax rates going up next year? Lower the 401k deduction this year, then raise it next year to compensate.

The second problem with raising income tax as a tax-the-rich strategy is that it only affects the high-income wealthy. People like the aforementioned candidate are wealthy, but it’s all wealth, no income. The money’s already in the bank, so any income tax was long since paid. Only if that money makes more money is it taxable, and then it’s even more fungible. Interest and dividends are taxable as regular income, but capital gains (increase in stock price) only become income when the stock is sold. So you sell stocks only when the tax rates are particularly favorable or when you really need the cash. It’s a cat-and-mouse game that the government can never win, in part because the super-wealthy can save money by spending big bucks to avoid taxes, and in part because the super-wealthy are themselves voters who can save money by making campaign donations to create loopholes.

One of the big problems in the financial meltdown was that home prices dropped dramatically, and the revenue for most municipalities is based in property taxes. When you tie the government’s income to one part of the economy, a crash in that sector leaves the government empty handed, which causes government layoffs as well as fewer government services when people need them the most. That’s why most economists favor a value added tax (VAT), like in the EU: it taxes nearly every financial transaction, so government coffers rely on no single part of the economy. Relying on a tax-the-rich strategy is perhaps the worst of all: not only isn’t it economically diverse, it relies on an absence of loopholes for those best suited to create and exploit loopholes.

On Tuesday I’ll be voting for Tom Horner, whose strategy is neither to tax the rich (exclusively) nor to decimate governmental services. Rather he plans to lower the sales tax rate but broaden the number of goods taxed, making it ever so slightly more like a VAT. It’s a pragmatic, rather than a feel-good strategy.

More on writing to the 7th generation

While I was at Camp Unistar this summer, I wrote a letter to my first grandchild to reach the age of 18. It’s an introduction to this project. Next summer I plan to write the next letter in the series, to the other grandchildren. (It’s on the computer, so each grandchild will get a copy.) After that I’ll write one every year to a subsequent generation.

When I’m done writing the letters, I’ll make printouts and stuff them in envelopes within envelopes within boxes, so that my grandchildren will each get a box of letters for his or her descendants. Then my great grandchildren will open their boxes (given by their parents) to find letters for their children, and so on. With each letter there will be some knickknack or photo from the 20th century (or early 21st); each one will be different, so there should be some excitement to see what is enclosed.

I targeted my first letter for the mid-21st century, assuming my children (4 and 6 years old) will start to have children in about 25 years (2035) who will open the letters on their 18th birthday (2053, give or take 10 years.) It’s hard to figure out how to address people 40 years from now; it’s as if I’d gotten a letter from 1950 on my 18th birthday. Fortunately we can still understand letters from the 1950s pretty easily. People still watch Laurel and Hardy from the 1920s and 30s. Once you go a few more generations, things start to get weird.

At what point will people still be using web browsers as we know them? Will this blog entry still be accessible in 2200? Will there be another world war? What words will have gone out of fashion? Will the language have become more formal, or less? Will we still need to brush our teeth? And most important, what advice can I give to an 18 year old which will still be relevant? (Studying advice for college, perhaps? Will they have college? Will my best advice be outdated by scientific discoveries?)

I think about things differently now. I wonder how long things will last in terms of generations. Since one of the goals of this project has been to alter my perspective, it’s a success so far.

Remembering Nancy Haley

When I was on the Board of Directors for the Prairie Star District of the UUA, one of my favorite co-directors was Rev. Nancy Haley. She was always lively, thoughtful and thought-provoking. When we got mired in budget debates and fears about funding, she would dare us to dream big: that if our services were valued, they would find funding. And she was right. She would tell me about her son, a fellow geek who worked on the crowd animation software for Lord of the Rings. Through these conversations it became clear that she had her own inner geek, which was revealed when she did a worship service in which she had everyone make a Möbius strip.

She died suddenly and all too young; though she had grandchildren, last I saw her she had energy to last for great grandchildren.

Obituary

Writing to my great-great-great-great-great-great-great grandchildren

I’ve been contemplating a project, which I may be too young to do, namely to write a letter to my descendants seven generations from now. This is inspired by the Iroquois notion of considering the impact of one’s actions on the next seven generations. In order to consider them, I must think about who they are, and what better way than to write a letter? Conversely, what greater gift could I have received on my 18th birthday than a letter from a Revolutionary War era ancestor?

There are a lot of things to consider if I’m seriously going to do this. How do I get the letters to their intended recipients? What if I don’t have descendants then? If I include photos, how do I make sure they won’t fade– or worse, damage the letters? And finally, what would I say?

Delivering the letters may be the easiest problem. First, redundancy works in my favor. If each child has two children, I’ll have 128 such recipients. If a few letters get lost along the way, I can still succeed. I can give letters to my grandchildren, enclosing letters for their descendants. With each passing generation, the tradition grows more meaningful, increasing the likelihood of delivery. I can also enclose photos or mementos, different ones for each letter, so parents will look forward to seeing what their children get.

I’ll be thinking about this project for a while longer. If anyone has any suggestions or pointers, let me know. And I encourage others to consider this sort of letter writing project.

In 10 years, Real Programmers will use functional languages

Back when I started programming (on an Apple ][e, to help date things), there were two kinds of programmers. Real Programmers talked assembly language. Other programmers weren’t real, because they didn’t need to know the inner workings of their computers, and therefore didn’t really understand computers. More important from a pragmatic standpoint, Real Programmers could get the computers to do anything that was physically possible with the hardware– and the programs ran 10x faster.

Over the next decade or so, as compilers got better and computer hardware became tuned toward compiled code (rather than assembly language), C programmers were allowed to join the Real Programmer club. These days, Real Programmer usually implies C or C++. And now that even lowly Javascript runs within spitting distance of C, the distinction is nearly 100% machismo and 0% practical considerations. (Down from about 50%/50% in the early days and 80%/20% in the C days.)

But there’s still a practical reason for hiring a Real Programmer. Modern languages insulate you from having to think like a computer. That’s good, because 99% of the time you don’t want to think like the computer– you want to think like the users. But that other 1% of the time, if you can’t think like a computer, you’re going to run into major trouble. Assembly and C are weeder languages– it’s easy to weed out the good programmers from the bad ones. Java, C#, and the other modern languages make it really hard.

What’s worse, the language features in C that have gone away (manual memory management, for example) are now really, really bad ideas on modern multi-core, networked computer architectures.

Enter functional languages. They’ve been around since the 1960s, and have mostly been limited to the artificial intelligence community. They’re also well suited to failsafe, networked computing applications. (Google repopularized them with the Map-Reduce programming style it uses internally.) The basic idea is that you design using mathematical functions, rather than machine operations. The practical difference being that in traditional languages you modify variables, whereas in functional languages you apply functions to constants to obtain new constants. Because you avoid variables, you avoid all sorts of difficult problems where multiple processors are trying to edit the same thing at the same time. It also means that the computer has incredible flexibility in being able to cache partial results, retry calculations, split up the code between multiple processors, and otherwise optimize or handle hardware failure.

Functional programming isn’t hard if you’re mathematically inclined. If recursion doesn’t throw you for a loop, it can be just as easy as traditional programming. But it’s hard enough to separate the Real Programmers from the code monkeys. And its advantages are compelling enough for programmers to switch to functional models. The main thing keeping functional programmers from being considered Real Programmers by the C/C++ crowd is the cultural divide. Real Programmers take pride in knowing exactly where their ones and zeroes are. (Except they don’t anymore, thanks to virtual memory, three or more levels of cache, and processors that rewrite their code on the fly.) Functional programmers pride themselves on keeping their code in the mathematical realm, far from any real processors. But as it becomes more clear that the “hard core” programming problems are best solved by the programmer writing specifications which enable the computer to use all its fancy optimization tricks, we’ll see more and more Real Programmers switch to functional programming.

As what may be an opening salvo, the Go language was designed in part by some of the people who invented C, and is named after one of its functional features.

Gah! Java has no modulo operator!

Amazing that I’ve been programming in Java for about 15 years, and I hadn’t run into this before. Tells you just how insidious this could be. Java’s ‘%’ operator acts like a modulo operator most of the time, but it’s a remainder operator. Your formula may work just fine in C, Python, Perl, Excel, and everywhere else— until you hit a negative number.

The difference is that the range of modulo-n is 0..(n-1) for positive n, whereas the range of Java’s quasi-modulo is -(n-1)…(n-1). So x%3 in Java goes from -2 to 2, whereas everywhere else it goes from 0 to 2. If you get a negative result, you need to add 3 to get the right answer.

This comes up because I’m trying to find the quarter that a month is in. Quarters can be defined as starting in any month (e.g. the fiscal year for my church starts in July, so Q1 is July, August, and September.) But since months are a cycle of 12 (a modulo-12 number system), there are only three kinds of quarter systems: January starts a quarter, February starts a quarter, and March starts a quarter. Call them 0, 1, and 2, and call the months 0-11 (the way Java painfully does), and you can find the number of months since the start of the quarter as (month-quarterOffset)%3. As long as you’re not using Java.

The end of a rant?

I’ve had this rant for a few years now, and I repeat it every time I need to reboot my computer or phone for a system update. Why, in this day and age, should I need to reboot for a system update? The updates should just happen automatically in the background (with my permission, of course) without disrupting my work. The technology to do this has existed for decades. It’s a lot of work to get this to work seamlessly for legacy PC programs, but smart phones run apps in a more controlled environment where this sort of thing wouldn’t be difficult.

Now RIM, maker of BlackBerry smart phones, has purchased QNX, maker of highly robust real-time operating systems. Since 1980, QNX is what you used if your computer happened to be running a nuclear power plant, medical device, car, or anything else that must not fail. System updates don’t even slow it down.

The trick is that QNX is a microkernel operating system. The kernel (the part of the OS that is always running) is tiny. Traditional kernels contain all the code for handling the video display, the hard disk, the keyboard and mouse, and various other services that user-visible programs use. A microkernel is more like a traffic cop, handling messages to and from the programs that provide those services. Need to update your video driver? A new video driver program gets installed, and takes over from the old one. No reboot required. The only thing that requires a reboot is a change to the microkernel itself. And because the microkernel is so small and simple, there’s not much room for bugs to hide. And QNX has had 30 years to shake the bugs out. If RIM decides to go with a no-reboot-ever policy for system updates, they could do it.

Question for Latin lovers

In Latin, are spoken numbers constructed in the same style as Roman numerals? For example, in English, 1999 is spoken as “one thousand nine hundred and ninety-nine,” which matches the Arabic numeral construction. In Roman numerals you would write MIM. (Actually, in ancient Rome, you would have written MCMXCVIIII). So would the words in Latin be something like “thousand plus thousand minus one”?