March 31, 2009

Logo, Lisp and Me

By the time I moved to a new school (Don Bosco School, Siliguri) in Grade 5, they had stopped teaching LOGO. So, my journey with computers in any form started with GW BASIC. So, I had no idea about what LOGO was except that it was fun. I did not have a computer so early and by the time I got it, I was too old (!!) for learning LOGO.

Some things have changed now, however. After 14 years have passed, I don't think that I am too old, any more! My 10 year old sister is learning LOGO in her 4th grade (Saint Joseph's School, Matigara) and I want to teach her to program LOGO on the computer. So I began my LOGO learning journey..

The first things I saw startled me:

To top it all:

"Logo is the name for a philosophy of education and a continually evolving family of programming languages that aid in its realization."
- Harold Abelson
Apple Logo, 1982

Never lose the child like wonder- said Randy Pausch in his last lecture. Well, I am 24 and I hope computers will continue startling me for many years to come!

March 29, 2009

Book Review: The Last Theorem


I finished reading The Last Theorem, Arthur C. Clarke and Frederik Pohl. Its a story of Ranjit Subramanium and his life after he finds a proof to Fermat's Last Theorem

There is also a parallel storyline in the book which involves characters from other parts of the universe- Grand Galactics, One point fives and machine-stored creatures. The two storylines have common strings attached at various points and finally converges in the end with both Ranjit and Myra (his beloved wife) ending up as machine-stored long after their deaths.

My main motivation in reading this book was its fictional relationship to the theorem. Considering that, I am a tad disappointed as it doesn't really justify my choice as it has a somewhat cursory in its treatment of the theorem.

However, taking that out of the equation, this book is a enjoyable read as it takes you on a voyage in a solar sail and more. To the math lover's delight there are references to Sophie Germain and Lady Ada Lovelace.

For a detailed review of the book, please visit http://www.sfsite.com/03b/la292.htm
Link

March 28, 2009

CS17 at Brown University: A great CS foundation course

I just finished going through bulk of the lecture notes published as part of the CS17 course of Brown University.

The course begins by introducing functional programming via Scheme and moves on to OCaml in later stages. By introducing the two languages, the students get a flavor of a static and a dynamically typed language. An important point inferred is: static typing is not simply about prefixing the data type of the data during its declaration.

Just as a basic foundation course should, the course also introduces algorithmic analysis, Abstract Data Types or ADTs- the reason for calling them abstract is very well clarified with illustrations.

There are really great lecture notes in there and they are enjoyable too. If you are a CS student work the assignments out. If you are no more a student with at least a faint interest in good CS and if you haven't taken a look at this course, please do.

I would also be interested in knowing some more such delightful courses. If you know one, please let me know in a comment. (I am aware of SICP, and currently have planned a schedule for working through them)

March 27, 2009

SoM: Amnesia of Infancy


(Image Source: http://www.medicirc.org/images/infancy_off.gif )

Marvin Minsky in in the prologue of his book- The Society of Mind, describes common sense as an amnesia of infancy, which makes human beings forget the way they learned to do simple things such as putting blocks together to form a tower.







Its insanely hard to tell more than a I don't know, when confronted with the How of knowing certain things:

Q: How do you know that if you fall, you get hurt?
A: I fell for the first ever time in my life and I got hurt, so I know that.

Q. How do you know that?
A. I learnt it the first time

Q. How did you learn and how did you remember?
A. I don't know much except that I, like most sane living beings, including animals have something called a brain which tells me these amazing things, which I now would classify under common sense.

Not perhaps the best example to prove my point. But, the idea is that most things that we know today, as adult human beings converges to a point, where all seems to be common sense, the origin of which we don't know.

Perhaps, that is amnesia of infancy.

March 22, 2009

The Music of Primes

You really don't have to be a (wannabe) Mathematician to love prime numbers. Just browse through http://www.musicoftheprimes.com/ and you will have spent a very enlightening 45-60 minutes of your time.

Also, you might try to get hold of the book: http://books.google.com/books?id=3wtJP1qmnUcC

March 16, 2009

Learning Machines

I just finished reading Computing Machinery and Intelligence, the oft-cited seminal work of Alan Turing.

The paper is the basis of the Turing Test that is a proposal for testing a machine's ability to think and hence demonstrate  Intelligence, at par with Intelligent human beings.

Among the various issues discussed in the paper, (bulk of which I comprehended only slightly), section on Learning Machines interested me a lot. During a year's work (a year ago;now in coma) on Commonsense Reasoning, along with my supervisor, we were trying to devise or at least think of solutions to endow programs with simple commonsensical facts and figures- stuffs that "we, humans just seem to know", but the all conquering machines seem so dumb when confronted with them. The interesting point that is mentioned in the work is:  

Instead of trying to make machines think or know like adult humans, we should rather think of making them think like small children, at birth and subject them to a learning process- filled with punishments and rewards, so that they learn during their life- so that they grow. They have a lifetime. In my words, I would call it as making machines aware of their immediate sourroundings, so that they learn, and gather exprience, as humans do.

On greater motivation and understanding, I might try my hand at giving back a bit to Wikipedia

March 12, 2009

Magical 6 Figure

Howdy Readers! My blog hit the 100000 mark sometime today morning! Yay! I am also closing in on 500 posts.

Its been a great 3 years of blogging!

March 10, 2009

Quick Tip: Setting up LaTex editing with 'gvim'

A year back, when I was using LaTeX for preparing my high-quality (at least visually!) technical reports, I used Kile. I liked it and was very happy with it.

I need to edit a .tex file again. However, instead of using Kile (which is a KDE program) on my XFCE destop, I decided to set up VIM for LaTex environment.

Turned out to be really simple:
  1. Install the base latex compilers,etc. On Ubuntu, use sudo apt-get texlive-latex-base
  2. Configure the Latex suite by following the excellent instructions here
And, you should be ready to go.

March 7, 2009

Book Review: The Hammer of God



I finished reading my first Science Fiction work ever (Never too late :-))- The Hammer of God, Arthur C. Clarke.

Why did I choose this book, since frankly I had hardly any idea about what I was buying?
Well, I wanted to start reading Science Fiction (Why? Read the second point in Points for Style in How to Become a Hacker) and I had an upcoming 4-5 hour road trip coming up.

I was browsing through the books in the Science Fiction section and was reading the summary when the name of the asteroid- kali struck me. I mean, Kali? The Goddess of destruction, and being an Indian and a Bengali, I found it weirdly amazing. So I happily picked the book up, was excited to buy my first Science Fiction work ever and already had in mind the text I would write on the first page of the book.

It was an amazing read, taking exactly a week to finish and savour. How do I feel after reading my first Science Fiction?

Give me more
!

March 4, 2009

DTrace on Linux

Linux port of DTrace has been moving for some time now.

I just tried the latest bits from ftp://crisp.dynalias.com/pub/release/website/dtrace and the initial impression is we got really cool stuff (in the making here).

Besides, GCC, Kernel headers, you will need the following stuffs to compile and load the DTrace kernel module:

  • libelf-dev: Working with 'elf' files
  • zlib libraries: working with the zlib files
  • bison, flex
Once you have got them, extract the sources and do:
  1. make all
  2. sudo make install
  3. sudo make load
If you do not see any error message, then the DTrace kernel module 'dtracedrv' has been correctly insrted.dtrace -l should display a long list of the currently available probes.

Let's try a simple DTrace one-liner.

This DTrace one-liner dtrace -n 'syscall:::entry { @num[probefunc] = count(); } will display the number of times a system call is invoked during the time its running. Press a C-c after sometime and you should see something like this:


amit@kubuntu904:~$ dtrace -n 'syscall:::entry { @num[probefunc] = count(); }'
dtrace: description 'syscall:::entry ' matched 329 probes
dtrace: buffer size lowered to 512k
dtrace: aggregation size lowered to 256k
^C


kill 1
rt_sigpending 1
readlink 2
sigprocmask 2
brk 3
uname 3
lstat64 5
fcntl64 7
sigreturn 7
close 11
open 11
socketcall 11
_llseek 14
munmap 15
rt_sigaction 16
mmap2 19
access 27
rt_sigprocmask 30
stat64 54
fstat64 69
setitimer 230
writev 397
time 482
_newselect 545
write 709
futex 727
ioctl 754
poll 1583
gettimeofday 2212
read 4878
clock_gettime 5462



That's all for now. I just wanted to post my initial excitement :-)

Some points:
  1. If your OS seems to hang after the DTrace command, and even a C-c/ C-d/ C-z won't help, then its possibly an issue with the terminal you are using. I had issues with gnome-terminal, xterm and ETerm. However, it works perfectly on KDE's konsole
  2. If you are using Debian 5, you will possibly need to recompile your kernel for the zlib symbols in the kernel
  3. If you are familiar with DTrace on Solaris, you must have noticed that I could use DTrace as non-root user, this is different from the way it works on Solaris. I shall try to explore more on this.

March 2, 2009

NetBeans Community Docs: 300!

Hey all!

We at the NetBeans Community Docs have reached 300 documents! Wow! Exactly, 2 years back the program was started by James Branam!

Congratulations to all involved in the program! Thank You James for starting the program which have helped many a soul to do their bit for a great Open Source project.

A very big Thank You :-)