Wednesday, March 21, 2012

Good news

A friend was recently in the hospital with a blocked artery and had angioplasty. This is not as absurd as open heart surgery. The later, though effective and highly successful, has been described as "overhauling an engine while it's running". However, even short hospital stays are not cheap.

The thing is, he recently changed jobs. And as of a few years ago, employers have started delaying health insurance for a month or three while you start the new contract. This is pretty evil. Getting health insurance on your own is ridiculously expensive. And if there's any kind of employment gap, it's ridiculously expensive when you have essentially zero income. So when this has happened to me, i've skipped health insurance for a month here and there. I take no medications, and rarely have anything serious happen, so it seems like a good bet. I've been lucky so far. When my gall bladder exploded, i was covered. It would have been something like $6k.

Anyway, the good news is that my friend's new insurance did indeed take effect before his hospitalization.

We seriously need to decouple health insurance from employment in the USA. Employers have way too much power over employees. And, employers have been shown time and again to make use of their power in unethical ways. For example, i know people who were threatened with termination who, once terminated, must then leave the country. That's because these people were invited to work here on a work visa. It's a major hassle to sell everything you have and fly home.

The thing is, companies, especially large companies that run a cyclical business, like to hire people on "at-will" contracts so that they can dump them when business slows. In the old days, they paid these people a bonus. Not so much anymore. There are some good reasons to be a contractor. First, you have a spouse with insurance, and you go with contracts so you can opt out of it. Second, you want absurd breadth of industry experience. Third, as an "at-will" contractor, you have the option of quitting without notice or explanation when you discover that your new boss is an asshole. The sword cuts both ways. But when jobs are scarce, you tend to take what's available. And that's when it becomes clear that this whole system sucks. We need an affordable national health plan.

Tuesday, March 20, 2012

OBFUSCATED COBOL

Today, i ran into a snippet of COBOL with a bug. It was of the form

IF LONGWINDEDNAMEA = 3 OR 4
AND LONGWINDEDNAMEB(1:1) = C
MOVE...

but it should have been

IF (LONGWINDEDNAMEA = 3 OR 4)
AND LONGWINDEDNAMEB(1:1) = C
MOVE...

because AND has higher precedence than OR. So what the first example does is, uhm, what the heck? Oh. COBOL has implied subjects and implied operators. If omitted, it uses the previous subject and/or operator. The first example expands to this:

IF LONGWINDEDNAMEA = 3 OR LONGWINDEDNAMEA = 4
AND LONGWINDEDNAMEB(1:1) = C
MOVE...

so the compiler directs the computer to compute

IF LONGWINDEDNAMEA = 3 OR (LONGWINDEDNAMEA = 4
AND LONGWINDEDNAMEB(1:1) = C)
MOVE...

Which is not at all what the author wanted.

When I was a good deal younger, the incredible verbosity that is COBOL was explained away like this. The language is designed so that business managers could read it. It's hard to imagine what business manager audience COBOL was aimed at. None that i've ever met could have told the difference between COBOL that does what it looks like and obfuscated COBOL.

IMO, a large fraction of computer bugs are actively encouraged by languages that think programmers don't know how to type. Computer languages also have absurdly complex precedence tables. Who could get that right every time? Only the guys who look it up every time, or use parenthesis every time. Why not just go with left to right everywhere? 1 + 2 * 3 = 9, instead of 7 (because you need to * before +).

Now, i suppose programmers don't, by and large, know how to type. I could type 22 words per minute by the end of high school. I could type 22 words per minute by the end of college (plenty of practice, but no additional instruction). Over the next 20 years, at a keyboard for 2000+ hours a year (40,000 hours), my typing speed doubled to about 40 words per minute. But about ten years ago, i got addicted to a typing game for a couple months, and my typing speed shot up to over 70 words per minute. What a wasted 20 years. With a little instruction, i could have save huge amounts of time typing.

Wednesday, March 14, 2012

Happy Pi Day

Go ahead, have a slice of pie. It's pi (π) day (3.14 or March 14th).

Wait a minute. I get '3' as the third month. But 0.14 of a month like March (31 days) is 4. So, shouldn't π Day be March 4th?

Or, if it's just the decimal representation, and you use the digits, what about other bases. Computer people use octal. The number pi, in octal, is 3.11. So two decimal digits of π is 14/100 (100 = 10 * 10). In octal, you're looking for a number that in decimal is x/64 (64 = 8 * 8). x = 64 * (14 / 100) = 8.96, or roughly 9. But 9 (decimal) in octal is 11, which is 8 * 1 + 1. All that to say, computer nerds can claim the 11th of March as pi day too.

Why stop there? Computer people also use hexadecimal. In hexadecimal, π is 3.24 or March 24th. This is particularly handy if you missed March 14th.

And, in Europe, dates are reversed from the USA. I have no idea if anyone really celebrates π day on the 22nd of July, which is 22/7.

If that's not enough, you can at least think about Tau day. Tau (τ) is π * 2 or 6.28 or June 28th. I don't know what you'd eat, maybe 2 pies? But you can show off as a real math geek.

There you go. You are eligible to eat your π on March 4, March 11, March 14, March 24, July 22 and June 28th. That should fill your pie hole.

If all else fails, March 14th is Einstein's birthday. And he doesn't look a day over 133. If you're not into π, you could have Einstein cake. You can have your cake and eat pi two (π * 2 = τ).

Tuesday, March 06, 2012

Opposition to Mars

Mars opposition this year was March 3rd. That's when Mars, the Earth and the Sun are lined up. It's when Mars is closest to the Earth for another year and a couple months. It's not a magic date where, if you miss Mars on that day, you missed it. It's just that Mars gets closer to the Earth up to that date, then farther. It happened to be cloudy on the 3rd for me. But on March 5th, i happened to have a 60 mm (2.4 inch) diameter refracting telescope out, and though there were some hazy clouds, and got to see the orange blob at 78x magnification.

It wasn't very impressive. However, i have ready access to a 254 mm (ten inch) diameter reflecting telescope. Since this is four and a quarter times the diameter, i should be able to see details four and a quarter times smaller. But also, it collects over thirteen times more light. That means the image should be brighter, and can stand more magnification before becoming grainy. Good enough to see some surface features at a glance, such as a polar ice cap. About once every five minutes, the atmosphere is still for a split second, and lots of surface details become clear. So the views are great for the patient.

The 2003 Mars opposition was the closest Mars would be to the Earth in something like 70,000 years. That's because it took place in late August. That's the time of year when the ellipse that is the Mars orbit is closest to the Sun. Six Earth months from late August is late February. So this very early March opposition can be described as nearly the farthest Mars opposition for quite some time.

It will be worth a look. Through my astronomy clubs, i have access to larger telescopes. And so do you. One club offers a public Open House every month, and another operates an observatory that seems to be open essentially every clear night. It's highly likely that you live near such a club.