I get a lot of credit card offers. That doesn’t surprise me. However, it’s the frequency and format that I don’t understand.

Yesterday I got one from Capital One, for their “Go Miles Ultra” card. Today I got one from Capital One, for their “Go Miles” card. Last week it was for “Go Miles” and for “Go Miles Visa Platinum”. The four offers look completely different. They are using different size paper, have a different format, different interest rates, and the cards look different. Do they really have multiple marketing departments working independently? It sure seems that way. I get an average of three offers a week from Capital One. Or maybe they are trying out lots of different things to see which one gets the best response rate.

I occasionally get offers from companies whose cards I already have. That seems silly. Are they wanting me to get a new card and transfer the balance from the old one? The new card offers certainly look to have better terms than the card I have.

I also get offers from companies whose cards I have cancelled. Discover Card really annoyed me and I am not going to sign up with them again. In complete contrast, American Express was very nice to me when I cancelled; I may someday get an American Express card again.

One amusing thing I see these days is that the credit card companies send me a piece of plastic or cardboard that looks like a credit card. I’m collecting these and will soon post pictures of them to flickr.

Over the last few days we’ve seen lots of calls for giving to organizations that will help the tsunami victims. After you do that (I’m giving to the American Red Cross), step back and think about other forms of giving.

Disasters like the South Asian earthquake/tsunami get a lot of attention because they are easily identified events. Longer term, slower problems like famine and poverty aren’t as easy to identify with, and need help too. Car crashes kill a lot more people than airplane crashes, but there are lots of car crashes, and each one is small, whereas there are just a few big airplane crashes. Airplane crashes make the news, so airplane crashes are what people remember. This is also why special interests get laws passed in their favor. It’s easier to identify with the thousands of milk producers who will benefit from higher prices than with the millions of families who will benefit from lower prices (either directly, at the store, or indirectly, with lower taxes).

We’re going to see a lot of people asking why there wasn’t a tsunami warning system in the Indian Ocean. There will be a host of reasons, like the infrequency of tsunamis, the lack of funding, the poverty in the area, stinginess of Americans, etc. But I think the real question is why is there a tsunami warning network in the Pacific? Solving individual problems like a tsunami detection network will make us feel good. They are something you can point to easily and say something was done. But they’re not necessarily the best use of money, and may even be taking attention, effort, and resources away from other projects that could help more. If the economies around the Indian Ocean were as strong as those around the Pacific Ocean, I think we would have had those tsunami detection networks. We need social, economic, and political development to help solve millions of problems instead of solving only those that have gotten widespread press.

So after you’ve helped the short term relief efforts, think about investing for the long term. What organizations are helping the social, economic, and political development in these impoverished nations? I think money spent there will be a better investment than money spent on the relief efforts. I want people not to have to worry about their next meal, not because I’ve sent food their way, but because they can support themselves. I want people not to have to worry about their health, not because I’ve sent them vaccines, but because they can take care of themselves. I want people everywhere to have the luxury of being friendly to the environment, being prepared for disasters, and being able to help others in need. But I don’t know how to get to that world.

I recently started reading Jeff Hawkins’s On Intelligence, and it reminded me of how computer folk like hierarchies. Hawkins’s premise is that the neocortex of the human brain learns with hierarchies. Hierarchies are used for memory and for prediction. I really like this book. However, I think the description of the neocortex in terms of hierarchies is misleading. He writes:

What do I mean by a nested or hierarchical structure? Think about music. Notes are combined to form intervals. Intervals are combined to form melodic phrases. Phrases are combined to form melodies or songs. Songs are combined into albums. Think about written language. Letters are combined to form syllables. Syllables are combined to form words. Words are combined to form clauses and sentences.

I agree that there is hierarchical structure, but it is in the individual occurrences of those notes, words, and phrases—not in the general classes of them. I think it is unlikely that the brain separately learns the letter “h” in the word hotel and the word home. Instead, a single part of the brain learns the concept for h, and it feeds into both the concept for hotel and the concept for home. This structure would have multiple levels, just as a hierarchy has, and it would represent small features at the bottom and large objects at the top, just like a hierarchy, but each node would not feed only (or primarily) into one parent node:

Hawkins in fact writes that lower levels are used by multiple high level objects:

In a complementary bit of efficiency, representations of simple objects at the bottom of the hierarchy can be reused over and over for different high-level sequences. For instance, we don’t have to learn one set of words for the Gettysburg Address and a completely different set for Martin Luther King’s “I Have a Dream” speech, even though the two orations contain some of the same words.

and he writes that there are a lot of connections from outside the main hiearchical pathway:

On close inspection, we see that at least 90 percent of the synapses on cells within each column come from places outside the column itself. Some connections arrive from neighboring columns. Others come from halfway across the brain.

So Hawkins does see something other than a hierarchy. I thought perhaps that he was using the term “hierarchy” differently than the usual meaning, but the diagrams in the book reinforce the tree structure: every node has a parent; every parent has multiple children.

How this “sharing” occurs, I think, is a key element of generalizing to learn abstractions. It’s not just an efficiency trick. I think it is likely that the brain learns specific instances (which form a hierarchy) first, but then generalizes that to classes of objects. The specific instances might be forgotten later (perhaps this is the role of sleep). Once generalized into classes, the relationships no longer form a hierarchy. Instead it’s probably a partially acyclic graph structure, where there are cycles within each layer, but no cycles between layers. I’m really just guessing here though.

I’m really enjoying this book. Viewing the brain as a prediction machine explains many things I’ve wondered about. For example, take a look at the blurry word on this page, and then take a look at it in context. In context, you can tell what the word is. That makes sense if the brain is predicting things.

My only complaint about this book is that the diagrams in the book and the use of the word “hiearchy” suggest a tree structure, but I think it would be more realistic to look at it as a graph. Yes, graphs are messy, and trees are beautiful, but just because we computer scientists like playing with them doesn’t mean they’re there.

In the U.S., many people think being a “millionaire” means you’re wealthy. This post is a guide to becoming a millionaire. It is primarily aimed at young people (high school / college age) in the U.S. If you start at age 20 and make minimum wage, you should be able to be a millionaire.

Patience

You can be rich through crime, luck, or time. Crime is risky; I haven’t any experience in the area so I have no recommendations if you want to go that route. Luck isn’t something you can directly control, although there is the saying Luck favors the prepared. I think there is indeed something to that saying. Keep the big picture in mind, and you are more likely to see opportunities. However what I’m going to focus on here is using time to become rich.

Compounding

The key to having lots of money is compound interest. The second key is to take advantage of government incentives.

Let’s set as a goal I want to be a millionaire when I retire. What will it take to achieve that goal? What it takes depends on your current age. I will start out assuming you are 20 years old. That gives you 47 years before the age of 67, which is considered “full retirement age”. Next, let’s assume laziness. I want to save for 4 years and never save again. This is not an unreasonable goal—when you are young (if you have a job) you will likely be able to save quite a bit, but once you start a family, it will be much harder to save.

Let’s assume I save $X per week (for four years), and I am going to save it for 47 years. I can invest this in index funds in a Roth IRA. The S&P 500 has returned an average of 10.7% per year over the last 70 years, but if I index in Vanguard’s index fund, I have a 0.2% fee, so that comes to 10.5%. If I assume that continues, then I can compute how much I have after 47 years: 1.10547*X*52. Since I am saving over 4 years, and I want to have a million dollars, I need to solve for X: 1.10547*X*52 + 1.10546*X*52 + 1.10545*X*52 + 1.10544*X*52 >= 1000000. When I do that, I find that X is around $51.

Saving $51 per week for 4 years will make me a millionaire.

Caveats

It’s certainly possible (and likely) the stock market won’t behave like it has in the past. Tax laws may change. The government may collapse. The biggest issue is that a million dollars 47 years from now will be worth less due to inflation, and may even be commonplace. Even today, a million dollars isn’t quite enough to retire comfortably.

Still, $51/week doesn’t seem too bad ... to be a millionaire.

Note that you have to put this into an IRA to avoid the capital gains taxes. If you save outside an IRA (or 401(k)), you will lose 1/2 of that in capital gains (2/3rds if you live in California), plus another 1/3rd (estimated) in income taxes. Combined, that means saving in an IRA gives you three times as much as saving outside an IRA (four times as much if you live in California).

Saving works much better when you are young. If you wait until you are 30, you have to save $127/week to get the same effect. If you wait until you are 40, you have to save $344/week.

Perspective

If you have trouble saving, you might think about it this way: if you do nothing (no spending), your $15,000 income (just in one year) will be worth $1,500,000 at retirement. Working a full time job at minimum wage, you’re getting over a million dollars a year added to your retirement. If you buy something worth $50 today (at age 20), it is taking $5,000 out of your retirement. But you have to do something to avoid becoming a millionaire—you have to spend most everything you earn.

Thinking this way, you might think you should never spend anything. Not so. There are a few things to keep in mind:

Once you reach the government limit to IRA contributions ($3,500 I believe), you no longer are saving inside the IRA. The $50 item is not costing $5,000 anymore; it is costing $2,500 ($1,650 in California). Spending money becomes cheaper once you have contributed to your IRA.

As you get older, you get less of a benefit from compounding. The $50 item is taking $5,000 from your retirement when you are 20, but it is taking “only” $2,000 when you are 30; $740 when you are 40. So as you get older, it makes less and less sense to save (assuming you have saved when you are young).

There are other investments you can make when young that are worth more than what you can get from index funds. For example, investing in your health and education and happiness may pay off more than the S&P 500 returns. But be careful with that happiness thing. Make sure that the $50 you spend today on happiness will brign you more happiness than $5,000 will bring later in life. Be careful with the education thing too. Calculate what a four year university is costing you at retirement (add up room&board, tuition, fees, and lost wages). It’s awfully expensive (up to $15,000,000!).

The value of money goes down the more you have. Having ten million dollars isn’t ten times as good as having a million dollars. You need to find balance between spending when you are young and spending when you are old.

When you are young, contribute the max to your IRA or 401(k). It’s not that hard to become a millionaire. It just takes time.

Sometimes on the weekend I’ll post to my blog some of the interesting things I’ve read. One of the problems is that it takes a lot of effort to do this. (Why is Blogger so slow? I waited over 15 minutes after I clicked “Publish Post”, and then gave up... but the next time I tried, it was fast.) I just signed up for del.icio.us today. It makes it easier to keep a collection of links. You can see more of my weekend (and weekday) reading on my del.icio.us page. (Unfortunately, del.icio.us is slow too, but nowhere near as slow as Blogger.)

While signing up, I thought more about how computer folk like hierarchies. Gmail labels, del.icio.usbookmark tags, Reiser groups, and flickr tags all break out of hierarchies (mail folders, bookmark folders, photo folders, filesystem folders) and instead use some sort of label/tagging system. In del.icio.us you can assign any number of tags to an entry. A filename or URL path a/b/c is ordered. Tags in contrast are unordered: a b c and c b a are equivalent. Paths are structured: the b/c part of a/b/c makes sense only within the context of a. You can specify a by itself but not b or c. Tags are unstructured: you can specify any one or many of them in any order. With paths I put something in one “place”. With tags I can put something in multiple “places”. The downside is that with paths I can put places inside of places, whereas with tags I have no containment structure. Once I overcome my own love of hierarchies, I think I will like using tags/labels.

I found the site last night while looking for information about Unicode U+2024 ONE DOT LEADER, which was referenced in an article about mdash, ndash, hyphens, and other typographical characters in HTML. SIL’s site promised me “here is the true story of U+2024.”

Branch to the Right: an article about writing (one of fifty; I will not read them all this weekend)

Country Codes used by various organizations; I found this while trying to understand Great Britain (GB) vs. United Kingdom (UK), why ISO assigns the code GB to the United Kingdom (ick), and why the top level domain for the United Kingdom is .uk instead of .gb (since it’s supposed to match ISO)

For those of you who aren’t yet scared of Python, maybe these will help:

Recipe 299,777: subclass dict, assign self.__dict__ to point to self. I can’t believe this really works. For those of you wondering: __dict__ points to a dictionary that contains the fields of an object. By making a dict’s __dict__ point to itself, it exposes all of the dictionary’s mappings as fields of the dictionary itself. Ooh it’s all twisty.

Recipe 66,531: make a Singleton by having all instances share the same __dict__. Normally you make a Singleton class that constructs only one instance. Here instead you allow lots of instances, but make them share state. Brilliant.

Recipe 303,057: intercept name lookup in a specially marked method to provide Prolog-like functionality in Python. This uses Python 2.4 decorators to intercept method definition. It inspects the methods, finds out what names it refers to, and points those names at Prolog-like variables. I don’t quite follow everything going on in this recipe, but I like it!

I found these on Oliver Steele’s post about Python becoming Lisp. I studied Scheme, not Lisp, and I have to say that the above examples are not Schemish. Python has its own flavor of demonic insanity.

Oliver Steele offers some good thoughts on IDEs vs. editors. I admit I am a “language maven”, but I’ve also tried using IDEs. There are some really cool things that you can do with an IDE and I would like to use them. Most recently I used Eclipse to build a Java applet. Given that I am not a Java pro, it was definitely easier to use an IDE that knew all the black magic to compile applets than if I had used Emacs with command line Java tools. The trouble is that in my everyday work, I am working with Java, C++, Python, text files, XML, HTML, CSS, Javascript, shell scripts, and a little bit of Perl. I use Windows XP, Windows 98, and Linux. So I have to choose between using one tool for all of these, or using maybe 12 different tools, each specialized for one task. I keep returning to the one “swiss army knife” approach.

Computer people like hierarchies. File system folders, HTML/XML/SGML, Java packages, class hierarchies, Usenet groups, the Windows registry, domain names, IP address assignment, software version numbers (1.1.5 comes before 1.10), GUI widget container hierarchies, URL paths, and hierarchal menus are some examples. Hierarchies are expressed using tree data structures, and trees are pretty cool. So we tend to want to use them when we see a new problem. It’s a structure taught to all computer scientists. It’s an old familiar friend.

Sometimes a tree isn’t the best structure for the problem. On the Internet you see some things that are not hierarchies, like email addresses (user@domain), the web (a directed graph structure), and IP routing tables. Sriram’s post got me thinking about overusing tree structures, and in particular, the A <i> b <b> c </i> d </b> e problem in HTML.

HTML uses a containment model: when you write <abc>xyz</abc>, xyz is contained “inside” the abc element. In a containment model, A <i> b <b> c </i> d </b> e is an error. In contrast, Emacs and XEmacs use an overlay model. Instead of a containment relationship, an overlay is attached to any span of text, and overlays can overlap. In an overlay model, A <i> b <b> c </i> d </b> e should be rendered A b cd e. There’s no problem. The text selection is also something that is hard to express in a tree structure. It’s just another overlay in Emacs.

But overlays don’t seem to be the right fit for larger structures, like paragraphs, sections, documents. For those containment makes more sense. Within a block however, overlays make sense. I think the difference may be between things that can be nested (a div can be inside another div) and things that can’t (it makes no sense to put an i inside another i), but I’m not really sure.

An argument can be made that supporting A <i> b <b> c </i> d </b> e properly at the expense of no longer having a uniform model (which is used by DOM, XSLT, etc.) isn’t worth it, but that argument should be made explicitly. Every use of a tree structure should be justified, because there is a natural bias towards trees among computer folk.

I am quite impressed that they left it subtle instead of highlighting it. It reduces the short-term impact but is much cooler in the long term. Things that take some effort or luck to notice are the things that people will remember. If it’s easy to see, it’s easy to forget.

For a few years now I’ve been wondering what subjects I would have liked to learn in high school. I got very little out of Literature or History, but I love learning history from The History Channel. Typing was a great class. I hated it at the time but it has been quite a valuable skill. Physical Education (a.k.a. Gym) made me hate exercise. :-( I’m quite happy I took Math and English. Two subjects I wish were mandatory:

When two prices are charged, people paying the higher price (often in the United States) believe that if the firm were forced to charge one price, it would charge the lower one. Unfortunately, that is not always the case. Sometimes mandating a single price results in just choking off the small market, rather than lowering the price in the large one.

These will display a blue ◇ next to unvisited links, a purple ◆ on visited links, and a red ↷ on links that have another URL embedded inside (usually indicating a tracking redirect), a red ✉ on email links, and a red ✇ on javascript links.

You can pick lots of fun shapes and symbols from Alan Wood’s Unicode page (note: there are lots more pages on his site with lots more symbols). To use a different symbol, just put in its Unicode hexadecimal value in the CSS, with six hex digits (i.e., use a leading 00).

I don’t know if I will keep these customizations, but it’s fun to play with. You can put any text or the value of any attribute before or after any HTML element. Mix this with hover effects for lots of fun! Opera users can also have fun with generated counters (for example, to number all the links on the page).

I’m a font geek. I look at highway signs (in the U.S.) and think, “ick!” I’m really excited to see Clearview Hwy. It is much easier to read and much prettier than the usual font. Unfortunately it isn’t being used in California (yet). Also interesting is the story of how they got started with this project.

It seems so simple. I really like what I see. Simple is good. I especially like the inverted creation pattern: normally you create some structure (a database table, a form, a class in object-oriented programming), create new objects using that structure, and then populate them. In JotSpot, you first create objects and can attach structure to them afterwards. I wonder if you can attach multiple forms to the same page. I wonder if the external objects (RSS feeds, Google search) are tied to pages only or if they can be attached to forms, so that they apply to all pages that adopt the form.

So far though JotSpot looks like it’s built for companies to buy. I would like something that I can use for keeping notes among friends, keeping track of my “to do” list (where other people can comment on it), or other lightweight non-commercial uses.

There’s something that bothered me about the Squeak environment, and it’s the same thing that bothered me about LambdaMOO and OS/2’s Workplace Shell, and to some extent, about objects in general: the objects you create make sense in that environment but it is hard to remove them from that environment. There is an entire “world” there with objects depending on code in classes, which depends on code in other classes and so on. It’s all very nice while you are in that world. There are incredibly cool things that can be done. But it’s hard to interact with other worlds, especially when they have been customized (different versions, patches, optional packages, etc.).

The Mac community had this problem too. Resource forks are all very nice, but they only work while you live inside the Mac community. Once you step out, they are a mess. The resource forks didn’t work with ftp or http or gopher or other file systems. The Mac folk just blamed everyone else for being so primitive. But being primitive is good. I’m probably the only one in the world who thinks file extensions are good. Other sorts of metadata—unix file permissions, Windows file attributes, etc.—have the same problem. They live outside the simplest system (files have a name + data), so they get lost.

WinFS sounds like it will be very cool ... as long as I live within the Longhorn world. As soon as I step out, it’s all lost. These days I keep much more on the network than I did just a few years ago—blogger, web, gmail, network file server, multiple computers, cell phone, PDA, TiVo. Any solution that only works when I’m in a little part of that world is not very interesting except as a toy.

Any centralized storage of data/objects is just not going to work in my life. The more I think about it, the less I think object-oriented programming is as useful these days. Objects are about tying data to behavior. Behavior is code. Code is highly unlikely to work on all the different systems I work on. The most useful thing for me is to have data and code separated. And as I mentioned above, metadata is too messy. So I need to have data with no metadata and no code. It would be fine if the metadata lived in the same file as the data. This fits in with the Unix model: data and programs are separate, data can work with many different programs, and programs can work with many different types of data. It doesn’t fit well with the Windows and Mac application models: a file (data) has a certain type, which is associated with a particular application (code). Instead of a Word document, an Excel spreadsheet, a Photoshop file, I need file types that have data alone and work with many different applications: HTML, JPEG, PNG, Text, CSV.

For a while now I’ve been happy separating data and programs at the OS level. It buys me a lot of flexibility and power. I’ve been thinking about whether it makes sense to do the same inside a program. If encapsulation at the file system level (e.g. my inability to decipher a Word document without running Microsoft Word) is bad, is encapsulation also bad at the object level? Maybe it’s time to give up on object-oriented programming.

Radeox is a library that converts text to XHTML. It can be used in Wikis, and it is used in the SnipSnap Wiki. But more importantly for me, it can be used as a command line tool or as a library in Java applications.
Radeox accepts this syntax by default, but is customizable to meet my needs.

One of the neat features about Mozilla/Firefox/Galeon/etc. is that you can apply user style sheets to web pages. (Actually, you can do this in IE as well, but it’s not as well known.) Someone has figured out how to create “skins” for gmail. Gmail’s use of pastels looks bad on my laptop screen, with the pastel blue for “current message” looking almost like white, so I’m looking forward to skinning gmail.

(Text generously provided by Lipsum.com.) Notice that Arial Unicode MS has rounder, wider glyphs. It’s more pleasing to my eye. It’s also bigger. But when I try reading the text, it seems that Arial is easier to read than Arial Unicode MS. I wonder if Arial is better hinted.

It’s refreshing to hear someone talk about the positive side of “price gouging”. Every change has two sides, and it’s common that you only hear half the story. For example you might hear (in the 70’s) about how cheap cars from Japan are making Americans lose their jobs, but you won’t hear about how American families are better off with all the extra money they saved by having a lower cost car. Usually you’ll only hear from the people who are worse off and you won’t hear from the people who are benefiting.

Imagine waking up one day and finding that the street you live on has been transformed. It’s no longer open to vehicle traffic, and there are hundreds of tents and tens of thousands of people walking around. That’s what happened to me during the Mountain View Art and Wine Festival.

How did people communicate before language? They pointed at things and made various grunting sounds. We’re much better off with language. We can talk about things not only as they are but as they might be. We can talk about past, present, and future. We can talk about relationships like containment. We can talk about patterns like numbers and repetition.

Working with Windows reduces me to the level of “point and grunt”. It’s very hard for me to say things like, “repeat this every Tuesday afternoon” or “keep trying to download from here until you have four files.” With Unix I have language: I can write simple commands (phrases) and combine them into larger commands (compound sentences, paragraphs, etc.).

It’s a lot of work to learn language. It takes many years for babies to learn how to talk and then later how to read and write. But you can express so much more with language than without. With computers it’s the same way. It takes a lot of investment to learn something like Unix, but it pays off when you can start expressing complex thoughts.

Yes, Windows has nice graphics. Graphics are pretty. They say that “a picture is a thousand words”, but there’s a lot that is hard to express with pictures. How do you express in a picture complex thoughts like “next week I expect three llamas to meditate in my back yard?” You might try using a whole series of pictures for this, but then you start approaching “a word is a thousand pictures.”

What I see at work is a lot of people using computers in a very primitive way. Computers are good at automating things. The people using Windows tend to perform more mindless repetitive tasks. The people using Unix tend to automate their tasks, so they can work on more interesting things. Windows makes things look easy. And they are, at first, because you’re only doing simple things at first. But complex things are harder. For people who spend a lot of time on the computer, it’s usually worth learning to automate the tedious and boring tasks. And that means you need language.

Show Failed URL puts the URL in the location bar instead of the XUL error page. I still have trouble with the Back button when there are errors, though.

Tabbrowser Preferences lets me change some (but not all) new windows to open in new tabs instead. It has some other tab options as well. I also like Petite Tabbrowser Extensions, but it doesn’t seem to let me make external links in new tabs instead of new windows.

Flat Bookmark Editing is something I loved in Galeon and missed in Firefox. This extension gives me sane bookmark management in Firefox.

Target Alert is something I tried setting up manually (using userContent.css), but the extension is more polished.

DOM Inspector lets me look at the DOM tree of any page. I don’t use this very much.

I had thought that charging customers different prices for the same thing was unfair and the result of pure greediness. But Hal Varian explains why “differential pricing” might be better than fixed pricing, especially in industries with high fixed costs. One of the arguments boils down to: if some people are willing to pay more than others and the fixed costs are high, then you can end up in a situation where it is worse for the consumers (as a group) to all have the same price than to have different prices. The producer usually benefits from differential pricing, but in many (most?) situations the consumer does too. One case in particular is when the producer would go out of business without differential pricing; there is no benefit to the consumer of losing the opportunity of purchasing a product or service.

My sense of fairness says you should charge the same amount for the same thing, but the math shows that society is (overall) better off with less fairness.

Pay as you go.

I’ve also been thinking about fixed payments vs. charging for usage: road taxes vs. toll roads, unlimited vs. per-minute telephone charges, subscription vs. per-story newspaper fees, unlimited vs. micropayment for surfing the web, packages vs. pay per channel cable television. In all of these cases, I’m sure I would save money by having a choice to pay less (and get less), but I think the cost of thinking about each of the decisions would mean I’d end up less happy. I would have to question each phone call. I would miss out on some TV channels that I wouldn’t pay for if I had a choice, but occasionally offered something I want to watch. I would click on fewer links and view fewer web pages. I’d read fewer newspaper articles. I’d drive less, even at times when it’s worth it. I suspect (but have no good way of knowing for sure) that paying for use (which increases fairness, since everyone pays the “right” amount) would be worse for society than fixed payments.

Cost of decision making

When I started using gmail, I realized that over the years I’ve thrown away a lot of messages that I would’ve liked to have kept, because there is a cost of keeping it (exceeding quota, having to file them into folders, etc.). I have had to make thousands of tiny decisions (“do I keep this email?”) each day, and I sometimes I got them wrong. I probably would have been better off paying more, getting a much larger quota, and keeping everything. But at every email, there was no reason to pay for a larger quota.

Quicktime is so annoying. Quicktime for Windows uses the Mac interface. Blech. (I much prefer the Mac, but I would rather have consistency when using Windows than to have one app using a Mac interface.)

Anyway, it kept pestering me to upgrade itself. I’m sure that when it upgrades itself it will hook itself deeper into my system, but after many months of pestering I finally upgraded.

The license agreement includes:

THE APPLE SOFTWARE IS NOT INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES,
AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL SYSTEMS, LIFE
SUPPORT MACHINES OR OTHER EQUIPMENT IN WHICH THE FAILURE OF THE APPLE SOFTWARE
COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.

So are they worried that nuclear facilities are going to be critically dependent on Quicktime?

Wikipedia formatting rules, which include using inline HTML tags (which is different from what I had been thinking of doing—treating everything between tag pairs as raw HTML).

Alternative syntax for links, with the main variants being inline links, such as [http://www.ibm.com/ IBM Corporation] and out of line links, such as `IBM Corporation`_ and later .. _IBM Corporation: http://www.ibm.com/. This page also has some comments about character substitutions, such as -- turning into — and `` ... '' turning into “ ... ”. I’d like to have such features, but I don’t yet know how easy this will be.

There are lots of good ideas out there, and there are a lot of issues I hadn’t thought about. My own notes tend to be formatted so that I can easily edit them with XEmacs and filladapt-mode. Where I don’t have particular conventions already established (like named links), I would like to use what’s already out there.

For allowing HTML in my notes, I was originally thinking that I’d require XHTML, but this note about XHTML made me realize that all I wanted was a way to find closing tags, and not all of XHTML. I plan to require all tags to be closed (<X> ... </X>) or self-closing (<X />), but I do not plan to require other aspects of XHTML.

I envision three levels of parsing:

At the top level, a notes file is composed of several notes separated by some marker. The marker may contain some information. For my notes files, the marker is [bracketed text] on a line by itself, and the text inside brackets is the name of the note.

At the block level, there are four types of blocks:

Lists begin with a bullet (*, 1., etc.).

HTML blocks begin with an HTML block-level tag (<p>, <div>, etc.).

Preformatted text begins with spaces for indentation. All subsequent lines indented at least that number of spaces will be part of the preformatted text block.

Any other text (including HTML inline tags) begins a paragraph.

At the inline level, there are three types of spans:

HTML spans begin with an HTML inline-level tag (<img>, <a>, <abbr>, etc.) and end at the corresponding closing tag.

Markup spans begin with some markup character (*, `, \) and typically end with the same markup character. However, the rules are tricky because markup characters sometimes occur in contexts where they are not being used for markup. The \ character is used for escaping in contexts where the following character would otherwise be treated as a markup character. (This seems complicated.)

Text spans begin with any text.

Indentation plays a key role in parsing preformatted and list blocks Implementing this may be trickier than I initially expected, especially because my notes were not written with these rules in mind.

ReStructuredText and Twiki have had a lot of good work put into them, and it’s silly to reinvent it, unless I’m trying to solve a different problem. I have to remind myself that my main goal is to parse my existing notes, and my secondary goal is to be able to write new notes easily. If the syntax of old and new documents is going to be different, then perhaps my approach should be to write a parser for my old notes that converts everything to my new note format, or perhaps I should manually convert everything.

I’ve been looking through my old notes and have realized that like many other people, I follow certain conventions when writing text files. I’d like to publish some of these notes to a web site. The simplest thing to do would be to upload the notes as text. The second simplest thing to do would be to upload the notes as HTML, with a <pre> around the entire note. However, it would be cooler if I could take advantage of the conventions I've used to write something richer than text.

There are lots of systems that allow you to write text and produce HTML. I wrote one a few years ago to turn this text into this set of HTML pages. ReStructuredText turns text into HTML; see the sample page. Wikis turn text into HTML as well. Of these, the goals of structured text were the closest to my own: intuitive, simple, readable. However, none of these actually worked with my own text formatting conventions. My A* pages use { ... } for formatting. Wikis use lots of ` backquotes `. For example, see this set of rules, including “Use five single-quotes, or triples within doubles, for some other kind of emphasis.” ReStructuredText conventions are the closest to what I've used in the past.

My goal was to have a system that could read my existing notes for the past 15 years. I didn’t want to go back and edit all those notes to fit some formatting convention. In particular, these are some differences between my conventions and ReStructuredText:

I often use indentation for preformatted text. ReStructuredText uses indentation for indented paragraphs (using <blockquote>—ew!) and :: for preformatted text.

I use *bold*, /italics/; ReStructuredText uses **bold**, *italics*. I don’t think this would really matter though.

I don’t have a good convention for sections. In the last 5 years I’ve been using [header] on a line by itself, but I don’t have any way to have subsections. I have been writing short notes, not documents, so I never really needed subsections. ReStructuredText uses text with a line underneath or on top to mark section headings. It seems like a nice convention, but my existing notes don’t use it.

I don’t have a way to include images, because I am just writing simple notes. ReStructuredText has this:

At this point, I started wondering why I would want to write ReStructuredText instead of HTML: <img src="images/biohazard.png" height=100 width=200 alt="alternate text">.

I have no way to include links with anchor text. I do include URLs and email addresses, often but not always surrounded by <...>. ReStructuredText uses ` and _ characters, with several nice ways to avoid writing URLs inline in the document body.

Looking over my notes, I’ve realized that this task is harder than it initially seemed. For example, my notes mix plain text with code/output. I’d like plain text to be rendered in proportional font and code/output to be rendered in monospace font. I don’t have a good way to solve this for my existing notes. For future notes, I could use ReStructuredText’s convention of ``text``.

I have two problems to solve: how do I read my existing notes, and what do I do for new notes? I’m not trying to write documents (I am comfortable writing HTML); I’m looking for something simpler for quick notes. The ReStructuredText format for images made me realize that it’s really a new markup language. Simple things like paragraphs and lists are close to what I’d write naturally, but most of the formatting conventions are not. Then it hit me: if I need a markup language anyway, why not use HTML?

The problem with HTML (especially for quick note taking) is that it’s cumbersome for the simple things: text, paragraphs, lists, code snippets. For less common things (images, tables, anchor text), it isn’t as much of a win to invent a new language. So my plan is to parse text with the most common text formatting conventions (paragraphs, lists, etc.), but allow any HTML tag to “escape” into HTML mode. That way if I want to do anything complicated, I can drop into HTML, but if I want to stay simple, I can write plain text.

Why doesn’t ReStructuredText do the same thing? StructuredTextNG includes a rule to let people use SGML, but it didn’t seem to get much attention. I suspect it’s because they do not want to assume that HTML is the output format (it might be PDF or XML) and the target audience is less comfortable with HTML. TWiki also has both structured text and HTML. The original Wiki does not, and there is a discussion about pros and cons.

It will take some time to play with this system before I know whether I like it. I might end up finding that I do want to avoid HTML altogether, or that I want to write entire documents in text. I am likely to find that some of my old notes are ambiguous and cannot be parsed easily. It may be easier to go through them and fix them up instead of writing a more complicated parser.

Update: [2011] It seems that Markdown has won, not only for me, but for lots of other people. It also allows embedding HTML for when Markdown isn't enough. As of 2011, Markdown is being used by an increasing number of tools and apps.

If you are considering giving to charities, consider giving the tax deduction to them too. (In the United States at least, donations to charities are considered “tax-deductible” and you do not have to pay taxes on that amount.) If you donate an item or cash worth x, and your tax rate is r (30% would mean r=0.3), then you’re going to get x*r back in your tax refund. Give that to the charity (in cash). You’ll get x*r2 back in your tax refund. Give that to the charity too. You’ll get x*r3 back. Give that to the charity too. Rinse and repeat.

So when you’re giving an item worth x to the charity, if you decide to give all the tax credits to them, they will end up with something worth x / (1 - r). Let’s say you’re donating an item worth $100 and your marginal tax rate is 33% (federal + California can easily be this high). You can give them $100/(1-0.333) = $150 if you go through the itemized tax deductions. So give them the original item plus the $50. That’s a big bonus for them (especially since it’s cash), and all it costs you is the time and hassle of keeping track of the receipts for tax purposes. If you had kept the tax credit, you would have $33, but if you give it to them, it’s worth $50.

If I ever work on Yapps again, I should take a look at using this “undocumented” feature of the SRE engine. I’m currently going through a list of regular expressions and trying to match each one. For example, I might have a list r'if', r'\w+', r'\d+'. With this new feature, I can combine all the regular expressions into one with alternation (r'(if)|(\w+)|(\d+)') and then the regexp engine will tell me which one of them matched. This should speed up the scanner greatly.

It’d be nice if everyone posted product & service ratings online. Unfortunately they’re much more likely to post something if it’s negative. For example, take a look at Apartment Ratings.com. Most of the comments are negative. Most people who had a positive experience didn’t post. (And some of the positive posts seem to be from employees of the company being rated...) If everyone posted ratings, they’d be much more useful. (As you might guess, I’m looking for a place to live...)

I find that I too am guilty of not posting enough ratings. I’m far more likely to post negative ratings than positive ones, even though I have a positive experience with most products I use (like this Thinkpad T40 I’m using right now). I’m not sure what the solution to this problem is. It needs to be much easier to post reviews in a way that can be aggregated.

Weird Documentation is funny but it's natural to end up with weird things like that. The trouble is that things that make sense in one context (that of the author, who has been using some product during development) don't make sense without that context. This is why user testing is so important. You get to learn that you had gotten so used to some particular way of thinking that you don't realize how it has affected your thinking.

If you ever wanted to learn to program but thought the books were too boring, this guide to Ruby is for you. You may end up running away screaming back to the boring books, but it's worth taking a look. You'll also have “chunky bacon” in your head for the rest of the week.

There are two lines of thoughts for pointers vs. references. One
says to use pointers when something can be null and references
elsewhere. The other says to use pass pointers when something is
mutable and pass const references when it's immutable, because if
you use non-const reference parameters it's hard to tell at the
caller that something might be mutated.

I tend to prefer using references almost all the time. So I was looking for something that could address the mutability issue without my having to switch to pointers. Here's one solution:

It's a small helper class that annotates the argument. Instead of the caller
using f(x) for both immutable and mutable parameters, it'll use f(x)
for immutable and f(receive(x)) for a mutable parameter. Here's some sample code:

Just as auto_ptr is the standard way to use the type system to mark the transfer of ownership, receivable is a way to use the type system to mark that an argument may be mutated. There may be other kinds of annotations that can use the same technique.

A few years ago I started exploring an idea I call “smart
numbers”. In C we had pointers and numbers. In C++ we
tend to use smart pointers instead of pointers. Why not smart
numbers instead of numbers? Read more...

Fun scenic drive this weekend—we went to Lake Tahoe on highway 50, from Sacramento to South Lake Tahoe. The weather was warm so there was much snow melting, feeding waterfalls and streams.

Something new: the Heavenly Gondolas just a few blocks from the casinos. Previously, you had to drive in from the main street (highway 89) to find Heavenly. Since I wasn’t there to ski, I never bothered driving to Heavenly before, but now that it’s on the main street, I might take their gondolas to the top just for sightseeing. They cost $20 for a round trip (per person) and take you from the lake level (6000 feet) to the top of the mountain (9200 feet).

This is the first time I went up to Tahoe and back in one tank of gas. 12.2 gallons, 450 miles. Driving at 45–55 mph (on highway 50) really helps with gas mileage. If we hadn’t used the air conditioner and if we had waited until the tank was empty, we could’ve made 500 miles on one tank of gas. (No, I don’t have a hybrid; I have a 10 year old Saturn SL2.)

Total cost of the day trip: $49 = $25 for gas, $19 for food and snacks, $5 for slot machines.

I've been thinking about my web proxy project again. Proxy v3 has lots of neat features; proxy v4 has an interesting architecture. Unfortunately when I was working on features, I had lots of ideas about improving the architecture. When I started proxy4, I decided to work on a flexible architecture, but that took so long that I never went back to implement features.

I'd like to implement features again. For proxy5, I want to spend much less time on the architecture. I'm considering using the Twisted framework. It includes a basic web proxy, but it supports only HTTP 1.0. I'll have to take a look and see how easily that can be extended to work with HTTP 1.1.

Instead of buying the shampoo and other items myself, I just went to Country Pet Wash in Mountain View, CA. It was quite nice. They provide the shampoo (several to choose from), tub, towels, aprons, restraints, blow dryer, and other items. Washing the cat was $12; washing a dog is $15, I believe. The cat tried to run away but soon realized it couldn't, and calmed down. The cat's now softer, cleaner, and smells better.

The secret to true happiness. Print this out. Put it up on your fridge. Television vs. books? This article tells you why books are better. Going to a concert vs. buying a home theater? This article tells you why the concert is better. It tells you why you should minimize "drugs, chocolate, loveless sex, shopping, masturbation, television and spectator sports".

When querying for best search engine, Yahoo! returns Yahoo! Search. MSN returns MSN Search. Google returns Choose the best search engine for Your Information Needs, a site that lists many search engines and gives advice on which one you should pick when looking for different kinds of information.

Elisa Camahort's Personal Weblog is really nice. I found this blog while looking for restaurant reviews for the Silicon Valley area. I wish I had the energy to make such a useful, easy to navigate, nice looking blog. Things I like: easy scan of blog entries with 'Read More' to see the rest; categories; RSS feed; statistics. Update [2004-02-16]: Elisa is too modest; she says it's all thanks to iBlog. But it isn't just the appearance that I like. It has lots of good, readable content. There are lots of nice looking blogs I've found, but few of them have anything useful on them, so I've never mentioned them.

In my ideal Internet future, everyone would write up a quick review of every product/service they buy. Currently I end up buying lots of junk because I don't know that it's junk. With lots of reviews out there, everyone can buy only the good stuff. Companies would no longer be able to get away with selling bad things, because they'd all get negative reviews. This future requires that publishing reviews be incredibly easy. Blogging or Epinions are currently the closest thing we've got. I much prefer blogging because there's no central control. This future also requires software that can read millions of reviews and aggregate them into something that consumers can actually interpret, but I'm sure this will come if the reviews are out there.

Nelson M. and Joo G. both point me to Geomag SA, the Geomag site. Apparently the inventor of Geomag and the previous producer of Geomag, Plastwood, no longer get along. Plastwood has abandoned Geomag and come out with their lookalike, Supermag. This would explain the promotional material I've read, in which Plastwood makes it sound like Supermag is the successor to Geomag. It also explains the difficulty of finding Geomags―I'm sure Geomag was scrambling to find a new manufacturer. The catalog includes a list of their sets, including some building image galleries. The Geomag site argues that Geomag is better than Supermag:

Supermag magnets are ~25% weaker

Supermag magnets are a single bar instead of Geomag, which has two bars (!)

They also describe why they think two different lengths is a dumb idea. The example they give is essentially suppose you want to build something with only one length... you have to buy all these extra magnets that you don't use. True, but with the new Geomag you end up having to buy these "panels" (at least it appeared that the panels were included in sets with rods). I do like having a single length but I can also see some advantages of having two lengths. Their site navigation is a little confusing, but eventually you'll find a gem: Geomag: Come & Play. This part of the site has beautiful diagrams showing how Geomag works, how you should build things, and so on. In particular, they show the two-magnet interior of a Geomag rod. From what I read on their site, Supermag contains a single magnet in each rod. However, it's not clear to me what the difference is in practice. Geomag claims between the magnets is a steel rod. Doesn't this essentially turn it into a single magnet? In any case, the Geomag site is convincing. It matches my own experience with Geomag vs. Supermag: Geomag is generally better than Supermag but Supermag is still decent.

February 15's Alias had a reference to the Church of Mammals as a place where you can become a minister online. I'm going to file this next to the "get a Ph.D. in 27 days" ad I found. You can do anything on the Internet!

Comcast announced today that they want to buy Disney. I think this is foolish.

What does Comcast get out of this deal? What does Disney get out of this deal? What do consumers get out of this deal?

Comcast thinks that by having access to content, they can deliver Disney contant (movies, sports, etc.) through their delivery system (cable TV, internet). My question is, are they thinking that only they will deliver Disney content? Let's say they decide to restrict Disney content to only Comcast customers. Viewers are not going to subscribe to multiple cable TV or multiple internet services to get Disney channels. Most consumers thus lose access to Disney content. This is bad. Disney loses access to consumers. Advertising revenues go way down. This is bad. So I don't think Comcast can really pull off restricting Disney content to their own network. Comcast may get a few additional customers, but Disney loses a lot more than Comcast gains.

So if Comcast can't practically restrict Disney to their own network, what can they do with it? What is the advantage of having Disney content, if it still has to be distributed to their competitors? Well, maybe it can be used in negotiations with others (Time-Warner Cable, DirectTV) who also own content. Or maybe they're going to use the resources of one company (like cash) to benefit the other. But I think the real reason this merger came up is the reward structure in public companies. CEOs can claim "success" when they do something. One thing to put on your resume is "led $66 billlion merger". It looks good, even if the merger didn't make sense. We're bored. We have lots of money. Let's buy someone.

I think delivery networks that own content are in a worse position to negotiate the delivery of more content. As a delivery network, they're a partner of a content provider. As a delivery network that owns content, they're a competitor.