Ask: Do CRT monitors cause headaches?

I posted this on slashdot.org two weeks ago, but the story got rejected. I am posting it here.

I have myopia (medium to high myopia). I wear corrective lenses (in the form of glasses) with negative six optical power, both eyes. The optical power had gradually been decreasing, but since over two years now, it has stabilised at negative six. I use computers a lot on a daily basis. For the past three years, I have been working entirely with laptops and LCDs. I still do, at home, where I have a wide-screen laptop I use. However, almost eight months back, I joined a software house in the capacity of a software engineer. Unfortunately, they only have CRT monitors (13-inch or less) there. I am not used to working with CRT monitors. And in fact, I cannot work with them without having a cracking headache, eye-ache, and without shedding tears. This is the major reason why I flushed out all monitors at home three years ago.

In the last few months working with CRTs at this organisation, I have been feeling the brunt of it extensively. I have headache (at times severe) and eye-ache almost every day I am at work. If I stay back at home, and use my laptop all day long, for hours at ends, I feel nothing. However, as soon as I have spent a good half an hour or even less in front of a CRT at work, the problems start to appear. I have been trying to narrow down to those factors that may actually contribute to the headaches and eye-aches. Traveling to and fro work (I drive to work in my car) might be one factor, as I have to fight my way through rough traffic every day. But, besides that, I could pin down no other factor. The office environment is a long shot from being a haven, but it is not by any stretch of imagination what I would call uncomfortable. I discussed my concerns with friends and other people, and while none of them have medium to high level myopia like myself, they do agree that using CRTs does cause headaches. I raised the issue finally with my manager. He forwarded it to the HR head who called me for a chat. Surprisingly, to him, my not being able to work with CRTs is something he had not heard of ever before. He asked me to get an eye test with my ophthalmologist, and get a letter written from him that suggests I cannot work with CRT monitors. I thought that that was the height of stupidity. But since I already have a much better job offer waiting for me, I did not think it worth protesting. (However, I do wish that they may solve the problems I am having, as I would prefer to stay back with this organisation.)

Yesterday, however, I did visit the ophthalmologist for a routine check-up. The diopters of my corrective lenses remain the same, negative six that is. I do have allergy in my eyes, which I have had for a while, and for which I have been taking treatment on and off. The ophthalmologist did agree with my reservations with working with CRT, but he politely refused to write such a letter, stating that he cannot do so. He asked me instead to fight the battle with the administration of where I work, stating that I do not need to show them any certificates or letters for something I am not comfortable with at work. I will confront the administration, nonetheless, later today. But I wanted to know what you guys think about it. Have you ever had problems with working with CRTs? Especially those of you who may have myopia to any degree and have to work with computers for long hours daily?

Note to self: How not to light a BBQ fire!

It is barely past two in the afternoon. I am still struggling with the hangover from last night’s BBQ party. The lower part of my torso aches like it has never ached before, in part from sitting on my knees and in an uncomfortable position for hours at a stretch while grilling and cooking the BBQ meat. Also, I drove a lot that night too.

It took Ammar and I just a little less than an hour to make a fire. It wasn’t until this morning that mom told me that we would have been more successful with making the fire had we used oil instead of the gratuitous amounts of petrol we poured in. Not only does the fire, that way, last long enough for the coal to do its magic, using oil leaves an after taste and smell in what is being cooked that simply make the stuff more delicious.

Practice makes perfect, now. However, as I soberly told Rakesh when he had asked how to do BBQ while standing next to me watching me move the grilled meat over and sideways, there is really no future in it.

On a more serious note, someone should really teach Munir how to blow a sheesha.

grep and regular expression revisited

Yesterday, while helping Laiq figure out the pattern he wanted to match against his data set, I bumped into grep’s odd behaviour with respect to regular expressions. Later that day, I went over the man page for grep at length to find out why grep behaved differently than I expected it to.

In the man page for grep there is a separate section on how regular expressions are interpreted within grep. The information provided in that section is brief. It is hard to say whether it provides documentation for a subset of the semantics of regular expressions in grep or the complete set in its entirety. That notwithstanding, I decided to write a (ironically) brief post on grep and its interpretation(s) of regular expressions.

According to the man page, grep understands two different versions of regular expression syntax. One is basic regular expression, and the other is extended regular expression. You would think that both of these versions would differ in more than one ways. However, in terms of functionality provided, basic regular expression is no different than extended regular expression.

The man page lists down only one difference between the two groups of regular expression syntax. With basic regular expression, the meta-characters ?, +, {, |, (, and ) lose their special meaning. To use them in their special capacities, they need to be back-slashed (escaped). In contrast, with extended regular expression, these meta-characters have to be back-slashed only when they are required to be used literally.

If you are trying to, for example, match the string “[000]“, you could work with grep in one of the following ways:

echo '[000]‘ | grep ‘\[0\+\]‘
echo ‘[000]‘ | egrep ‘\[0+\]‘

In the first example, note that the meta-character + is escaped because we want to use it in its special sense, that is as a repetition operator. In the second example, though, the + is already being used in special sense. Also note the use of egrep in second example as opposed to grep. egrep is essentially nothing more than grep -e grep -E (thanks to Zohair for pointing out the error) which triggers the extended regular expression syntax.

Another difference I could spot out is that the available set of named classes of characters do not work with basic regular expression. These named classes of characters include (but are not limited to) [:alnum:], [:alpha:], [:space:]. If there is indeed a way to make use of these named character classes with basic regular expression syntax, I would love to hear about it.

Additionally, I noticed that a limited subset of Perl-based character classes is understood by grep, in both basic and extended interpretations. For example, the \w and \W character classes are understood, but \d and \D are not. If there is a need to match against a numeric pattern, either the named character class [:digit:] or the expanded [0-9] form can be used. As I noted earlier, what is and what is not supported in terms of character classes and many more are not extensively documented in the man page. It is hard to take the absence of documentation of something in the man page to mean that that something is not supported within grep.

echo '[000]‘ | egrep ‘\[[0-9]+\]’
echo ‘[000]‘ | egrep ‘\[[:digit:]+\]’

That mostly sums about grep’s limited interpretation of regular expressions, as I see it. If you are a Perl guy and, not least, a regular expression one, you would feel at home with -P switch to grep which allows for regular expression patterns to be specified and interpreted in the same way as Perl interprets regular expressions. So, while the character class \d is not available with grep’s basic and extended regular expression syntax, it can be used readily with the -P option.

echo '[000]‘ | grep -P ‘\[\d+\]‘

Regular expressions aside, there are a couple of very useful switches to grep that are commonly ignored or are generally never known of despite being clearly documented in the man page. One such gem is the -o switch. The default behaviour of grep is to display the entire line which matches the given pattern. Often it is desirable to display only the part which is matched, and not the entire line. The -o switch does just that.

There is also the -n switch. It prefixes each matched line or part of matched line with the line number from the file where it is found. This can be really helpful in many situations.

The -x switch forces the pattern to match exactly the whole line and not part of the line. This is a useful functionality which is unknown to many.

Like these, there are a handful more switches that can come in real handy. The man page lists all those.

When it is not fun, move on!

The following is an excerpt from Richard Branson’s “Screw It, Let’s Do It: Lessons In Life”.

    As soon as something stops being fun, I think it is time to move on. Life is too short to be unhappy. Waking up stressed and miserable is not a good way to live. I found this out years ago in my working relationship with my oldest friend, Nik Powel.

    Nik was with me from the very start of Virgin. I was the ideas person and Nik kept the books in order and handled the money. His main job was to run the Virgin record stores. They did very well. When we started the airline, we wanted it to be the best. We sank millions of pounds into it. Our main rivals, British Airways, tried to stop us. As the war between us heated up, we needed more and more money. It seemed an endless pit. Virgin Music was wealthy but the airline was eating up the cash. Nik didn’t enjoy taking such huge risks. That was when we both knew it was time for him to move on. I bought his shares in Virgin from him.

    Nik’s first love had always been films. He used his profit from Virgin to start Palace Pictures. He made great films, like The Company of Wolves, Mona Lisa and The Crying Game, which won an Oscar. He is still in the film business, still having fun and we are still friends. After a struggle, the airline finnally went into profit. If Nik had stayed with Virgin he might have made more money, but he would not have been happy. If we had gone on working together even after the fun had gone, we might have stayed friends. He made the right choice. This is the why I say, never just try to make money. Long-term success will never come if profit is the only aim.

I have been meaning for a long time to say along those lines. Richard Branson, however, has aptly put it into perspective. On an altogether different note, this book is an inspiring read.

Venting

Venting. Junaid earnestly thinks that it accurately describes me. I think in some ways (or a lot of ways, depending on where you’re coming from) it does!

Would you like to step out of the car, please?

Imagine having friends in the car driving to a far-off diner, finding a safe spot to park the car what may appear to be little more than five minutes walk away from the diner hoping to avoid the traffic police from subsequently towing the car away (otherwise eventually leaving you with no other option but to bribe the police officials or go to the trouble of getting and paying the ticket with money pulled out your own pocket), and the friends working up the cheek to whine about how far you are parking the car, how they will have to walk all the way down, and to rudely quip that they be dropped off instead in front of the diner while you go park the car. Stomps on the nerves real bad and hard, even when you know that they are merely having fun. Driving and finding a place to park a car in Karachi are trouble enough, that you have to gulp down crap like that from friends riding along.

You know who you are. Do be careful the next time you’re riding along in my car. I will have no qualms in screeching the car to a halt, asking you nicely (barring that, rudely) to step outside, and roaring away without you.

VMware, 64-bit processors, and Virtualisation Technology

Attempts to set up a 64-bit guest operating system using VMware workstation on a 64-bit Intel processor machine running Windows 2003 R2 Standard 64-bit Edition failed miserably this past week at work. As Chaz6 and larstr subsequently pointed out in #vmware on irc.freenode.net, the particular Intel processor in the machine being used does not support Virtulisation Technology (VT). It came as a thudding surprise as admittedly I had not known anything about VT and suspected that VMware would not ever need rely on a special [hardware] feature of 64-bit processors to be able to emulate 64-bit guest operating systems, but as things stand today, VMware cannot. I had discussion soon thereafter with Talha over the slightly shocking yet disappointing discovery, which mostly fell into a heated debate as all serious discussions with Talha do — he apparently mostly can’t seem to be able to take rigorous positive criticism in stride. However, he pointed out a link to a knowledge base article from VMware that explains sufficiently clearly why VMware has to confront this particular requirement.

I have my reservations about Xen being able to overcome this restriction in order to emulate 64-bit operating systems on 64-bit hardware without VT support (or the AMD equivalent). However, a rather pissed-off soul in ##xen on irc.freenode.net did, when I inquired after the issue, briefly comment that Xen should not have any problems. Beyond that, further inquisitions did not yield so much as a response from anyone. I may probably end up putting 64-bit version of some Linux on that machine and pulling off setting up Xen on it.

Additionally, if you are playing with VMware on 64-bit hardware, there are tools that will check beforehand for you whether the processor supports VT (or AMD equivalent) or not.

Monday Morning Blues

Brakes failed (had to press really hard on the brake pedal all the way down three times in a row in order for the brakes to take effect). Drove awfully slowly. Didn’t find space at the usual parking lots. Had to park at an overly expensive parking lot. Got late on the day I had decided (and actually left early) to reach work on time.

Jinxed!

Telling Vim not to create swap and backup files.

It should come as no surprise to those who know me that I rely on Vim almost nearly always for any sort of text editing tasks. If you have used Vim before with little more than passing curiosity, you will have noticed and been annoyed by the swap file Vim creates when opening a file and the backup file that is created after committing changes to the file. While there is a very good reason why Vim does that by default, one which you may come to appreciate when things turn sour following a morning you woke up on the wrong side of bed on, it still is pretty annoying to have one extra file with a clumsy extension cluttering up the space whenever you open a file. Well, at least, it always does a splendid job of stomping on my nerves.

There is a way to get around to that, though. There is always a way. The following two directives which would go into the system-wide or user-specific “vimrc” file disable, respectively: a) creation of swap file whenever a file is opened using Vim; b) creation of a backup file whenever an opened file is altered and saved through Vim.

set noswapfile
set nobackup

I plucked these two from Vim Tip #907.

The irony of driving

I will honk most rudely. I will cut the dangerous of cuts mindlessly. I will work up a temper by not allowing myself to stay relaxed and vent the frustration by pressing harshly on the accelerator …

… only to make it to the next traffic jam earlier than others to start all over.