Don’t pull out the Logitech G15’s keys

By admin - Last updated: Monday, April 28, 2008

You’d think that the Logitech G15, the greatest achievement in keyboard technology known to man, would react better to the common task of removing the keys to clean the coke I just snorted all over it (I’m talking about the drink; the G15 handles powder spills just fine). And yet, now the keys are sticking if they’re not pressed exactly in the middle.

It seems that the plastic hooks that keep the keys upright don’t take too well to bending, and now that I pried them out, the bent hooks let the keys play from side to side. So pressing the key slightly from the side will make it tilt and get stuck in its shaft, making it hard to press, and sometimes making it stick.

One of the greatest offenders is the left Ctrl key, which now makes it hell to copy and paste, and the F key, which now makes it hell to tell Logitech to go Fuck themselves for making me consider dropping a hundred bucks every time I want to clean my keyboard.

Filed in Hardware • Tags:

I hate ads, but I can’t be bothered to block them

By admin - Last updated: Tuesday, April 22, 2008

My problem with internet advertising is that during my entire decade or so of browsing, I haven’t once seen an ad for anything that I’ve ever been even remotely interested in. I don’t see it happening any time in the future either, unless ad targeting systems somehow learn to scan my mind for my deepest desires. A lot of this is because I live in a small, obscure, European country (the local websites of which I do not browse), which makes my relevant ad domain a lot smaller.

But the main issue is that ads are the internet equivalent of cold calls. And cold calls are deplorable because they assume that I’m somehow incapable of finding what I want on my own. If I want a product to perform some specific task, then I will search for it. I don’t want to be constantly reminded that there’s an application that can insert gay ass smilies into my emails. I’m not interested, I don’t need your products, and I don’t want to hear about them, because I am not going to buy them, period. When and if I, for some reason, start needing a gay smilie application, then I’ll Google it. I will then commit seppuku to retain my honor.

Read the rest of this entry »

Filed in Uncategorized

Vista SP1 “Unauthorized Changes”

By admin - Last updated: Thursday, March 20, 2008

I left Windows Update installing Vista SP1 today, however, instead of a nice and upgraded system, I got locked out of my computer with this lovely message:

[Window Title]<br />
Windows software protection</p>
<p>[Main Instruction]<br />
An unauthorized change was made to Windows.</p>
<p>[Content]<br />
Windows has discovered a change that will result in limited Windows functionality. Use the link below to find out how to fix Windows.</p>
<p>[Learn more online] [Close]

Vista screwed itself over

Clicking on Learn More Online took me Microsoft’s Genuine Advantage validation site, which happily reported that my copy of Vista isn’t genuine, with error code 0xc004d401. It was convinced that I had some kind of incompatible software that was interfering with validation, and gave me a list of anti-virus and malware checker programs that have been known to cause this problem. Obviously, I had none of them, or at all, ever.

It turns out that this was caused by Vista hosing itself while trying to update to SP1. I’m not sure if it’s caused specifically by SP1, or any of the updates that I installed before SP1, but actually getting SP1 to install fixes the problem. Microsoft’s suggestion to reboot into safe mode won’t help, because you can run neither WGA, or Windows Update from there. Luckily, It doesn’t take much to circumvent the lockout.

  1. Click on Learn More Online
  2. Type in “file:///c:”, without the quotes. This will get you into Explorer.
  3. Use the Folders pane to navigate to the Control Panel, at the bottom.
  4. Use the little arrow to expand it, and open Windows Update.
  5. Check for updates. If you have SP1 waiting for you, download and install.

If that doesn’t work for you, or SP1 doesn’t show up as an update, then you likely have a different problem. You can still make life easier for yourself by navigating to the Windows directory and from there launching Explorer.exe, which will give you your desktop back. Some things will be disabled, and you’ll have a memory quota that’ll only allow you to launch two or three programs at a time, but it’ll make troubleshooting a bit less painful.

I installed SP1 and the problem went away, and Windows validates fine now. I was tipped off to a failed SP1 install being the culprit, because there was a task in the Task Scheduler that called for a “HitmanSp1.exe” (which didn’t exist) to be launched. Microsoft, your killers fail again!

Filed in Windows • Tags:

register_shutdown_function after all the other register_shutdown_functions

By admin - Last updated: Friday, March 14, 2008

PHP’s register_shutdown_function lets me run code after it finishes running the script, be that naturally or forcibly. This makes it a perfect fit for a whole bunch of things, like running maintenance database queries or showing debugging information.

function do_maintenance()
{
  $db-&gt;doSomeQueries();
}
 
function debug_write()
{
  echo 'some debugging information';
}
 
// Last things to execute
register_shutdown_function( 'do_maintenance' );
register_shutdown_function( 'debug_write' );

There’s one caveat, and it’s explained in the PHP documentation:

Multiple calls to register_shutdown_function() can be made, and each will be called in the same order as they were registered.

Read the rest of this entry »

Filed in PHP • Tags:

How to get a (non-visual) ComponentModel.Component’s parent Form or Control

By admin - Last updated: Friday, March 7, 2008

I recently ran into the need to get the reference of the parent form of a Component that I was creating. The problem is that Components, unlike Controls, don’t have a Parent property, nor any other simple way of getting it. I’ve browsed around for solutions, but I could only find vague references to what needed to be done. Most solutions simply suggested that I simply create a public property, that I then set manually in the parent Control. One article came close, but it didn’t work. It did however point me towards looking into the ErrorProvider component, which does exactly this.

I found the solution by looking through it’s source code. We still expose a public property, however, instead of setting it manually, we can simply instruct Visual Studio to set the property for us, when it generates the designer code for any component we put it into.

private ContainerControl parentControl;
public ContainerControl ParentControl
{
    get { return parentControl; }
    set { parentControl = value; }
}
 
public override ISite Site
{
    set
    {
        base.Site = value;
        if (value == null)
            return;
 
        IDesignerHost host = (IDesignerHost)value.GetService( typeof( IDesignerHost ) );
        if (host != null)
        {
            IComponent baseComp = host.RootComponent;
 
            if (baseComp is ContainerControl)
                this.ContainerControl = (ContainerControl)baseComp;
        }
    }
}

Read the rest of this entry »

Filed in C# • Tags: ,