Tuesday, December 30, 2008

Something to help make Windows suck less

Here's a program that helps Windows suck less: AutoHotKey, which is basically a scripting language/interpreter for intercepting keystrokes and acting on them.

It allowed me to write the following, which is the "Clipboard Swap" command I thought would be occasionally useful. (Clipboard Swap: It copies highlighted text to the clipboard while replacing it with the current clipboard contents. It's activated by Windows-v).

#v::
tempClip := clipboard
Send, ^c
ClipWait,0.5, 1
tempClip2 := clipboard
clipboard := tempClip
Send, ^v
clipboard := tempClip2
Return


Just copy the script, paste it into, eg, ClipboardSwap.ahk , and then run that file with AutoHotKey (you may want to include it in your Startup folder so it's loaded every time).

Inasmuch as the above code is copyrightable, I hereby relinquish it to the public domain.

Enjoy!

Sunday, December 28, 2008

Unintentionally Funny Code

So, a couple of weeks ago I was at work, digging through the codebase, trying to root out hard-coded client-specific logic.

Here's what I found (genericized to avoid non-disclosure problems):

public class Class1
{
public virtual bool IsClientOne()
{
return Class2.CanUseOptionA();
}
}


And then...

public class Class2
{
public virtual bool CanUseOptionA()
{
switch(Class3.Id)
{
case (int) Class3IdValue.ClientOne:
return true;
default:
return false;
}
}
}

Thursday, December 04, 2008

When centralization fails...

I was reading an article the other day that said that 1 in 10 jobs in the US are dependent on the big three US automakers (Ford, GM and Chrysler), or their supply chain. And that, therefore, is the reason they must be bailed out of their current financial troubles. (EDIT: and before someone corrects me, I don't care what the actual numbers are; the important points are: 1. that their size is the justification for their immunity to failure and 2. they probably do pose a significant danger to the US economic situation because of their size.)

I'm not a big fan of bailouts. Leaving aside any market-based arguments (though, if you're going to pretend to have a free market economy, you ought to either stick to it or stop being surprised when bad things happen), I think that people and groups should be allowed to fail when they screw up, and they should be held to the consequences of their actions (especially on the 'bailout' scale).

But, it seems to me, that the real problem here (or at least a symptom that's closer to the root problem) isn't the fact that the big three are in financial straits. The problem is that the economy is so dependent on just three companies, especially companies that are similar.

My suggestion, then, if taxpayers must be forced to pay for the mistakes of a greedy, myopic few: instead of bailing out the Big Three, use an equivalent amount to fund a number of different automobile start-ups, preferably some with lots of experienced auto-industry people, some with fewer (but none of the current management, though it's unlikely they would join anyway); some in Detroit and some elsewhere; companies that are willing to take sensible, forward-thinking risks, even though they may fail; and then, as those that are successful grow larger and more powerful, take the repayment and invest in other startups, wherever a cartel is found, posing a danger to the economy.

Or, here's another thought if the big three must get the money: invest an equal amount in the startup idea, and negotiate in the bankruptcy hearings to make assets (factories, equipment, etc) that would otherwise be abandoned (but still remain the property of the three!) available for a reasonable price to the startups.

Anyway, enough of that. Bailouts make me so mad I want to spit.

Tuesday, December 02, 2008

YouTube Symphony Orchestra, how cool is this?

I must share this.

YouTube and the London Symphony Orchestra are teaming up to create the YouTube Symphony Orchestra, consisting of, first, a collaborative piece, written by Tan Dun, and played by you and me, on YouTube. That's right, you download a part and record yourself playing it in time with Tan Dun's recorded conducting and then upload the video to youtube! And, second, a live performance of (some of) those who participate at Carnegie Hall.

I almost want to go buy a video camera right now.

The City Born Great - How Long 'Til Black Future Month?

The second story in N. K. Jemisin's anthology How Long 'Til Black Future Month? , "The City Born Great," is an exciting ta...