Sunday, September 11, 2005

Spent the weekend doing my scheme assignment. More precisely spent most of the weekend thinking about how to write a macro for letrec. No clean solutions yet.

However, I see that there is a class of problems that need *something* extra to be solved. Its all guesswork at this stage, so I could be totally off the mark.
Here's a simple problem.


(let ([a 5] [b a]) ..)

A let* or a nested let will make the above assignments work by making a visible to b.  The sequential approach would require a to be defined before b or b to be within a's scope.

(let ([a 5])
    (let ([b a])
       .....
))


This would probably solve the above problem.
Now, how about


(let ([a b] [b "B"]) ...)
   
In (letrec ([x1 v1][x2 v2]...[xn vn])How can you ensure that all x's can see other x's?
In scheme, my guess is that this is implemented as a function [How? Dont arguments need to be evaluated then?]

An attempt to write this as a macro,
without using any side-effecting operations will prove the need for some kind of a parent structure that embeds all the variables and passes the structure around for each assignment. This problem led me to the discovery of  (1) and (2).  While the first url is very readable, the 2nd one is more complete and much less readable.

I keep trying to shut out the imperative part of my brain, How would you do this functionally?

Sunday, September 11, 2005 5:00:48 PM (US Eastern Standard Time, UTC-05:00)  #    Comments [20]Trackback
 Wednesday, September 07, 2005

If you are looking to buy a gift for a geek, then you may want to look at thinkgeek.
I like the digital photo frame where you can connect a photo frame to the usb port of your computer and copy upto 10 pictures and then start a slide show on the frame. That frame will look good in my living room, just that the price $434 doesn't look too good to me. The idea is pretty neat though.

Talking about ideas who would ever think of an internet urinal?! A geek of course.

Wednesday, September 07, 2005 8:28:06 PM (US Eastern Standard Time, UTC-05:00)  #    Comments [3]Trackback
 Monday, September 05, 2005

Flying Spaghetti Monsterism - . I am still shaking my head after reading this. Read it and don't forget to read this and the comments in the discussion forum on the page.

RAmen.
Monday, September 05, 2005 2:43:49 PM (US Eastern Standard Time, UTC-05:00)  #    Comments [4]Trackback
 Monday, August 22, 2005

I have been thinking about what courses to enroll for for the past few days. The fall '05 CS subjects that have been interesting me are

1. Independent Study with a professor I will be doing research with

2. Operating Systems

3. Principle of Programming Languages

4. Quantum Computing

5. Algorithms

Practically I can do only 3 of these in a semester and it was easy for me to decide that I wanted to do 1 and 2 for sure. I also decided that I could take algorithms next semester. Now between Programming Langauges and Quantum Computing, I didn't know which to drop. I wanted to take the compiler course (and parallel computing course) next semester, so Programming Langauges would have been a good thing to study this semester. However, I decided I would study quantum computing. Scheme scared me off and I decided to drop programming langauges.

Half an hour before my appointment with my graduate advisor, I bumped into Dan Friedman. I introduced myself, he seemed to remember that I had emailed him. I told him how intimidated I was by him and so how I hadn't met him earlier. I knew of him as this big man who wrote a lot of scheme books. I have never programmed in scheme and do not understand many of the functional programming concepts. I have not understood continuations for example. Roshan and Sidharth often discuss the stuff and I participate in it as long as it seems mathematical and the moment they write scheme on paper [its usually paper napkins in some cafe/restaurant], I shy away from the discussion.

I told Dr. Friedman about my interest and about my inexperience with scheme and he said I must take the course. A 5 min conversation with him and I decided to take the course :-) !
Quantum Computing will have to wait I guess. I am excited about the classes (I can't remember the last time I waited with anxiety for a lecture), they begin on 29th August.

Monday, August 22, 2005 3:31:27 PM (US Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Monday, August 15, 2005

Do not read this blog entry if you are not a Harry Potter enthusiast or if you intend to read book 6 and haven't done so yet.

Like many Harry Potter enthusiasts I read Harry Potter Book 6 as soon as I could lay my hands on it.

Harry Potter and Half Blood Prince is like a prequel to the last book. Its quite obvious as you read the book that Rowling has thought out the entire story before she wrote this book. It kinda ends abruptly, but like most Harry Pottter books keeps you hooked on till the end. I see it as a good improvement over the previous book which was a let down for my high expectations. This one quite lived upto my expectations and wait time. When I finsihed reading the book at some insane time early morning [or late night for most of us], I was very depressed and shocked about Dumbledore's death. I woke my brother [Ankit], who is generally very irritable when asleep, and told him "Ankit, Snape killed Dumbledore..", he woke up instantly with a wide grin and said, "I knew it". The two of us sat and spoke and discussed the book for sometime after that. Our discussions and conclusions and thinkings are below.

Seeing Dumbledore's faith in Snape, I believe that Snape is not a *real* villain. Ankit thinks Snape is what he is projected to be in this book. I actually think of Snape to be this smart cool guy [I could fall in love with if I were at Hogwarts :)] after reading this book. Probably a secret setup between Dumbledore & Snape to get to the next trust level in Voldemort's eyes. The next guess is that RAB  is Regelus Black, the deatheater who I think died at Azkaban in the previous book. The final guess is that Harry Potter could be a horcrux and so Harry Potter may have to kill himself to destroy Voldemort completely after he destroys the remaining horcrux-es.

The next day I googled for Harry Potter and Half Blood Prince and found to my surprise that there were others who came up with the same theories. I hope Rowling is reading it all and manages to surprise the readers with the final book.

If you are a Harry Potter fan http://www.dumbledoreisnotdead.com/ is a place you may want to visit.

Monday, August 15, 2005 11:49:59 AM (US Eastern Standard Time, UTC-05:00)  #    Comments [15]Trackback
 Sunday, August 14, 2005

I reached US after what seemed like a never ending flight. I had to change 5 flights and visit 7 airports to get here! Boy, the airlines should have paid me for trying this route out! I am sure not too many would. Cochin - Colombo - Bangkok - Hong Kong - LA - Chicago - Indianapolis !

Well, look at the bright side, I saw the airports of quite a few different counties :)

Bloomington is a small town, a large bulk of its population coming from Indiana university. The Indian population here is quite small.

I am getting used to some of the american jargon [egg plant, okra, pickles ...] and realising that India has its own additions to the Indian english language.

Cell phones in the US work quite differently. Believe it or not, cell phones in India are quite a blessing and the service works much more reliably. And we crib about airtel and hutch not working in caves and mountains when we go for vacations! Here cell phones are based on minutes [time], it doesn't matter whether you receive or make calls, most plans its just the same. Your usage minutes go down. And this applies for toll free numbers too. Well, the good thing in US is you could sign up for a 1 yr or 2 yr plan and get a handset free [the way our reliance phones work] and that you could change your service provider and still retain your phone number. I guess we'll get there soon.

I have my international students orientation next week. I hope to spend free time in finding an apartment to stay in and buying essential furniture if its an unfurnished place.

Sunday, August 14, 2005 1:01:34 PM (US Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback
 Wednesday, July 27, 2005

I am in Cochin till Aug 9. Thought it was a good idea to spend time with family before leaving for pardes. So the general advice I am getting from family, relatives and their friends is to come back to India soon. All the talk is managable as long as I am being fed good home made food.

Last few days in office, I saw how much of a pain storage still is. About 6 months of photos and only photos and I have over 4 giga bytes of images - none I want to part with. What is the best way to carry this data around? And what is the best way to arrange them without spending too much time on it and assuming that they aren't well catalogued? I don't like the idea of resizing them and uploading them as an album in one of the photo-upload websites. I want to preserve the resolution and exif information of all the images. And we are talking about a few gigabytes here. Any clean solutions?

Wednesday, July 27, 2005 8:14:11 AM (US Eastern Standard Time, UTC-05:00)  #    Comments [0]Trackback