Archive for September, 2002

30 Septembris 2002

Dodging babies

Well, so today was set for the Dread Baby Visit, so I had David call me at work with a spurious emergency (and had to keep from cracking up at what he invented).

But of course once I beg off, so does someone else, so I may have to go through this whole rigmarole again if I can’t convince people to call off the whole collective-visit idea (which is my next tactic).

Grrrr. Wish there was a man in the office, honestly I do.

Delay

This is just to let Tish know I haven’t forgotten about her. I really do want to wait to help her install Movable Type until the next version comes out.

In the meantime, I have been pondering her page design. As much as I like absolute positioning, I think I’m going to do this one with floats. What I hope to accomplish is letting her blog text flow down the side of the picture, and then open out a bit, shortening the width of the sidebar. I can’t see how to do that except by floating both picture and sidebar.

If anybody else can think of a better way, drop me a line or ping this post.

Off the market

Well, if you needed the world’s best Visual Basic for Word programmer, you missed him; he just got hired elsewhere, much to my delight.

He is leaving a job at the same place I worked at two jobs ago. They are so wonderfully dead in the water without him—wonderfully because they thoroughly deserve to lose him.

I wish him everything good in his new job.

27 Septembris 2002

Ping!

Okay, so now I learn that The Peanut Gallery told me how to solve my moving difficulties via .htaccess a month ago, and I didn’t know about it because I didn’t check my referrer logs.

Right. That does it. I’m enabling TrackBack pings. Hope I don’t regret it. Need to tweak my templates to make them visible; should do that shortly.

Humanities geeks

I made our Visual Basic for Access programmer very happy yesterday.

A few weeks ago, I had occasion to crawl through the code behind our census data-entry database. During that crawl, I learned how the screen navigation is coded. It wasn’t relevant to my task at the time, just a “oh, hm, that’s how that works, interesting, Visual Basic rots” thing.

Day before yesterday, I tested the code-rewrite on the database that purports to handle the 1920 census. Now, as bureaucrats will, they rewrote the census form in 1920, moving columns hither and yon, so the screen-navigation code based on the 1910 census didn’t work for 1920 at all.

Yesterday my boss asked me to write up how the navigation ought to work. Because I knew how it was coded, I was able to produce a nice clear set of needed actions for each field. The database guy was so thrilled he sent my boss no less than three “gosh, this is really cool, thanks!” messages, which my boss duly forwarded to me.

Nice to make somebody happy. Goes to show, too, that it’s worthwhile to teach humanities geeks some programming, rather than leaving it the exclusive preserve of the IT priesthood. Sure, I’ll never write huge enterprise-level apps, but even with my limited knowledge I can make the lives of those who do write huge enterprise-level apps considerably easier.

HLink smackdown

The Technical Architecture Group on the W3C just handed the HLink spec a massive smackdown. (See xmlhack for details. Also see yesterday’s XML-Deviant column for a run-down on the controversy.) Use XLink, like it or lump it, said TAG.

I am not terribly sure this was wise. No, I have no beef with XLink, and since XHTML 2 is breaking backward-compatibility anyway I don’t see much heft in the “we don’t wanna add a namespace prefix to href” argument.

Still. I think the TAG would have been smarter to toss HLink at the XLink working group and say “Hey, we want something like this; it’s cool. Figure out how to incorporate it into the XLink spec, and make sure it is expressive enough to handle everything XLink does.”

If the XLink working group is smart, and if it can see past the animosity with the HTML working group, it won’t wait for TAG to tell it to do this.

26 Septembris 2002

You know you are a Python blogger when

…you start out a script (after the #! line, of course) with import sys, os, re, blog and type three more lines before you realize you meant glob.

Some Puerto Rican name tidbits

A few things I saw in my catalogue of census names:

  • You couldn’t throw a stone in Puerto Rico in 1910 without hitting a María, Juana, Juan, or José. These four names are staggeringly common; no other name comes close.
  • Classical names are surprisingly well-represented, especially among men. Examples: Agripino/a, Alcides, Demetrio/a, Dionisio/a, Eleuterio/a, Hipólito/a, Nicanor(a), Themistocles, Ulises, Valeriano. Some, but not all, of these are explicable as saints’ or popes’ names. A few of the yucky quasi-classical pastorale names around, too.
  • Visigothic first names are very rare, but a few names persist: Edelmiro/a, Eduviges (I assume this is Visigothic, anyway; this name is both male and female), Teodomiro, Wenceslado/a (in many, many spellings).
  • A curious but eminently logical back-formation: Margara from Margarita (even a couple of Margaros). I also saw Ursulo as a male name; I don’t think that’s common.
  • Liquids were (still are, I believe) practically indistinguishable in Puerto Rican Spanish, especially as syllable codas. Commonest one-letter-off catch I found.
  • Several religious names are used for men and women alike without regard to grammatical gender. Encarnación and Evangelista are as likely to be men as women.
  • A bit of nationalism: 64 cases of América, 33 of Américo, 22 of Patria.
  • Commonest suffixes are -ino/a, iano/a.

I’m going to have to do some digging to figure out where some of these names come from. Anybody got any leads on Nepomuceno?

.htaccess">Adventures in .htaccess

I have been completing CavLec’s move from textartisan with discoveries about .htaccess files. I thought I would share what I’ve learned. (Yes, I know I should have known all this for years. So I’m slow.)

Here’s the deal. First, your Mighty Sysadmin needs to be using Apache to run your website. Most do; assume as much until told otherwise. Second, your MS has to allow you to use .htaccess files. Some may not. If you don’t feel comfortable asking, just make an .htaccess file, upload it, and see if it works.

An .htaccess file is a plain text file. If you edit the code on your web page by hand, you can almost certainly use the same program to edit .htaccess. Don’t do it in a WYSIWYG web-page tool, and for heaven’s sake don’t do it in Microsoft Word!

You probably want one .htaccess file (simpler), and you probably want to put it at the top level of your website; you can affect the whole site or any part of it from there. You are, however, permitted an .htaccess file in each of your directories, so if that makes your life easier, do it.

The .htaccess file contains instructions to the web server, many of the same instructions that your Mighty Sysadmin can issue. (You can’t do everything your MS can, but you can do quite a bit.) When asked for a page in a directory with an .htaccess file (or a subdirectory of a directory with an .htaccess file), the web server checks the .htaccess file and executes any instructions that affect the page asked for.

What kind of instructions can you issue? Well, you can password-protect a page or a directory (though this is slightly more complicated), you can create custom error pages, you can map troublesome filename extensions to each other to avoid 404s—and, when you move stuff around, you can have the server redirect the old page to the new page. This is what I got into.

Here’s how it works:

Redirect permanent /path/to/old/file http://URL/of/new/file

Redirect is the command. permanent says that this is a permanent move, so don’t expect the page to reappear here. (You can substitute temp for a temporary move, or seeother for a different page that serves the same purpose. If the page is just plain gone forever, put gone and do not put the URL of the new file—though for my money you might as well let it 404.)

The path to the old file must start from the topmost directory of your website. So if I were to redirect the CavLec page (http://yarinareth.net/caveatlector/index.html), I would put /caveatlector/index.html. The URL to the new file must be the complete URL as you would type it in a web browser.

Pretty slick. Works like a dream, too; try this link to CavLec on textartisan and see where you end up. (By the way, permalinks to the CavLec archive on textartisan are currently 404ing; I hope to fix that shortly, but because of fragment identifiers and changing my main archive type it’s a mite more complicated. Regexes ho!)

There’s a good .htaccess tutorial on OpenSourcePan, and another one on JavaScriptKit.

The only really hard thing about this is grammar. Is it a .htaccess file, or an .htaccess file?

Finding anchors

Take a look at what digiboy did. He’s built a first hack at the browser stunt I asked for yesterday: exposing anchors in a web page. Nifty.

The only problem is that it’s impossible to tell where each anchor is on the page. I’m not sure how solvable this is client-side, though. My ideal browser has a menu command “Show anchors” and then highlights (or pops a character or image into—something like that) each spot where there’s an anchor. Right-click the highlight, copy link to clipboard, just as I can do with blog-generated permalinks. Sigh. Wouldn’t that be cool?

Found digiboy via my referrer logs. Maybe I should crawl through those more often than I do.

Update: Check this out, courtesy of Kryogenix. It is a wondrous cool bit of Javascript that does everything I asked for. Sa-weet. I have to teach myself Javascript, like, right away.

I also had the View-Page Info command in Mozilla pointed out to me. The Links tab will show you the links (including anchors) on any given page. Unfortunately, it doesn’t give much of a clue where the anchors actually are on the page, so I prefer the Kryogenix solution. Which is, as I think I said, wondrous cool.

Update update: See also this CSS-based technique for showing URLs, courtesy of Colin Z. Robinson. Very clever. Gee, ask a silly question, get a lot of very intelligent answers.