Friday, October 30, 2009

Bottom Up contruction of Octree and Visualization

I along with Ashwin had done a graphics project in which we were supposed to build octree efficiently and to answer near queries for nodes.
The project is here.

Please go through the Readme.
One possible set of instructions to run the code is as follows
1) make
2) make random
3) ./random > input.txt
4) cat input.txt
5) ./octree input.txt
1 (for selecting a node)
1.80277 1.10057 1.23684 (giving the node which basically select any one point from the input.txt ...this is the first random point which was generated)

thats it .... a window will open and use arrow keys to navigate
i = zoom in
o= zoom out

Friday, September 18, 2009

Using Gmail's Email Autocompletion to your advantage

Hello All,

This post is specially directed towards the Hostel Sysads of IIT Bombay Hostels.

What problem are we trying to solve ?
When mails and couriers arrive at the Hall Manager's Office in our hostels, we want to set up an easy system which will allow the Hallie's assistant to notify those who have got mails by sending emails to them.

We will create a file which has mappings from Room No of student to his EmailId in a .csv format which will be accepted by Gmail. Then Gmail's autocompletion feature will display the email id when you write the room no.

1) An input file which contains mapping of room no. and email id of person living in that room
2) A python script which converts this input file into .csv [CSV = comma separated values] which Gmail accepts.

Download this zip file. It has three files.
a) A sample input file named "HostelAddressBook.txt". In that file, you will see two columns. First column is a room no. and second column is an email id of person living in that room.
b) file.
c) An output file "mappings.csv" which was generated after running the python script on the input file.

1) Download the above file and extract it.
2) Run the script by typing "python" on the terminal in linux.
3) Output file: "mappings.csv" is generated.
4) Import this file into Hostel Office Gmail account by following the instructions given here.
5) Testing: Once the import is completed, start to compose email. In the "To" field, write the room no(e.g. A704 ) which is present in the input file.

The python script used in above code is hardly of ten lines. You can easily understand the code and modify it to suit your needs. Like if you need mappings from a person name to email id rather than room no.

Please do post comments and modifications.

Sunday, September 6, 2009

sources.list for IITB Junta for Ubuntu 9.04 i.e Jaunty

deb jaunty main restricted universe multiverse
deb jaunty-updates main restricted universe multiverse
deb jaunty-backports main restricted universe multiverse
deb jaunty-security main restricted universe multiverse
deb jaunty-proposed main restricted multiverse universe

Sunday, August 30, 2009

The The English Language Is Goofy

The following poem was a comment to the post by the above name. I liked it and hence reproducing it here.

We'll begin with a box, and the plural is boxes,
But the plural of ox becomes oxen, not oxes.
One fowl is a goose, but two are called geese,
Yet the plural of moose should never be meese.
You may find a lone mouse or a nest full of mice,
Yet the plural of house is houses, not hice.

If the plural of man is always called men,
Why shouldn't the plural of pan be called pen?
If I speak of my foot and show you my feet,
And I give you a boot, would a pair be called beet?
If one is a tooth and a whole set are teeth,
Why shouldn't the plural of booth be called beeth?
Then one may be that, and three would be those,
Yet hat in the plural would never be hose,
And the plural of cat is cats, not cose.
We speak of a brother and also of brethren,
But though we say mother, we never say methren.
Then the masculine pronouns are he, his and him,
But imagine the feminine: she, shis and shim!

Let's face it - English is a crazy language.
There is no egg in eggplant nor ham in hamburger;
neither apple nor pine in pineapple.
English muffins weren't invented in England .
We take English for granted,
but if we explore its paradoxes,
we find that quicksand can work slowly,
boxing rings are square, and a guinea pig
is neither from Guinea nor is it a pig.
And why is it that writers write but fingers don't fing,
grocers don't groce and hammers don't ham.
Doesn't it seem crazy that you can make
amends but not one amend.
If you have a bunch of odds and ends and
get rid of all but one of them, what do you call it?

If teachers taught, why didn't preachers praught?
If a vegetarian eats vegetables,
what does a humanitarian eat?
Sometimes I think all the folks who grew up speaking
English should be committed to an
asylum for the verbally insane.
In what other language do people recite at a play
and play at a recital? We ship by truck but send
cargo by ship. We have noses that
run and feet that smell. And how can a slim
chance and a fat chance
be the same, while a wise man and a
wise guy are opposites?

You have to marvel at the unique lunacy of
a language in which your house can burn up as
it burns down, in which you fill in a form by
filling it out, and in which an
alarm goes off by going on.

So if Father is Pop, how come Mother isn't Mop?

And that is just the beginning--
even though this is the end!

Wednesday, August 26, 2009

Jaunty Ubuntu 9.04 Using more cpu

Recently I installed ubuntu 9.04 on my computer.
All was fine except that it was using more cpu than usual.
I used top and system monitor to determine which process is using more than its normal share.
Unfortunately, I couldn't found any.

Thankfully I found this post.
According to it, the "vino" (VNC server) which comes installed with ubuntu is causing some problem.

So solution my friends (which worked for me) is to simply uninstall it.
I am simply writing this post to duplicate the solution so that this solution comes early in search results.

Thanks for reading and do comment if you find this useful.
Again your comments are important to determine the usefulness of this solution.

Friday, August 21, 2009

Setting up Ldap based logins in Hostel Comp Rooms in IIT Bombay

First of all, a sincere thanks to Pankaj Pandey for helping me out in creating this script and the innumerable ways he has helped me.

We have created a script which allows one to set up Ldap based login in computers.

How it works: We have a file called as ldap_logins in config folder. This file contains ldap logins of those students whom who you want to give login access.
When a student enters his login and password, it verifies the ID with ldap and then checks whether his name is present in the file.

Prerequisites: We have tried this method on only Ubuntu computers. So we don't guarantee that this will work on any other system i.e. Fedora , Gentoo, etc . If it works then fine but if it doesn't we cant help you.

You need to have working computer with Ubuntu running on it. Also iitb-repositories must be properly set, i.e. aptitude command should work.

1) Download this script and untar.
2) Run the following commands:
sudo ./
While configuring ldap, it will ask for two things,
b) ou=People,dc=iitb,dc=ac,dc=in

3) Ldap version to be used is 3
4) Select "No" twice.
The script continues and installs other related things.
5) Restart the computer

Go through the script to understand what is happening.

We have also created a python script which will give u ldap logins if you give it a text file containing rollnos. You can get such a list of roll nos from Hall Manager. This script is present in ldap_search folder. The script is straightforward.
To run the script, you need to have ldap module installed.

Friday, March 13, 2009

Some Links

Some links which I liked. Try them out. Not sure whether they will still work.

The Paradox of Our Age

The paradox of our time in history is that we have taller buildings but shorter tempers,
wider Freeways, but narrower viewpoints. We spend more, but have less, we buy more,
but enjoy less. We have bigger houses and smaller families, more conveniences, but less time.
We have more degrees but less sense, more knowledge, but less judgment,
more experts, yet more problems, more medicine, but less wellness.

We drink too much, smoke too much, spend too recklessly, laugh too little, drive too fast,
get too angry, stay up too late, get up too tired, read too little, watch TV too much, & pray too seldom.

We have multiplied our possessions, but reduced our values. We talk too much, love too seldom, and hate too often.

We've learned how to make a living, but not a life. We've added years to life not life to years.
We've been all the way to the moon & back, but have trouble crossing the street to meet a new neighbor.
We conquered outer space but not inner space. We've done larger things, but not better things.

We've cleaned up the air, but polluted the soul. We've conquered the atom, but not our prejudice.
We write more, but learn less. We plan more, but accomplish less. We've learned to rush, but not to wait.
We build more computers to hold more information, to produce more copies than ever, but we communicate less & less.

These are the times of fast foods and slow digestion, big men & small character, steep profits & shallow relationships.
These are the days of two incomes but more divorce, fancier houses, but broken homes. These are days of quick trips,
disposable diapers, throwaway morality, one night stands, overweight bodies, & pills that do everything from cheer,
to quiet, to kill. It is a time when there is much in the showroom window & nothing in the stockroom. A time when technology
can bring this letter to you, & a time when you can choose either to share this insight, or to just hit delete...

Remember; spend some time with your loved ones,
because they are not going to be around forever.

Remember, say a kind word to someone who looks up to you in awe,
because that little person soon will grow up & leave your side.

Remember, to give a warm hug to the one next to you, because that is the only
treasure you can give with your heart & it doesn't cost a cent.

Remember, to say, "I love you" to your partner and your loved ones, but most of all mean it.
A kiss and an embrace will mend hurt when it comes from deep inside of you.

Remember to hold hands and cherish the moment for
someday that person will not be there again.

Give time to love, give time to speak! And give time to
share the precious thoughts in your mind.


Life is not measured by the number of breaths we take,
but by the moments that take our breath away.

If you don't send this to at least 8 people....Who cares?

I dont know whom to attribute this.
Here are some links to help you out.
But origins apart, its a wonderful piece to read.

Speak Up

Let me read you something by Martin Niemoeller, a German pastor who opposed
the Nazis.
"In Germany, they came first for the communists,and I didn't speak up because I wasn't a communist.
"Then they came for the Jews,and I didn't speak up because I wasn't a Jew".
"Then they came for the trade unionists,and I didn't speak up because I wasn't a trade unionist.
" Then they came for the Catholics, and I didn't speak up because I was a Protestant".
"Then they came for me,and by that time, there was no one left to speak up".

I heard the above quote first in Boston Legal from Shirley in a case. I dont remember exactly which one.

Tuesday, January 20, 2009

Settings for thuderbird in IIT Bombay

In this post, I am gonna give some basics on setting up gpo( for general iitb junta) and cse(for cs junta) account logins. Also useful would be setting Ldap and Cse Ldap directory in address book so that you dont have to actually go to (intially it was and search someone gpo address there.

So here they are:

Install thunderbird.

For GPO Account:
Now we need to create email accounts,
Go to File>New>Account
Then select Email Account and click on 'Next'
Now in the Email Address dialog box put your GPO emailid,then click 'Next'
Here select 'IMAP' option and put imap-server as '' (without quotes)
Also it will ask for smtp server, give it as ''
Rest is simple, click on 'Next' and fill in the details as required and then on 'Finish'
As a final step, do this
Edit->Account Settings->Outgoing SMTP server>Edit.
In the new window that opens, select TSL, if available option
and you are done

For CSE Login Account:
Now we need to create email accounts,
Go to File>New>Account
Then select Email Account and click on 'Next'
Now in the Email Address dialog box put your GPO emailid,then click 'Next'
Here select 'IMAP' option and put imap-server as '' (without quotes)
IF it will ask for smtp server, give it as ''
Rest is simple, click on 'Next' and fill in the details as required and then on 'Finish'

For setting up Ldap Address Directories:
Go to Tools>Address Book
Click on File> New > Ldap Directory
for gpo ldap directory do this:
Name : Ldap
Hostname :
Base DN : dc=iitb,dc=ac,dc=in
Port : 389
Bind DN : leave blank

for Cse Ldap directory do this:
Name : Cse Ldap
Hostname :
Base DN : dc=cse,dc=iitb,dc=ac,dc=in
Port : 389
Bind DN : leave blank

For News Group Account:

File -> New -> Account -> News Group Account
Fill in your name and email address.
News Server :

After your account is created, you need to manage your subscriptions, by selecting the groups whose news you would like to receive.

Tuesday, January 6, 2009

Installing Xspim on Ubuntu

Installing Xspim

download tar.gz file from this location

(to get xmkmf)
>>>sudo aptitude install xutils-dev

(required for compiling)
>>>sudo aptitude install flex bison

(required for windowing system)
>>>sudo aptitude install libxaw7 libxaw7-dev

go to xspim directory

change Imakefile as follows

set the following directories to whatever locations u want
I think u can skip this step

first create directories E-Dir,B-Dir,M-Dir
>>> mkdir E-Dir B-Dir M-Dir
Then edit the Imakefile in xspim directory as follows:

# Full path for the directory that will hold the executable files:
BIN_DIR = /opt/spim-7.4/xspim/B-Dir

# Full path for the directory that will hold the exception handler:
EXCEPTION_DIR = /opt/spim-7.4/xspim/B-Dir

# Full path for the directory that will hold the man files:
MAN_DIR = /opt/spim-7.4/xspim/B-Dir


type at command prompt
>>>make install

To run
>>> cd B-Dir
>>> ./xspim