Lately we have been getting Emma into a bedtime routine. Ostensibly, this is to teach (condition?) her into going to sleep easily at night, provided the routine is observed. In actuality, she doesn’t go to sleep much more consistently than before the routine. But that’s not really what I came here to write about. Part of Emma’s bedtime routine is for daddy to read her a story. (Literacy for the win!) Tonight I tackled Horton Hears A Who, one of her two Dr. Seuss books (which are by far her longest bedtime stories). I noticed while reading the book that Dr. Seuss must have pronounced “mayor” as a one-syllable word, a homophone to “mare,” whereas I pronounce it as two syllables, rhyming with “conveyor.” I’m not sure if I pronounce it differently because I live in a different region, or because the pronunciation has shifted since the book was written in 1954, or both. (Contrary to what your grade school teachers probably tried to burn into your head, English is a constantly evolving language, and the accepted pronunciation and even meaning of words varies by region and changes over time.)
Here is an example of what I’m talking about from Horton Hears A Who:
There aren’t any Whos! And they don’t have a Mayor!
And we’re going to stop all this nonsense! So there!
And here is one more example, which is even odder to my ear:
“So, Horton, please!” pleaded that voice of the Mayor’s
“Will you stick by us Whos while we’re making repairs?”
It is weird to read because “mayor” is used for a rhyme several times in the book, and if I read it so that it doesn’t rhyme it sounds really weird. In fact, I tend to pronounce the word that is rhymed with mayor (i.e. “there”) as two syllables.
I guess I’m not really going anywhere with this, it was just something I noticed and thought I’d point out. Other than mayor/mare thing, I didn’t notice any other rhyming problems. In one place, I think “grocery” must be pronounced as a three-syllable word in order to have the intended rhythm, although I (and most people I know) typically pronounce “grocery” as something like “groshry.” Oh well, people still consider Shakespeare great poetry, even though many of his rhymes no longer rhyme, so I guess it doesn’t necessarily spell doom.
Behold! The original utterance of “That’s what she said,” from a 1992 “Wayne’s World” skit on Saturday Night Live, predating The Family Guy by seven years, and The Office by thirteen years.
That is all.
I was looking for a listing of the broadcast schedule for the Beijing Olympics that begin tonight, and I had trouble finding anything in a format that was close to what I wanted. Fortunately, as a programmer, I am used to taking existing data and manipulating it into a format that I want, with the help of a regular expression or two. The idea was to have something very compact that I could print out, that would be useful when deciding what to record on our DVR. I figured I’d share what I made.
A few notes:
Schedule is subject to change. If it does, blame NBC and China.
I used data from TeamUSA.org because it was the closest format I found to what I actually wanted. If it is wrong, blame them.
All times are correct for the east coast and most are correct for the west coast. Otherwise, I’ll quote the source data: For NBC primetime and late night, all times listed are ET/PT. NBC weekday daytime show airs at same time in all time zones. For USA, MSNBC and CNBC all time listed are ET. For Oxygen all times listed are ET/PT.
The data is sorted by air date, to make it easier to pick what to Tivo in the next 24-hours. If you’re trying to find when a certain event occurs this probably isn’t the format you want.
The data is very compressed because it was intended to be printed. Through the magic of columns and margins I got it to fit on just two pages. I wanted to make it compact, because everything I’ve found online is either a huge spreadsheet or a huge list.
I have omitted the listings for events streaming from NBCOlympics.com because this was intended to help with DVRing.
I have omitted the Telemundo listings because I don’t speak Spanish.
I have omitted the Universal HD listings because they all said “24 hour coverage.” No need to repeat that every day. (The listings for USA were almost as vague with 12-hour blocks, but they at least listed the events that would be shown.)
I’ve omitted NBC Olympics Basketball and Soccer channels because: 1) it is pretty obvious what they air; 2) I don’t know if we get them; and 3) if we do I still don’t have any desire to watch basketball or soccer.
Be sure to watch in the HDs if you can. 6.75 times more pixels FTW!
I’ve come up with a very simple solution to the problem of browser-cached CSS files. What I mean by this is: when you update the CSS which manages your website’s presentation, it will take a while before some visitors actually see those changes. The reason, of course, is that browsers (this is at least true of IE and Firefox) will cache CSS files pretty aggressively, without checking very often to see if they have been updated. Usually refreshing the page will solve this, but most visitors aren’t going to care enough to do this. Meanwhile, your site will look pretty broken to them (especially if you’ve done something like styled a list so that it looks like a horizontal toolbar instead of a bulleted list, for example).
So here’s the very simple solution. Add the following rule to your root .htaccess file:
RewriteRule ^(.*)\.[\d]\.css$ $1.css [L]
I’m assuming that you have a common include file or template or something which prints things like the page header. If so, whenever you update your CSS file (say, style.css), you update the link tag in your header to use style.0.css. This will look to the browser like it is a different file from style.css, so it will download it again. But Apache is really just loading the same CSS file through the magic of URL rewriting—you’re just ensuring that the user picks up your recent changes. You can repeat the process the next time you tweak your CSS, just change the header to style.1.css and so on.
Over the weekend—while I was back home for my brother’s wedding (some pictures will likely come soon)—I noticed that the organic milk my mom has started buying has a really long shelf life. The carton I was pouring milk from, for example, didn’t expire for well over a month. I was curious why this was the case so I did a little research and it seems that this milk has been treated with ultra-high-temperature (UHT) processing, rather than regular pasteurization. From what I’ve read on Wikipedia, it seems that UHT milk could actually sit at room temperature for months without going bad, and in Europe it’s actually sold unrefrigerated. Apparently they sell it refrigerated here because Americans wouldn’t buy unrefrigerated milk in test markets.
I couldn’t find a consensus as to why organic milk is UHT processed, though. Some people said it was because “organic cows” aren’t given antibiotics, so UHT must be used to be sure all bacteria are killed. Another said organic milk is typically shipped from further away, so they have to use UHT or it would be about to expire by the time it got to the store. I’m not sure which is the real reason and I don’t feel like doing any more research.
Anyway, I thought that was an interesting fact I’d share with the class.
A hilarious blog I discovered a few months ago is Stuff White People Like. I’ve been meaning to mention it here for a while, but a good post last week, entitled Being Offended, reminded me I needed to share. Here is an excerpt:
Naturally, white people do not get offended by statements directed at white people. ... As a rule, white people strongly prefer to get offended on behalf of other people.
Another good one is Knowing What’s Best For Poor People:
It is a poorly guarded secret that, deep down, white people believe if given money and education that all poor people would be EXACTLY like them. In fact, the only reason that poor people make the choices they do is because they have not been given the means to make the right choices and care about the right things.
Those are two of my favorites. Some other good ones to read are Study Abroad, Music Piracy, Organic Food, Hating Corporations, Religions that their parents don’t belong to, and Grammar.
And for a great cross-section of the kinds of idiots that reside on the internets, try to read some of the comments! (I say “try to” because very few people will actually succeed.)
Some astute individual has probably told you at some point that Eskimos have dozens of words for “snow,” whereas English-speaking individuals only have one.
They lie! (Warning: link goes to a PDF file.)
Also on Wikipedia.
I found this today and thought it was kind of neat. Many northeastern Indian tribes had names for each of the full moons every year. Here is a list of the named moons for 2008. First up is the Full Wolf Moon, next Tuesday.
Maybe everyone else has heard about this, but I never had so I thought I’d share. It also seems like a great idea for an elementary school teacher to have a little party for the class for each of the moons, while teaching the kids about Indian culture.
I started a list last week of completely random facts that I have learned in the last few months, for the express purpose of sharing them with you, my faithful blog readers. Without further ado..
When a pilot lands a jet on an aircraft carrier, he does not put on the brakes. In fact, he throttles his engines to full power. The is because he might not catch one of the four wires which stop the jet, in which case he must be going fast enough to immediately take off again (otherwise he’d roll off the deck into the ocean). When such an emergency take-off is required, the pilots call it “bolting.” In the briefing room, the last pilot who bolted has a mark of shame on his seat (I believe this was a red towel or red jacket or something like that). I saw this on some Discovery Channel program; I think it was an episode of “Really Big Things” about the USS George H. W. Bush.
When a woman goes to a doctor, no matter what the reason, they ask when her last period was. I learned this when I went with Stephanie to the emergency room after she fell down the stairs and nearly broke her foot. I believe she was asked the question at three different times (at check in, by a nurse, and by a doctor). I failed to see what that had to do with her foot. It was later explained that they need to know if there is any possibility that you are pregnant before they administer any drugs or take an X-ray or basically do anything.
Squirrels make noise. That’s something I found out after Punky nearly caught one. She chased it up a tree, where it turned around about ten feet from the ground and started making a noise that’s kind of hard to explain, somewhere between a high-pitched grunt and a low-pitched chirp. I’m not sure what natural predator of the squirrel might be deterred by this noise. Maybe some kind of bird? Or bats maybe?
When a flag is raised to half-mast, according to US Flag Code, it should be raised all the way to the top, and then lowered to half mast. When it is taken down, it should be raised to the top before lowering it again. I had always assumed you just raised it halfway and stopped. Also, probably the least-observed article in the flag code: “The flag should never be used for advertising purposes in any manner whatsoever.”
Now you can all feel more knowledgeable.
Something I learned today: overloaded method resolution in Java is done at compile-time, not runtime. Warning: if you have no idea what half the words in that sentence meant, then you probably don’t care about the rest of this post.
Let’s say Alice (who is in tons of hacking books for some reason) wrote this code:
public class Alice
{
public static long roundToNearestFive(long n)
{
return Math.round(n / 5.0) * 5L;
}
}
And let’s say Bob (who totally has a thing for Alice even though she says they are just friends) wrote this code:
public class Bob
{
public static void main(String[] args)
{
System.out.println(Alice.roundToNearestFive(12.7);
}
}
When Bob runs his code it will print 10, since 12.7 will be silently converted to an integer (12) to be passed into roundToNearestFive(), and 12 is closer to 10 than to 15. Bob could call roundToNearestFive( Math.round(12.7)) to fix this, but that is annoying because now he has to first round his floating-point numbers before passing them into a rounding function. So Bob asks Alice to provide a fix, and she adds a version of the function which takes a floating-point number:
public class Alice
{
public static long roundToNearestFive(long n)
{
return Math.round(n / 5.0) * 5L;
}
public static long roundToNearestFive(double d)
{
return Math.round(d / 5.0) * 5L;
}
}
She sends a new .jar file to Bob with the change, and he runs his code again, expecting it to now output 15. But it still prints 10.
The problem is that when Bob compiled his code, there was no roundToNearestFive(double) function available. So the compiler generated bytecode that looked something like Parent.roundToNearestFive( (long)12.7). So even when he runs with Alice’s new code in place, the bytecode is still forced to call the integer version of the function. The only solution for Bob is to recompile his code against the new .jar file sent from Alice.
For further reference, here is the spec for binary compatibility in Java. And here is more information about Alice and Bob.
August 23, 12:01 am
Are you sure Dr. Seuss wasn’t a Newton-Conover cheerleader? I’m thinking Mayor isn’t your problem, it’s ‘there’ and ‘repairs.’ Try saying them more like a cheerleader and I think you’ll have it down: ‘theeey-rrr’ and ‘repay-errs’ respectively.
Go raaaaaayyyy-uuudddd!
August 23, 10:32 am
Yes, I think it is equally probable that Dr. Seuss was, in fact, a cheerleader. I had not considered that possibility for some reason. :)