Jun, 2019 back to Mar, 2006: (nothing)
Self-improvement is an admirable goal, but it's easy to lose track of why we should strive for it.
This morning I woke up with a flash of insight. I work hard to always become a better person to merit the respect, admiration and trust of the people I care about. The path takes a lifetime, and the rewards are well worth it.
It's not my fault, it's theirs.
(By ignoring context, I have promoted this blog entry from an anecdote to a mantra.)
In my first Philosophy conference, we were asked to state our name, program, and reason for taking the course. After going about halfway around the room, the spotlight fell on the person next to me, who said she was in Chemical Engineering and was taking Philosophy because she was afraid Engineering is making her a robot.
My turn came right after that. I had prepared some drivel about improving my methods of reasoning. But I thought about it for one more second, and then I said, "same reason."
Ironically, the only time I actaully blog is when I'm hacking at my blog.
I wanted a simple HTML category list for my Pyblosxom blog. I hacked something up quickly, without much regard to maintanability or portability.
<![CDATA[__author__ = "Adam Hooper" __version__ = "1.0" __url__ = "http://www.adamhooper.com:4242/blog" __description__ = "Gives an HTML list of blog categories" import Pyblosxom.tools import os.path import re def cb_prepare(args): request = args['request'] data = request.getData() dirs = Pyblosxom.tools.Walk(request, root='/var/www/pyblosxom', pattern=re.compile('[^.].*'), return_folders=True) html = ' <ul> ' for d in dirs: rd = os.path.split(d)[-1] html += ' <li><a href="/blog/%s">%s</a></li> ' % (rd, rd) html += ' </ul> ' data['categoryList'] = html]]>
If you're not happy, determine why. Then formulate a plan to solve the problem. The end result is happiness. And what if you fail? Well, if you're not happy in the first place, what do you have to lose?
It really is that simple.
But getting XHTML 1.1 compliance took a long time, because of of the Content-type header. I ended up having to write a plugin, which meant learning how PyBlosxom renderers.
My default flavour is called adam; with that in mind, here is my plugin:
<![CDATA[__author__ = "Adam Hooper" __version__ = "1.0" __url__ = "http://www.adamhooper.com:4242/blog" __description__ = "Sends appropriate XHTML Content-Type header" import os def generate_content_type(): if os.environ.get('HTTP_ACCEPT', '').find('application/xhtml+xml') != -1: return 'application/xhtml+xml' else: return 'text/html' def cb_prepare(args): request = args['request'] form = request.getForm() config = request.getConfiguration() if ((not form.has_key('flav') and config.get('default_flavour', '') == 'adam') or form['flav'].value == 'adam'): renderer = request.getData()['renderer'] renderer.addHeader('Content-type', generate_content_type()) renderer.needsContentType(None)]]>