Archive for the ‘Programming’ Category

The Commodities Gadget

Saturday, November 28th, 2009

And here is the Google Gadgets version of the Commodities Widget. It supports exactly the same chains of commodities as the mac version:

  • Energy: Crude oil, natural gas, heating oil and gasoline
  • Softs: Sugar, coffee, cocoa and cotton
  • Grains: Corn, soybeans and wheat
  • Metals: Gold, silver and copper
  • Currencies: US dollar index, Euro, British Pound, Swiss Franc, Yen and Canadian dollars.
  • Stock indices: Dow Jones Industrial futures, S&P 500 futures and NASDAQ.

Use the ‘+Google’ button under the embedded gadget above to add it to your iGoogle page. From your iGoogle page, you can click the down triangle in the upper right corner of the gadget and then ‘edit settings’ to select what to chart. You can also click the chart to go to the corresponding page at INO.com with a bigger chart, more options and info.

The Commodities Widget

Friday, November 27th, 2009

Commodities widget

I know it’s been a while, but the sequel to the broken Oil Price Widget is now here. The new widget not only shows the oil price, it shows a set of other futures, currencies and indices as well. I named it the Commodities Widget, even though some of the things it shows are not strictly commodities.

The new data source is INO.com. They are probably the web’s best free source for futures contracts. Clicking on any chart in the widget will bring you to the corresponding INO.com page with more details and longer-term charts.

Download: Commodities Widget.

Instructions: Mac OS X 10.4 Tiger or higher is required. If you’re using Safari, click the download link. When the widget download is complete, Show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it. If you’re using a browser other than Safari, click the download link. When the widget download is complete, unarchive it and place it in /Library/Widgets/ in your home folder. Show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it.

A Shiny New Engine for OptiMap

Saturday, February 28th, 2009

OptiMap, the free TSP solver for Google Maps, used to guarantee the optimal solution for up to 9 locations only. That number has now been increased to 15. If you had more than that number of locations, you would get a solution close to the optimal (often the optimal).

The new OptiMap uses the dynamic programming solution to the TSP for problems of size 10 - 15. I tested various values for the cutoff in different browsers, and I could have set it differently. The main problem with the dynamic programming solution is its memory footprint. It uses O(n * 2^n) memory, which gets problematic around n = 15 in JavaScript (n being the number of locations, of course). This is especially true on smaller devices like smartphones. It would probably work well with n = 18 on most desktop computers and browsers, but I haven’t gotten around to making a dedicated smartphone version yet.

There is also a noticable difference between different browsers in JavaScript execution speed. Safari 4 is the fastest browser I tried so far. I haven’t tested Google Chrome yet, but I suspect it is also in the super-fast category. Once Opera comes with its Carakan JavaScript engine, I will run a speed test on OptiMap and publish the results here. Maybe I should set n automatically based on the user’s browser?

Set is Back

Saturday, June 14th, 2008

A few of you will remember Set, a brain-intensive card game where you have to find three cards that have either the same or totally different properties in each of four categories of properties. Sounds complicated? Try it here! I coded up this game five years ago, for my friend Kristian’s birthday. That’s why you have to get through the deck in less than ten minutes. He didn’t get his birthday present before he had completed it in less than ten minutes ;-)

US Dollar Index Gadget

Sunday, March 2nd, 2008

Non-mac users can now enjoy the US Dollar Index Widget as a Google Gadget on their iGoogle.com homepage (Mac users can install this widget too, but might want to use the dashboard version instead). I find this widget to be very useful on my iGoogle Finance tab! Again, thanks to INO.com for letting me use their feed, and Fabian Graciano, for the idea of making the original widget.