Writing systems #

SIL International has many interesting articles about writing systems. Here are a few:

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.”

Weekend reading #

Python recipes for madness #

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.

Why I don't use IDEs #

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.

Labels:

Atom vs. RSS #

Tim Bray’s post about Atom makes me feel a lot better about Atom. He says Atom is to RSS what XML is to SGML. I haven’t looked at the specs to know whether it’s true, but I’d like it to be true.

The cost of safety #

Thank you, Transport Blog, for posting about airline safety, government regulations, and the overall danger of life.

Weekend reading, and thoughts #

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 c d 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.

The FedEx logo #

I’ve before never noticed the hidden arrow in the FedEx logo. Now that I’ve seen it, I’ll never forget it.

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.

Weekend reading #

Education: what subjects should we teach? #

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:

  • Personal Finance: Balancing your checkbook, keeping out of debt, the value of saving (compound interest!), the cost of borrowing (compound interest!), risk/reward, ways to keep and save your money (checking accounts, savings accounts, brokerage accounts, CDs, money market, stocks, bonds, mutual funds, etc.), ways to pay for things (cash, checks, check cards, debit cards, smart cards, credit cards, paypal), what insurance buys you (reduced risk), and so on. Marginal Revolutions has a post about educating people on these topics.
  • Advertising: The power of brands, strategies and tactics used in marketing (celebrity endorsements, infomercials, glamour/macho, misdirection, etc.), analysis of commercials (have the kids watch TV and then discuss the commercials), sales & bargains, price discrimination (name brands vs. generics, for example), fashion, seasonal pricing, sneaky deals (“sign this check for $3.00 and you agree to subscribe to our service ”), bundling, cross-product promotion (American Express promotes MCI, MCI promotes Continental, Continental promotes American Express), sales tactics/psychology, ways to compare products (UL, Consumer Reports, epinions, newsgroups), etc.

I think these two subjects would help people much more than most of the traditional subjects taught in school.

Differential pricing for medicine #

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.

—from Leveling costs worldwide is not cure for drug prices (DemocratAndChronicle.com)

Firefox customization: link customization #

Firefox 1.0 was released today.

One of the fun things you can do is alter the way Firefox (or Mozilla or Galeon) displays web pages by using custom CSS. Today I changed userContent.css to add these rules:

:link:before {
  content: "\0025c7";
  color: blue;
}

:visited:before {
  content: "\0025c6";
  color: purple;
}

*[href*="=http"]:before {
  content: "\0021b7";
  color: red;
}

*[href^="mailto:"]:before {
  content: "\002709";
  color: red;
}

*[href^="javascript:"]:before {
  content: "\002707";
  color: red;
}

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).

Weekend reading #