The one about the Nostalgia

High school friend pings me. We chat for a bit, he starts getting sentimental about school. About “missing those back bench memories,” and “had a great time then.”

It appears that, over the years, I have grown immune to nostalgia. All I could remember was being sent out of class every day. And that’s what I told him, possibly phrasing it in a way that didn’t sound too arrogant.

Anyway, that’s not the point.

I recently took a look at my CMI homepage again. At a first glance, it seems (by second glance, you get convinced) to be the least professional a home page can get, especially in academic circles. “Especially,” because in academic circles, CSS is a sign of joblessness.

Also, it has these pretentious copyright notices at the bottom of pages, and some pages having something that goes “Linux is a trademark of Linus Torvalds.” By the time you’re reading this, those notices have been removed, so don’t bother.

Then there was also my homepage in Hindi. I guess, I had to find some use of my then new-found skill of typing in Hindi.

But again, this is not the point.

On the project page, I found this link to “openMath”. High school Computer Science, board exam project. First fairly complete code written after I moved to Linux. Oldest surviving code written by me. (The older code died during the Great Hard-Disk Crash of 2004, which also coincided with the Great Backup-Floppy-Disk Crash of 2004.)

And with that, I figured I am not that immune to nostalgia after all.

I decided to compile it again.

It took me some effort to do that, since there were many stale cpp files around. No makefile. Hard-to-read code. (I used Kdevelop at that time, which did the compile business for me, and also used Visual C++ to compile for windows to demo at school.) But in the end:


arnold@arnosh:~/builds/openmath/Release$ ./a.out
openMath Beta, Release 0.1.2 Jan-2005
(c) 2004-2005 A J Noronha.
You are free to redistribute or modifu this program under the
the terms of the GNU General Public License version 2.0

Restoring previous session ... failed.
Loading default session ... okay.
#

First try:

# eval 1+2+3+4
10
# eval ln(exp(3))
3
# eval x=8
8
# eval sin(x+2)
-0.544021

Impressive. I should also point out that it does this infix to postfix conversion, which I had then just learnt in school.

What else functions are supported? I hacked my way through the messy code to find the following command:

# oper-showall
oper+ oper- oper/ oper* oper= oper. oper^ oper~ tan cot sin cos cosec sec asin acos atan sinh cosh tanh ln log log10 exp pow10 pow v Z re im oper/vr oper-vv oper*rv oper+vv box

It turns out I have inbuilt datatype support for complex (Z(1,2)) numbers and vectors!


# eval re(Z(1,2))
7.6638e-4943

Hmm, I can swear it used to work five years ago.


# eval v(1,2,3)
[1,2,3]
# eval box(v(1,2,3),v(1,2,3))
Segmentation fault

Oh well.

I can define functions too:


# oper f %1^4
# eval f(3)
81
# oper f %1^%2
# eval f(3,5)*2
486

I can overload operators!


# oper oper* %1+%2
# eval 3*4
7

Apparently I have code in place to polymorphically overload operators for different datatypes. For instance, oper+vv is the function for adding two vectors. But, umm, I can’t get it to work.

Anyway,

# quit
arnold@arnosh:~/builds/openmath/Release$

Advertisements

One Response to The one about the Nostalgia

  1. After exploring a number of the articles on your website, I really appreciate your way of blogging.
    I book marked it to my bookmark website list and will be checking back in the near future.
    Take a look at my web site as well and let me know how you feel.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: