Pat Gunn (dachte) wrote,
Pat Gunn
dachte

Windows Wide Open

I found another bug in the markup code for POUND. It's not worth figuring out its exact nature and fixing it though, because that entire module is ugly and can be done a lot better. I'll probably rewrite it this weekend. There are a lot of ways to write parsers, programming-wise -- there's the Right Way, which is bulletproof, but stops you from doing some tricks and is hard to understand until you warp your mind into the right place to understand the parse tree. I don't like writing formal grammars, so I generally try to avoid that, and do one of the Hackish Ways, using a number of regular expressions to progressively mutate the source stream into the target document, perhaps storing some state along the way. Sometimes it's slower, sometimes it's faster, than using a grammar. Regular expressions are too hard to use casually in C, so if I were back in the stone ages, I'd probably write a grammar (or, shudder, use the primitive string operators to do it).

As a snippet of random wisdom I just dispensed to a friend on AIM, it's a very bad idea to read/write text files from a CGI/ASP/Servlet/etc, for many reasons. It's easy to have multiple instances of your code overwrite each others data, and even if you make it session independent, if the user opens multiple tabs, they will be hosed. It's bad for performance as well. Using a database is a much better idea -- you get transactions, atomicity, and retrieve exactly and only what you need. Of course, performance can still suck, but if the text file is of any size, usually less than parsing text.

One thing I've been disappointed to find is that with a number of disks I've been buying recently for work, if I do a looong, read-write-test format on them (takes about 24 hours), almost all of them show some bad sectors somewhere on the disk. A lot of companies that make laptops say that they won't replace a LCD that has a few dead pixels -- the error rate is too high, and so only if you have a line or a region that's bad will they replace it under warranty terms. Are modern hard drives the same way? Suckage! It's especially bad seeing that most people, as far as I can tell, don't do these very long hardware tests before putting equipment into use.

Last night, the Zets watched Ice Pirates, a really really bad movie. The film was like a MST3k version of Star Wars (itself a pretty poor series, but nothing like Ice Pirates). In a world where there are guns, lasers, and the like, apparently they thought that having a number of people having swords and wearing chain mail would make sense. There are also clumsy robots that use kung foo, giant space herpes straight out of Alien, knights, and castrated, lobotomized servants that wear silver spandex suits. In a way, it's like a number of films from the 80s collided to make this one that fits together less well than the worst of the buildings on CMU campus. We actually only made it halfway through before three people fell asleep, two of them having just gotten engaged to each other. Mazel Tov to them!

Justin heads back home tonight -- I'm hoping I get a chance to take him to India Garden before he goes. So far, Debb, who I'm on speaking terms again with, has not shown up to do any visiting. Hopefully that'll still happen. Frustratingly, I haven't heard anything on Qatar yet -- I'm actually rather keen to go after having chewed on it.

Regardless of whether Qatar happens, I am beginning to think that having someplace to live outside the United States, just in case, would be a good idea. The United States has been an active source of damage to the world for awhile, exporting bad laws, dumb ideas (abstinence-only sex-ed), and bad companies. The current waves are also making us eat our own dogfood, and I don't like the taste of that very much. A lot of people are upset with BushJr, even conservative folk, for the speed at which he is moving things, but I think they're fine with the direction things are going. I would hope that eventually we would begin to approach the Netherlands in our level of cultural development, but we are perhaps going the other way. If, right now, I were given citizenship in some western/central European country and a nice (ideally university) job over there, I would probably go. I'd be happy to (re)learn German or learn Dutch or French or one of the other languages.

Tags: tech
Subscribe

  • Still alive

    Been feeling a bit nostalgic. Not about to return to LiveJournal - their new ownership is unfortunate, but I wanted to briefly note what's been up…

  • Unplugging LJ

    It's about time I pulled the plug on the LJ version of my blog: 1) I'm much more active on G+ than I am with general blogging. I post many times a…

  • Mutual Trust

    I don't know which should be considered more remarkable: That a cat should trust a member of a far larger and stronger species that it can't…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments