William Stein wrote: > On Thu, Aug 13, 2009 at 1:55 PM, Peter > Jeremy<peterjer...@optushome.com.au> wrote: >> On 2009-Aug-11 15:29:29 -0700, William Stein <wst...@gmail.com> wrote: >>> I just wanted to let people know that David Ackerman -- a UW student who >>> took my course on Sage last quarter -- is working (funded by NSF) on >>> creating a "units package" for Sage right _now_. >> Since no-one else has mentioned it, I presume you are aware that there >> is a 'units' tool included with Unix that does most of this. It looks >> like it's optional on Linux (at least boxen knows it exists but doesn't >> have it installed). It's standard on FreeBSD (and the underlying >> constants were worked through fairly recently to bring them into line >> with the latest values). >> > > I "apt-get install" it so it is now on sage.math. > > Regarding interval arithmetic, the Sage symbolic manipulation package > works with intervals, so it would be straightforward at any point in > the future to have unit conversion ratios be intervals if one wanted > that. > > I would find USD and EU conversion useful when I'm traveling. Then > the conversion should be looked up somehow using urllib say when the > program starts or every few minutes. > > William
Mathematica can look up conversions. It also has an historical database of conversion rates. But I doubt anyone would seriously use MMA to look up today's exchange rate. Is somewhere like: http://www.xe.com/ not easier? I suppose there is some argument to being able to download the latest data each time you connect to the internet, so when on a plane with no WiFi, you will have reasonably recent data. But certainly if I had internet access, I'd use http://www.xe.com/ not any maths software. I've tried to parse the odd web site in the past. The problem is it tends to break over time, as webmasters make small changes. One site I used to connect to had chess games in a zip file. Then they started putting the games in a directory, not at the top level. It was relativity easy to fix. But I've had similar experiences parsing web sites. Another possibility, which could avoid some of these issues, it to download the data to the Sage web site and get Sage to fetch the data from the Sage web site, not from http://www.xe.com/ NPL, or anywhere else like that. Then, if the format of the data changes, updates need to be applied to the Sage web site, not to every version of Sage in existence. That is what Mathematica does - when a currency conversion is looked up, data is collected from Wolfram.com. Then you can get issues of with companies block an IP address, if one IP keeps interrogating the data. I used to get fed up with late-running trains on my local line and wanted to prove the number of trains running late were higher than the advertised figures. So I wrote a web parser to get data on the current running times of trains on my local line. Then I could find out exactly how late each train was. That was until my IP address got banned. Without a stable API, the web based lookup might be more hassle than it is worth. You might not agree with all or any of the above, but I hope it highlights some possible issues. Dave --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---