Wednesday, December 17, 2008

Mesquite rip-offs

There are several casinos with associated hotels in Mesquite, Nevada.

Some of them advertise rooms "from $24.99" on billboards and signs at the casinos.

However, the rooms go for anywhere from $34.99 to $54.99 if you just walk-in.

Apparently you have to have made a phone reservation to get the lowest price. So, why advertise the lowest price right at the door?

We said the words "false advertising" and the clerk responded that the word "from" on the billboards makes it not false. Yeah right.

There were almost no cars in the parking lots on Monday night when we stopped there. Maybe it's the economy. Maybe it's shady business practices. We certainly don't believe in the truthfulness of these establishments and will not frequent them.

We ended up staying at a very nice Best Western there for $62. Yes, we will pay more to avoid doing business with liars.

Monday, December 8, 2008

Y2K38

This is a follow-up to the post on "Powers of two".

Readers of that post may recall that using 32 bits, there are exactly 4,294,967,296 possible patterns or codes. That's quite a lot to expect a reader to remember. But perhaps the reader will remember the rule of thumb, and recall that 32 bits is about 4 billion patterns.

It happens that in Linux systems, such as the one I use to write and publish my own little web applications, a 32 bit number is used to store the current date and time. The possible bit patterns are used to indicate the number of seconds after midnight, January 1, 1970 GMT (Greenwich Mean Time). This is an approximation (see Unix time for the gory detail).

Here is a table showing just a very few of the possible bit patterns (grouped by four for readability). I have placed the bit patterns in a particular order, which is a lot like an automobile odometer, with each wheel working its way up from 0 to 1 and around again.

The first column shows the bit pattern, and the second column shows the decimal number that is generally assigned to that bit pattern.

0000 0000 0000 0000 0000 0000 0000 0000 0
0000 0000 0000 0000 0000 0000 0000 0001 1
0000 0000 0000 0000 0000 0000 0000 0010 2
0000 0000 0000 0000 0000 0000 0000 0011 3
0000 0000 0000 0000 0000 0000 0000 0100 4
...
0000 0001 1101 0111 1111 1001 0000 0000 30931200
...
0011 1011 1001 1101 1111 1001 1010 0000 1000208800
...
0100 1001 0011 1101 1100 0001 0010 1001 1228792105
...
0111 1111 1111 1111 1111 1111 1111 1101 2147483645
0111 1111 1111 1111 1111 1111 1111 1110 2147483646
0111 1111 1111 1111 1111 1111 1111 1111 2147483647
1000 0000 0000 0000 0000 0000 0000 0000 -2147483648
1000 0000 0000 0000 0000 0000 0000 0001 -2147483647
1000 0000 0000 0000 0000 0000 0000 0010 -2147483646
1000 0000 0000 0000 0000 0000 0000 0011 -2147483645
...
1111 1111 1111 1111 1111 1111 1111 1110 -2
1111 1111 1111 1111 1111 1111 1111 1111 -1

If you click on the link for one of the bit patterns, you will be using one of my little web applications to tell you what that bit pattern means as a date and time on my Linux server. Since the server is located in Texas, the time will be in CST (Central Standard Time).

The very first link is the moment at which the Unix epoch begins. The next particular times that I have chosen to list are, in order: 1 through 4 seconds after the start of the Unix epoch; the start of Christmas Day in London in 1970; a moment that has had a big impact on our country; a moment that came and went while I was writing this post; and the final three seconds of the Linux clock.

After that, things go wrong. The usual interpretation of the bit pattern as a number goes negative. This happens because the usual interpretation of a bit-pattern-as-number is done with Two's Complement rules.

And at that point, many programs will stop working as expected. This is known as the "Unix Millenium bug" or "Y2K38".

If you just look at the bit patterns, you'll see that the problem happens right when the odometer rolls over to put a one in the left-most position (making it negative Two's Complement rules). My program stops counting forward at that point and jumps to 1901.

Of course, my program will not likely still be available by 2038! Even if I have continued to pay the lease payments, and that I have lived well into my 80's, it is likely that the system will have been updated to fix the problem by then.

This is nothing for anyone to lose any sleep over. I had to post it to get it out of my head. Other articles about this are one by Ansari and Patil and another by Unnikrishnan, both published in May, 2005.

"An X-treme Proposal"

This is a postscript to my earlier comments on political correctness.

The title of this post is a quote, since it exactly matches the title of a Boston Globe article published January 5, 2003*.

I assume no one has taken this proposal and ran with it, since it was made nearly six years ago, and I've never seen it in action, nor does a web search turn up any application of it.

In a nutshell, it addresses the problem of how to refer to a non-specific person without resorting the the sexist "he", "him", and "his". Personally, in spite of that disability that makes it difficult for me to be politically correct, I tend to use "she" for one non-specific person and "he" for the next one to appear in a dialog, and so forth. Ladies first**.

The proposal coins three new words: "xe", "xem", and "xers" (pronounced "zee", "zem", and "zayrs") to be used instead of "he/she", "him/her", and "his/hers", respectively.

The usage that seems to be gaining ground is to use "they", "them", and "theirs" for a non-specific person. Interesting, that if you pronounce these words with a mild French accent, you get something like "zey", "zem", and "zayrs".

Mostly, when I have occasion to write about non-specific persons, it is a technical document, so I'll tend to write it up like this:

When the system administrator receives such a request she will go to the user management page, enter the user identifier, and click "Search". The necessary information will then appear on her screen. She'll read this off to the user and ask him if he understands. If not, she will go on to the next step.
This does double duty. Not only are "her" and "him" given equal time, but by carefully choosing, I can even have "her" being superior to "him". Isn't that the ultimate in political correctness? Or have I misunderstood the intent?

*The Boston Globe wants $2.95 to let you read the article, even though it is now hardly news. You can get the first few lines here. Or, if you google the title you can find a site or two who copied it verbatim (thus violating copyright--but the sites are not in the U.S.A.).

**That reminds me of an awkward experience that I had a few years ago on the WordPerfect technology park. As I was leaving the cafeteria, I held the door open for a woman who was right behind me. She snapped at me that she was perfectly capable of opening the door for herself. Ouch. Okay, so ladies first; obnoxious women can take care of themselves.

Friday, December 5, 2008

Stubborn Elevators

You get in the elevator and press P3 to go to parking level 3. Then you remember, wait, I'm on level 4, so you press P4. But the elevator still stops on level 3. Why isn't there a way to tell the elevator that you changed your mind?

Or you press the button to call for the elevator to go up when you really want to go down. So, an elevator full of people going up stops and opens its door and lets those people have a look at you while you wait for an elevator that is going down. Why isn't there a way to tell the elevator that you changed your mind?

No big deal, except that it causes a few people a minor annoyance once in awhile. Multiply this by the number of elevators in the world, though, and you have a huge cost in annoyance because there is no way to tell an elevator that you have changed your mind.

I believe that what I have described is true of all elevators. Correct me if I'm wrong.

The elevators that I have to deal with every day are stubborn in another way that I've not seen before. If you've called for an elevator to go down and one stops that is going up, chances are you'll climb aboard. You then press the button of a lower floor and it won't take it. The light won't come on at all. You have to wait until it has gone up to the highest floor it has decided it is going to go to, and then press the button for the (now much) lower floor. Who designs the software that controls "my" elevators? Will you please explain, what were you thinking?

Tuesday, December 2, 2008

Political Correctness Impaired

For well over ten years I have had a sign in my office (actually a "cube") which makes this polite request, "Please be patient with me: I am Political Correctness Impaired."



It was initially intended as a self-referential joke. As a joke, it was a member of a family of jokes that was popular at that time, such as saying "folically challenged" for a bald man (such as myself). These sayings were not seriously intended to be politically correct, but had a similar form and were poking fun at the advocates. Being self-referential, it was calling upon advocates of political correctness to exercise the compassion due to one who had a particular handicap (oops, I mean "disability", sorry--see what I mean?): not being able to go along with their program.


Over time, I have begun to wonder if the sign isn't actually true of me. Part of this comes naturally, from my generation--educated before the days of political correctness. Part of it may be simply that I am a member of so many of the majorities that political correctness advocates consider unduly privileged.


Maybe I will post more examples of my thoughts on this subject, but for now, I'll just mention one. I grew up in a country deeply divided by two official languages (and two unofficial cultures). In western Canada we spoke English, yet I spent about ten years mostly speaking French, starting just after high school. This included seven years actually living in France and French-speaking Switzerland and visits to French-speaking Belgium (two other countries divided by official languages).


Many years later I heard of an incident in Alberta, Canada which changed my opinion of language issues, and considerably deadened my sympathies for the (locally) disadvantaged French speakers in western Canada. The French speaking minority in northern Alberta had formed a private school where their children could be educated in their native language. An English-speaking family had petitioned the school to allow their children to attend so that they could learn French. The school denied permission, explaining that the school was only open to children from ethnic groups that had traditionally spoken French through generations.


It's hard for me to understand exactly what this minority group in Canada really wants. Apparently they don't want any converts. What they have obtained is for the government to make every service available in both French and English. For, example, I once made a border crossing from the U.S.A. into western Canada speaking only French to the official.


Oddly, this bilingualism includes stop signs, which feature the French word "arrêt" as well as the English "stop". Or is it English? When I lived in France (and the other French-speaking countries), all of the stop signs only said "stop" (but generally didn't have the octagonal shape--see the image from Tonga).


As is generally the case when political correctness bears sway, the situation is asymmetric: The stop signs in non-French-speaking Canada are bilingual, but apparently in Quebec (French-speaking Canada) they are not (judging by this image). Hmm.