February 26, 2008

Finally an explanation to mod_python: (Re)importing module 'django.core.handlers.modpython'

Posted in Software at 00:49 by graham

If you use Django with Apache, no doubt you have noticed lots of these lines in your log file:

mod_python: (Re)importing module ‘django.core.handlers.modpython’

Well, over on django-users Graham Dumpleton finally cleared it up:

You can ignore these messages from mod_python. You will see them every time Apache starts up a new child process for handling requests. It is just telling you that it is importing the handler for mod_python for the first time for that process.

Apparently this has been fixed in mod_python 3.3.1:

mod_python shouldn’t have really ever been making sys.path modules reloading candidates as it causes too many problems. The newest version of mod_python addresses the problems around that by separating sys.path imports from its own.

So now you know!

February 12, 2008

The fine line between populism and racism

Posted in Society at 02:16 by graham

As you probably know, the U.S.A. is electing itself a new president. The process is that each of the two parties elects their candidate, then they compete against each other. The four remaining Republicans vying for their parties nomination recently participated in a debate here in California. Here is the transcript of the Republican debate of January 30th 2008. It’s mostly standard political fare, until you get to the topic of immigration. Then, well, see for yourself:

Read the rest of this entry »

Wine grapes from least to most tannins

Posted in Misc at 01:40 by graham

Gamay, pinot noir, sangiovese, tempranillo, zinfandel, syrah, merlot, cabernet sauvignon, nebbiolo.

Please note that this is a general indication – the origin of the wine and process used (such as aging) may change the order of this list. See Somm’s comment below.

February 10, 2008

Quote of the day

Posted in Software at 07:56 by graham

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

—Brian W. Kernighan, co-author of The C Programming Language and the “K” in “AWK”

Seen in Idiomatic Python.

February 8, 2008

AJAX, IE6 and System error: -1072896658

Posted in Software at 03:43 by graham

I have just spent a while wrestling with this problem, so in case anyone else comes across it.

Symptoms

  • You are making an AJAX query to your server – in my case using Yahoo’s excellent YUI, connection manager.
  • On IE6, using the Microsoft.XMLHTTP object, you try and read the responseText parameter (or the YUI does for you).
  • IE says msxml3.dll: System error: -1072896658 (nice error eh?)
  • Everything works fine in Firefox

Solution

Make sure the response from your server has the correct mime type: ‘text/plain’ if it really is plain text. In my case I was sending a response of ‘text/html’ and sending plain text.

I wish you never experience this problem. If you do, hopefully this has helped you.