Hi Numpeans, I have been working on a web-based scientific application for about a year, most of which had been written in either Matlab or SPLUS/R. My task has been to make it "driveable" through an online interface (if anyone cares about mortality forecasting, drop me an email and we can chat about it offline). I chose Python/Numpy for the language because Python and Numpy are both so full featured and easy to work with (except for one little thing...), and neither Matlab nor R could gracefully deal with CGI programming (misguided propaganda notwithstanding).
However.... I have spent a huge amount of my time fixing and bending my head around off-by-one errors caused by trying to index matrices using 0 to n-1. The problem is two-fold (threefold if you count my limited IQ...): one, all the formulas in the literature use 1 to n indexing except for some small exceptions. Second and more important, it is far more natural to program if the indices are aligned with the counts of the elements (I think there is a way to express that idea in modern algebra but I can't recall it). This lets you say "how many are there? Three--ok, grab the third one and do whatever to it" etc. Or "how many? zero--ok don't do anything". With zero-based indexing, you are always translating between counts and indices, but such translation is never a problem in one-based indexing. Given the long history of python and its ancestry in C (for which zero based indexing made lots of sense since it dovetailed with thinking in memory offsets in systems programming), there is probably nothing to be done now. I guess I just want to vent, but also to ask if anyone has found any way to deal with this issue in their own scientific programming. Or maybe I am the only with this problem, and if I were a real programmer would translate into zero indexing without even noticing.... Anyway, thanks for listening... Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/numpy-discussion
