Archive for January, 2006

The problem described in Rants and Revelations : Oh, buggeration! has been fixed.  It was a simple matter of some bad DOM programming - the way I was turning on and off the divs to show various parts of the refresh screen, specifically to show the “You’re done” part, was incorrect.  It’s unfortunate that the way I was doing it before worked on Firefox and Safari, otherwise I wouldn’t have assumed it was correct.

In case anybody cares, I had

div.setAttribute(”style”, “display:none”);

where I should have had

div.style.display = “none”;

which of course makes a lot more sense and is a lot cleaner if I ever put a style sheet on these things.

In my entry Rants and Revelations : Baby’s first AJAX I crowed about my lovely new AJAX Javascript refresh thing.  It is a thing of beauty and I thought a joy forever.  Until I got an email today from a guy who was generating a database and it suddenly stopped refreshing.  He said it did work until he added another state to the ones he’d done before.  And he also revealed that he was using IE, and was unable to change to Firefox becaused the computer was provided by work.

So I checked it out, and did a really big database generate.  It refreshed a bunch of times, and then suddenly it stopped.  And when I hit shift-refresh, the count reset to 0 as if it didn’t make contact to the XML producer at all, or couldn’t parse it or something.  “View Source” wouldn’t even bring up a window.  But when I posted the same URL into Firefox, it showed the correct results.  I tried backing off the security settings to the loosest, to no avail.  Can’t see anything useful in the various settings pages.
I wish IE had a Javascript console.  I’d really like to know what’s going on.

(Gee, how many times have I used that title that Firefox actually showed it as the first completion option once I typed the “B”!)

I have this curious pain running around my head.  Sometimes it seems to manifest itself like a hard little ball that lodges either just under the bridge of my nose or about an inch up from the bottom of my skull in the back.  Most of the time it’s just pressure on the back of my eyes.  Sometimes my eyes just won’t focus for a second or two.  I’m not sure if this is some sinus thing coming on, or a migraine about to pop.

Oh well, I guess we’ll see.  After all, there’s no better way to get expert medical advice than to post about it to your blog, right?

I’ve enhanced my CoPilot Waypoint Database Generator to do a bit of AJAX-like coding.

Formerly, after you’d entered all your parameters it would fire off a background task, and then continually refresh a page that would look at the background task’s log file and tell you how many records it had put in the file already.

Now, the refresh page is still there, but if you have Javascript active, it does a window.location= to redirect to an html page which has some javascript that uses the XMLHttpRequest or ActiveXObject to call a perl script that generates a very small XML file that only has the progress, and sets the appropriate div in the page to visible and sets some values in appropriate spans.

It seems to work very nicely, but what a convoluted mess. Between the HTML, the CSS, the Perl, and the Javascript, I’ve got language fatigue. Javascript is not turning out to be my favourite language. I’ve never been able to understand why Sun didn’t sue Netscape over the intentional confusion between Java and Javascript, but now I’m even more confused.

All the other craptacular syntax and bogus object model aside, what Javascript really needs is a simple way to turn a simple bit of XML into an associative array. And don’t talk to me about JSON - even if I wrote both the client and the server, I just don’t feel right about having the client eval a string passed to it by the server - I just know there’s got to be a security exploit waiting to happen. So instead I’ve got all this

var tStatus = xmlDoc.getElementsByTagName("status")[0].firstChild.data;
var tOtherURL = xmlDoc.getElementsByTagName(”otherurl”)[0].firstChild.data;
var tRows = xmlDoc.getElementsByTagName(”rows”)[0].firstChild.data;

That’s just ugly.

In my continuing attempts to keep from killing the people around me, I’m trying another way to blot out the noise around me.

At the Apple Store before Christmas, I tried out the Bose noise cancelling headphones.  Just like their aviation headphones, they were awesome, light, and way too freaking expensive .  They’re around $300, which I suppose is a bargain compared to the Series X aviation headphones which are around $1000, and have been since they invented the concept of ANR (Automatic Noise Reduction) in aviation headphones.  The aviation ones haven’t budged in price in 10 years, so I don’t expect to see the music ones getting drastically reduced either.
So I compromised and bought myself a pair of Sony MDR-NC6 headphones.  These are semi-open like the original Walkman headphones, but with a battery compartment in the bow just above the right ear.

You put them on your head and flick the switch.  The first thing you notice is that you can no longer hear the air noise in the overhead HVAC system, nor the three computers sitting right behind your head on the desk behind you.  Then you turn on the iPod and find you can use a much lower volume setting.  Not sure if that’s because everything got quieter, or because the iPod got louder.  Even near-by conversations are muted.  Hey, I don’t feel like punching the guy using his speaker phone to check his voice mail.  Much.  This is good!  And no sore ear canal from ear buds that don’t fit very well.
There are a couple of downsides, though:

  • I don’t think the bass response is very good.
  • The battery compartment presses into my head annoyingly after a lot of hours of continuous use.
  • I don’t know how long the battery lasts yet - that might be an issue.
  • When you’re walking around, if you don’t turn off the noise cancelling you get a very loud wind noise in your ears.  I have no idea why.

Turns out the solution isn’t to use mod_rewrite at all, but instead to use mod_redirect. Maybe not as efficient, but simple, clean and even I can understand what’s going on:

Redirect /blogs/pt/index.xml http://xcski.com/blogs/pt/feed/
Redirect /blogs/pt/index.rdf http://xcski.com/blogs/pt/feed/

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blogs/pt/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blogs/pt/index.php

</IfModule>

When I moved this blog from MovableType to Wordpress, the rss feed urls changed. Since I didn’t want the livejournal syndication to break, I put in mod_rewrite RewriteRules to redirect those feed urls. When I upgraded to Wordpress 2.0, what had been an extremely long .htaccess became just a few lines long, and all the fancy stuff that they used to do in .htaccess with mod_rewrite are now evidently done in index.php itself. So I’m trying to figure out how to insert new RewriteRules to do what I did before, but everything I try either does nothing, or it causes the whole blog to break with a message in the error.log file saying “mod_rewrite: maximum number of internal redirects reached. Assuming configuration error.”

Here is the existing .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blogs/pt/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blogs/pt/index.php
</IfModule>

I would have thought that adding the following would be sufficient:

RewriteRule index.rdf /blogs/pt/feed/
RewriteRule index.xml /blogs/pt/feed/

or possibly, since /feed/ is evidently going to be passed to index.php as arguments, like this:

RewriteRule index.rdf /blogs/pt/index.php?&feed
RewriteRule index.xml /blogs/pt/index.php?&feed

I also tried with [L] and/or [R] conditions. No luck.

I’d like to get all those syndicators working again. If you have any suggestions, please leave a comment or drop me an email.

When the Google Maps API was announced, David Megginson publically challenged me and other programmers to come up with a decent flight planning application that used it. Well, it’s not here yet, but RunwayFinder - a flight planning tool for pilots is getting closer. At least it’s a decent substitute for the “Nearest Airports” search in AirNav - you put in an airport id and it shows the ones in the neighbourhood as well.

I had a bunch of plans for the vacation.  Some of them actually got done.

Goals:

  • Spend time with my daughter, step-daughters and wife (partial credit - probably could have done better, but it was great to have Liane here for the first time in years even just to hang out, and we did a few fun things.)
  • Finish reading “Ajax In Action” (partial credit - read the first 10 of 13 chapters and Appendix A.)
  • Reimplement the “progress report” part of the navaid.com web site so that instead of re-drawing the entire page every 10 seconds it just grabs the actual count that’s changed and puts it into an appropriate div.  (Not even started.)
  • Add some more design notes to the NavData wiki. (Not done.)
  • Import some of the user data files I’ve been sent into the navaid.com web sites. (I did a couple, Brazil, Argentina and the UK, but I’ve got a couple more to do.)
  • Finish Half Life 2 which I got last Christmas.  I stopped last January when I had some video card problems.  (Played for 15 minutes, got to Ravenholm, got violently motion sick and stopped.)
  • Get some flying in. (Didn’t get a single day without low ceilings.)

I probably get a failing grade for that.

As I wrote in Rants and Revelations » Ok, that’s annoying I was having problems with comments.  Upgrading from SpamKarma 1 to SpamKarma 2 seems to have fixed it.  I was very reluctant to upgrade, because SpamKarma 1 was doing an incredibly good job.  And I don’t want to fuck with something that works.

I upgraded to Wordpress 2.0 a few days ago.  I just noticed today that the comment count isn’t incrementing when people post comments (although they do decrement when I delete a test comment).  So there’s all those posts on my main page that say “Comments (0)” even though they have comments.  And they’re not showing up in my “unread comments” plugin either.

I think I’m going to have to try turning off some plugins to see if that makes a difference.  I hope it’s not SpamKarma.