November 17th, 2005

Boingboing had a post yesterday about the iBuzz. I found it quite funny. N‘s wife says that this could be very unfortunate if the song finishes before you do, especially if the next song on your playlist isn’t the right tempo. On the otherhand, it could start a very interesting subculture where people recommend “good” playlists.

Foreign students in the US

November 15th, 2005

Reuben has an interesting post about foreign student stats in the US. I have always wondered about what these numbers were. I am too lazy to say anything about them except that it is “interesting….” . Read for your self below.

Here’s some stats of interest to those of us who went to school in the U.S. India continues to be the top exporter of students (80,466) into the United States, followed by China. 72 percent of Indian students enrolled at the graduate school level, while 20% enrolled for undergraduate programs. As a general trend though, international admissions into the U.S. seems to be declining, a pattern that emerged in the wake of post-9/11 rules and regulations.

The second table shows the top 5 importers of foreign students among U.S. universities. I am not surprised at all by USC, UIUC and UT figuring in that list, but was intrigued that Columbia and NYU would show up. After all, both schools are private and have relatively high tuition fees (not to mention the costs of living in Manhattan) compared to state schools. Is New York truly the best college town in the U.S. now, as a friend of mine had once suggested?

Top Exporters of Students

1. India
2. China
3. South Korea
4. Japan
5. Canada

Top Importers of Students

1. University of Southern California
2. University of Illinois, Urbana-Champaign
3. University of Texas, Austin
4. Columbia University
5. New York University

Blog That

November 15th, 2005

I wrote a plugin to send any item to a blog with 1 click. Yes I know another plugin!!. This is the last one for a while, I promise.. Maybe I should patent this one like amazon did. Anyway, here is a screenshot of what the output looks like.


blog that

You can edit the output by editing a template file just like you would do for a regular Gregarius theme.


Jan 10, 2006. Download version 0.3.2

Older Versions

  • Jan 10, 2006. Version 0.3.2
    • Prevented the icon from appearing when you were not logged in.
    • Changed the default config options to a wordpress.com blog
  • Nov 26, 2005. Version 0.3.1
    • Prevented the icon from appearing when you were not logged in.
    • Changed the default config options to a wordpress.com blog
  • Nov 20, 2005. Version 0.3
    • Now checks the admin cookie for all items and not just private items.
    • Bug fix for posting as blog items as a draft. Thanks Phil.
    • User config value to change the category into which the blog is posted.
  • Initial release version.


Gregarius version 0.5.2 +


  • Remember to read the README.txt file in the subdirectory blogthat_files/

Astronomy Picture of the Day

November 13th, 2005

Mt Everest

The Astronomy Picture Of the Day (APOD) has some stunning images. One of them is this stunning panoramic view of the top of Mount Everest. Coming up tomorrow is a picture of the Martian Everest – a volcano called Olympus Mons. Wikipedia says that it is the tallest known mountain in the solar system (3 times the size of Everest) and if one were to stand on the highest point of its summit, the slope of the volcano would extend all the way to the horizon. If you want to track the APOD pictures, here is a screen scraped RSS feed.

Lilina theme for Gregarius

November 12th, 2005

I added a new theme for which gives it a similar interface to . It is still a work in progress, so I decided to create a page for it to keep track of changes in the version. This theme shows you the item titles, so you can scan them quickly. You can expand out an individual item by clicking on the title. Expand out all the titles by clicking the expand/collapse all button. You can also hide the sidemenu by clicking on the button with the arrowheads. This last state is stored in a cookie and remembered across visits.


Lilina theme for Gregarius


Dec 30, 2005. Download version 0.4.1
This version has the following changes

Older Versions

  • Dec 30, 2005. Download version 0.4
    This version has the following changes

    • The items are now grouped by date.
    • More compitibilty with the svn version. Uses screenshots, overrides etc..
  • Dec 22, 2005. Download version 0.3.2

    • Added Accesskeys for collapsing the sidebar (Alt-f) and for expanding/collapsing all the items(Alt-C)
    • Fix for a bug while expanding/collapsing all the divs in Firefox
  • Nov 12, 2005. Download version 0.3.1
    • Fix for a bug that prompts you to download update.php after updating.
  • Download version 0.3.

    • The sidemenu hidden state is stored in a cookie and saved across visits
    • Removed underscores from the feed titles
    • Made the icons line up – Thanks Chris
    • Bug fixes when using this theme with version 0.5.2 of Gregarius


Gregarius version 0.5.2 +


  • I do not use this theme myself, so updates will be slow.


November 12th, 2005

textmate screenshotHaris just posted a pretty detailed overview of his favourite text editor: . It looks cool and has lots of features, however it costs $40+. A bit too steep for me, but it would be worth it if you are a power text editor user. Anyway it is highly unlikely than I am going to be using anything but for the rest of my life. From countless hours of playing nethack, my brain has been hot-wired into mentally replacing the arrow keys with h,j,k,l.


Stop the presses

November 10th, 2005

A shell script I wrote earlier got mentioned in the December issue of Macworld. It is hard to find the mention, but it is there. :) I wrote the script to move my feeds from Safari RSS to Bloglines. Last month, I upgraded the shell script to an action, so you do not need to open Terminal.app if you do not want to. The article is a bit incorrect about that point, but I guess it was written a while ago.

If you are looking to move to/from Bloglines and you want more freedom and would like complete control over your feed reader, I recommend the excellent, open source program : . It is highly extensible and supports plugins and themes and has lots of goodness. If you spend a lot of time reading feeds it is important to have a feed reader that does everything just the way you want it to.


November 7th, 2005

Apoorva made me put in a preview function so that you can preview your comments before you submit them. It is so easy to add functionality to a wordpress plugin. I downloaded and installed the Live Comment Preview plugin. I also stumbled across the Get Recent Comments plugin. This one shows recent comments and trackbacks in the sidebar.

Top 100 books

October 30th, 2005

Time magazine recently published a list of top 100 books from 1923 to the present. Naturally one man’s soup is another man’s poison. Here is a compilation of choice reviews from amazon that gave the books only 1 star. It is hilarious!!

Area of a polygon

October 29th, 2005

I was recently asked to find an algorithm to calculate the area of a polygon. I was given the co-ordinates of the vertices in order and I was told to assume that the polygon did not intersect itself. I was able to come up with some solution which involved triangulating the polygon, however that solution was no good as it would not work with certain types of polygons. How would you come up with this algorithm? Remember that your solution has to also work for polygons that are wierdly shaped. You cannot assume that the polygon is convex. Here are some examples….
irregular polygons

Suppose the vertices of the polygon are given by (x_1, y_1), (x_2, y_2), \ldots, (x_n, y_n) where the nth set of co-ordinates is equal to the first, then the area of the polygon is given by the nice formula

\displaystyle \frac{1}{2} \sum_{i=0}^{n-1} \left( x_i y_{i+1} &#8211; x_{i+1} y_i \right).

A really nice solution to this problem is using Green’s Theorem. This theorem equates a line integral around the boundary of a simple region to a double integral. The theorem states that if C is a piecewise smooth, simple, closed curve in a plane and it encloses a region D, then

\displaystyle \oint_{C} L\, dx + M\, dy = \int\!\!\!\int_{D} \left(\frac{\partial M}{\partial x} &#8211; \frac{\partial L}{\partial y}\right)\, dA.

If we can choose L and M such that \displaystyle \left(\frac{\partial M}{\partial x} &#8211; \frac{\partial L}{\partial y}\right) = 1, then the double integral on the right hand side in Green’s Theorem will just calculate the area of the region D. One option is to take M = \frac{x}{2} and L = -\frac{y}{2}.

If D is the polygon and C is the boundary, all we need to do to calculate the area of D is to calculate the line integral on the left hand side in Green’s Theorem. Consider the path integral from (x_i, y_i) to (x_{i+1}, y_{i+1}) of  L\, dx + M\, dy. The path is parametrized by a function \Gamma from [0,1] to the line joining (x_i, y_i) to (x_{i+1}, y_{i+1}) , and is given by

\displaystyle \Gamma(t) = \big( x_i + t(x_{i+1} &#8211; x_i), y_i + t(y_{i+1} &#8211; y_i) \big).

So the path integral becomes

\displaystyle \int_0^1 \bigg(L\big(\Gamma(t)\big) , M\big(\Gamma(t)\big)\bigg) \cdot \Gamma^{&#8216;} (t) \, dt.
So we are integrating from 0 to 1, the function
\displaystyle \bigg(-\frac{y_i + t(y_{i+1} &#8211; y_i)}{2} , \frac{x_i + t(x_{i+1} &#8211; x_i)}{2}\bigg) \cdot \bigg( x_{i+1} &#8211; x_i, y_{i+1} &#8211; y_i \bigg) .

This simplifies to

\displaystyle \frac{1}{2}\int_0^1 -y_i ( x_{i+1} &#8211; x_i) + x_i  (y_{i+1} &#8211; y_i) \, dt
and this is simply \frac{1}{2}( x_i y_{i+1} &#8211; x_{i+1} y_i) . So if we take the line integral over the closed path C, we get the formula for the area which is written above. Of course, if we get a negative number for the area, this would mean that C was not positively oriented and we should take the absolute value to get the area.

Source: Area Measurement: Planimeters & Green’s Theorem