I realized that I never write about work. I'm not sure why. I suppose that it just never occurrs to me that anyone would find it interesting. Work stuff certainly doesn't fit the mandate or purpose of this site, which essentially is to save thoughts I've had at various times so that I can go back and re-read them later. I was even supposed to have a code snippet repository and an online scratchpad (in addition to other things) here as well, but I never got around to doing that. Bottom line: Anyone reading this but me does so for their own reasons. (So if you aren't me and you want smarmy personal weblogs written for an audience, go look at WWDN or The Gus.)
OK, so I have some work stuff to report on. It's not interesting work stuff. You have been warned.
I'm writing an app that sucks data out of a popular groupware calendaring/messaging server and turns it into XML so that an XSLT processor can pick it up and do magical things to it. It ought to be very fancy once done.
I had the app "done" in a couple days. I was making XML just fine. But it wasn't actually done. My app had inconsistencies because the data it parses can vary much more than I previously thought. I had to account for that. My simple data structure of an array of hashes of arrays would no longer suffice. So I went looking for someone that had invented a similar wheel. I came up with nothing.
I discovered why there are so very few XML generators as compared to the large number of XML parsers out there: it's incredibly hard to actually make XML from highly variable or unstructured data. There's typically nothing about the data that tells you what the data means to the last element of data you just read. Or the next 8 elements you're going to read next. Or the stuff you already read and fired off an event for. Unstructured data has no meta data, which is must have for XML to be made. XML implies and demands structure. Everyone wants to write nifty parsers for going through, extracting, or doing whatever to structured data, but nobody wants to write libraries which help people make that data. And I can't blame them.
I was sorely hoping for my app to be super-abstract: give it a set of name/value pairs, nested arbitrarily deep, in any order, and you'd get structured XML based on how the data was named. I thought that was a pretty decent result for a few days coding. As a proof-of-concept, I even used the functions I'd written to create XML representations of directory listings (I've got a big ass XML doc which represents the /usr heirarchy on my Linux workstation for instance). But then the bubble burst: One condition I have to account for is repeating namepsaces at the same "level". Oy! It can't be! It's like having two files with the same name in the same directory! The world is ending!
So I've spent the last two days working my way down the Perl data structure rabbit hole(s). My solution is going to be either brutally simple, or utterly unmaintainable. And I would normally opt for code which is "simple and stupid, but easy to read an it works" over "very slick and buzzword-compliant but nobody can tell what the hell's happening". The wrinkle here is that I'm a temp still, and they are just now hiring for my job. It's a juicy job description, too, one most geeks would jump at. So there's more than a little inkling to impress the professors with a ninja master-quality solution even they can't figure out. Except that won't help anyone; if nobody can maintain it but me, then I'll never get rid of the albatross.
Ahem... so here is what I have so far when making XML. I currently have an array of hashes which can contain arrays of hashes or hashes, each of which can contain arrays, references to hashes, or hashes. Those hashes can contain any of the parent elements I just mentioned. The "top level" arrays of hashes can similarly have hashes of arrays, arrays of hashes, arrays of arrays, hashes of hashes, hashes of rerefences to arrays/hashes, ad infinitum. About the only thing I don't have are plain, bare scalars (aside from all the list context and reference stuff, that is). I also have functions which unwind these data structures. They are what makes XML. I descend through and make attribute, check parent elements, check element level, add new PCDATA, etc.
I think my solution is unworkable, even though it works. Even code which accesses a simple array of hashes can have a lot of punctuation in it. If the keys to a hash are references to something, then you just doubled the number of times your fingers hit the '{' or '}' keys. I'm serious: you can write something, banging away for 45 minutes, switch over to a term window, run it, get slightly off results, go back to your code... and get completely lost. From coding 45 minutes straight to completely lost, in the space of 90 seconds. You'll have foreach loops five deep, each of which look like line noise. You'll run out of descriptive temp variable names. You'll make spaghetti.
I love Perl, I really do, but I don't think I have a head for the brutally complex stuff. I've been getting down on myself lately because I think maybe I'm an idiot for not looking at my problem and saying "Ah ha!, Here's what we need...." Although now I think the problem is actually kinda complex. Any time you take free-form user input you have to account for "variances", but to build well-formed XML on the fly while doing it is very hard. I might not be cut out for the real propeller-head low-level stuff. Or maybe I need to finally break down and take a data structures class of something. Things will be better when my future (at least the immediate one) is secured.
Filthy (my favorite movie critic of all time) reviews Attack of the Clones:
"If I hadn't seen the other four Star Wars movies, I would think Attack of the Clones was 90 minutes of shit and 45 minutes of decent movie. Having seen the others, though, I think this one is 90 minutes of shit and 45 minutes of really good movie."Which pretty nicely sums up what I was thought about it. The rest of the review explains why the movie mostly sucked: Action with jedis and droids good, love story with wooden acting and smarmy dialog bad. Stuff we all knew.
I've been gone a while. My dad went into the hospital and, by all accounts, he nearly died. I'm not going to say anything else about this occurence other than I had a severely unpleasant week, and I've been lax on my side projects. (I know how that must sound, but I say one man's shallow is another man's escapism. Anyone else who mostly unsuccessfully attempts to fill the shoes of an arthritic father with a fatal heart condition whose daily job is to take care of a 25-year-old quadriplegic can cast the first stone when I say I have a growing list of things I want to think about other than what I did last week.)
Anyway, moving on...
My first mind-duller was getting the new fileserver working. See, the machine had nearly-new IBM Deskstars in it: a 20GB for the OS and two 40GB drives setup as a RAID1 pair for our network-shared data (MP3s/images/etc. over Samba and NFS, some web-based stuff). The machine worked great until two of the drives started doing that "click-of-death" thing that you hear about from IBM "Deathstars" lately. Mine had the clicking sound, plus a very faint scratching noise in one of the RAID drives. It got to the point that I couldn't write files to slowly larger number of directories and I'd have to manually fsck (with ext3 partitions, no less) on each reboot. My fileserver needed a lung transplant.
Fry's had this sale on 80GB 7200RPM Western Digital hard drives for $149. I bought two a couple days before I left for PHX. I had a mostly new 15GB Seagate drive from my old fileserver that I used for the OS. I put the two 80GB drives in, threw in the Red Hat 7.3 CD, and went to town. I'd never made a software RAID array from the install before. Oddly, it's easier to do it manually after the install. But after seeing how easy it is to recover from having two disks fail and how simple it is to set up and manage a mirrored RAID array, I'm nearly positive that from now on I'll always pay the extra cash for a duplicate drive. It's really cheap insurance, and I figure 80GB ought to last a couple years.
It's not like the 40GB I used to haev wouldn't have been fine, though. I'd have loved to keep using what I had. I've always had good luck with IBM drives. I guess I figured that since they invented the hard drive, they ought to know what they are doing. But the 60/70GXP Deskstar line is just not fit for normal use. But since IBM has essentially sold their hard disk unit to Hitachi, then the point on what I'll buy in the future is moot.
My second timewaster is getting Transgaming's WineX. I wanted to play a game. I couldn't find the second Medal Of Honor: Allied Assault cd, so I decided to install Jedi Knight 2. And then I remembered that I don't have that CD either. I did remember that I made a copy of it in the form of an ISO image on my newfangled RAID storage area, however, and that I could just burn a new copy. And then it occurred to me that there wouldn't be any point in wasting a CDR since I could just mount the ISO image locally where my CD-ROM normally gets mounted and install from there:
[wee@lazlo src]$ cd /mnt/acosta/cdr-tempAnd that's all there was to it. It runs like a champ.
[wee@lazlo cdr-temp]$ sudo mount -t iso9660 -o loop ./jediknight2.iso /mnt/cdrom
[wee@lazlo cdr-temp]$ winex /mnt/cdrom/Setup.exe
[wee@lazlo cdr-temp]$ sudo umount --force /mnt/cdrom/
[wee@lazlo cdr-temp]$ cd ~/TransGaming_Drive/Program Files/LucasArts/Star\ Wars\ JK\ II\ Jedi\ Outcast
[wee@lazlo Star Wars JK II Jedi Outcast]$ winex JediOutcast.exe
I saw a resume today from a guy who wants to be a VP of something (anything). There was something unobvious about the resume that really annoyed me, yet I couldn't put my finger on just what it was. (The rest of it was hilarious in its own right.) Driving home tomight, it occurred to me what was wrong with the resume. It had the following as part of its objective:
... strive to ... increase corporate profitability, create a unique and rewarding environment for my staff, and enable customer 'delight.' ...What bugged me about that? No, not the word "delight", and no, not that it's in quotes, and no, not that it's right after the word "enable". The sexual innuendo and/or jokes in that phrase are officially Low Flying Fruit, and I cannot go there.
For some reason I can't explain, I find discussions about numbers fascinating. I already knew all that yet I still read the entire thing, and even made some number doodles of the examples on my notepad.
In other news, my right wrist hurts badly and I can't feel either the pinkie or ring fingers on my right hand; they are tingly and numb. If I can't type, I'm going to be in a serious world of hurt, both literally and figuratively. There's a reason I gave up rock climbing and other physical activities involving hands: all my future and present wealth and vitality is predicated on the notion that I will have at least passing dexterity in at least four fingers and one thumb. I've broken every digit I have (that includes toes), and most (all but two, I think) on my hands more than once. My left thumb has been broken three times, for example, once with protruding bone. If I had known how much I'd rely on my hands (as opposed/in addition to my mind) when I was younger, I'd have likely done safer things, or forgone the occasional physical experiment.
Anyway, I decided to write about it. Now that's funny...
Red Hat 7.3 came out yesterday. I pulled down the ISOs last night. Today between bouts of napping, I mounted them via the loopback, made some symlinks under the web root and got ready to install. I hit a minor snag, though: the floppy drive in my main machine has been acting funky for a while (how long? I have no idea since I never use floppies), so used my Windows laptop to make the boot image floppy. RH7.3 comes with a funky Win32-based GUI image writer utility now called rawwritewin.exe. I'd never heard of it before, but I guess it's been out for a while. It's kind of a nifty little app.
Anyway, I installed over the network, picked through the packages carefully (I noticed that things like Namazu are included now, which is cool). Then I noticed that KNewsTicker was listed. And then I remembered that one of the developers emailed me and said he was going to include my stock quote grabber script in the next version of the news ticker applet. So I had to go look for it.
Sure enough, the file at /usr/share/apps/knewsticker/scripts/stock.pl is my script (with his changes, although I'd say about 90% of it is still stuff I typed).
I know it's corny, and just a little perl script, but it was kinda cool to install Red Hat and have "software" I'd written come with it. It made me smile a little bit (and want to get back on the horse of making some improvements to that 25 month old script). Yeah, I said it's cheesy. So sue me... :-)
I've been wondering why otherwise seemingly intelligent and capable people continue with affectations like 'virii'. Maybe they think the double 'i' makes them sound smarter? This has always confused and annoyed me. The real plural for virus is of course viruses. It has a dreaded 'ses', not two i's. When are people going to give up the chance to sound like bigshots? Every time another email worm comes around, you see self-proclamined experts talking about "virii this" and "virii that"... If I was King of All U.S. of A, I'd ban TechTV first thing.
And where the hell did that extra 'i' come from anyway? You can use the plurals cacti and octopi (although cactuses and octopuses are preferred), but what would you think if someone said "Yes, there appear to be quite a few octopii in that tank." or "Please watch your step as there are many cactii about..."? Did Webster have a sale on i's at some point? Is today brought to you by the letters i and i?
While I'm ranting, let me just say that the only thing worse than seeing 'virii' in print is hearing someone say "veye-rye". Damn that's annoying... you might as well pretend to have an English accent while you say it. I'd even prefer "veer-eye" over the long first i. Those waterheads sound like Fry's clerks hawking overpriced Norton products to Joe Simpleton the Hewlett-Packard PC owner. Strangle strangle strangle.
Oh yeah, one more thing to rave on about while I'm on the subject: trojan != worm != virus. Those are three distinct things! They have different infection vectors, life cycles, etc. The virii get royally pissed when you confuse them with trojii and worii.
I ought to make a virus/worm/trojan that infects windows machines. I'll call it 'callthemViruses!goDdammIt.A'. It'll add/change a line in the c:\msdos.sys file to "BootDelay=999999" and then it'll drop in a new logo.sys file to an image which simply has the definition of the word 'virus' on it. Have people get a nice, long look at that while they wait a million seconds to boot up.
Well, enough of my pet peeve du jour. I'm home sick with a real biological virus. Instead of try to work I'm going to do some more word puzzles. I've got a book of rebii around someplace...
Well, this is it: I'm really famous now. Big time. I've got my name in the BogoMips Mini-Howto. And not just once, but twice. Scroll down to the listing for the "AMD Athlon/1330" or "Crusoe/400" entries (or search for 'wrhodes').
I wasn't going to do this, but why not... Here's what a BogoMip is:
Quoted from the Internet, origin unknown but brought to the attention by Eric S RaymondWhen I got my new Athlon 1.33GHz, I did two things: a kernel compile (using defaults) and a BogoMips comparison against my older Athlon 600. The difference between the two was exactly what one would expect. So then I got curious and looked up another 1.33 Athlon on the BogoMips Mini-Howto's comparison table. The speediest Athlon listed was like a 1.2GHz or something. So I mailed my BogoMips number to Wim van Dorst, the author of the Mini-Howto, and basically told him that mine was bigger than anyone else's, and he must put it in the listing so others may bask in awe of it's sheer girth. We had a little email exchange that was pretty amusing. The innuendo couldn't be kept up long, though., and Geoff Mackenzie
, there is an humourously illustrative definition of BogoMips as "the number of million times per second a processor can do absolutely nothing."
On a more precise basis, from Lars Wirzenius'mail of 9 September 1993, explaining Bogomips, with additional detailed information by Alessandro Rubini,
, and by Wim van Dorst:
`MIPS is short for Millions of Instructions Per Second. It is a measure for the computation speed of a program. Like most such measures, it is more often abused than used properly (it is very difficult to justly compare MIPS for different kinds of computers).BogoMips are being determined in
BogoMips are Linus's invention. The kernel (or was it a device driver?) needs a timing loop (the time is too short and/or needs to be too exact for a non-busy-loop method of waiting), which must be calibrated to the processor speed of the machine. Hence, the kernel measures at boot time how fast a certain kind of busy loop runs on a computer. "Bogo" comes from "bogus", i.e, something which is a fake. Hence, the BogoMips value gives some indication of the processor speed, but it is way too unscientific to be called anything but BogoMips.
The reasons (there are two) it is printed during boot-up is that a) it is slightly useful for debugging and for checking that the computers caches and turbo button work, and b) Linus loves to chuckle when he sees confused people on the news.'/usr/src/linux/init/main.c
loops_per_sec is used in several drivers for more serious purpose. The actual delay functionudelay()
is in assembler, and therefore each port has its own definition in/include/asm/delay.h
. Theloops_per_sec
variable and theudelay()
function are used in numerous drivers, see:
cd /usr/src/linux #or where else source is located
find . -name '*.[hcS]' -exec fgrep loops_per_sec {} /dev/null \;
find . -name '*.[hcS]' -exec fgrep udelay {} /dev/null \;
The BogoMips calculation loop for the non Intel CPUs is similar but not the same, because it is programmed in another assembler language. BogoMips is however the only portable way over the various CPUs (Intel-type and non Intel-type) for getting an indication of the CPU speed. Even CPU clock speed is not available on all CPUs.
I should be sleeping. It's 3:00am and I didn't get a lot of sleep last night. But instead of nap out, I have some Catholic jokes to share.
Q: How do you get a nun pregnant?
A: Dress her up like an alter boy.
Q: How are a Christmas tree and a Catholic priest alike?
A: They both have ornamental balls.
Seen in a .sig some place: Abstinence makes the Church grow fondlers.
And just for good measure:
Q: What's the difference between a Catholic wife and a Jewish wife?
A: A Catholic wife has real orgasms and fake jewelry.
And that's about as offensive as I wanna get right now.
So my Linux on a cash register hobby page thing was on Slashdot. Way cool. I have no idea how the guy that submitted it found it. He might have been searching google for Linux POS systems or something and came across it. I was up in Phoenix visiting my folks when I decided to borrow my mom's PC and check the haps online. I nearly spit coffee out of my nose when I saw my site on Slashdot. I didn't think my project was terribly novel, but I got some positive comments. Slashdot had some blackout/protest thing directed at it that week, so maybe they were hard up for new or something. They certainly seemed to put out a lot of news items during the week. I thought it was interesting to see the "/. effect" firsthand. My provider stayed up nicely.
I got about 35,000 individual visitors in a couple days time. The page hits have trickled off to about 4000 a day (I usually get about 400-500 per day). I had people from Slovenia and Malaysia and the Russian Federation and every other continent besides Antarctica stopping by. I had a Qualcomm person or two come by as well. And my 404 page got quite a bit of notice as well. I don't have a 003.html, so the pics are "out of sequence". Quite a few people noticed this and started requesting the "missing" page. It might have been in the Slashdot comments too. I forget.
The best part was the email I got. I had 40-something emails from people, all of them very nice. I answered every single one of them (and I can be real bad about letting emails languish, so I made a conscious effort to respond to them all). Some people had bought used POS systems like the one I have and wanted info on them (one fella in particular was in deep need of help, and I sent him a bunch of links as well as info on the unit). Another group sent me POS links, had info about the hardware, and the like. I have some really great pointers to stuff and I'll post them here tomorrow or thereabouts. The last group of emails was along the lines of "nice hack". The LED-on-a-stick was especially popular, and I got some emails asking what plans I had for it. Not sure yet. Yet another future MG post.
The comments in the Slashdot post were pretty damn amusing. Tracy got a kick out of a couple of them in particular. Most comments were of the "this ain't no big deal" category. They're right: it really isn't a big deal. I'm just doing it to have fun. I like taking stuff apart. I only took pictures because I've got a handy thumbnailing script and I wanted to show Trey the progress so I annotated the pages. Besides, how was I supposed to know what the things were made of? For all I knew, they had StrongARM CPUs in them. And it's been fun getting the LED-on-a-stick working. I didn't mind the harsher comments. You can't please everyone all the time, especially when you aren't trying to please anyone at all.
Oddly, since little project became "famous", I haven't done squat with it. I brought a cash drawer back with me, so I'm going to hook that up soon. It's on the floor right now. I did yank out the Voodoo3 card and put in an old SoundBlaster AWE16 I had, but that's not hardly progress. And there's these guys with a LCD display daemon project who are writing driver support for my LED-on-a-stick (and those like it; apparently my model is fairly common). I'm going to help them beta test. So stuff'll get done. Trouble is, I discovered the HTML::CalendarMonthSimple perl module and had to write a database-driven event calendar right quick (it even has my birthday in it). I'm gonna use it as the base for the web site for my parents' cabin. Yet one more future MG post. I'll have to write more often I think. Oh yeah, I even submitted a patch for the module which allows for table cell font resizing.
All in all a very amusing situation. I really wished I would have put the URL to the cash register on the web too. I have apache logging to the printer. I'd have loved to be able to save that receipt.