You are currently browsing the monthly archive for March 2008.
Before I left for my studies, I had a short stint in a unit largely responsible for the administration of our reserve forces. Work was pretty mundane actually. My workplace was in a laid-back part of the island. Walking along the long driveway leading up to the hill where my office was, one could almost imagine himself in a back-to-the-40s time-warp. This is no exaggeration, for the blocks used to be hospitals in the Second World War. Some blocks had housed British and Australian POWs, one of whom painted the Changi Murals. In retrospect, life there wasn’t bad. Regimentation, if any, was minimal. I had the luxury of getting to go home everyday, much like any other office worker. It was a position my conscripted peers would envy. I had to stay overnight to guard the front gate once in a while, but it wasn’t frequent. The officer in command took a rather relaxed attitude towards disciplinary matters. I don’t think anyone was really stressed over the rather tedious but mindless paperwork that is the staple in such an outfit. It was uncanny that we enjoyed these privileges because of a certain amount of discrimination from the headquarters. It was sometimes said that the unit was a backwater for people whom the headquarters didn’t want. We were misfits in some ways or other. On my part, I couldn’t see how I could be branded a “misfit” though. The upside to that was that we got housed in a place far away from the command of our headquarters, and we took liberties with rules.
My conscripted peers generally came from very different social and educational backgrounds from what I was used to in those past 19 years of my life. I was out of the comfort zone of my high school classmates who were mostly book-types. It was not a crowd with whom I could discuss my interests with, much less understand my aspirations at that time. When I said I was going to do physics, I got asked in response: “What? Physiotherapy?”. Actually, the fact that I attended high school had set me apart from most of my peers, some of whom had dropped out in middle school. I was met with clueless looks when I tried to communicate my academic interests to my peers. I’m not sure if they felt slighted in any ways, or if I had put my foot in my mouth. It was a world I had never seen. In retrospect, that contrast was striking. I was perceived to be the extremely privileged amongst my peers — something which I wasn’t conscious of. There must have been jealousy and a certain disdain meant for me then.
My duties ranged from collecting mail, printing and folding letters, calling up servicemen to update their records, and on one occasion, visiting the “un-contactables” at their homes. It was an easy life that gave me free time to study undergraduate material in advance during working hours.
I didn’t think I saw any value in my working there, at that time. To be honest, it was menial work. Even the boss admitted that when he had a chat with me one day. That must have been one of the reasons for my desire to get away. As things later turned out, I had the option of leaving for undergraduate studies in a subject I’ve always loved. It was clear to my bosses and peers what I should choose, given that the opportunity open to me was very hard to come by, and I wouldn’t be surprised to hear the same opinion if I asked the people I knew then. It was all as clear as crystal, or so I thought.
(To be continued…)
18/3/08:
Dreamt that V had a break up. I don’t think I’m that into her, but the subconscious mind is sending peculiar signals.
How much of our values and talents should we credit our parents for?
I have a friend who’s depressed that he is single. He’s probably single because he is clinically depressed. Ouch.
19/3/08
I hate to admit it, but I’m still in the closet as far as my past obsession goes. For those few seconds, I clutched the set of lecture notes I once used and lulled myself into a reminiscent mood. Then I slipped it into my bag and left for home.
20/3/08
Maybe I’ve mentioned this in a previous entry, but I’ll say it again anyway. As much as one needs to accept their own weaknesses, it is equally important for one to come to terms with his strengths and talents. It’s not wrong to be privileged. What may seem like a weakness to oneself could very well be the subject of envy for others. Dealing with it goes beyond superficial humility. If there’s anything I’d like kids from my alma mater high school to learn, this is it.
This was on my programming wishlist: a way to randomize wallpapers so that it changes every time I login to Windows XP. There exists programs on the net that does that, but I was looking for a solution that takes a small amount of scripting on my part. Ideally, I’d like to install only the script interpreter and nothing else.
The original idea was to create a shortcut, the equivalent of a UNIX symbolic link, to the picture file I wanted to display. I downloaded Python 2.5, copied a selection of my travel photos into a directory, and wrote a script that creates a shortcut (with a fixed name) to a randomly choosen file from that directory. Then I edited the registry so that this script is run at login. I needed some way to create a shortcut from the command line. This turned out to be non-trivial since XP does not offer a straightforward command line utility that creates shortcuts. I went against my rule and used a freeware shortcut creator that I executed in the script file. From Control Panel -> Display -> Desktop, I set the wallpaper to this shortcut. That didn’t work. The .lnk file was opened instead of the file that the shortcut file points to. Apparently, shortcuts sometimes aren’t taken to be links to the files they point to, unlike symbolic links in UNIX.
Naturally, one can do away with shortcuts, copy the chosen file over to a fixed filename, and configure this fixed filename to be the wallpaper. I ran the modified script, and then set the wallpaper to point this file in Control Panel -> Display -> Desktop. I had my randomly chosen wallpaper the first time I did this, but it didn’t change on subsequent logins! The script did what it was supposed to do — update wallpaper file by copying over the selected image file. Windows just didn’t realize the file was updated!
I did a little surfing on the net and poking around in the registry. Windows XP stores the path to the wallpaper file in the key “HKEY_CURRENT_USER/Control Panel/Desktop/Wallpaper”. This file is always a bitmap, even when a jpg or gif file is assigned to be the wallpaper. So it seems like the final format of the file needs to be a bmp. This was the next discovery — when any other graphics format is chosen as the wallpaper, Windows would convert that into a bmp and then assign the path of the latter to the key. I need a command line graphics file converter! Google didn’t turn up any results for command line graphic file converters that comes with Windows, so I used ImageMagick (it might be worthwhile to find out how Windows does it). As for changing the value of the wallpaper key in the registry, the command line program reg.exe that comes bundled with Windows XP does just that.
It was not enough to merely change the key value. One has to tell Windows to load the new value. As described here, one has to run ” RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters” to update the system of the changes.
Here’s the Python script that does all the work. Edit the necessary lines for your paths.
import os
import random
import os.path
random.seed()
wallpapercurr = r"[PATH-TO-WALLPAPER]\currwall.bmp"
ImageMagickexe = r'[PATH-TO-IMAGEMAGICK]\convert.exe '
wallpaperdir = r"[PATH-TO-WALLPAPER-DIRECTORY]"
filelist = os.listdir(wallpaperdir)
fileindex = random.randrange(0, len(filelist)-1)
if os.path.splitext(filelist[fileindex])[1].lower() == '.bmp':
execstring = "copy " + wallpaperdir + '\\' + filelist[fileindex] + " " + wallpapercurr
else:
execstring = ImageMagickexe + wallpaperdir + '\\' + filelist[fileindex] + " " + wallpapercurr
os.system(execstring)
# set registry entry
setregexecstring = r'reg add "hkcu\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "' + wallpapercurr + r'" /f'
os.system(setregexecstring)
# refresh
os.system("RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters")
Install your favorite Python interpreter, then either through the registry or the Startup folder on the Start Menu, set up the interpreter to execute this script on log in.
For amateur astronomers and people with casual interests in the night sky, this script can be easily modified to display the star map for the day. The basic idea is to have a star charting program generate star charts as graphic files. These files need to have filenames that are labeled according to the date and time they are plotted for. A star charting program that has a command line interface would be extremely useful. Unfortunately, I couldn’t find one with that feature, so I went about the laborious way. I manually generated star maps in .gif format using Cartes du Ciel, and stored them in the same directory. The first time I did this, I generated enough star maps for the rest of this month. The .gifs generated have filenames that are of the format [location]-[year]-[month]-[day]-[time].gif. This script does the rest of the work. As before, some lines need to be edited.
import os
import time
wallpaperdir = r"[PATH-TO-STARMAPS]\Starmaps"
timestruct = time.localtime()
y=timestruct[0]
m=timestruct[1]
d=timestruct[2]
mapstring = "[LOCATION]-" + `y` + "-" + `m` + "-" + `d` + "-[TIME].gif "
#execstring that converts/copies file
execstring = ImageMagickexe + wallpaperdir + '\\' + mapstring + wallpapercurr
os.system(execstring)
# set registry entry
setregexecstring = r'reg add "hkcu\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "' + wallpapercurr + r'" /f'
os.system(setregexecstring)
# refresh
os.system("RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters")
As before, save this script, configure the system to run this at startup, and you’re all set!
Sometimes I do learn a little more about myself through my own visceral reactions. Like how I tried to divert my attention to something else, or try to change the topic when I hear about my past obsession mentioned in a conversation I’m overhearing. Is it a fear of the memory of pain, or the fear of pain itself?
I believe it’s a mix of both.
Time: 1:20am. Music on the speakers: Brahms’ Piano Concerto No. 2 in B-flat major, op.83
The euphoria of yesterday has subsided. I’m rather pleased with the results some of my students got. One of them was probably quite elated to score the highest grade in a subject that she has been least confident of, and for which I tutored her. Another scored almost perfect score if not for the harder “extra” paper she took. I was glad enough that she did well for her core subjects, but she doesn’t seem to feel the same. That I can understand, having been brought up in the same academic climate. Another didn’t get top scores, and is wondering if she could even get into university. It was the first time she called me on the phone, and she didn’t sound too excited. I offered my help at advising on university options and all.
In retrospect, that faithful day was for me only one important hurdle and frustration out of the many that came later. The end-result was only good for getting my foot into the next door. In the years that followed, like many of my peers, our outlooks became more nuanced and less one-sided. I wished we would realize earlier that grades aren’t everything, and that accomplishments and fulfillment aren’t measured by tangible metrics or constrained by whatever our social conditioning like us to believe.
I’m setting off for another trip soon. I need the break from urban crowds.
She thanked me hours after the fact, as if as an afterthought. It doesn’t feel like it would end here.
I can’t explain it, but ever since I returned from my holiday, the sight of couples on the streets don’t bite at me as much as before. And it’s not that my life has changed very much. The jet-lag might have temporarily sapped my energy for angsting and moping. I don’t know. What’s bothers me more is the noise and the throngs of humans in the malls. It gets claustrophobic and nerve-wrecking. I don’t believe they want to grow it to 6.5 million when it’s so bad with 4 million. I’m moving out of here eventually. The people can’t really be blamed for crowding up the malls. There aren’t any good spots around here to hang out in anyway. With the subway stations nearby and consumerism working its ways, most of us just hit the malls out of habit.
It was a last minute decision to hit the concert hall last night. I considered it a relief from the human hordes on a Saturday night. The pre-intermission programme saw a mix of the traditional and the contemporary. “Sha Di-er Chuan Qi” was my favorite amongst them. What were traditional Xinjiang tunes were woven into a tapestry threaded by modern-sounding harmonies. It ended the first-half of an otherwise quite traditional, staid, though rather impeccably performed programme.
My attention was drawn to the Jinghu players during the second half, which featured a Jing opera vocalist. The Jinghu players seemed slightly uncoordinated at first, but they played well enough for me to start to groove along. It’s the first time I actually enjoyed Jinghu solos, and I think they got it right somewhere.
The final programme for the evening was “Nan Wang De Puo Shui Jie”, composed by Liu Wen Jin. The use of a female choral ensemble added a rather refreshing spin to the music. Those few bars of choral parts, even if they were just chords, enlivened the piece enough that I was quite moved. I’ve never attended choral performances, but I might now. The concert ended on a jovial note with the encore item “Xi Xun Chuan Bian Zhai”, a work my secondary school orchestra had performed years back.
I’m only acquainted with very few of the orchestra’s musicians, and one of those was the conductor in the orchestra I was in. On stage, he appears withdrawn and full of unspoken burdens amongst his fellow musicians who are all smiles and proud at the conclusion of another well-performed concert. I became aware of some personal issues of his through an interview on TV I caught by chance many years ago. That which I can logically understand but not emphatise. I wish I knew what’s bothering him now, but I don’t have the right to. I think it would please him to know that I was part of an orchestra he conducted, and that he takes some credit for my support today for the music he has always been passionate about.
The jet-lag’s going away, thankfully. Last night’s concert pushed my sleeping hours later into the night so I didn’t wake up at 2am this morning. I should feel better at work next week. And there’s the star party expedition to look forward to next weekend!
