Brink of crashing

Indy racer Danica Patrick had a memorable quote in this nice Honda promo :

If you’re driving your car and you feel frightened a little bit, we bump up against that feeling as much as we can to try and push that limit further, and get comfortable there and then push it again, so you’re constantly on the brink of crashing, because that’s the fastest.

| |

Getting django-auth-openid to work with Google Accounts

update: This blog post is meant for older versions of django-authopenid. The latest version available at pypi has implemented a fix similar to this one, and hence works out of the box, you wont need this fix.
Thanks to Mike Huynh for pointing this out!

I've been playing with Django over the past few days, and it's been an interesting ride. For a person who really likes PHP's shared- nothing, file-based system model (I'm mostly a drupal guy), Django comes across as overengineered at first, but I'm beginning to see why it's done that way.

I was trying to get single-signon working, and settled on django-authopenid over the other django openid libraries, django-openid, django-openid-auth and django-oauth. It was easy to use and understand, and wasn't seven million lines of code.

My intention was to use the OpenID extension to get the user's email address during the sign on process. However, it doesn't seem to work with Google's OpenID implementation, because Google uses the an Attribute Exchange (ax) extension instead of the Simple Registration (sreg) OpenID extension that is implemented in the library. A quick hack to django-authopenid's makes it work:

- from openid.extensions import sreg
+ from openid.extensions import ax
- sreg_request=None):
+ ext_request=None):
- if sreg_request:
- auth_request.addExtension(sreg_request)
+ if ext_request:
+ auth_request.addExtension(ext_request)
- sreg_req = sreg.SRegRequest(optional=['nickname', 'email'])
- redirect_to = "%s%s?%s" % (
- get_url_host(request),
- reverse('user_complete_signin'),
- urllib.urlencode({'next':next})
- )
- return ask_openid(request,
- form_signin.cleaned_data['openid_url'],
- redirect_to,
- on_failure=signin_failure,
- sreg_request=sreg_req)
+ ax_req = ax.FetchRequest()
+ ax_req.add(ax.AttrInfo('', alias='email',required=True))
+ redirect_to = "%s%s?%s" % (
+ get_url_host(request),
+ reverse('user_complete_signin'),
+ urllib.urlencode({'next':next})
+ )
+ return ask_openid(request,
+ form_signin.cleaned_data['openid_url'],
+ redirect_to,
+ on_failure=signin_failure,
+ ext_request=ax_req)

Obviously this is a very cursory edit. I'm too lazy to improve and submit this as a patch, so readers are encouraged to submit it to all relevant projects!


Purple Summer

For those who care, I will be working at Yahoo! Research in New York this summer. The offer letter just arrived in well designed (and very purple) packaging, with seventeen thousand million documents to sign. Nonetheless, I’m excited about working there!

| |

360° view from Mt. Everest

(via APOD)


what is wrong with the new gmail buttons

I’m having trouble getting used to the new Gmail button. Here’s the explanation, in a simple animated GIF. My my motor memory remembers the position of the “Delete” button, and finds the “Move” button in its place.

Also, “Move to”? WTF? It looks like the fruit of a religious compromise between the “Folders are evil, Labels are googly” and “Folders are how the world works, you hippies” camps. Hey design-by-committee… Look, it’s your new friend, Gmail!

| |

Database Autocompletion Demo

The video overview of the SIGMOD 2007 demo is now up!


My Research Papers, now more accessible

Many readers have complained that this blog is always full of artsy and time-wasting material… “what about all the technical stuff? Aren’t you a computer person?!” they ask. To pacify these masses, I have just converted three of my recent papers to HTML format. For the first two, I used the HEVEA LaTeX to HTML converter, which I found slightly better than LaTeX2HTML. For the 3rd paper, I have inexplicably misplaced the source files, and hence the HTMLization was done via Gmail’s PDF Viewer.

The picture above is from the 2007 SIGMOD demo paper. I’ll post videos of the demo in a later post. Here’s a quick preview of each paper:

  • Qunits: queried units in database search CIDR, 2009
    Keyword search against structured databases has become a popular topic of investigation, since many users find structured queries too hard to express, and enjoy the freedom of a “Google-like” query box into which search terms can be entered. Attempts to address this problem face a fundamental dilemma. Database querying is based on the logic of predicate evaluation, with a precisely defined answer set for a given query. On the other hand, in an information retrieval approach, ranked query results have long been accepted as far superior to results based on boolean query evaluation. As a consequence, when keyword queries are attempted against databases, relatively ad-hoc ranking mechanisms are invented (if ranking is used at all), and there is little leverage from the large body of IR literature regarding how to rank query results.
  • Effective Phrase Prediction VLDB, 2007
    Autocompletion is a widely deployed facility in systems that require user input. Having the system complete a partially typed “word” can save user time and effort. In this paper, we study the problem of autocompletion not just at the level of a single “word”, but at the level of a multi-word “phrase”. There are two main challenges: one is that the number of phrases (both the number possible and the number actually observed in a corpus) is combinatorially larger than the
    number of words; the second is that a “phrase”, unlike a “word”, does not have a well-defined boundary, so that the autocompletion system has to decide not just what to predict, but also how far. We introduce a FussyTree structure to address the first challenge and the concept of a significant hrase to address the second. We develop a probabilistically driven multiple completion choice model, and exploit features such as frequency distributions to improve the quality of our suffix completions. We experimentally demonstrate the practicability and value of our technique for an email composition application and show that we can save approximately a fifth of the keystrokes typed
  • Assisted querying using instant-response interfaces SIGMOD 2007
    We demonstrate a novel query interface that enables users to construct a rich search query without any prior knowledge of the underlying schema or data. The interface, which is in the form of a single text input box, interacts in real-time with the users as they type, guiding them through the query construction. We discuss the issues of schema and data complexity, result size estimation, and query validity; and provide novel approaches to solving these problems. We demonstrate our query interface on two popular applications; an enterprise-wide personnel search, and a biological information database.

Larry's Bell Labs Days

Larry Luckham documents the people at Bell Labs :

In the late ’60’s I worked for Bell Labs for a few years managing a data center and developing an ultra high speed information retrieval system. It was the days of beehive hair on the women and big mainframe computers. One day I took a camera to work and shot the pictures below. I had a great staff, mostly women except for the programmers who were all men. For some reason only one of them was around for the pictures that day.

A fun set of pictures.


These are a few of my favorite things

From a comment on reddit:

Comments on code and captions on kittens
Getting that bug and bad grammar writtens
Working in python and dealing with strings
These are a few of my favorite things

Making good memes and hard logic riddles
Mispells and root shells and cheap ramen noodles
Living near an exchange with really low pings
These are a few of my favorite things

Girls in geek shirts with xkcd dresses
Using grep dict/words to find one that matches
Fantasy actors that say “good tidings”
These are a few of my favorite things

When the net lags
When the kill stings
When I’m feeling sad
I simply remember my favorite things
And then I don’t feel so bad

| |

Liquid Food

I recently underwent oral surgery to have 3 impacted wisdom teeth removed. Having 3 stitches in my jaw, it’s a little hard to eat anything that doesn’t go through a straw. Ironically, I’m not even allowed straws, since the suction isn’t good for the stitches. So what does one eat in this situation? Stuff that I have consumed so far:

* Strawberry Milk shake
* Blended milk and cereal
* Blended carrot and tomato soup
* Strawberry Cheesecake Shake
* Clam chowder
* Orange juice

Today I’m planning to try Ratatouille, which Katherine’s making for me. Also in the works is Blended chicken soup; I’ll post the recipe once it’s done.

I also found an interesting blog called Jaw Dropping Blends which hosts recipes for people just like me!

| |