Arnt Richard Johansen's home page

Thank you, Poland!

Thank you, Poland!

[Tuesday, Dec 28, 2004 @ 15:57] | [tech] | # | G

Colourmap rotation

One of the things I like doing in the Gimp is this:

Original picture, with green grass Manipulated picture, with red grass

On the left: lawn with rock and axe, taken outside my parents' house this summer. On the right: the same picture, using Filters -> Colors -> Map -> Colormap rotation in the Gimp.

Of course, getting good results by colourmap rotation requires areas of some saturated, primary colour.

[Tuesday, Dec 28, 2004 @ 15:20] | [art] | # | G

Migrating from GreyMatter to Pyblosxom

The transition from GreyMatter to Pyblosxom was not entirely painless, though much easier than I had expected. CGI installation was a breeze (although it took me a while to figure out that even though the installation doc did not say anything about moving other files than pyblosxom.cgi and config.py into the CGI directory, Pyblosxom actually consists of a small suite of scripts whose path has to be specified in config.py.

Then came the whole business with URL rewriting. Having URLs like http://arj.nvg.org/pyblosxom.cgi/path/to/blog_entry.html looks ugly, and I'm not sure it is even compliant with the relevant URI standards to have pyblosxom.cgi as anything else than a directory in this case. So I wanted to redirect http://arj.nvg.org/path/to/blog_entry.txt to the pyblosxom script, but only if it does not exist as a regular file.

The solution I found (after reading up on mod_rewrite a while, and various swear words) was adding the following to my top level (but not sitewide) .htaccess:

RewriteEngine on

# If the requested file or directory does not exist
RewriteCond %{REQUEST_FILENAME} !-F
# Try serving it through Pyblosxom
RewriteRule ^(.*)$ /pyblosxom.cgi/$0 [L]

# Replace index.html with Pyblosxom
RewriteRule ^$ /pyblosxom.cgi [L]

Porting the visual layout was not very difficult, either. The "templates" in GreyMatter are quite similar to those in Pyblosxom, so I only had to retrieve them from the web interface and paste them together into Pyblosxom flavour files. Besides, most of the work was done in standalone CSS files anyway.

I opted not to write an import script, since I only had 8 entries in my old blog. Instead, I downloaded the source from the web interface, and inserted <p> and </p> where necessary. Non-Western text in Unicode was troubling, however. GreyMatter stores such characters in a puzzling internal format. After having given up typing the Russian word язык in on emacs, Yudit and KEdit, I pasted it from the web browser to Yudit.

[Tuesday, Dec 21, 2004 @ 17:34] | [tech/web] | # | G

Night vision is laterally independent

Couldn't get to sleep tonight, because I was too excited about going home for Christmas tomorrow. So I picked up the mobile phone (it was under my pillow, since I use it as an alarm clock), and read some news on WAP. After having read all my bookmarks, I put ut down.

When looking at the dimly lit room, I noticed that the image from my left eye looked darker than the one on the right. I had held the display of the phone up against the left eye when reading, since that is my dominant eye. So the left eye had got lots of the light, but the right eye next to nothing. Hence, the left eye was accommodated for day vision, while the right one was still in night vision mode.

It struck me that the first time someone discovered this, it must have been an important result in neurology. Consider this: in the pre-technological era when the human brain spent most of its time evolving, few light sources that would be seen only by one eye existed. Hence, there should be no evolutionary advantage of having a separate feedback mechanism for each eye, as opposed to a central "light meter" that responds to the overall brightness of the visual field. Therefore, the reason that the dilation of the pupil of the eye is controlled separately for each eye, must have something to do with some structure in the brain that was "already there", ie. evolved for a separate reason.

Trying to go back to sleep now -- have to be up in less than six hours.

(If you know something about this that I haven't mentioned, please feel free to drop me an e-mail.)

[Thursday, Dec 16, 2004 @ 02:15] | [science] | # | G