Well, managed to make it back. Due to one thing and another, didn't manage to leave the house until after midnight. Didn't get on the road until about 1:30 (had to make a last-ditch attempt to get the coveted Nickle's Donuts, since one sister had played a major role in making sure two separately-purchased bags of the things did not survive until my departure). Sat down to the computer back in MD around 7 am. Now 10 to 8, may as well stay up until the rental office is open at 9(?). Had to come back when I did due to office's unwillingness to understand that they could let me sign a lease before my roommate signed the "notice to vacate", then sign it themselves once they were satisfied that all the conditions were met.
Well, it's time for my blog to go into stasis mode again for the holidays. I will bring my laptop to my hometown, and it will no longer serve up the pages to my blog. In the meantime, I'll put it all somewhere; haven't decided whether that should be Geocities or Speakeasy. I'll try to keep posting, though that can be a bit of a pain when I'm dependent on the IP address to make this website work. I still have to use the software on my laptop to make new entries, and then I have to upload them to the temporary hosting site, where comments will simply not work.
At least I won't have two weeks of comment spam to catch up with...
I don't know how many of you have heard of Google Suggest; I think I read about it briefly on /. yesterday, but ignored it. I checked out Spolsky's blog today and he had a link to it, so I checked it out.
So I says to myself, I says, "Self, what popular search term would Google predict based on the first few characters?" I'm at work, so I can't use THE most popular search terms, so leaving that arena, I immediately thought of the "all your base" meme that so thoroughly captivated the fascinations of geeks throughout the world that it was probably the real cause of the downfall of the tech industry in 2001. "What sort of priority would Google give this important term?" I continued, adding another "...self" for a little more emphasis.
Google delivered most excellently. Go ahead, give it a try. Type "all your" in the Google Suggest field, and see what you get.
I was just reading through the EULA for Adobe Reader, and, for once, I'm glad I did. Two interesting things.
1) Afghanistan is off the list of embargoed countries. This is the first time I've noticed this on any license. Iraq, however, is not. Gotta keep this stuff out of the hands of that al-Zarqawi fellow, and probably want to make sure that Allawi guy isn't reading any PDF's, either. Serbia is still on the list, and I have no idea why. I mean, it's not exactly a big Kumbaya circle over there, but i haven't heard of the current government, such as it is, supporting terrorism or anything.
2) I just love this section:
9. Governing Law. This Agreement will be governed by and construed in accordance with the substantive laws in force: (a) in the State of California, if a license to the Software is obtained when you are in the United States, Canada, or Mexico; or (b) in Japan, if a license to the Software is obtained when you are in Japan, China, Korea, or other Southeast Asian country where all official languages are written in either an ideographic script (e.g., hanzi, kanji, or hanja), and/or other script based upon or similar in structure to an ideographic script, such as hangul or kana; or (c) Ireland, if a license to the Software is purchased when you are in any other jurisdiction not described above.
While we're at it:
I was required to bring back several lines of code from and older version of the file. Those original lines looked like this:
switch (value) {
case CONST1:
do_something_simple;
case CONST2:
do_const2_specific_thing();
{
//several lines we'll call "code x"
}
case CONST3:
do_const3_specific_thing();
{
//the same several lines -- "code x"
}
Breaks are left out for brevity, but they're there in real life. That "several lines" was about 8 lines. Well, I just couldn't abide that code duplication, but what to do? One possible answer: turn code x into a function, then just call the function in each case. But it just didn't seem like enough code to justify its own function, which creates more jumping around when a programmer has to follow the code, and possibly involves adding the function to a header file, which would require me to check out another file and edit it.
Another possibility:
switch (value) {
case CONST1:
do_something_simple;
case CONST2:
case CONST3:
if (value == CONST2)
do_const2_specific_thing();
else
do_const3_specific_thing();
{
// "code x"
}
This keeps everything localized, and it would really not be too bad. But there are two primarily aesthetic objections. 1) (somewhat practical) it involves making the same comparison twice: value gets checked against CONST2 twice. 2) it diminishes the value of the switch statement, since it now only has two branches, and half of the flow control related to the value of the switch discriminator is done with something other than the switch.
Here's what I ended up with:
switch (value) {
case CONST1:
do_something_simple;
case CONST2:
do_const2_specific_thing();
goto common_code;
case CONST3:
do_const3_specific_thing();
common_code:
{
//"code x"
}
This is about as clean as you can get. No duplication of code, no new functions, no repeated comparisons, and everything simply does exactly what it needs to do when it needs to do it. The use of goto is so unconventional (I've been writing C for a living for 3 years, and I've almost never seen it, though I did find a few hits in our software when I decided to grep for it) that it may well catch the unwary maintainer off-guard, but the target is so close to the jump call that consternation is unlikely.
If anyone thinks they have a better solution, or a good story on why even this type of goto is unacceptable, I'd love to hear it.
I have just had my first Ikea experience; I guess it wasn't really a good one. I walked out with the Allak chair, which seemed perfectly comfortable. Well, I put it together, and I found that the tilting/reclining mechanism just didn't work. Had to, sigh, go back to Ikea (forgot to pick up a gift card last night anyway) and ask about it. The person working in the area where the chair was sold was clueless; I will have to bring the now-assembled chair back.
The handle underneath, which is used both for tilting the seat and for raising and lowering it, works for the latter but not the former. But the cylindrical knob underneath (hard to reach) which adjusts the tension for the reclining portion, won't budge. My current theory is that the chair ships with the tension knob turned all the way to the full tension, "nothing will budge this" setting, and the arm which is used for locking and unlocking it is in fact unlocking it, it just doesn't look that way because the seat isn't moving.
Dammit, have to go to the "we make you bus your own trays so we don't have to create more jobs that would make our food slightly more expensive" Ikea for the third time, all for this chair.
More than a month ago I decided to suspend my practice of purging my bulk folder in Yahoo. I wanted to see just how much spam I would get in a month. Oh, don't ask why. 30 days is how long a spam stays in that folder, then it gets automatically deleted out of the back end. So assuming the rate of spam is constant, that number should eventually stabilize.
Well, on Wendesday or so, the number made its way up to something like 419. No, not THAT 419, though come to think of it, it would be a nice coincidence, except that the number pretty much fluctuates constantly. I was about ready to call it, because I was pretty sure it had been at least a month since I stopped deleting messages, but I let it wait a day. But then... the number started plummeting. I look at my folder now; I got one spam on Wednesday, and NO spam messages on Thursday or so far today.
Lycos has put out a screensaver that puts a heavy network load on known spam servers. Apparently, though this was not the intent, these screensavers have actually shut down some of those servers. I wonder if that's the cause. I also wonder if Yahoo[u.p.o.] feels so certain of the bogosity of some e-mails that it doesn't even allow some of them into the bulk folder.