Site Cleanup
In preparation to start experimenting with Google AdSense on my site in an effort to cover some of my hosting costs I decided to go over my content and fix some stuff that has been broken for a long time. Both my master’s thesis and bachelor’s thesis had broken images which are now fixed. In case of the master’s thesis some of the images were broken because I had used an absolute URL to point to my homepage while I was still a student. The other class of errors where in the XML version of the thesis where I was using XHTML img tag but had mistakenly tried to apply the XHTML namespace to the src attribute, but this is wrong with XHTML. The bachelor’s thesis likewise had one absolute URL to my student home page, but all the navigation images were also coming from a site that has long since gone. sed came in handy:
for i in `ls *.html`; do sed -i "s#broken url#new image#" $i; done
So now you get to enjoy my “art”
. Which brings me to Gimp and why it is so damn hard to do simple things with it, like drawing a triangle. In the end I ended up installing GNU Paint, drawing a triangle, and then rotating and adding alpha blending to it in Gimp to get the next, prev and up images.
I also went through my Dead of Winter Role Playing Campaign site, and provided a short start page instead of the humongous world description file, and broke the 38 chapters long journal into individual chapters for those who want to read it in smaller chunks. I used a 142-line Python script to split the original file; 90 lines of the script is just the HTML header and footer HTML template. The actual code is simple, as it just splits from each chapter div which I had luckily marked in the original and then dealing with the links to previous and next chapter. This was another case where I found the Python syntax of applying values from a dictionary into a format string very convenient:
header_template = """ %(prev)s %(this)d %(next)s """ # some looping code that calculates values for prev, # this and next header = header_template % {'prev': prev, 'this': this, 'next': next}


