There are moments when I have to sit back and enjoy being a geek. Today had one of those moments. After an upgrade the library system developed a new quirk. It was almost impossible to get phone numbers to print on the notices we use to call people when an item they have placed a hold on arrives. I spoke with the vendor at length about the problem and was told that because we had an old “PHONE” field in all of the older user records (all staff, faculty and admins) there was not much that could be done. The system runs through the list of phone fields and the first field it encounters with the word phone in it prints. That is unless that 1st field is blank, then it prints nothing at all.
I asked the company if it was possible to delete that field in records where it was empty. They gave us three options. Option one was to manually remove that field from each user record. To remove the field twice from over 3500 users would be a daunting task to say the least. For option two they said they could write a program to fix it for us but it would cost a rather large sum of money. Option three almost seemed offered in jest. It was the option where I could write the program myself. None of the options provided seemed all that appealing to me.
After letting a co-worker start on the list for a day or so, I began to tinker with the process as well. It was extremely tedious. I hate tedium. So I started to consign myself to the fact that I would once again have to delve into the world of SIRSI API. Believe me when I say, it is unlike anything most people would consider an API. I ran through my API manual to no avail, the commands I wanted were not listed. I went through the electronic documentation, still no help. I skimmed the super secret API guru website, and saw nothing of use for this problem.
It was at that point that I decided I was on my own. I began watching the transaction logs on the server as I manually removed field after field in user record after record. Each time I removed a field a specific line of data appeared in the log. It seemed a little to easy at first glance, that was of course because it was to easy. The logs only showed the second half of a two part process. In order to delete a field, you have to know the fields “Absolute Field Position”. This is a number that for my purposes might as well have been random. (It’s not really random of course, but it might as well have been) I had hit a brick wall so to speak. How was I going to find out the number I needed when the command used to retrieve the number was purposefully filtered out of the logs, and left out of the documentation. I remembered from my training that there was a way to un-filter a command, but to do so I would need to know what command it was I needed un-filtered. So there was no real help there.
I finally had a burst of inspiration this afternoon while explaining the problem to my co-worker / friend, Kendall. I tend to get those bursts of inspiration around him. I chalk it up as some form of a Holmes and Watson relationship. He forces me to come at the problem from different angles, and that often leads me to the solution. Today was no exception. I hit upon the idea of creating a logging proxy that would sit between the client and the server and dump all of their communications to a log file of my own. I could then read my log file, which was not filtered, and had the advantage of showing traffic both directions. I already knew the 2nd half of the sequence to delete, so then logically what came before it in that log would be the missing link I was looking for. Thankfully there is no need to actually create such a proxy from scratch. The gurus of the Unix/Linux world have already done that in a program called “netcat”. After a little tinkering with netcat I had a proxy setup. I connected to the server via the proxy and deleted my first field. A quick glance into my log file and I was presented with a massive burst of data from the server in response to a previously unknown command. I had indeed found my missing command.
Now that I had the command it became a simple matter of using it to retrieve the “Absolute Field Position”. Once I had that number I was able to construct the second part of the command. After doing a little fidgeting in a text editor I manually sent the newly constructed command into the server and nothing happened. Well actually something happened, it gave me an error. I tinkered and tweaked and finally noticed the problem. Once I corrected my mistake I ran my command again and to my cheers of joy the old PHONE field vanished from the users record. One record down ~6999 to go. By this time it was 4:15 and I quickly documented all of my progress and dumped it to my jump drive for safe keeping. When I arrived at home I found myself driven to complete the project and actually write code to automate this process.
I tinkered and coded and coded and tinkered and around 8:00 I ran my first test. It was a success. A little more tinkering and I am now happy to report that by 9:15 tonight all of those troublesome fields are just a distant memory.
Month: March 2006
A post to make you smile
I stumbled across a site today and I just had to share it. It’s to cute for its own good. The site is called “Cats in Sinks“.
Shhh… Do you smell that?
In honor of today being such a nice day / evening I stopped by the store on the way home, picked up some great looking pork chops, some new interesting looking new rub, and some sort of rice in a box thing. When I got home I pulled off the grill cover, fired it up (it started right up, no problem) and scrubbed it down. I then seasoned the meat, and wiped the grill down one more time, and threw them on. As I type this I am sitting on the desk, listening to the crackle of the chops cooking, and smelling that wonderful scent of grilling food. Yummmy Yummy!
Metroid Prime Hunters
I broke down and got Metroid Prime Hunters tonight. I’m not really good with FPS games, but again, its a Wi-Fi title… so uh… Gotta Have it… I realised tonight that I have bought more games for the DS than I have for the last two game systems I had total.
Here’s my friend code for it. Same deal as always… if ANYONE hapens to get it.. post your friend code here so I can play you. I promise I SUCK at FPS so I’m an easy target…
Name: cap60552
5197
5906
6039
I Don’t do windows…
Today at work my order for a “Swiffer Duster” came in. Wow what a cool device. I ordered it so I could clean out the giant dust puppies living behind the computers in the desks, and tables. It worked wonders. Unfortunatly I got a little creative… Out of curiosity i iped it across the air intake vent above my desk. This vent has been a grey metal color since I started working here 11 years ago. I thought it was odd they didnt buy white ones, but knowing how cheap the place can be, I didn’t give it much thought. Besides… How often does one stare at the ceiling. When I wiped over the vent I about screamed. The vent is actually white. It had so much dust on it that you coudl NOT tell what color it was supposed to be. I wonder why we are always sick up here. I cleaned all but one vent here, and I am waiting for the HVAC guy to come by so I can show him the mess. Of course I’m certain he will give me some excuse along the lines of it begin better to not disturb the dust. This is fricking absurd. I also did a demo for my boss and she was horrified. She has now placed a work order to have all of the vents cleaned. Something tells me they wont do it, as any time we have asked them to dust they respond with, “It’s not our job to dust. ” (This is actually why I ordered the swiffer in the 1st place) I think I may actually buy one for home though, I know my room could use it, and behind the TV and other electronics could really use it as well. I know its proably more ecologically sound to use a regular duster, rather than generate that much more waste, but the removal of the dust and crap in the house might just offset that in my head. Yes, an old fashioned duster would probably work jsut as well too, but the old fashioned dusters I’ve used jsut kick up the dust back into the air and I don’t want that.
Descisions…
I have a delima. I have a gift certificate to think geek. The problem is, I jsut can’t make up my mind as to what to buy with it. I have narrowed it down to two possible orders. Post your vote as a comment to help me decide.
Option 1:
Option 2:
- The Red Swingline Stapler (Office Space rocks… Milton is my hero…)
A third reccomendation made popular by people who know me to well.
Option 3:
Ahhhh choices, choices, choices…
Who’d a thunk it…
I think we all had a fun time at Dave’s today, I know I did. Overall I think things went pretty well considering we don’t really know a lot about what we were doing. 🙂
Birthday Dinner
Tonight after work I went for a nice German dinner at the Bavarian Inn in Lisle. I love the food, and the beer selection there. This was the brainchild of my buddy Tony, and because he didn’t get around to emailing anyone until this morning almost everyone had prior plans. We ended up having four people for dinner counting me, and it was a really nice time.
When I arrived I was kind of tired from not sleeping much this week. (Damn you Nintendo and your evil addictive Tetris DS game) So I figured I had about 30 minutes or so before everyone was going to be there so I took a quick cat nap. I awoke to Tony and Carrie knocking on and shaking my car. (Yes Jon, I jumped and flailed. No I did not hit my head.) So I hopped out of the car, grabbed the cell phone, hit the lock, and shut the door. We went in and as we were sitting down at the table to wait for Zack I realized I had locked the keys in the car. Crap…
We had a nice dinner and great conversation. Sometimes it is just really nice to have a small number of people at dinner. We all talked about this and that, remembered al sorts of capers from the past and had an enjoyable time. The waitress even brought out a free Chocolate Amaretto Bundt cake with a candle for me. It was delicious! As a rule, I am not a big chocolate cake fan but I thought I would be polite and eat at least part of it. Ye flipping gods, it was incredible.
After dinner we sat and talked a little more to let the food, and beer digest a bit. One topic of discussion was how I was going to get into my car. I explained that this is about the fifth or sixth time I’ve done this, and I’m an old pro at breaking into my car. After a bit more conversation and the bill was paid, (no one would let me pay again…) we said our goodbyes and Tony and Carrie went back home while Zack stayed with me to assist me in my break-in. He was still feeling a little effect of the dopplebach beer so I drove his car to the local K-Mart to acquire the one ‘tool’ I would need to gain entry to my car.
We wandered K-Mart and to my dismay they did not carry the item I needed. We wandered a bit more looking for a suitable substitute, and found one in the camping isle. I noticed a packaged containing four Coleman campfire forks. Looking at the package they appeared to be perfect in almost every way. They were the correct length, the correct gauge of wire, and they were even pre-bent into almost the perfect shape. We paid and made our way back to the restaurant. Zack watched as I made the 2 final necessary bends to one of the forks and in less than 5 minutes (a new personal record) I was holding my car keys.
I think on some level I should be more disturbed than I am that I can so easily break into my car. On the other hand it sure is a lot cheaper than a locksmith. Of course the best option would be to just get a spare key made and put it in my wallet, but where is the fun in that!
e-cards
Here are links to the ecards I got today: (I’ll update the post if more come in)
Card 1 – Capps Family
Card 6 – I.T. Department (I got welcome to oldsville)
Happy Birthday
Happy Birthday to me…
Happy Birthday to me…
Happy Birthday, Happy Birthday, Happy Birthday to me…
Wow, 30. Yup, Feels just like yesterday… Except there is snow on the ground and everything else. It’s pretty, I jsut hope theres not any more of it, I’d rather not shovel.
I think I’ll stop on the way to work and get a cookie cake and take it into work. I guess that means I should get going then.