Tag Archives: Tech

Regex to the Rescue

Just had to update a site of more than three hundred static pages. I’ve done it once before using FTP and some simple find/replace dialogs, and it took me hours and hours. This change was significantly more complex than the last global one I had to make, but instead of even attempting it the old way, I decided to write a smart Perl script to apply the changes to all the files. The whole thing took about 20 minutes, saving me mind-numbing hours of work and the client hundreds of dollars. It’s the first time I’ve used Perl for much beyond the simplest things, and I must say it’s pretty handy. Pretty darn handy indeed.

Now With Resin

I spent a good part of tonight getting Resin running and tweaked for Andrew, who’s currently working for Comics.com, I believe on the Daily Dilbert. How cool is that? Anyway he’s finally moving Jazz Houston away from his current host over to me. The java stuff is groovy, now it’s just a matter of moving the database.

Now that Resin is installed, I must say that I couldn’t be happier with the current tech on the server. Apache 1.3.17 sits happily and never complains, PHP Accelerator helps PHP even ridiculously faster than it already is, MySQL 4.04 is really amazing despite the questionable version number and the silly name they picked for the dolphin, mod_gzip saves me bandwidth (used 123 GB last month), and now accessing my mail through IMAP, I couldn’t be happier. Life is good. If you made it this far, you’ll probably be interested to know that HPUG is tomorrow at 1 PM. We’re going to have a bluetooth extravaganza!

Curly Function for PHP added

It’s called PHPCurlMe, so check it out. (I know, that’s an incredibly compelling reason, but it’s late.) No any installation instructions for b2 yet because, as previously stated, it’s late and I’d like to tweak it some more. But I realized that if I continue obsessing about it being absolutely perfect right now I’m never going to get it out there. So think of this as a submission for peer review, a first draft. Right now the function is a little conservative for my tastes.

Houston Wireless Meeting Tonight

Several people have expressed interest in attending this meeting, so here’s the message from Jeremy (whose URL I love). You can sign up for the HWUG list here.

—–BEGIN PGP SIGNED MESSAGE—–
Hash: SHA1

A reminder to all, the monthly HoustonWireless meeting is tonight at 7:30pm at Kaveh Kanes. This will be a mixed-bag technology roundup and Q&A. Several of us will present some material about different aspects of wireless. This is a good chance to get an overview of what’s out there, maybe a bit of what’s coming, and maybe get some questions answered.

The lineup so far as I know includes Erewhon talking about antennas and probably other stuff, myself talking about what all the 802.11 protocol alphabet soup means (e.g. a,b,g,i,…) and a bit about security, Matt (one of them :)) will talk about warchalking and wardriving, I think Glass is going to talk about meshes, and who knows what else.

Also, I’d encourage people to bring gear for “show and tell”, we’ll do a “gear roundup,” especially APs (e.g. if you’ve got a WAP-11 you can bring, or an RG1000, or a home-grown mutant, or …). I’ll demonstrate HostAP on my laptop, too, given sufficient time.

Regards,
Jeremey.

MTCurly Update

I’ve updated the Curly Quotes for Movable Type script in response to two points made by John Gruber. It was interesting to be referred to by last name only, so I felt the need to respond as soon as I read the criticisms. The issues identified, namely the inability to quote single letters like “a” and a small whitespace bug which affected a valid but rarely seen method of writing tags, were trivial to fix. I am still a firm believer in a faster pure regular expression solution to this particular problem; with a good enough regular expression you can parse anything :). Thanks to John for pointing these out.

This Explains It

How and Why the Internet Broke—while it scares me that so much of the internet could be affected by one company, particularly one controlled by WorldCom, it’s good to know why I couldn’t get to my own site through SWBell the other day. While this is obviously a huge blunder on their part, overall I still like UUNet. Last summer I got a personal tour of their network operations center and I was very impressed with the people working there and the infrastructure they had. It was also humorous how obviously some parts of the NOC were for show, such as the windows that turned opaque with the flip of a switch and the extremely large big screen televisions overlooking the main room which “are more for you [visitor] then them [workers].” The one they did say they watched closely was the one on the Weather Channel, because apparently weather can have a large effect on their operations.

MySQL 4.04

MySQL AB never announces these things properly, so for those who are interested there is a new version of MySQL out, namely 4.04. Ironically, 404 errors is what I got when I tried to download it, as from their dozens of mirrors I could only find one, so I’m assuming this is hot off the presses. From the tests I’ve run so far there seems to be a very marginal speed increase over 4.02, but it doesn’t seem to have any of the terrible bugs that 4.03 had. 4.03 really should have never been released to the public. I found all the files I needed here.

Southwestern Bell Trouble

For some reason my SWBell DSL can’t get to any of the sites on my server, or actually on my whole subnet. I can ping it from other sites though, and I’ve tunneled my connection through UH to bring you this wonderful update. Oh well, for all its faults, SWBell usually fixes things like this within an hour or two. But to those of you weren’t able to access the site due to your service provider, I sincerely apologize, and if you send me their name I’ll write them a letter. By the by, this box has now been up for over one hundred and thirty-seven days.

Chic Geek Jacket

I’m normally not the most up-to-date on the latest fashions, but after reading this review and visiting the product’s well-designed website, I’d like one for the two months when it’s going to be cold in Houston :). Version 2.5 (you gotta love clothes that have version numbers!) looks very stylish and like something I would actually wear.

So, if I start buying clothes to match my geeky ways, does that make me a closet geek?

Em and En Dashes in Movable Typo

Several users of the MTCurly plugin have written in or commented about the module catching em dashes written in as two hyphens. In the PHP function I have parsing the text on this site, I actually have this rule running. Well, it’s a pretty trivial task to do this, but when I was thinking about it the issue of en dashes bothered me and I decided to reread one of my favorite ALA articles, A List Apart: The Trouble With EM ‘n EN.

While the majority of people will just want to use the em dash, I think the possibility of having en dashes generated automatically as well would be very convenient and encourage more widespread adoption of them. But how do you notate an en dash using only the characters on the keyboard? I thought about this and came to the conclusion that there should be two optional addons to the code, one for changing two hyphens into an em dash, and one that changes two hyphens into an en dash and three into an em dash. Get the updated code. I’m curious to hear some thoughts on this.

For those who aren’t familiar with the proper usage of em and en dashes, here’s a quote from the ALA article, which I think is the best summary of the matter on the net, by Peter K. Sheerin.

The em dash (—) is used to indicate a sudden break in thought (“I was thinking about writing a—what time did you say the movie started?”), a parenthetical statement that deserves more attention than parentheses indicate, or instead of a colon or semicolon to link clauses. It is also used to indicate an open range, such as from a given date with no end yet (as in “Peter Sheerin [1969—] authored this document.”), or vague dates (as a stand-in for the last two digits of a four-digit year).

Two adjacent em dashes (a 2-em dash) are used to indicate missing letters in a word (“I just don’t f——ing care about 3.0 browsers”).

Three adjacent em dashes (a 3-em dash) are used to substitute for the author’s name when a repeated series of works are presented in a bibliography, as well as to indicate an entire missing word in the text.

The en dash (–) is used to indicate a range of just about anything with numbers, including dates, numbers, game scores, and pages in any sort of document.

It is also used instead of the word “to” or a hyphen to indicate a connection between things, including geographic references (like the Mason–Dixon Line) and routes (such as the New York–Boston commuter train).

It is used to hyphenate compounds of compounds, where at least one pair is already hyphenated (as in “Netscape 6.1 is an Open-Source–based browser.”). The Chicago Manual of style also states that it should be used “Where one of the components of a compound adjective contains more than one word,” instead of a hyphen (as in “Netscape 6.1 is an Open Source–based browser”). Both of these rules are for clarity in indicating exactly what is being modified by the compound.

Other sources also specify the use of an en dash when referring to joint authors, as in the “Bose–Einstein” paper. Some also prefer it to a hyphen when text is set in all capital letters.

While quoting the above article, I noticed what may be an error in the source where it looks like in the paragraph about en dashes em dashes are actually used. I’ve corrected it in the quote above. Typos happen, I’ll drop Zeldman an email. (Time to break out the spel chequer.)

I’m also considering adding a few other things to the next version of the plugin, so if you have anything you’d like to see in there let me know.

Database Backend for Gallery

Gallery, in my opinion, is the best photo management software out there for web right now; it really does everything you could want such a package to do. However, it’s relatively old, as far as web projects go, and development decisions made long ago are starting to really limit it. With version two of Gallery Bharat, the main developer, is fixing everything he wishes he had done right the first time. I’ve been following the new code on the CVS pretty closely and from what I’ve seen so far it’s really quite nice.

Bharat (page has sound) is doing things right the second time around, but the project isn’t moving terribly fast. One of the biggest hassles in trying to deal with Gallery as it stands now is interfacing with the serialized data files. It’s almost impossible to hack unless you get really knee deep in the code. Also, due to the flat-file nature of the data files, things get slower the bigger they get. I had to disable the random picture on the menu just because it was adding about a second or more to the time taken to generate every page! With the data accessible through SQL, I could write a random photo block in five lines of code that takes almost no time to run, not to mention all the other fun things you could do with the data in a proper relational database. Check out the Zeitgeist for an example of some fun things you can do with SQL and PHP when you’re bored.

Anyway, it looks like a temporary solution may be available soon. I’ve contacted the developer and I’m looking into implementing this her as soon as possible. Cross your fingers :).

Curly Quotes in Movable Type

I am happy to announce that the “curlyquotes” module for Movable Type has passed out of beta into the release stage. Many thanks to Todd of Dominey Design for testing and providing valuable feedback. Here are the updated instructions. For full details, please see this script’s info page, which lets you receive updates by email, leave comments, report bugs, ask for features, and ask questions, et cetera. Here are the updated installation directions:

  1. Install the MTRegex plugin. (Directions from readme.txt file)
    1. Get file.
    2. Place the ‘regex.pl’ file in your Movable Type “plugins” directory
    3. Place ‘regex.pm’ and ‘postproc.pm’ in a ‘bradchoate’ subdirectory underneath your Movable Type “extlib” directory.
    4. You should end up with something like this:
      • (mt home)/plugins/regex.pl
      • (mt home)/extlib/bradchoate/regex.pm
      • (mt home)/extlib/bradchoate/postproc.pm
  2. Create a new template module called curlyquotes with the code from here.
  3. Add <$MTInclude module="curlyquotes"$> to the top of all your templates.
  4. Replace all occurences of <$MTEntryBody$> with <$MTEntryBody
    regex="1"$>
    .

Usage is free, in every sense of the word, but if you could throw a link back this way I would appreciate it. Also if you improve on the code in some way, submit your changes so everyone can benefit.

What this module does: It takes straight quotes/prime mark, and makes them proper typographer’s quotes, sometimes called “curly” or “smart” quotes. So basically it takes "this" and makes it “this” using the proper HTML entities. It also works with single quotes, apostrophes, and multi-paragraph double quotes. It slices and dices!

Why? Because there is no button for a curly quote or apostrophe on the keyboard. No really, see the old post for more.

Google News

Google News has ‘officially’ launched, insofar that it is now a tab on the now-crowded Google toolbar (not toolbar, I guess tab-bar). Although it’s still labeled as beta, those of you who remember what it used to look like know that it’s come quite a way. It seems to have some sort of algorithm running, so check it out. If you’re interested in seeing what else is cooking at Google, check out Google Labs, which currently has such goodies as a keyboard navigable interface, a glossary, something fancy with sets, and an interface that will return results based on your voice commands.

Search

I’m in the process of compiling ht://Dig 3.2.0b4 to add full-featured search to this site. If you don’t have experience with it already, I would highly recommend checking out ht://Dig next time you consider making a search feature. I considered using a FULLTEXT MySQL search but that would ignore one of the largest sections of the site, the Photolog, which is not MySQL-driven (yet).