Archive for January, 2008

Well, after working with the two screen setup for a couple of days, I’ve started to get a terribly sore neck. A bit of self-evaluation shows that when I’m looking at the laptop screen, I’m craning forward and down, which is ruining all the good effort that my chiropractor and the stretching exercises he gave me over the last three weeks have done.

So I’m now running with the laptop screen closed, using the KVM to use the big screen for both laptop and desktop use.

Unfortunately when I came in this morning, my desktop was totally unresponsive. I couldn’t get it to wake up when I switched to it on the KVM, and I couldn’t ssh to it from my laptop. So I power cycled it. That required manually fsck’ing the disk, and then when it did come up for real, the mouse went nuts and started opening programs and moving stuff around on my screen like it was being driven by a demented ghost. It had also booted the wrong kernel (one that didn’t support MVFS). So I booted it with the proper kernel and it was ok. Except that as always, vmplayer complains that I haven’t run /usr/bin/vmware-config.pl, so I ran it again. Don’t know why that never “sticks”.

I discovered a new monitor mode for the 24″ CRT that gives me even more screen real-estate. That’s nice.

I also managed to borrow a KVM from the lab downstairs so I can occasionally look in on my Linux box to see if I’ve got any new Lotus Notes “mail”. That’s nice.

Unfortunately the PS2 KVM doesn’t work well with my USB mouse – I have a USB to PS2 adaptor that I was using at one point, with the USB mouse going into the PS2 mouse adaptor, which was then going into my PS2 to USB adaptor. That was mostly a proof of concept (to make sure I could take the output of a PS2 KVM and plug it into my USB-only laptop), and also it made it easier to switch the PS2 keyboard and the USB mouse between my USB-only laptop and my PS2-and-USB Linux box. But plugging a USB mouse into a PS2 adaptor into a PS2 KVM didn’t work so well for the mouse. Every time I switched the KVM I had to reset the mouse by unplugging it and plugging it back in. Not good. So in the meantime I’m using the PS2 mouse that came with the computer instead of the USB mouse I brought from home, and it sucks. No wheel, and it uses a ball rather than optical. Oh, and it’s a Belkin, so it will probably fail in 5 minutes.

I’ve mentioned before that in order to help defray the costs of putting my stuff on a colo box, I partitioned the box in 3 Xen virtual machines, and rent two of them out. Well, yesterday one of the renters, Terry, asked for a bit of help with his Apache set up. Not knowing his root password, I mounted his hard drive in the “dom0″ Xen controller, using “mount /dev/xen-space/xen2-disk /mnt” and started poking around. Well, evidently that managed to confuse ext2 because a few hours later he emailed me to say that his disk had gone “read-only”, and when he tried to reboot it didn’t come up.

Looking at my munin graphs, it appears that when he rebooted, it took down the whole box. I had to email the owner of the rack to power cycle my box, which he can do remotely. When it came back, 2 of the 3 virtual machines came up fine, but Terry’s was asking for a root password to run fsck. I shut down his virtual machine and did a fsck from within the dom0, and it found several things out of whack. But after those were fixed, I was able to restart Terry’s virtual machine.

So lesson learned. I’m not sure if things would have been happier if I’d mounted it read-only, but in the future if I need to mount one of the partitions in /dev/xen-space I’ll shut down the xen virtual machine instance first.

Below the cut is a highly illegal picture of my 17″ Powerbook G4 (1440×900 screen resolution) at work, connected up to my 24″ SGI/Sony GDM-90W11 CRT monitor (1600×1200 screen resolution), with the big screen being used for Eclipse, and the small screen showing my web browser open to Sun’s Java API documents, as well as a couple of convenient Terminal windows including one dedicated to pgsql.

The Safetype keyboard and mouse are also plugged into the Powerbook. All I really need now to make my work environment complete is a KVM so I can actually switch over to Linux and check my Lotus Notes and build in the dynamic vob.

So this is what I do now – I bring my laptop into work, hook it into the corporate network, and rsync my laptop’s /vob to my snapshot view on the Linux box. I run clearviewupdate on the snapshot view to get everything I’ve changed overnight checked into the vob, and then rsync it back so that everything that got checked in gets turned back to read-only. At that point, I’m good to go and I can plug the keyboard, video and mouse into the laptop and work. When I’m ready to leave at night, I unplug the laptop from the monitor and put the keyboard and mouse back on the Linux box, and run the same procedure all over again.

I also have a dynamic view of the same development stream, so I can build the bits of code that are actually working. (I can’t build in the snapshot view because you can’t make a snapshot view anchored at /vob, and far too many Makefiles have hard coded full paths instead of relative paths).

It’s all pretty sweet so far.

Continue reading ‘You can never be too rich, too thin, or have too much screen real-estate’ »

I’m busy re-writing vast swaths of my low-level code in order to support a new database schema. One of the classes that I wrote that got used all over the place is called “Playlist”, and its various subclasses. Playlist has an abstract clone() method. I almost never write clone() methods, so somebody must have asked for it. And I think I know who now.

As part of this re-write, I using Eclipse’s “Find References” function a lot to see if some method needs to be re-written or can just be deleted. While doing that, I found an interesting bit of code in an obscure part of the system that I’ve never looked at before:


private Playlist doClonePlaylist(Playlist playlist) {
Playlist clonePlaylist = null;
 
// need a special clone
// as the playlist cone function
// doesn't copy the playlist
// external id which we really need
if (playlist != null) {
clonePlaylist = (Playlist)playlist.clone();
clonePlaylist.setExternalID(playlist.getExternalID());
}
 
return clonePlaylist;
}

If the guy who’d written this bit of cruft still worked here, I’d want to ask him why the fuck he didn’t just tell me that I’d left one parameter out of my clone() method, or even better, fix it himself? Ideally, I’d want to ask him while dangling him over the edge of a multistory building, but that isn’t going to happen.

I’m trying to find the optimal solution for doing my after-hours work at home, so that I don’t forget what my wife looks like.
Continue reading ‘Hmm, still not working out well’ »

I was just reading the story of British Airways Flight 9 on Wikipedia. I hope that some day when I get into difficulty as a pilot, I’m as calm as Captain Moody:

Ladies and Gentlemen, this is your Captain speaking. We have a small problem. All four engines have stopped. We are doing our damnedest to get them going again. I trust you are not in too much distress.

That’s just beat out Captain Al Haynes “You want to be particular and make it a runway, huh?” as my favourite aviation quote.

I was driving to work this morning, admiring that unfamiliar shiny yellow orb in the sky and thinking that if I wasn’t overburdened by work and it wasn’t windy as hell, this would be a good day to go out flying. But then I saw a pickup truck with a ladder in the back backing down the shoulder. “Why would he be doing that?” I wondered to myself, when suddenly the van in front of me ran over another ladder that was lying the road, causing it to pop up into the air menacingly. I swerved around it without hitting either it or any surrounding cars, and afterwards had time to wonder if it would have hit my grill or come in through the windshield if I’d hit it.

I just finished reading How To Recognize A Good Programmer, and kept thinking “hey, that’s me” for every point. So why did my last two job interviews not go so well? I’m a good programmer, I know I’m damn good actually, and according to this, everybody else should think I am too.

Oh well, I’ve got 6 months left on this contract. Maybe I should get some paper qualifications to impress the people who aren’t smart enough to read that article.

For this current project I’m on, I’ve resolved to give Eclipse a try. This is a major step for me, because my fingers have been typing vi commands for 20 years now, and it’s really hard to get out of the habit of typing “[escape]jjjjj” or “ZZ”. Everybody else here laughs at me because besides etags and the syntax colouring of gvim, I don’t have all the fancy stuff that they have. On the other hand, I can do everything through a ssh connection and can keep my hands on the home row.

Oh well. Welcome to the 21st century. Here’s your kazoo.

I’ve been doing Java since 1998, and yet I only just discovered this interesting fact. If you have a class called, say, DBAsset that has a bunch of static methods in it, and you have some static member variables, and you initialize the static member variables, like so:

class DBAsset
{
static PreparedStatement insertStmt = null;
static PreparedStatement deleteStmt = null;

Then calling multiple static methods from within DBAsset’s static main using just the unadorned method name doesn’t do anything to those variables, but each time you call one of those static methods from some other class using DBAsset.methodname, those static variables get reinitialized to null. Huh.

Update: Figured it out. The code that initialized the variables was getting called *before* the code that set it to null, because I had a static DBAsset theAsset = new DBAsset(); before the static initializers. I’m such a slaphead.

I spend some time, not nearly enough, during the holiday finishing up my functional spec for the task assigned to me for this release. And during that time, it has been obvious that the isn’t enough time in the schedule to get it done. So I asked for, and received, permission to work overtime. I committed to work at least 60 hours a week for the next two months. And here it is, the eleventh day in a row of billable work, and I’m already tired.

Sigh. At least the money is good.

Vicki asked me to stay home this morning because the furnace guy was coming to do one of the inspections on the hideously expensive maintenance contract we signed up for due to a hard sell sales pitch. She wanted me to stay because she says the furnace guy gives her a real hard sell every time for something that we absolutely must replace or we’re killing babies and torturing puppies. I’m not sure where she’s been for the last 11 years, but by now you’d think she’d realize that I’m no better at resisting those sorts of sales pitches either. But hey, this spreads the blame around for the stupid stuff we get talked into and takes the pressure off her, so I’m willing to do it for her sake.

The guy came, did the usual poking around in the basement, and came up and said “Your ignitor unit is testing at 99 ohms and we recommend replacing it any time it gets to 100 ohms, so you’re due”. I asked for a price, and he showed me it woud be $160 now, or $280 if it was an off-hours call. So I thought I’d outsmart him and ask if he had one in stock, and he said no, he’d checked the truck and he didn’t have one. I figured that would mean that if it *did* fail in middle of the night, we’d have to wait for a day or more while they ordered the part, and we’d risk the birds dying if that happened, so I said to go ahead and order it. A few minutes later, as he’s leaving, I asked when they were coming to install the part, and he said “I had another look around the truck, and found one, so it’s installed already”.

Dammit, he played me for a chump. He must have known that if he’d said they had one in the truck that I would figure they’re easy to come by and so I could afford to wait until it failed, but if they didn’t I’d want to replace it pre-emptively. I’m such a sucker.

My back spasmed up in the middle of the night. Actually, it was about 5:30am so I just got up. But because I’m working on my Functional Spec, instead of spending the day lying down to relieve the pain, I’m going from chair to chair trying to find a comfortable position to type.

I’m terribly depressed, and I’m not entirely sure why. I mentioned this to Vicki, and she started listing off dozens of reasons why I should be happy with no signs of stopping until I conceded the point. And I have to agree with every one of them. I should be happy. And yet, I am not.

There is one thing hanging over me right now – a Functional Spec that I promised would be done by Wednesday, and which I haven’t done nearly enough work on. The more I’m working on it, the bigger a job it looks. And the more impossible seems the deadlines both for having the Functional Spec and even more important, the code that I’m spec-ing. And with my project manager and my current product manager, that’s not going to go over well. Before, I might have been praised for giving information that would allow the schedule to be adjusted, but with these two I’m not sure. I feel like neither of them trust me, and because of that I don’t entirely trust them.

But I’ve been in bad situations at work here – hell, I survived a year and a half at SunGard without cracking up. Oh wait, I didn’t – I spent two years in therapy around that time. So never mind Sungard. But I did survive a year at Gandalf, where my boss’s boss thought his whole department should be shut down so I had to spend half the time writing long descriptions of what we were doing and how much we were saving the company.

So anyway, I don’t know why I’m so sad. And being sad isn’t helping write the Functional Spec.