java reflection on generics

When you drill down far into Java reflection, you end up at the reflection class for generic types. This is, if you have

class Blah {
  T t;
  public T get() { return t; }
... Blah stringBlah = new Blah();

Then you can get the configured return type “String” by reflecting on the method “get”. The return type of that method is String. BUT if you need the generic variable T of Blah, you end up calling Blah.class.getTypeParameters(). And here the fun starts in the doc of TypeVariable:

The type parameter D represents the type of generic declaration that declared the underlying type variable.

wtf? this is as complex as playing braid.

never installing a laptop os

Your computer doesn’t start? Black screen, a cursor, nothing else? Well, you may be tempted to wipe & reinstall. Back at impact we had the company directive not to fumble around installing operating systems again and again, but to stick with the os the vendor has preinstalled and fix it. The reason behind this is that most vendors tune the installation and also that re-installing all software and data costs too much time = money.

So yesterday Ingrid’s compaq evo laptop got a black screen of nothingness after the bios logo and instead of windows, a cursor flashing once. Then reboot and infinite repeat. I used knoppix to check what happened, harddisk still there, files looked as usual. Next thought: master boot record (MBR) so I read there are two ways: using gentoo startup cd and ms-sys or windows xp install cd. I had only knoppix so I choose windows xp boot cd. But my boot CD didn’t have the “recovery console” menu when installing. Pressing F10 continously while it bootet finally brought up console (how intuitive). Later I found the windows xp cd shipped with the laptop, that had the “r” for recovery, so there is a difference between windows and windows.

fixing mbr and boot in the recovery console is easy, type fixmbr and fixboot and it should work. Not for me, I also thought that maybe all this is wrong and my floppy drive is broken (ha, that is the first in boot order), so I moved it down in bios list of boot devices. I also checked HP’s guide for fixing boot problems, and blindly entered commands like “fixmbr /device/harddisk0” in recovery console.

Ok, it bootet now. But then:
Windows XP could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEM

A thing I often heard from nightmare stories, it happened the registry was missing. Lucky me, the Microsoft Guide to recover the registry is on the first page when googling for the problem. The boot loader was right, half of the files of the registry were gone. I copied them from an automated backup which is done by windows every day (ha, you never know what useful things this os does when “being busy”).

Alas, after 3 hours the system was back. So, it took me three hours to get my system back, compared to the 2hours of installing an operating system and then endless days of updatefest and installing software, it pays off. I am quite slow with computers, others may have done this faster. Ingrid was quite happy to have her machine back, though. I don’t pick any OS better than the other, I have the same problems with all of them. But keeping one alive is always better than wiping, at least for me.