Wednesday, July 22, 2009

Reminiscence

I still remember vividly that period of time during my undergrad. I was in my second semester. She didn't like me much during those days. Our brief encounters were generally curt and to-the-point. I wouldn't speak much with her, and she would talk to me only when necessary.

I was tense. It was the day of the final semester lab examinations. I was sitting in my chair in the System Software Lab, having been asked to simulate the first pass of a two pass assembler as my lab exercise for the exam. Though this was not one of the harder programs, it certainly was not one of the easiest. Put my noncoperative luck during D-days into the mix, and I was looking at an uphill task. Next to me, I could see my friend Ankit smiling at his paper. Apparently he must have gotten the relocating loader, one of the easiest ones. Across me, Gopal was fidgeting warily with his paper. I guessed immediately that the dreaded second pass of the Dynamic Linking Loader had found its way into the hands of the only person in our class that could dare to stand up to the challenge. My eyes glanced carelessly over the room, and I was seeing a motley of expressions, some glad, some relieved, some scared, some hopeful and some woe-begone looks amongst my classmates. Forcing myself to think about the issue at hand, I looked back at my sheet. However hard I stared at the paper, the question adamantly refused to make itself easier. Deciding that I had to take a new approach, I started writing down the algorithm on the answer sheet, just to relieve my tension. My fingers were a little shaky, so I knew that I had made the right choice by choosing to write the algorithm first. Programming with a nervous mind generally ends in disaster. It took me 20 minutes to complete writing the algorithm. I still had around 2 hours and 40 minutes to tackle the code. I turned my computer on, got the exam login from the lab assistant, Mr.Tamilselvan, and opened the Linux VI editor. Taking a deep breath, I looked once more at the question sheet, desperately hoping that the question would have morphed itself into something easier. The same words I had looked at 20 minutes earlier jeered at me, as though they were daring me to take a crack at the program. My fingers were growing cold. It was then, that I saw her again. She looked at me, it was just a glance, but for some reason, my tension culminated to the point where I could hear my heartbeat. She seemed to be amused that I was sweating in the air conditioned room. True, I was looking like a dog that had been subject to a forceful shower. I looked back at her, and managed a tiny smile. She smiled back, and that seemed to relieve the tension to an extent. I started coding.

For an hour, I tackled the program, making changes to my original draft, executing the program, debugging it for errors, and making sure that the output looked reasonably acceptable. I was doing a good job I guess, because I could no longer hear my heartbeat and my breathing resumed to normal. After an hour, I was satisfied with my work, partially, to be honest. At this point, you must put up with me because I need to explain what I was supposed to be showing as output. The output for my program required me to parse the input file, reading all the symbols, and assign addresses to each instruction. These would represent the program counter values. Additionally, I was supposed to generate a symbol table, which should contain all the variables used in the instruction set, along with their address. Now that I have made this clear, let me tell you where the problem was. My parser was working fine, and it was displaying addresses for all the instructions in the input file. However, when I opened the symbol table file that I was supposed to be populating, an empty file stared back at me. I tried changing a few things in the program, but it wouldn't give in. I even tried typing in the symbol table entries. But after I ran the program, it would erase itself. I was vexed. I was tired. I sat back in my chair for a couple of minutes, thinking of other alternatives for this. My father had once told me that broad thinking would actually help in a crisis, and that there is no single route to success. He had always advocated the importance of having a backup plan incase the main plan failed. This was what struck my mind at that moment, sitting in the examination hall. I looked up. She was standing near me again, smiling at my monitor, which was now displaying the screensaver, having been idle for 5 minutes. I hastily pressed the space bar, and my program popped up. She chuckled to herself, and walked away, smiling. I couldn't help but smile at the mirth of the situation. I half wished she had not come near me, since a plan was formulating in my mind, and her arrival had interrupted its development. I willed myself to resume my thought-process, and in 5 minutes, my plan was clear. It was exactly as my father had said. I had a backup plan, one that would most likely succeed, and if it didn't, I still had about an hour left to dwell on other alternatives.

At this point, I opened up my program, and looked at the instruction where I was creating my symbol table. It read as follows: "f = fopen("symtab.txt","w");" This was a command to open the file called "symtab.txt", which should be populated with the symbol table values. This was the file that kept erasing itself, when I ran the program. I changed that line. Now, it was looking as follows: "f = fopen("ashsslabsymtab.txt","w");". It was just the same command, except that I had made the file name more complex. That had been my purpose. I executed the program, and opened that file. I already knew that changing file names don't change outputs, so it didn't come as a surprise that the file was empty. I looked around me, everyone was busy typing, this was the moment. I opened the directory where the file was stored, and manually created another file, and called it "ashss1absymtab.txt". If you had noticed carefully, this file is actually different from the one I had invoked in my program, I had replaced the 'l' of the lab with '1'. Since 'l' and '1' look similar, it is hard to notice unless you are looking for it. I opened this file that I had created, and typed in the output that I was supposed to be seeing. I executed the program again. The file invoked by the program was still empty, but this new file that I had manually entered was intact, since the program didn't invoke it at any point. My work was done.

She was coming near me again. My adrenaline level was rising. I was starting to hear the rhythmic heartbeat from within me. When she was a couple of feet away, I beckoned to her. She smiled at me, and came to me. I told her that I was done with the exercise. She wanted to take a look at it. I executed the program, and the addresses of the instructions popped up flawlessly. She was impressed. She asked me if she could take a look at the symbol table. I quickly opened the file that I had manually created and showed it to her. It had the values I had entered. She was happy. She smiled at me again, and wrote something on a piece of paper. The external instructor visiting from a nearby college called me, and told me that I had completed the programming exercise, and that I had the verbal questioning section left. She asked me questions regarding the course material, and I was able to answer most of them right. She gave me a bright smile, and told me that my exam was over. I wished her a good day, and came out of the lab. It was over.

A month later, the results came out. I had scored 98/100. A very good score, although I wasn't entirely sure if I deserved it. My conscience accused me of cheating, while my ego came to my aid and called it presence of mind in a crisis. I told myself that Ends justify the Means, and all that mattered now was that I had completed this exam with a good score. During the course of my undergrad, I met her loads of times, but after the lab examination, something had changed. We became good friends.

Three years later, I attended her wedding engagement. She was someone whom I would not forget. Someone special. I gave her a complimentary gift, and wished her a joyous married life. Yes, her name is Gayathri, and yes, she was my professor during my undergrad.

No comments:

Post a Comment