Weblog of an Aspiring Computer Scientist
Random header image... Refresh for more!

Posts from — September 2007

Geometry, Desktop Environments.

So, here we are at this very important juncture in life. Probably three months from now, I shall be clicking “Send” on each of my college applications. But first an update on what I have been doing. I am trying to write clean code and create a backup script. It seems to be coming on nicely. I have to just include the command line options and it should be in working condition. Apart from that I have switched to xfce which seems to be a terrific alternative to KDE (ahem for my museum piece). I don’t know why but I happen to dislike KDE. It is such a resource intensive envrionment and comes with unnecessary bells and whistles like bouncing icons and whatnot. XFCE is ok.

I still love fluxbox. By the way I came across a wonderful book called “Geometrical constructions with compasses only” by A. Kostovskii ( I don’t know why the author put two “i”s in there).

The Mascheroni theory states that, “All construction problems solvable by a ruler and a pair of compasses can be solved by a pair of compasses alone. ”

I had a look at some sample problems in the book. Most were of the variety that I had done already such as drawing line segments n times the length of the given line segment and so on. I skimmed through and got to the part that I hadn’t come across before.

Inverse. Let us say we have a circle with centre O and radius “r”. If we fix a point P somewhere in the plane of the circle, then point P’ is the inverse of point P if |OP|.|OP’| = r ^ 2. The circle in question is called the circle of inversion.

I then had a look at some of the problems that came at the end of the section on the inverse of a point. One question involved proving a theorem that went:

“The inverse of a line with respect to a circle is a circle.” Let us see how this can be solved. I felt that this was very simple. I fixed a point P on the line, dropped a perpendicular from the centre of the circle on the line and marked the point of intersection as Q. I then plotted the inverse points of those two points. Considering that Q is the foot of the perpendicular from the centre, we can safely assume that the angle OP’Q’ is equal to angle OQP = 90 degrees as OP’Q’ and OQP are similar triangles. As P is moved along the line, P’ moves along the circle as the angle OP’Q’ will always be 90 degrees.

The next question involved plotting the inverse of a point P with respect to a circle with centre O using only a compass. I used the idea of similarity as quoted in the previous paragraph. If P’ is the inverse of P, OP/OQ (Q being a point on the circle) = OQ/OP’. Finished. OP’ x OP = OQ ^2. So if we draw a circle with centre P such that it cuts the circle at points D1 and D2, With D1 as centre and OD1 as the radius, draw an arc and cut this arc with another one obtained by carrying out the above procedure with point D2. Tada, inverse obtained.

I then had a look at some sample problems solved by Mascheroni himself !!

One feature I have observed about the constructions done by Mascheroni are very elegant. For example have a look at this question:

“Plot the centre of a given circle.”

I rattled my brains and came up with the age old solution of getting two normals to intersect. I simply could not avoid using the ruler. One would of course attribute this to the fact that my experience with the inverse of a point or a curve is limited but I feel that if ideas don’t strike when the material learned is fresh in the mind, when will they strike?  I hate looking the solutions to problems but I was forced to look at the solution to this one. Here goes:

Take a point on the circle. We’ll call this point “O”. With O as the centre and taking any arbitrary radius “r”, draw an arc cutting the given circle at A and B. With OA as radius, draw an arc and cut this arc with another one drawn with B as centre and OB as radius. We should be getting point O’. If we draw a circle with centre O’ and radius OO’ such that it cuts the first drawn circle at D and D’, the points of intersection of arcs with centres D and D’ and radii OD and OD’ respectively give us point O” which is the centre of the given circle.

The proof seemed fairly simple as soon as I read the solution. Since A and B were lying on the same circle, A was the inversion of B and vice versa. Hence the circle is the inversion of line AB. So elegant.

I don’t know when I will reach the capability of Mascheroni, V. A. Uspensky and other mathematicians whose works I have been exposed to. I just hope that that day comes soon.

September 29, 2007   No Comments

Pdumpfs - a cool versioning utility, Elephant Filesystem

Here is a simple versioning utility - for those who like to keep it short and simple. pdumpfs is similar to Plan9’s dumpfs. pdumpfs is written in Ruby and stores snapshots in YYYY/MM/DD format. To the current snapshot, only those files are copied which actually have been modified. Those which haven’t been modified end up as hardlinks to the previous snapshot. Cool ain’t it ? Have a look at pdumpfs at http://0xcc.net/pdumpfs/index.html.en. Enjoy !

I came across a pretty interesting filesystem called the Elephant FileSystem. Why ? Because Elephants never forget ! EFS was made keeping the public in mind. Thats right ! EFS is what I call cool. Let me explain. Manually controlled versioning filesystems need to be controlled ( excuse the redundancy ). This can result in too many backups and not to mention the confusion that follows. Apart from this, lets just say you are working on a file and make a blooper ( read as edit a whole paragraph and save only to realize that the previous paragraph was better ) and did not run the versioning utility before undertaking this enterprise, you have to resort to your memory. EFS versions a file as soon as it is written to. However, most operations are reversible. Deleting a file does not mean that it has been booted out of the storage device. Data retention policies can be specified for every file or a group of files. EFS scores all its brownie points courtesy its understanding how users store files on their drive. While it becomes impossible to remember what distinguishes a version of a file from another, EFS does it using the concept of landmark files. This is because storage is always limited. One can never have an infinitely large storage device. When you get close to occupying all the space on your drive, it becomes necessary to kick out a few of those versions. EFS’s creators believe that a landmark file should be allowed to stay and other lesser important files be removed. Heuristics of files should of course be determined by us. A landmark could be newest version of the file or one which had the largest time gap between successive versions and so on. It is also important to distinguish between source files and object files as object files are rarely of use after linking The paper talks of two versioning policies - keep one (the policy that comes with all filesystems)/ keep all (the policy that comes by default with most versioning filesystems ) and keep landmarks (the coolest of the policies ). The filesystems we use on a day to day basis allow us to link one inode per file. Thus one can use the inode number to name files. However EFS departs from this model as files have multiple inodes. It redefines inode numbers to index a file’s log instead of its inode.

EFS treats directories differently compared to files. The directories plainly store versioning information. The creation and deletion (if deleted) times of a file are stored. Directory entries are retained as long as at one version of the file they name is retained.

EFS is cool but I do feel that a nomenclature style like ext3-cow would really be excellent. Have a look at EFS, its definitely worth it :) .

September 22, 2007   No Comments

Yes.. I am back in action.

I suppose whoever is wasting their time reading this blog must have gotten tired of that very line. Anyway I am working hard on my coordinate geometry script. I also got myself a HP 50g calculator. It rocks to the core. It is amazing. I got it to draw a lot of graphs for me. It comes with minesweeper too !

By the way, I had a look at useless python’s source code page and I could see my name there. Stumped! It is the same script I used to solve that feisty trouble (1st post or 2nd post). As per useless python’s website, I am truly useless :)

I am working on creating a Pi file filler and a Pot file reader and I have decided to go with sqlite3 to store the msgids. Anyway, more on this later.

September 17, 2007   No Comments

We are elite…. yes we are.

Today, an unsuspecting user arrived at #computers on IRC with a complaint about a dead disk. Linux to the rescue was what we said immediately ! We made the individual download Ubuntu (sshhh…). Two hours later the download was fixed and we were working on the problem.

Point 1: The drive was behaving oddly. We demanded that ubuntu be booted into and /dev/sda be mounted. How?

sudo mkdir /media/ext_dev ; sudo mount -t ntfs /dev/sda /media/ext_dev

Didn’t work.
We then asked him to use the command:

dmesg | grep /dev/sda

He says its spat out a lot of errors. I was thinking, fs error for sure. The command I told him to use:

sudo ntfsfix /dev/sda

Four vital hours later, (must be one large drive :) , done).
It worked !

Phew, now I can get back to reading the posts on comp.sys.ibm.pc.hardware.storage :)

September 12, 2007   No Comments

ChironFS to keep your fs running, NILFS…

Replication of data so that it can be dumped across filesystems and when one filesystem goes pfft, you can use the replica. How does it sound ? I know just like RAID 1 ( Redundant Array of Independent Disks ). I found ChironFS yesterday and it sounds cool. ChironFS is purely FUSE based and can replicate data across a variety of filesystems. Check it out at http://code.google.com/p/chironfs/

Anyway, let us move to my latest obsession, filesystems with Versioning. NILFS is one of these filesystems for Linux. It can do continuous snapshots ! And all you need to do is just specify epoch as an argument and pat comes the file that was existent once upon a time in so-and-so state. What’s more, you can mount any number of these snapshots at a given instant (read-only).

I didn’t need to recompile my kernel at all as NILFS comes as it comes with a loadable kernel module.

I didn’t really go to NILFS expecting a lot of surprise. I just wanted to mess with the idea of versioning that NILFS came with. Remembes, ext3-cow allows you to access the snapshot of a file as if it were in the current filesystem. NILFS however does it in a different way. I personally appreciate ext3-cow a lot more than NILFS but thats just me.

Gotta rush so bye.

September 9, 2007   No Comments

Shriphani is back… !!

Well I really am back. I had a pretty hectic week. First I have this crap thing called phase test to attend at my education factory. Dumb ain’t it. Ironically, two days later I have to sit for my toefl exam. Well next, I am going out on the road sometime next week to promote edubuntu in schools across hyderabad. My first stop will most probably be in hps ramanthapur. I have to sit and design a few slides for this and go armed with some ubuntu clothing. I will be posting the slides I have made and so on. I want to ask all fellow hyderabadis to assist me in this. The ubuntu-ap loco team seems too inactive for this kind of work and I feel that if we have to produce a generation of techies and geeks, better start at school level. Assistance will be respected.

Shriphani Palakodety.

September 5, 2007   No Comments

Hard-linking directories? It’s possible

Let us face it, no matter how geeky we are or how computer-aware, hardlinks to directories need to be banned. But, I don’t really care, I want to be able to use hardlinks on directories. The BSDs did bring about symbolic links but a simple rsync from your free shell directory to your PWD ( presently working directory ) will tell you why.

I was told one of the “cracker” tricks for Linux which takes for granted that the user is geeky and dumb (possible - but I haven’t seen a species as yet). Mr. Saifi told us about hard-linking /etc/passwd into our $HOME. Try running a chown on you dir and there goes security down the bin……

Why do these problems occur. Because the very presence of symbolic links has made hardlinks obscure. Sysadmins no longer care about hardlinks - they just keep doing trash work forgetting about hardlinks. But one filesystem plans to change it all ! GCFS - Garbage Collection FileSystem. It claims that it does allow hardlinking of directories but I was confused about what it would do to the tree like structure of the filesystem once one allowed hardlinks. What about the possibility of infinite looping courtesy carelessness ?

From the GCFS homepage, I got to know that GCFS does away with the tree like structure, allows linking a directory to a subdirectory and whatnot.

Some users may be perplexed by Meta-characters like “.” and “..” which we cannot do without. The thing is that in GCFS, the path you traced while reaching your $PWD is remembered and “cd ..” should take you to the previously inhabited directory and not necessarily the first hardlinked directory.

Right, till next time, goodbye !

September 3, 2007   No Comments