January 5, 2009 by vishalmanohar
I had written a Sudoku puzzle solver in Java some time back. Had some time today and rewrote it in Python so I could deploy it on GAE. The result is Sudoku Ninja.
It can currently solve most of the Hard problems on Web Sudoku.
It also has an API where you can enter the puzzle data as a series of numbers row by row and have ‘0′ in place of unfilled cells and send it as a GET request This returns text with the values filled in accordingly. Example.
Posted in projects, python | Leave a Comment »
December 6, 2008 by vishalmanohar
I like the view of alltop.com because it allows you to scan the feeds very quickly. But I wanted a customizable selection of feeds and so set about writing http://feedsrus.appspot.com/ on Google App Engine.
Thanks to URL Fetch API in google app engine and the Feed Parser library it was really easy to build.
The feed entries are cached in memcache in GAE and refreshed every 30 mins. Because of some limits in the number of cycles a request can use, the current implementation doesn’t scale for more than 9 feeds or so. Planning to fetch 9 at a time and use AJAX to load the rest in bits.
UPDATE: I modified the code to use Google AJAX Feed API and removed the part in the server code where I download the feeds. This means that all the GAE needs to do is maintain the user’s feeds in the data store. And of course, it is fast now.
UPDATE 2: Feedsrus now has tabs!

Tags: appengine
Posted in projects, python | Leave a Comment »
September 23, 2008 by vishalmanohar
Ever since I wrote this, I wanted an chat bot which would respond to messages and provide some service. One of my most desired service was to fetch word definitions. An avid user of Google’s define keyword search, I wanted it on a chat window.
Got some free time today and whipped up a dictionary service. With free libraries like xmpppy, pywordnet etc, writing the service was very easy.
Steps:
- Created a GMail Id to use as a Jabber Id
- Install xmppy and python-jabberbot which is a wrapper over xmpppy which makes it very easy to plug into a Jabber service
- Install WordNet for dictionary database
- Install PyWordNet which is a python interface for WordNet database
- Implement a method starting with bot_ e.g. ‘bot_define’ so that when the user runs enters ‘define <word>, this method would be invoked and the meanings returned. See python-jabberbot link for more info.
Planning to extend this to put in more services.
Tags: jabber, python, wordnet
Posted in projects, python | 1 Comment »
May 2, 2008 by vishalmanohar
I finally sat down to play around with Google’s App Engine a couple of days back and the first thing that strikes you is how easy it is!
Taking the idea from Swaroop CH’s Productive Home Page, I wrote a small Start Page app where you can configure your favorite links for easy access. It hardly took an hour to write the code itself and the most time consuming part was getting an App name (“istartpage” in my case) because the good app names were already taken!

The SDK is very easy to work with and even simulates a login interface if you plan to use the Google Accounts sign-on for your app. But I found the template engine a little difficult to use. Rather than using built-in tags, why not allow just plain Python code in a template like it is in JSP’s in Java .
App Engine provides a dashboard for your app where you can view/filter logs, view/delete table data etc.
All in all, a good platform to create hobby apps.
Tags: app engine, python
Posted in projects | Leave a Comment »
March 14, 2008 by vishalmanohar
A common gripe about HTML rendering is that white spaces are not preserved.
For e.g. giving
<table><tr><td>This is a test</td></tr></table>
will end up being shown as ‘This is a test’.
To show the spaces, people generally convert spaces to & nbsp;
to preserve the spaces. Instead, a CSS property ‘white-space’ can be used.
For e.g. to preserve the spaces, do this:
<table><tr><td style = "white-space:PRE">This is a test</td></tr></table>
This will display preserve the white spaces and show
'This is a test'
on the browser. We need to include a !DOCTYPE to make use of ‘white-space:pre’ property on IE.
Tags: HTML
Posted in Uncategorized | Leave a Comment »
February 4, 2008 by vishalmanohar
I wrote a Custom Button for FriendFeed since it is becoming my new hangout place on the net
Here is the link: http://vishalmanohar.googlepages.com/friendfeed.xml
Paste the file in C:\Documents and Settings\<your-folder>\Local Settings\Application Data\Google\Custom Buttons and restart your browser on which the Toolbar is installed. It will show the button.
Tags: friendfeed, Google Custom Button
Posted in social networking | Leave a Comment »