Category Archives: Tech

Strange But Universal(?) Editor Feature

Note: This entry has been restored from old archives.

I was wondering why some of my results were going wrong when doing some pattern matching in Perl. I have a file that gets generated by a script and has one big RE on a line that is read into another script and executed. For some reason the RE doesn’t match what it should… just then I accidentally discovered that it does match and then doesn’t match if I have had the file open in vim, so even though all I am doing is opening the file and then immediately doing a :wq (should just be a :q then I wouldn’t have had this problem, but I do also need to tweak the RE a bit at times) the file content is modified!

What is weird is I then tried the same thing in nvi and then in pico and they do the same thing! At this point I’m checking the difference using md5sum. Each editor spits out the same slightly modified file?!?!

What’s the difference? The file ends up one byte longer… all three editors add a ‘n’ to the end of the file without being asked to.

At first I thought it was something to do with line length (my RE is over 400,000 chars long) but the editors do this for files with a single line only three chars long too… so why do they do this? If three out of three editors tested do the same thing it indicates that it might not be a random decision. As far as I know the editors have completely different codebases, so it isn’t just a shared bit of buggy (unless something in a shared library is doing it). I have a suspicion that there is a reason for this and I wonder what it is!

For now I’ll just add the chomp to my Perl script (it should have been there in the first place) and seek enlightenment later.

Accellerated Perl

Note: This entry has been restored from old archives.

Hardware accelleration from perl! Argh, don’t tell the sales guys. Played with SWIG today, which I have done before in darker days, it easier to get working than I recall. Though I haven’t found a good reference for hooking it into an automake system, most people seem to use it with Makefile.PL stuff and the two automake examples I found were both autotools shells around Makefile.PL build setups. It is a simple enough process, so I guess I’ll do this one from scratch.

Today at lunchtime I wandered into town to buy an umbrella, I decided I was probably going to need one and better get one soon. Halfway there I got well and truely rained on, no shelter in sight. Just one of those funny things… I do have an umbrella now though.

I also tried to get some photos of my little Aphrodite printed, out of three photo places only one could deal with USB… but there USB port was broken today. Broken? How do you break a USB port exactly? Anyway, no photos for me today. Next time I’ll go armed with a CD and also a SD card, damn hippies.