Assorted random stuff.

<< current

This is where you stick random tidbits of information about yourself.

Random bit stream
Friday, October 25, 2002  
"It's not getting any smarter out there. You have to come to terms with stupdity, and make it work for you."
--Frank Zappa

10:12 AM

From the New York Times website, 10/25/2002:

Officials Say Records Show Gun Was Illegally Owned
Mr. Faraday was careful to say its copies of the M-16 were not assault weapons, since they do not have collapsible stocks, flash suppressers or a mounting to install a bayonet, some features that were ruled out by the 1994 ban. The magazine of the XM15 also holds only 10 rounds, the permissible limit set by the 1994 ban.

In addition, the rifle is only a semiautomatic, requiring a trigger pull for each shot, not fully automatic as a military rifle, which allows multiple rounds to be fired with a single pull of the trigger.

But Kristen Rand, the legislative director for the Violence Policy Center in Washington, a gun control group, said that the XM15 seized in Mr. Muhammad's car still had features that mimic an assault weapon.

"It complies with the letter of the law, but it is still an assault rifle," Ms. Rand said.

Given that the term "assault rifle" is LEGALLY defined as a rifle with flash suppressor, bayonet lug, pistol grip, etc., it is NOT an "assault rifle". The whole "assault rifle" concept has NOTHING to do with functionality, it's entirely cosmetic. "It looks like a military rifle, therefore it must be evil."

But at least Ms. Rand is honest in admitting she is pushing an agenda, even though she lies to do so...

10:10 AM

Once again the media proves that it's pushing an agenda.

They caught what they think are the killers who have been shooting random people in the Washington, DC area. On the news last night (network news, don't recall which channel) they were pushing the following (mis)information:

One of the shooters was in the military, and stationed in Washington state, where there is a sniper school. The man was not in the sniper school, he was a mechanic.

The rifle used was a .223 Remington caliber. This caliber was a modification of the .222 Remington, made by Eugene Stoner, developer of the AR-15 series rifle. The .223 had a slightly larger case, which allowed it to fire slightly heavier bullets, and a shorter neck, which worked better in a semiautomatic rifle than the long necked .222 Remington. Both cartridges fall into the category of varmit cartridges, suitible for game such as prarie dogs and cyotes. In many states it's illegal to hunt deer with the .223, and in the others it's the minimum acceptable caliber (and you'd better be really accurate, because there is no range for error). The military was very heistant about it's adoption, in part because of the short range of the .223 (only 300 yards--see post of 3/28/2002 for more info on the adoption of the M-16). All military and most police sniper rifles are in .308 Remington, a far more powerful and long range cartridge. So, since the .223 Remington is a marginal cartridge as far as power is concerned, why do they keep harping on the "high powered rifle" bit?

The rifle used was a Bushmaster XM-15, a semiautomatic rifle. Never mind that he only ever fired one shot at a time.

The rifle in question shoots a bullet that travels "a mile and a half a second". So how the hell do you get a mile and a half a second from 3050 to 3200 feet per second, which is what a .223 is actually capable of? No smallbore rifle I've ever encountered (and believe me, I've encountered a bunch) has been capable of propelling a bullet over 4500 f/s, and that requires a load hot enough to literally burn some of the rifling out of the barrel in less than a thousand rounds.

Blatantly wrong facts, focus on trivial and unrelated details, and deliberate use of misleading, high emotional context phrases. If the media is the watchdog of the free state, then where is the media's watcher?

9:39 AM

Wednesday, October 23, 2002  
To restate:

"Never attribute to malice that which can be adequately explained by stupidity." --Hanlon's Razor

But some days you really have to wonder just how far stupid coincedences go--was an act just serendipitous stupidity (if you'll allow for such a thing) or a subtle and devious conspiracy? A case in point...

The ANSI standard for the C language includes a handy function called "assert(int expression)". Its purpose is to stop the program and invoke the debugger if the given expression evaluates to a logical false condition (signified by a value of 0). So, the statement "assert(0);" will throw an exception that the debugger will catch and let you examine the program at that point. This is quite handy for debugging, because you can use assert statements to verify all your assumptions, and the debugger will immediately inform you if one of your assumptions is incorrect. It is not uncommon to use an assert to, for example, verify that a file was successfully opened, and then, if the file was not opened successfully, handle the error condition gracefully. The reason for the assert is to notify the programmer that the file was not opened, so it can be determined if the file was not opened because the filename was incorrectly assembled (which would be a program bug) or because the given directory did not exist (a runtime error that should be handled by the code, not a bug). Since you don't want assertions firing in cases like this in your release code, the "assert(int x)" function is actually a macro that is defined as nothing in release mode. All this is fine and good.

Now enter Microsoft. Since the compiler and debugger are closely tied to each other, they are written by the same group. Since invoking the debugger is very dependent on the debugging environment, the actualy implementation of "assert(int x)" is entirely up to the compiler/debugger authors. Therefore, you'd expect an assert in Visual C/C++ to pop up the Visual Studio debugger and stop at the given line. And it does. But here's where the line between malice and stupidity blurs...

Microsoft has ANOTHER version of the assert command, called "ASSERT(int x)". It works exactly the same as "assert(int x)", it's just all caps, and, C/C++ being case sensitive, that makes it a different function as far as the compiler is concerned. The big difference is that "assert(int x)" is an ANSI standard library call, whereas "ASSERT(int x)" is a Microsoft only call. All of Microsoft's sample code, the MFC source code, etc., is all written using ASSERT rather than assert, and to keep things looking neat, programmers tend to get in the habit of using ASSERT because it's what's already there.

So now you have some code written using Visual Studio, and you want to port it to a different OS. Everything is portable except the ASSERT function, but since it's the same as assert, the obvious solution is to make ASSERT become assert by doing the following:

#ifndef _WINDOWS
/* only for non-Windows code, otherwise Visual C/C++ will complain about duplicate definitions of ASSERT */
#define ASSERT(x) assert(x)

That should make all the ASSERTs into asserts, right? But think again...doing this actually results in a very slippery little Heisenbug. Consider the following:

#define A B
#define B C

What happens when the preprocessor works on that? Since only a single pass is made, only one substitution can occurr, so the output is:


and not


as would be the result of multiple passes. This is actually a good thing, since it is entirely possible to do:

#define A B
#define B A

which, in a single pass model, swap A and B in the code, and in a multipass model will result in a crash due to infinite recursion. Now remember I said that assert(x) is actually a macro that is defined as nothing in release mode? Then here's what we have in release mode:

/* assert.h defines assert(x) as nothing) */
#define assert(x)

/* we try to port code written with Microsoft's bastard ASSERT macro */
#define ASSERT(x) assert(x)

ASSERT(2 + 2 == 5);

Which, after preprocessing becomes:

assert(2 + 2 == 5);

But, since assert is supposed to be removed by the preprocessor, IT STILL FUNCTIONS IN RELEASE MODE! The only problem is that, since it's release mode code THERE'S NO DEBUGGER TO CATCH THE EXCEPTION! Since the debugger doesn't catch the exception, it falls back to the default behavior for that type of exception, which is a call to abort(), which TERMINATES THE PROGRAM!

Of course, all this goes away once you compile in debug mode--the debugger catches the exception, halts at the assert, and you can continue on. The error handling code does what it's supposed to, so you try again in release mode and IT DIES AGAIN!

So is this really attributable to mere stupidity? Or is it a carefully crafted scenario designed to cause subtle, nearly untraceable crashes in ported code that ran fine under Windows? I propose a corollary to Hanlon's Razor:

"The odds of an act being malicious are directly proportional to the profit of the act to the actor."

And by that corollary, I think there's some devious bastard working for Microsoft who saw a perfect opportunity to sabotage attempts to port Windows code to other platforms.

2:32 PM

Tuesday, October 22, 2002  

"Labor Unions Among Top Donors in U.S. Politics

WASHINGTON (Reuters) - Six of the 10 biggest donors in U.S. politics are labor unions, and they give largely to Democrats, a nonpartisan research group said on Tuesday.

The top 100 donors have given over $1 billion to U.S. political parties and federal candidates since 1989, and Democrats got 60 percent of it because of the generosity of labor unions on the list, said a new report by the Center for Responsive Politics, which tracks money in politics.

The biggest single donor was the public service and health care union known as the American Federation of State, County & Municipal Employees. It made nearly $30.7 million in contributions since the center began systematically tracking contributions, the report said.

Five other labor unions, and three professional associations representing real estate agents, trial lawyers, and doctors, took nine of the top 10 slots on the list of big donors.

Only one corporation, tobacco giant Philip Morris, made the top 10, with contributions of $18.6 million. Three-fourths of that money went to Republicans.

Of the 100 top donors, 51 were corporations; 27 were labor unions; 17 were trade and professional associations, and five were categorized as "ideological" or single-issue groups such as the National Rifle Association. It was ranked as the 22nd biggest donor and gave 82 percent of its dollars to Republicans.

By industry, the U.S. financial sector had the deepest pockets, with banks, insurance (news - web sites) companies and accountants making $226,749,297 in donations since 1989, the center said. As a sector they gave 58 percent of their donations to Republicans.

But the financial world total trailed the $345,730,591 in contributions from labor unions as a group over the same time period -- a whopping 94 percent of which went to Democrats, the report said.

In addition to AFSCME, the other unions in the top 10 were the National Education Association, a teachers' union; the Teamsters Union; the International Brotherhood of Electrical Workers; the Service Employees International Union, and the Communications Workers of America.

Although he ran only one federal campaign during the period surveyed, President Bush (news - web sites) ranked second on the top recipient list, garnering $3.2 million.

Top recipient was the House Democratic leader, Rep. Richard Gephardt of Missouri, who received $3.8 million since 1989, and is serving in his seventh term since that time. "

Now, given that, how about this, taken from Reuters later the same day:

"He [Gephardt] added, "If Republicans win control of Congress, they will enact the special-interest agenda, not the people's agenda.""

Yep, can't trust those lackeys of the special interest groups. Evil groups like the NRA spend unheard of amounts of money on those Republicans while the poor Democrats scrape by with nothing, all in the name of staying free from special interest ties...

5:04 PM

This page is powered by Blogger.