code snippets

It took _way_ too much effort to get those blobs of code to display properly. Even inside PRE and CODE tags, WordPress was mangling stuff. I downloaded “David House’s grabcode plugin”:http://xmouse.ithium.net/archives/2004/07/19/implementing-a-code-snippet-system, but then I had to play with my CSS to get the results to look acceptable (and they’re still wrong in the RSS feeds, but I give up for now).

It’s done now, and the _next_ time will be easy :-)

posted at 9:56 am on Thursday, September 30, 2004 in Programming, Site News | Comments Off on code snippets

WordPress and HTTP Conditional GET

I was looking at my logs, because I was seeing a lot of traffic on my XML feeds. Clichéd, perhaps, after the Microsoft debacle :-). I was looking because my RSS2 feed had risen to the top of the daily traffic statistics.

I did notice that many aggregators still aren’t using Conditional GET, and that some others don’t support gzip. But that wasn’t it… Instead, a full 25% of hits resulted in HTTP Code 302 (not modified), and yet were _also_ transferring the full RSS feed (sometimes compressed, sometimes not). Digging in the code, I found (in the Conditional GET logic in wp-blog-header.php):

I moved the exit to the right place, and now all my Conditional GET clients are downloading 0 bytes :-). Here’s the fixed version:


posted at 8:58 am on Thursday, September 30, 2004 in Programming, Site News | Comments (4)
  1. Reid says:

    I use “wget” to download my RSS feeds onto tnir to produce my news.tnir.org page. Now wget has an option, “-N, --timestamping that tells it ” don’t re-retrieve files unless newer than local”. However, I also use another option, “--output-file=FILE” because I don’t want 200 files named “index.html“. When you use that option, it turns off the time-stamping feature. Bleaugh.

    I downloaded the code to see if I could fix it, but it turns out that the code is structured in such a way that redirecting the output is a major fork in the code path. *sigh. Maybe one day I’ll get around to it..

  2. Reid says:

    Whoah, some of my HTML leaked through there. The comments info says bold tags are allowed, and I certainly did not type any “del” tags..

  3. Harald says:

    Apparently Textile is processing comments, too; text surrounded by “-” is marked with del tags, and text surrounded by + is marked with ins tags.

    Seems to be haphazard though, esp. since it appears that textile is adding tags, and then the HTML sanitizer is stripping (some of) them out…

  4. Hi Harald,

    just stumbled about your blog and found a nasty bug there:
    You got a self signed SSL cert for some parts of your blog, if a user doesn’t accept the self signed cert, your blog layout breaks away completely.

    Grettings from Berlin/Germany

traffic

There was a “major accident on the 401”:http://www.cbc.ca/story/canada/national/2004/09/29/hwy_crash040929.html this morning. Two trucks collided, and one caught fire. The cleanup closed the express lanes in both direction through Yonge Street during the morning rush hour; traffic was backed up all over the city as a result. (The westbound collectors are under construction through that section, so the highway went from 5 lanes to only 1 through that stretch, if I remember correctly). Worse, the fire damaged the roadbed in the westbound lanes, which means it’ll be a while before they can re-open them. I suppose it’s possible that the fire damaged the underlying bridge structure, in which case we’re completely hosed…

Anyway, I don’t drive the 401 (although I cross over it every day; that was a bizarre sight). However, there was a huge traffic backup across the bottom of the city this morning too; the Gardiner Expressway / DVP were stop and go from about Gerrard all the way across to _Islington_. Apparently our traffic network is so overloaded that a 401 closure causes backups on the other side of the city…

posted at 11:48 am on Wednesday, September 29, 2004 in Current Events, Personal | Comments (2)
  1. Reid says:

    So, what route do you take to work? Where is work? Downtown? So you zip down the DVP to.. Richmond? Or do you take the Gardiner across to Jarvis or Spadina or something?

    Inquiring minds want to know! Oh but wait, then terrorists would know your route and you would be targetted for sure!

  2. Harald says:

    I go south on Don Mills to the DVP, then south to the Gardiner, across the bottom of the city where I get off at the Spadina/Lakeshore exit. I take Lakeshore across to Strachan, where I park. Pretty straightforward …

    In the summertime, when traffic is light, I’ll usually get on the DVP at Lawrence instead; saves a few minutes (and avoids several annoying traffic lights). In winter, when traffic is heavier, there’s no point because the DVP is too slow.

dumb crawlers

I wonder who is teaching people that it is acceptable to download the entire content of a website, as fast as possible, and then come back and do it again the next day (and the next)…

larbin has been added to the list of blocked robots. Buh-bye!

posted at 9:19 am on Tuesday, September 28, 2004 in Site News | Comments Off on dumb crawlers

luddites beware?

Avoiding technology has it’s drawbacks:

Hurricane JEANNE

bq. WE ARE REMINDED THAT FROM SUNDOWN TONIGHT UNTIL SUNDOWN SATURDAY IS YOM KIPPUR…A SOLEMN JEWISH HOLIDAY. SOME OF YOUR JEWISH NEIGHBORS IN THE WATCH AND WARNING AREAS OBSERVING YOM KIPPUR WILL NOT BE LISTENING TO RADIOS OR WATCHING TV…AND MAY NOT BE AWARE OF THE HURRICANE SITUATION.

Jewish law does say that personal safety is more important than religious observance. So, for example, it should be ok to drive one’s car in order to evacuate from the hurricane watch zone. But the question remains: how many people will miss the warnings? Current predictions have the storm making landfall in Florida before sunset tomorrow…

Stay safe, everyone.

posted at 9:59 pm on Friday, September 24, 2004 in Current Events | Comments Off on luddites beware?

reading

My son has a homework assignment. He has to read, for at least 20 minutes a day, with an adult supervising him. Which means that I get to read for the same amount of time! Yay; I’m finally starting to catch up on a way-too-tall pile of unread books…

posted at 9:22 pm on Monday, September 20, 2004 in Personal | Comments (1)
  1. Greg Wilson says:

    Kewl — will you supervise me, too? ;-)

catching up?

I’m down to only 54 unread items in SharpReader…

Explanation: I leave things “unread” until I have a chance to do something with them; add to del.icio.us or bookmark4u; blog; e-mail to friends; read in depth; whatever’s required. Things tend to come in faster than I can deal with them at times, so I’ve been discarding stuff in the “interesting, but I’ll never have time to read it” category…

posted at 8:48 pm on Monday, September 20, 2004 in Personal | Comments (2)
  1. Reid says:

    Hey, I just found out about del.icio.us today; how long have you known about it, hm?

  2. Harald says:

    A month or so, I guess… I’m not using it aggressively yet.

outsourcing quote

The commentary is the usual, but I loved Mr. Greenspun’s way of phrasing it:

bq. American labor is wonderful but it is a luxury that most American families can’t afford

(from Philip Greenspun’s Weblog:)

posted at 12:07 pm on Monday, September 20, 2004 in Current Events, Links | Comments Off on outsourcing quote

Ivan

I’ve been paying a lot more attention to Hurricanes all of a sudden. I could claim it’s because of the upcoming Kitefest (we were worried about getting rained out, but it seems Ivan is going to stall in the Appalachians and leave us alone), but I think it’s simple fascination.

But for some reason, I’ve got a Tragically Hip song stuck in my head…

posted at 9:08 pm on Wednesday, September 15, 2004 in Current Events, Personal | Comments Off on Ivan

Homework

My son has spent 5 hours in the last two nights doing about an hour’s worth of homework. It’s not because he’s struggling with the material, it’s because it seems he can’t pay attention to it for more than 5 seconds at a time. Argh!

I hope the whole year isn’t going to be like this…

posted at 9:06 pm on Wednesday, September 15, 2004 in Personal | Comments (1)
  1. David Brake says:

    I have spent a whole summer in that mode – it isn’t necessarily something that just happens to the young…

it’s the most wonderful time of the year

Back to school, although today was just a two hour “meet the teachers” session. Both kids and adults had lots of fun reacquainting after the summer break.

Lots of people we talked to had hurricane experiences, either Frances or Charlie. We got off easy compared to some :).

posted at 5:41 pm on Tuesday, September 07, 2004 in Personal | Comments Off on it’s the most wonderful time of the year

a comparison

Mission Space was a much better ride than Frances …

posted at 10:14 am on Tuesday, September 07, 2004 in Personal | Comments Off on a comparison

false security?

That’s the first time _ever_ I’ve had to remove my belt to get through the airport security checkpoint. My wife had to take her shoes off!

Keep in mind, when reading this, that I have travelled in Europe during their anti-terrorism crackdowns; there’s no comparison. The United States is more interested in the appearance of security. For example, I watched two separate TSA agents walk into the bathroom, look at an “abandoned” suitcase sitting there, and walk out again…

Anyway, we’re home, safe and sound. It’s too bad we didn’t get to see the VAB _before_ Frances punched great big holes in it…

posted at 9:19 am on Tuesday, September 07, 2004 in Current Events, Personal | Comments (4)
  1. David Brake says:

    Yeah that happened to me too back in September in the US – seemed stupid to me then too. Better hope suicide bombers don’t stick dynamite up their asses!

    Glad you made it back safely…

    VAB?

  2. Jeff K says:

    VAB = Vehicle Assembly Building. Gee, this is the first I heard of it, but intrigued, I found a lot of news, rocket displays are down etc.:
    http://earthobservatory.nasa.gov/Newsroom/NasaNews/2004/2004090717559.html

  3. Harald says:

    Wow. About 100 yards from that rocket was the KSC “Hurricane Status” sign that we all posed in front of on our way out (they kicked us out of the visitor center early, and were sandbagging the doors behind us :-).

  4. Debbie says:

    I’ve never heard of belts having to be taken off before. Was the security guard female? ;-)

wind, and wind, and wind…

The north eyewall (what’s left of it) is less than 40 miles south of us, according to Channel 13’s spiffy doppler radar. The storm has lost quite a bit of strength; it’s impressive out there, but no flying alligators yet!

The big hassle with this storm is its size; we’ve been under it for over 18 hours now, and it’ll be at least another 18 before it calms down enough for emergency crews to start opening everything up again. Fortunately we have power, and Footloose is on VH1 right now :-)

posted at 12:40 pm on Sunday, September 05, 2004 in Current Events, Personal | Comments Off on wind, and wind, and wind…

everyone knows it’s windy

So I’m staring out the window at rain falling at 45° and the trees starting to lean over… Part of me wishes Frances would just _get_ here already; the suspense is wearing. It was supposed to arrive Friday, then Saturday, now Sunday early morning.

Our hotel is open, and packed with people who have fled their homes, both from Orlando and farther east. We still have power; we’ll see how long it lasts, as they’re predicting that most of Florida will be darkened by this storm. The hotel is currently planning a curfew at 10PM tonight, until at least 10AM tomorrow. But the storm has stalled, so I’m not sure if they’ll change those times.

On the plus side, the storm track has moved; we’re no longer centered in her sights :). The hurricane is predicted to move across Florida and keep going west. That means that there is _some_ chance that our airplane will actually leave Toronto on Monday, so that we can go home again!

posted at 4:05 pm on Saturday, September 04, 2004 in Current Events, Personal | Comments (1)
  1. David Brake says:

    Yikes! Try to stay out of the news. Send digital photos if you see any flying alligators though ;-)

Internet Explorer image caching revisited

A few days ago “I complained about Internet Explorer”:http://blog.cfrq.net/chk/archives/2004/08/21/argh-msie-and-bandwidth/

Google searching leads me to believe that MSIE doesn’t send If-Modified-Since: headers for images (and possibly other files, like CSS); instead, it expects to see an Expires: header in the HTTP response (It will also apparently listen to Cache-Control: headers). The beauty of standards is that there are so many to choose from…

More Googling led me to the following configuration directives for Apache:

   ExpiresActive On
   ExpiresByType image/gif "access plus 1 week"
   ExpiresByType image/jpeg "access plus 1 week"
   ExpiresByType image/png "access plus 1 week"

(It’s possible that image/* will work; I haven’t tried it).

I hope this helps someone else; I hope it helps me remeber next time :-)

posted at 10:50 am on Thursday, August 26, 2004 in Site News | Comments Off on Internet Explorer image caching revisited

Defense in Depth

I’ve visited lots of old fortresses in Canada, and a few in Europe, and I remember learning about defense in depth. This is the idea that your assets should be surrounded by multiple separate layers of defenses to make it harder for the barbarian hordes (or Americans :-) to break in. Ideally the defenses should be _different_, so that if a simple technique of defeating one is discovered, it doesn’t help against the others.

The forts I’ve visited are typically on a hill (so that you can see the enemy coming and prepare. But they’re also sunk into the hill, with sloping outer walls, to defend the inner walls against artillery. They’re surrounded by open fields (no trees or brush). The outer wall has gun emplacements, to mow down anyone trying to cross those fields. There is a deep trench between the inner and outer walls, deep enough that attackers must climb down, slowing them down. The inner walls are full of small, narrow windows to allow the defenders to shoot at anyone trying to cross the trench. The inner walls usually have towers that project into the trench, so that people trying to climb the inner walls aren’t hidden from defenders inside the walls; those attackers can be attacked from the towers. The important buildings inside the inner walls have their own defenses. And so on.

Of course, a few carefully placed shells from a battleship and the fort is history; but that’s progress for you.

Anyway, to make a long story short, here’s Robert Scoble’s “defense in depth strategy for Windows XP”:http://radio.weblogs.com/0001011/2004/08/22.html#a8128 – enjoy!

posted at 7:11 pm on Tuesday, August 24, 2004 in Security | Comments Off on Defense in Depth

RSS overload

I haven’t even gone on vacation yet, and I already have almost 1000 unread items in my RSS reader. This feels just like the early days of the death of Usenet, when there was simply too much to read (and the signal to noise ratio was dropping with every new message, but that’s another rant).

I just dropped about a dozen feeds; mainly mainstream stuff like Engadget and Gizmodo and a few news sources. They were interesting, but ultimately too much work to read. (Since when did reading blogs become _work_, anyway?). The _really_ interesting stuff gets forwarded to me by other people, or referenced in other weblogs, so I usually see it anyway.

That takes me down to 500 unreads… maybe I’ll drop the cesspool that is /. while I’m at it :-)

posted at 9:21 pm on Monday, August 23, 2004 in Personal | Comments (1)
  1. David Brake says:

    Unlike usenet you can have a little more fine-grained control since a good number of your RSS items will be from individual people whose content you trust to be occaisionally interesting at least. You could always set up an RSS feed that only gave you /. items matching a given search term (using google alert for example?)

Argh; MSIE and bandwidth

It appears that if you set the Cache settings in IE to “Automatically” or “Every visit to the page”, then every time you visit a page at blog.cfrq.net IE fetches all page objects (page, CSS, favicon, embedded images). For some of them, it is sending the If-Modified-Since: header (I see 304 responses for the blog CSS, for example), but it does not seem to be sending If-Modified-Since: for the banner JPEGs. This means that MSIE visitors download the banners several times in a row as they browse the site. This not only wastes my bandwidth, but it also interferes with their experience, since they have to wait for the banner to download on every page visit.

I’ve noticed IE doing this before on the client side with image intense applications (like MovableType :-), but I hadn’t investigated until recently, when a small increase in visitors to my blog site _doubled_ the bandwidth used…

Is this a known IE bug? Is there anything I can do on the server side to work around it? The investigation continues…

posted at 8:44 am on Saturday, August 21, 2004 in Rants, Site News | Comments (2)
  1. Reid says:

    You could conditionally use a low-res substitute for IE users..

  2. Harald says:

    An excellent suggestion, and trivial to implement. Since WordPress already shoves a bunch of rewrite rules into a .htaccess file, it is trivial to add another one to conditionally rewrite the .jpg URLs for MSIE users. I’ve compressed the JPEGs to about 20% of their original size. The quality suffers, but less than I expected it would…

looming energy crisis?

These days it is stories like these that keep me awake at night.

* “China – An Energy Timebomb?”:http://alt-e.blogspot.com/2004/08/china-energy-timebomb.html
* “Basic Choices and Constraints on Long−Term Energy Supplies”:http://www.aip.org/pt/vol-57/iss-7/p47.html

Basically: We’ll run out of oil in my lifetime; long before that, it will be expensive, and then rationed. Alternative sources simply can’t fill the gap; we do not have the capability to replace just our electricity needs with renewable energy, never mind our other energy needs. Even if North America switched to nuclear power, we’d run out of fuel in 35-58 years, a mere band-aid for the problem.

Meanwhile, SUVs are the fastest growing market segment in China, and GM is actively marketing them.

I haven’t the faintest idea what we’re going to do about this looming crisis; I do know that our current technique (hiding our heads in the sand) isn’t going to cut it.

posted at 6:38 pm on Friday, August 20, 2004 in Current Events, Science and Technology | Comments (5)
  1. Greg Wilson says:

    When OPEC turned the screws in the 70s, the market responded very quickly. Within five years, German and Japanese compact cars had made significant inroads into the American market, American manufacturers were downsizing their vehicles (as well as their plants) in response, and energy-efficient appliances were coming onto the market. As energy becomes more expensive over the next 20 years, I expect the same market forces will have the same effect. The real question is whether any of our elected leaders will be forward-looking enough to push us that way ahead of the rest of the planet, so that we can sell to them the way the Germans and Japanese sold to us 25 years ago. Reducing income taxes, while increasing sales tax on both fuel and fuel-inefficient machinery (factories and cars in particular) would be a revenue-neutral way to do it…

  2. Jeff K says:

    “Forward-looking” “elected leaders”? Hell, I hope you like horses!

  3. Harry Neff says:

    One statement and 3 responses to this crisis…. That should show us the real apathy around this country on the subject…. When we’re out of reserves, fule is $8+ per gallon and we’re all buying/riding horses or bicycles, maybe the collective will wake up.
    My grandchildren (now 1 – 7) will be left to solve this, I’m afraid.

  4. Jeff K says:

    I think even saying it is our grandchildren may be optimistic. I’ve read a number of books on the subject, and they all think that military might will protect the oil reserves for the western world. Unfortunately, might is not always right, *money* often trumps, and if China needs fuel to produce goods for the rest of the world, a worthy task, the people paying for the goods coming from China will be driving up their own fuel costs. My guess is that it would be less than 20 years before we’re making serious choices in the west to our personal transportation in order to keep the economy running efficiently because production is in Asia, not here. I’ve met people who said 3 years ago they couldn’t pay $1/L for gas. I often pay close to $1/L now for 94 octane gas… For some people then, the future is *now* (although, I’ve noticed these same people still buy the gas)

    Anyway, there is risk to any planning. I think the plan should be to estimate the cost and time to electrify suburban & inter-city rail, build the nuclear power-plants to power them, eliminate the tax on diesel fuel and ban the use of diesel in personal autos and ban the use of natural gas in power-plants. Then the plan should sit on a shelf waiting for the crisis to become more obvious to the stupid.

  5. Jeff K says:

    Btw, on Thu or Wed the National Post ran an article about the worsening crisis. Apparently not only do we have to worry about China, but the U.S. may want to reduce its dependance on mid-east oil, thus increasing its desire to buy Canadian oil. I think in the long run that’s fine, but there’s a lot of construction that has to be done before supply can meet demand in that situation, I believe.

« Previous PageNext Page »