Friday, May 1, 2009

Resolver One Review - 4 months with a .NET enabled spreadsheet and IronPython scripting

Spreadsheet programs were one of the first killer applications for the personal computer, as they allowed users to quickly calculate a large number of values using a simple and easy to use grid system. In 1979 VisiCorp released VisiCalc for the Apple II, and while this was way before my time, I have heard it revered as one of the major turning points into the era of computers being used for day to day business use. Since 1979 few changes have been made to the spreadsheet paradigm. Lotus created the Pivot Table in 1991 (Pivot charts and graphs came later), which greatly helped in creating interactive tables and graphs for analyzing data. Many mathematical and statistical functions are available in modern spreadsheet applications, but most of them rely on old and outdated scripting languages that can be a hindrance when analyzing complex data.

Resolver One is a new program that aims to make things easier by building the spreadsheet using the IronPython 2.0 scripting language. IronPython is an implementation of the Python scripting language built on top of the Microsoft .NET CLR and DLR runtimes, which means that it is able to easily interact with code from C# and other .NET languages and can make use of any existing .NET library or assembly. It also can perform complex operations such as web service calls, interact with external files or databases, and make use of the Ironclad NumPy library for complex data manipulation. Since it is based on the .NET framework you can embed custom IronPython or .NET objects into the cells instead of just storing numbers, dates and text. This can be very helpful as it allows you to apply Object Orientated Programming techniques to create powerful and easy to maintain spreadsheet.

I first came across Resolver One last year when Larry O'Brien mentioned the $25,000 Resolver One Challenge in one of his posts. I don't use spreadsheets much in my day to day work, as most of the work that I do is with databases. I do however enjoy playing poker, and the opportunity to learn IronPython, play with Resolver One, and possibly win some money was too good to pass up. Initially things got off to a bit of a rough start, as dynamic python is a vastly different programming model to the static .NET that I am use to using. Also IDE support for IronPython in Resolver One is pretty basic, and there isn't a lot of advanced features in external IDEs either. However after a week or two of prototyping I had enough knowledge to put together a basic spreadsheet for evaluating Texas Holdem poker hands. The spreadsheet uses a .NET library that treats each hand as a 52 bit binary mask and allows you to quickly score and rank hands accordingly. Using this library in Resolver One was as simple as adding an import statement, and by creating a custom GridHand object I was able to group the 1,326 unique starting hands into 169 distinct groups displayed in a grid. The spreadsheet could then use colors and cell comments to highlight which hand would be able to beat your pocket cards and give a full listing of win/tie/loss statistics in a matter of seconds.

When I first submitted it to the competition, the spreadsheet required a full 7 card hand (2 player pocket cards, and 5 on the board) to display the win percentages. Pre-calculated Preflop odds were also displayed before the hand was dealt, but other than that the features were quite basic. For the second submission, I altered the spreadsheet to use a Monte Carlo algorithm to allow predicting the win percentages on the Flop and Turn after running a few hundred trials on each group. On slower machines this might take up to 10 seconds to complete, but on a modern dual core machine it would only take a second or two to recalculate the spreadsheet. I now thought that this was the most amazing spreadsheet ever created, but sadly it did not win the competition. In my rush to win glory and fame I had neglected to pay any attention to the UI design or add any documentation about how to use the spreadsheet. It turns out I wasn't the only one.

At first I was a bit distraught, but after taking a step back it was clear to see that there was still work that needed to be done before it was a respectable spreadsheet. I was happy with how the spreadsheet worked, so I turned focus to creating a better User Interface and adding a built in help system. Since Resolver One is built on the .NET framework, you can add things like windows forms and controls. After a bit of fiddling with this project I was able to create a basic multi-tab embedded browser that would appear when clicking a Help button on the sheet. The browser ran in it's own thread, and you could program which pages would appear in each tab. This allowed creating HTML based help files that could be posted online or embedded directly into the spreadsheet. I also attempted to create a full tutorial system where clicking a button on a help page would perform an action on the spreadsheet (change value, highlight cell, etc), but I ran into some problems with changing the spreadsheet from a separate thread and was not able to finish this feature. I submitted the new Texas Holdem Monte Carlo Simulator spreadsheet to the competition with documentation, and was very happy with the results!

Overall I have to say that Resolver One is a very innovative program, and while there are still some rough edges I can see a lot of potential for this to be a new killer application for spreadsheets. The basic features are very easy to use, and if you know Python or have a programming background you should be able to code up whatever special functionality you want. It reminds me a lot of when I first started using Powershell, and it is definitely something that I will keep in my arsenal of tools for attacking complex problems.


Anonymous said...

While Resolver may technically be a better product than Excel, I can't say one way or the other, the problem is that it is hard for a new spreadsheet application to gain traction due to the install base of Excel.

If Resolver were cheap with a lot of add-ons for various functions, it might have a chance, but from what I see it cost 199.00?

I'd like to be able to play with your Texas-Holdem tool as I play online a good bit, but I can't justify buying Resolver just for that.

Glad you won the monthly contest.

Greg Bray said...

True, it is difficult for a new application to gain traction in an established market, especially when the new program costs more than the status quo. However it is another case of "You get what you pay for". With Resolver One, you get the ability to create complex worksheets using simple python scripting. Given their integration with various mathematical programs and Stock market data feeds, I think that their main target market is financial experts and statisticians, who would purchase the program using company/research money. For the average user, I would recommend the following:

1. Try it for free first. Resolver One has a fully functional trial version that lets you play with it to see if it fits your needs.

2. Request a free Open Source license. The spreadsheet I built was done using an Open Source license. This provides access to most of the features for free so long as the spreadsheets you create are released under an open source license. I would not have initially purchased a license just to create a Poker spreadsheet, but after using it for a few months now I will be purchasing a license, if only to support a small startup software company that offers a great product.

3. The C# library that I used is also Open Source, and includes a few free programs that are fun for programmers that like to play poker. Check out these links for more information:

Post a Comment