|Ned Batchelder : Blog | Code | Text | Site|
» Home : Blog
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.
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...
Two fun sites having to do circular geometry:
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?
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:
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.
We've carved our Halloween pumpkins:
From the left:
I'm sure there are better ways to photograph these. I have a Fuji point and shoot, but it can be set to manual mode. I just don't know what all that stuff means.
A year ago, we carved SpongeBob and punctuation.
Kottke posts Guidelines for focusing on learning:
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.
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.
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).
Turns out the Japanese have a different set of emoticons (smileys) than English speakers do. Theirs are right-side up rather than laying on their sides like ours. Smiling: (^ ^) Blushing while smiling: (*^_^*) Take a look at the whole set.
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.
I believe firmly in evolution, but I respect people who believe otherwise, and I encourage everyone to think for themselves and examine all the possibilities. But I thought we as a society were perhaps beyond encouraging "science" projects like Women Were Designed For Homemaking.
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,
I had to admit that it kind of was.
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:
Still and all, a remarkable feature, in an overwhelming brute force kind of way.
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:
I just added a preview button to my comment system (try it out!), and along the way was reminded about what is good and bad about PHP. It isn't two different things, it's one thing: magic.
Every time I read something Bruce Schneier writes about security, I agree with him: Terror Profiles By Computers Are Ineffective.
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 (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.
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.
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.
My wife has a piece in today's Boston Sunday Globe Magazine about our autistic son's bar mitzvah: The Rite Stuff.
Back in June, the event inspired me to write A good thing about autism.
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.
Eric Lippert engages in a paranoid fantasy: The Malware of Ultimate Destruction. I think he makes a good point here: our digital machines are vulnerable, and much worse stuff than Blaster can happen. But along the way he seems to believe the Microsoft marketing materials, at the same time that he proves their illogic.
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):
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.
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
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:
When logic fails you, you can always rely on the Wooly-Thinker's Guide to Rhetoric.
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.
According to Richard Gabriel, Objects Have Failed. I haven't read this yet, because I don't have time right now, but I intend to, so I'm putting it here.
(Updated from the comments) The ever-authoritative Bob points out that this is one side of a debate from OOPSLA 2002. Guy Steele's remarks from the other side of the debate are that Objects have not failed. Thanks, Bob.
Jim Gasperini takes stereo photographs, and has a novel way of presenting them as animated GIFs: Time for Space Wiggle. The effect works better on smaller images. The thumbnails look good, then you click through to the full-size pictures, and it seems kind of goofy.
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.
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.
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'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:
(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.
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:
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:
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:
Read the whole story.
Mike McGlynn sends along news of two free and ad-free hosting providers: NetDojo and f2o.org. Both provide very full-featured hosting environments (Python, PHP, MySQL, etc), with no charge and no ads. How do they do it?
Adobe has released version 6 of Acrobat Reader. When you launch it, you will notice a few things:
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 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.
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.
Michael Duell has come up with 23 Resign Patterns, including five Cremational patterns, seven Destructural patterns, and eleven Misbehavioral patterns:
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?
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".
More paper models. This time, it's spacecraft from science fiction: Star Wars, Star Trek, and so on. It's a Japanese site, so the navigation and instructions require some interpretation, but the models look detailed and accomplished: SF Paper Craft gallery.