« | » Main « | »

youngpup.net

Friday 31 October 2003

Aaron over at youngpup.net has some mad DHTML skills. His site is tricked out with all sorts of interesting dynamic elements (how does he make those panes resizable?). I'd love to understand more about Javascript and DHTML as a way to make sites adaptive. I wouldn't go as far as Aaron has, but he's got lots of interesting nuggets there.

Abuse of XML

Thursday 30 October 2003

Programming with Circles, Triangles and Rectangles is an interesting paper about integrating XML and its data model into programming language, introducing a language called Xen (good name!) as a demonstration.

Unfortunately, the authors have made some very bad XML decisions in making their paper available. If you try to read the paper in Mozilla Firebird, you will get an empty page. Looking at the source shows you why: the paper is served as XML, with a client-side XSLT transform to produce a readable page. Rather than use a standard mechanism to accomplish this, they've written some JavaScript to use Microsoft proprietary objects to perform the transform. OK, so this is one of those occasional times where you have to fire up IE to view a page so carelessly produced that only IE can display it.

Once you do, you get a long pause while the document is transformed, and then you see a page that looks like the state of the art circa 1996. After all that, I would have hoped at least to have some interesting effects, some unusual interaction, some truly beautiful typography. I got none of those things.

Why is there a client-side transform here in the first place? This is a large paper, 66K of XML, and it's totally static. It's the worst possible document to create with a client-side transform. Every reader will perform exactly the same computation to produce exactly the same page. Why not do the transform once, and then publish the HTML? And if you do need a client-side transform, why use a proprietary mechanism? Much simpler techniques (no coding required) are available that work in most modern browsers.

So in my effort to read what these clever guys have to say about using XML well in programming languages, I'm forced to confront the boneheaded XML decisions they made to get their paper on the web. Looking at the XSLT transform, it looks like the result of a publishing tool, but that doesn't let them off the hook. It doesn't bode well for the rest of their ideas...

Updated: Ted Leung points to a vanilla HTML version of the paper.

Fun with circles

Thursday 30 October 2003

Two fun sites having to do circular geometry:

  • Wholemovement is all about folding circles, and a remarkable number of things you can fold with them, too. It suffers from an all too common ailment: finding spirituality in geometry, but is a fun site nevertheless.
  • Make-a-Flake, a Flash toy for making paper snowflakes.

Impossible CSS gripe #2

Wednesday 29 October 2003

Here's another CSS gripe that I don't think we can do anything about. What the heck is wrong with tables as a concept? I understand why we want to separate content from layout. I can see that we don't want to overload the poor <table> tag with both tabular data display and grid layout, because that's poor semantics.

But everyone understands tables. Any designer out there can take any old layout grid, no matter how wild, and tell you how to create a table to display it. So why can't CSS use those concepts for layout? Why did separating the layout from the content requiring using entirely new concepts to describe the layout? All the HTML authors understood how to write tables, and all the browsers understood how to display tables. Why did CSS leave tables behind?

» read more of: Impossible CSS gripe #2... (6 paragraphs)

Impossible CSS gripe #1

Wednesday 29 October 2003

I know there's nothing to be done about this now (that's why this is an impossible gripe), but I really wish the authors of CSS had either:

  1. Written the spec so that it was more understandable from the start, or
  2. Provided a reference implementation, or
  3. Provided an extensive test suite, with results specified.

As it is, we're in a mess today, supporting a growing list of buggy implementations with horrific hacks like the high pass filter, mid pass filter, and so on. Try to understand Mark's text sizing code, and you'll see what I mean.

CSS is good, CSS is clean, the world will be a better place when CSS is done right. Lots of people will blame Microsoft, or Netscape, or some other browser author, for getting it wrong, and shrug it off as "just bugs". But let's face it: none of these browser authors wanted to implement CSS incorrectly (paranoid fantasies about Microsoft notwithstanding). If they had known their browser had it wrong, they would have fixed it before shipping. The bugs are there because people didn't understand the spec, or it was ambiguously written to begin with, or because they didn't have an exhaustive test suite to run in their browser.

Guidelines for focusing on learning

Sunday 26 October 2003

Kottke posts Guidelines for focusing on learning:

  1. Release the need to be right.
  2. Welcome one another's thoughts and opinions.
  3. Suspend judgment.
  4. Listen for understanding, not rebuttal.
  5. Make personal statements by using "I" rather than "you".
  6. Clarify first what was said before you challenge someone.
  7. Take time to reflect.
  8. Lean into discomfort.
  9. Respond first to what was said before making your point.
  10. Have fun.

Normally, I wouldn't just copy the entire list here, but I really like this list. I'd like to think that I do these things, but I'm sure I have a long way to go (and I'm even more sure that my co-workers would agree). It's a great set of guidelines for all of us.

re.split

Sunday 26 October 2003

Simon discovers Python's re.split(). About one particular aspect of it (parenthesized groups are returned in the list), he says, "I'm probably the last person to find out about this", but in fact, I never even knew re.split() existed at all! I think I've wanted this functionality a half-dozen times in the past, and never thought to look in the re module to find it. Python's standard library is incredibly rich, and often solutions are hiding in places waiting for you to discover them.

Women weren't designed for homemaking

Sunday 26 October 2003

As was pointed out in the comments to yesterday's post about the Landover Baptist Creation Science Fair, the whole site is a spoof, as the terms of service state. There are real Creation Science fairs, but they are much more innocuous than the spoof, with the types of projects typical of science fairs (Cycle of Life in Soil, Detecting Vitamin C in Fruits and Vegetables), with a few religious projects thrown in (The Garden of Eden, Why I Don't Believe in Evolution).

MC Hawking

Saturday 25 October 2003

Speaking of creationism, MC Hawking is "your ultimate resource for information about Stephen Hawking the gangsta rapper." I know these songs lower the level of discourse by quite a bit, but they are really funny, and true to their scientific origins. A number of them deal somewhat harshly with those opposed to the theory of evolution.

The sound an eye makes

Friday 24 October 2003

I love kindergarten, because it's when kids start learning to read, which opens up whole new vistas of connections for them. Last night, my kindergartener said,

Dad, isn't C the sound an eye makes?

I had to admit that it kind of was.

Amazon full text search

Thursday 23 October 2003

Now Amazon lets you search the full text of its books. This is astounding, not only because of the further differences it highlights between Amazon and traditional bookstores, but because of the effort it must have taken to accomplish. The text seems to be from scans of pages, subjected to an OCR process. And not just the bulk of popular books, either. They've got all sorts of wild and wooly volumes available this way.

I don't know how truly useful it will be, since full text searching can be extremely noisy, even before the OCR noise is factored in. Searching for "Ned Batchelder" (what else do people test searches first with?) found this:

received a preliminary version of the 2001 decommissfonfng study, which deferm(ned that EE wiff have to fund about $312 million

Still and all, a remarkable feature, in an overwhelming brute force kind of way.

InkTank

Thursday 23 October 2003

InkTank is a great online comic about a gang working at a software company (in particular, a game company). Barry Smith has just recently put the strip on hiatus, but there are three years of daily strips waiting for you to enjoy. If I may suggest a few choice nuggets from the first year:

InkTank characters

Terror profiles by computers are ineffective

Tuesday 21 October 2003

Every time I read something Bruce Schneier writes about security, I agree with him: Terror Profiles By Computers Are Ineffective.

I have an idea. Timothy McVeigh and John Allen Muhammad — one of the accused D.C. snipers — both served in the military. I think we need to put all U.S. ex-servicemen on a special watch list, because they obviously could be terrorists. I think we should flag them for "special screening" when they fly and think twice before allowing them to take scuba-diving lessons.

What do you think of my idea? I hope you're appalled, incensed and angry that I question the honesty and integrity of our military personnel based on the actions of just two people. That's exactly the right reaction. It's no different whether I suspect people based on military service, race, ethnicity, reading choices, scuba-diving ability or whether they're flying one way or round trip. It's profiling. It doesn't catch the few bad guys, and it causes undue hardship on the many good guys who are erroneously and repeatedly singled out. Security is always a trade-off, and in this case of "data mining" the trade-off is a lousy one.

Wooden mirror

Tuesday 21 October 2003

A very cool low-tech (or is it high-tech?) device: a wooden mirror. A video camera captures the image in front of the "mirror", and tilts wooden tiles to cause them to reflect more or less light. The result is a device that produces an image of what is in front of it (that is, it's a mirror), but it is made of wood. Very cool.

Ned Gully: autism and the Red Sox

Tuesday 21 October 2003

Ned Gully (the other blogging Boston-based software engineer named Ned with an autistic son) has written eloquently about the difficulty of dealing with less than ideal circumstances: What Being the Father of an Autistic Son Taught Me About Being a Red Sox Fan (and vice versa). I'm not a real Red Sox fan. I'm one of those Boston people that tunes in once every 15 years for the really big disappointments, but I understand where he's coming from.

Google definitions

Monday 20 October 2003

More Google goodness: definitions of words. Search for define polyhedron and get search results with a single (incredibly technical) definition added at the top. Be more specific and search for define:polyhedron, and you get a page with 17 different definitions, from a wide variety of sources. Oddly, dictionary.com doesn't seem to be one of them, since Google can't define triacontahedral, while dictionary.com can: triacontahedral.

anybirthday.com

Monday 20 October 2003

I've used this reference for years now, but I've never blogged it: anybirthday.com claims to have the birthdays of 135 million people, and they just might, because I've rarely known it to fail. Enter a name and maybe a zip code, and they'll give you the birthday. They want you to pay money to get lots of information, but the birthdays are free.

Fisheye menus

Saturday 18 October 2003

Jon Udell writes about irony in user interfaces: How rich is the rich GUI? He points out that sometimes native GUIs are richer than web interfaces (the common wisdom), but that sometimes the reverse is true. For example, the web has pervasive links and a back button, which native GUIs typically don't.

As an example of innovation in user interfaces, Jon points to a demo of fisheye menus. I'm all for innovation, and thinking outside the box and all, but I don't get this one. True, a traditional list box forces you to scroll, but why is that bad? With the fisheye box, I can see where I am in the list, but I can only read three of the entries at once. It's like using an ordinary list box that's three entries tall. And the standard listbox shows me where I am in the list with the thumb of the scroll bar.

Unicode test strings

Friday 17 October 2003

Joel recently wrote about Unicode: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!), and I have posted pointers about this before. Here's my own tip, which I learned from the internationalization (i18n) guy at Iris.

Create some test data to use when testing your software for Unicode goodness. If you don't speak a language that uses interesting characters, create some text that uses those characters, but looks like it's in English. For example, at work, I used these strings (the first is single-byte, but upper code page, the second is two-byte):

«küßî»

“ЌύБЇ”

Obviously, these don't "say" Kubi in any real way. They just look to English speakers like they do. This solves a problem with testing: if your developers or testers aren't familiar with what the right result is, how will they notice the wrong result? By using these strings (or actually, ones that are more about your own work), it will be clear if the output goes a little bit wrong.

Space cadet keyboard

Friday 17 October 2003

Have you ever tried to explain the Control and Alt keys to a Regular Person? They suddenly seem like the epitome of geekly shortcuts. Well, don't bother showing them the space cadet keyboard. It came with the Symbolics Lisp Machine, and had not just Shift, Control and Alt modifier keys, but also Top, Greek, Meta, Hyper and Super. They took a standard practice and cranked it up way past eleven, creating a geekutopia for entering data into a computer.

Emacs still retains some of this history. It will let you define variants of keystrokes using modifiers like Meta, Hyper, and Super. There's more about the keyboard at the Free On-Line Dictionary of Computing

More on exceptions and status returns

Thursday 16 October 2003

Well, ever since Joel took notice of my article about exceptions and status returns, the weblog joint has really been jumping. Joel asks me to give real examples rather than "DoSomething" for function names. It's kind of a funny request, since his example used functions named "f" and "g", but it makes sense to ground this in reality.

In response, I wrote another article laying out my view of how exceptions fit into real code: Exceptions in the rainforest.

A number of people rose to Joel's challenge before I could:

  • Len Holgate has a good example of how to handle the "failure during installation" scenario.
  • Jesse Ezell tries his hand at it, though I don't think I like his first try: checking the class of the exception seems a particularly awkward defense of exceptions.
  • Steve Tibbett shows some other ways to slice it (though I don't approve of "catch (...)").

Joel on exceptions

Monday 13 October 2003

OK, so usually Joel Spolsky is a pretty bright guy, and even when his ideas seem wacky or overstated, there's something true and useful about them. But he's dead wrong about exceptions. Joel's opinion (that status returns are the only way to go and that exceptions are akin to the dreaded goto) runs so counter to modern thinking that the ensuing discussion is considering the possibility that he was being subtly ironic, or that his site had been hacked.

Of course, I've made my opinion clear on this already. See my article: Exceptions vs. status returns. Update: I've added a section to that article rebutting Joel's points specifically.

Computer science history

Monday 13 October 2003

Karl Kleine has collected a nice array of historic documents in computer science, including the original Fortran manual, dated 47 years ago.

Linked from there is Al Kossow's manual collection, which covers ancient hardware, including the IBM 1620. Believe it or not, my high school had one of these things, with the delivery invoice still in the desk drawer, showing it had been dropped off at the school before I was born. For even more old-time fun, Al also has the The Minicomputer Orphanage on his site, complete with pictures and descriptions. All in all, a big blast from the deep past.

Fall of 5?

Sunday 12 October 2003

Almost six months ago, I declared my intention to learn to juggle 5 balls. I've done pretty well since then, but I wouldn't say I've got it down yet. My best run so far is 25 throws total (or as Sue parentally put it, "they each get five turns"). These days, 2 throws each is expected, and 3 throws each is not unusual. It takes a lot of practice, and I'm still working on it.

In the meantime, take a look at Jason Garfield. He has some remarkable skills (juggling 9 balls!), and a wicked sense of humor.

How should I backup data?

Sunday 12 October 2003

I need to get into a regular habit of backing up data. I have a CD burner, and it came with Roxio software for burning CDs. There doesn't seem to be a straightforward way to tell it, "backup these directories" over and over again. My last computer had Nero and Retrospect software for the burner, but they won't work with the new burner (they were Yamaha OEM, so they will only work with the Yamaha burner).

Does anyone have any recommendations? What's a straightforward way to have my data files regularly burned to CD? I don't mind if it is geeky, I don't even mind if I have to write some code. I just want to know that the data is burned on the CD, and that I'll be able to read it later. Does anyone have some python code to burn stuff to CD?

I don't really get CSS

Saturday 11 October 2003

I've fiddled with the type size on this page. I wanted it smaller, because frankly, I've never liked the shapes of the letters the way it was before. I like larger type generally, but I'm trying this smaller type for a while to see what I think.

But here's the thing: CSS makes me antsy. I understand the concept, and separation of style from content is a wonderful thing. Being able to declaratively make changes throughout a page with simple edits is tremendous. Max and I just had some fun making my links as wacky as possible:

a.wacky:hover {
  text-decoration: underline;
  font-weight: bold; font-size: 200%;
  background-color: black; color: white;
  text-transform: uppercase;
  border: 3px dotted yellow;
  margin: 10px;
  padding: 30px;
}

(try it: hover here).

But when it comes to setting font sizes and line heights in nested elements, I just don't get what's happening. I'm sure some of it is just browser implementation differences, but can someone please give me a simple rule for how to get it right? I've had the same problem when it comes to setting padding or margin or whatever on consecutive boxes. How do you come up with a system that works, without having to test all possible combinations of things? I want it to look good, but I don't want to fall down a CSS rabbit hole.

XSLT behind the scenes

Saturday 11 October 2003

I have the Encyclopedia Britannica Ready Reference pre-installed on my new home computer. I was poking around in its directories, and saw a number of familiar technologies: jython.jar, xalan.jar, and a number of XSL files. I'm not exactly surprised to see these things in pre-installed PC software, but it's still unexpected, and pleasant to discover.

I am surprised to see this template in one of their XSLT files:

<xsl:template name="just_output_the_damn_fool_thing_geez_cmon_man">
  <img>
    <xsl:attribute name="src">
      <xsl:value-of select="@src"/>
    </xsl:attribute>
  </img>
</xsl:template>

This clearly gets the award for Most Emphatically Named XSLT Template. Also, keeping in mind the points from Streamlined XSLT, it could be written thus:

<xsl:template name="just_output_the_damn_fool_thing_geez_cmon_man">
  <img src="{@src}"/>
</xsl:template>

Henry Ford and the RIAA

Friday 10 October 2003

What does Henry Ford have to do with the RIAA and its heavy-handed lawsuits against their customers? Around the turn of the last century, Ford played the part of the music downloaders in his own story of entrenched business trying to protect against technology by suing their customers. The "Selden Patent" was used to prevent Ford from selling cheap cars:

The litigation lasted from 1903 until 1911 and along the way, the association launched hundreds of lawsuits against Ford's customers to scare them away from his showrooms for buying "unlicensed vehicles."

Read the whole story.

Acrobat 6

Thursday 9 October 2003

Adobe has released version 6 of Acrobat Reader. When you launch it, you will notice a few things:

  1. The splash screen has a cool effect: it's a classic rectangular box, but the swirly image on it flows off its edges. Very nice.
  2. There are about 47 zillion patents listed on the box. Do we really need to list all the patents specifically, in the splash screen? Am I (or my lawyer) scribbling these down while the app launches? Let's not get ridiculous.
  3. You have a lot of time to notice all this stuff, because there's a line at the bottom listing all of the plug-ins getting loaded.

I know Adobe has been positioning Acrobat as more than just a document reader, but let's face it: for the vast majority of us, it is just a document reader.

Fortunately, Darrell Norton tells us how to make Acrobat 6 load faster. (Basically, just take away most of its plug-ins). In case you are worried that you actually want some of these plug-ins, he also follows up with descriptions of what the plug-ins do.

William Steig

Wednesday 8 October 2003

William Steig died last week at the age of 95. He was a prolific author and cartoonist. His children's books were remarkable not only for their inventive other worlds, often populated by civilized animals, but for their vocabulary. Steig never talked down to children, and used words that many children wouldn't understand on first reading. Where other picture-book authors would choose simple words to ease the reading, Steig forged ahead, believing (correctly) that kids would get the gist of it, and maybe even learn the word.

For example, Doctor De Soto, his story of a mouse dentist who faces the challenge of treating a fox, uses words like et cetera, dainty, timid-looking, flannel, bitterly, pitiful, bicuspid, morsel, quiver, extractor, gauze, shabby, promptly, particle, chortle, caressed, unique, permeate, dentine, dignity, and outfoxed.

His book Sylvester and the Magic Pebble won the Caldecott Medal in 1970. It's about a donkey who finds a magic pebble, but misuses his wishes. It has a special place in our family, as my wife Sue wrote in an article called The Magic Pebble.

Luckily, Steig lived a long life, and left us plenty of books.

Juggling with packets

Tuesday 7 October 2003

From deep in the network layer comes Michal Zalewski with news of a novel way to greatly extend your storage capacity: Juggling with packets. Like a juggler with more objects than hands, you can in theory send data out into the internet so that it eventually comes back to you, and store data out in orbit. With disk prices where they are, I'm not sure why you'd want to, but it's a cool idea anyway.

Michal is also one of the authors of p0f, which is a mysterious network-level app that can identify remote systems based on passive observation of TCP packets. Poking around on his page reveals many other strange pursuits. Dark arts indeed.

Resign patterns

Saturday 4 October 2003

Michael Duell has come up with 23 Resign Patterns, including five Cremational patterns, seven Destructural patterns, and eleven Misbehavioral patterns:

3.11 Visitor From Hell

The Visitor From Hell Pattern is coincident with the absence of run time bounds checking on arrays. Inevitably, at least one control loop per system will have a Visitor From Hell Pattern that will overwrite critical data.

How exceptions really work

Friday 3 October 2003

Chris Brumme explains how exceptions really work in Windows. This is an amazingly detailed piece that covers everything you could ever want to know:

Have you noticed that the C++ exception you throw is often a stack-allocated local? And that if you explicitly catch it, this catch is also with a stack-allocated object? Did you ever wake up at night in a cold sweat, wondering whether a C++ in-flight exception resides on a piece of stack that's already been popped? Of course not.

In fact, we've now seen enough of SEH to understand how the exception always remains in a section of the stack above ESP (i.e. within the bounds of the stack). Prior to the throw, the exception is stack-allocated within the active frame. During the first pass of SEH, nothing gets popped. When the filters execute, they are pushed deeper on the stack than the throwing frame.

A client crash hunted down

Thursday 2 October 2003

Another tale of guerilla debugging. A Kubi tester had a Notes client crash. Because Kubi Client runs in the same process, we had to suspect our own code. She captured the screen shot of the crash dialog box, which had the instruction address, and the fact that it was trying to access memory at address 0x00000000, but nothing else. She never had it happen before, and couldn't make it happen again. What's a developer to do?

» read more of: A client crash hunted down... (12 paragraphs)

Five best and worst things to say to your kids

Wednesday 1 October 2003

From Parents magazine, suggestions for the Best and Worst Things to Say to Your Kids. These are of course debatable (Sue didn't like best #1 and #2, for example). But keep in mind: good parenting skills come in handy when dealing with lots of other people in your life. Not because others act like children, but because good parenting often comes down to honesty and respect, and that's always a good thing. I've had good success with a variant of #3 ("I want you to help me solve my problem"): "I need your help".

« | » Main « | »