« July 2003 | Main | September 2003 »

August 2003 Archives

August 13, 2003

Letting Gnus run sa-learn

After being fed up with spam I decided to install "SpamAssassin":http://www.spamassassin.org/ on my server. This was very easy and with a bit of tweaking to the suggested .procmailrc everything's running fine. The only thing missing was a keyboard shortcut in "Gnus":http://www.gnus.org/ running sa-learn for spam & ham mails...

Continue reading "Letting Gnus run sa-learn" »

August 14, 2003

Next choice of reading

It seems I've somehow created myself a preference for reading books about society (except right before sleeping, when I read Terry Pratchett's Discworld series). Last Christmas got me No Logo by Naomi Klein, and this spring/summer I've been through both Fast Food Nation by Eric Schlosser and Nickel and Dimed by Barbara Ehrenreich. The problem now is where to go next. These three books have given me an appetite for this kind of material, but there's currently no book standing next in line. Should I read Naomi Klein's followup "Fences and Windows"? Or maybe go in a totally different direction? I'm open for any suggestions.

August 18, 2003

Lemmings

I'm supposed to start being a student again, not play "DHTML Lemmings":http://crew.tweakers.net/crisp/lemmings/

August 21, 2003

Windows, javascript:-URLs and https://

This one started when I was approached by a former colleague of mine asking for some help with a calendar script they were using in a secure server environment (https://). Entering dates using a calendar tends to be a bit easier for many people than writing them in. I had a look at the script and couldn't really find anything odd about it, the general function for showing the calendar going something like:
function showCalendar(targetForm, targetDate) {
  // code to create HTML for calendar went here

  // code that opens and writes the calendar
  var calWindow = window.open('', 'calendarWindow', ...);
  calWindow.document.write(lotsaHTML);
  calWindow.document.close();
}
This code was called by links in the calendar window whenever the user wanted to navigate back/forward a month, and that functionality didn't work. I failed to spot obvious errors in the code and sent off some code being a shot off the hip, but it totally failed to solve the problem. I then suggested to rewrite the code so that it reused a global window reference whenever it's available. The code became:
var globalWindowRef;
function showCalendar(targetForm, targetDate) {
  // code to create HTML for calendar went here

  // code that opens and writes the calendar
  var calWindow;
  if(globalWindowRef && !globalWindowRef.closed) {
    calWindow = globalWindowRef;
  } else {
     calWindow = window.open('', 'calendarWindow', ...);
  }
  calWindow.document.write(lotsaHTML);
  calWindow.document.close();
}
The reason why I believe this worked while the other didn't was that the links in the calendar window were javascript:-URLs calling showCalendar() found in the parent window, which in turn tried to reopen (and then rewrite) the calling window before the function had returned. Something which doesn't seem to be allowed (anyone see any reason why it should?). Goes to show that once you're going secure you should look through your code another time to make sure it's doing what you believe it's done, and doing it in a sane manner.

August 29, 2003

Accessing properties during loading

I recently worked on making my "tree menu":http://www.treemenu.com/ work with Opera 6 & 7 and noticed that v7 died with an error while trying to grab the frame names in the parent frameset. This is a problem I've never experienced with other browsers except Opera v5, and in that case I was able to fix it by letting the parent frameset's onload-event handle startup.

Continue reading "Accessing properties during loading" »

About August 2003

This page contains all entries posted to Ceci n'est pas un blog in August 2003. They are listed from oldest to newest.

July 2003 is the previous archive.

September 2003 is the next archive.

Many more can be found on the main index page or by looking through the archives.