DSPRelated.com
Forums

horrible C indexing

Started by Grant Griffin April 1, 2006
Jerry Avins wrote:
> Randy Yates wrote: > >> Hey Grant, >> >> Thanks for the reference to Grace Hopper, whom I had never heard of >> (to my discredit). >> >> In finding out about her, I came across this fascinating website on >> Women in Science that I thought others might enjoy. > > > I'll check it out shortly. Do you know that she or her group gave the > word "bug" its programming connotation? One of the programs her group > had written gave errors. Tracing was very difficult in relay computers > programmed in binary, as you can imagine. After concluding that the > computer was broken, not the program -- was that the first case of "It > must be the hardware? -- diligent examination found a moth's wing > preventing one of the contacts from closing. After that, every error was > jokingly attributed to a bug. > > Jerry
Version of story i heard was said moth was taped to lab notebook page under some label as "bug removed"
"Richard Owlett" <rowlett@atlascomm.net> wrote in message 
news:122ts312f384dc@corp.supernews.com...
> Jerry Avins wrote: >> Randy Yates wrote: >> >>> Hey Grant, >>> >>> Thanks for the reference to Grace Hopper, whom I had never heard of >>> (to my discredit). >>> >>> In finding out about her, I came across this fascinating website on >>> Women in Science that I thought others might enjoy. >> >> >> I'll check it out shortly. Do you know that she or her group gave the >> word "bug" its programming connotation? One of the programs her group had >> written gave errors. Tracing was very difficult in relay computers >> programmed in binary, as you can imagine. After concluding that the >> computer was broken, not the program -- was that the first case of "It >> must be the hardware? -- diligent examination found a moth's wing >> preventing one of the contacts from closing. After that, every error was >> jokingly attributed to a bug. >> >> Jerry > > Version of story i heard was said moth was taped to lab notebook page > under some label as "bug removed" >
Jerry, Richard, et al, Years ago, the tv show "60 Minutes" did an interview with her, and she produced the actual notebook with the bug taped in it! She was really a neat person (as she was portrayed in the interview). At her lectures, she was known for handing out pieces of wire which were just under a foot long where she had called the wires "nanoseconds", since their length corresponded to the distance light travels in 1 nanosecond. Clay
Clay S. Turner wrote:
> "Richard Owlett" <rowlett@atlascomm.net> wrote in message > news:122ts312f384dc@corp.supernews.com... > >>Jerry Avins wrote: >> >>>Randy Yates wrote: >>> >>> >>>>Hey Grant, >>>> >>>>Thanks for the reference to Grace Hopper, whom I had never heard of >>>>(to my discredit). >>>> >>>>In finding out about her, I came across this fascinating website on >>>>Women in Science that I thought others might enjoy. >>> >>> >>>I'll check it out shortly. Do you know that she or her group gave the >>>word "bug" its programming connotation? One of the programs her group had >>>written gave errors. Tracing was very difficult in relay computers >>>programmed in binary, as you can imagine. After concluding that the >>>computer was broken, not the program -- was that the first case of "It >>>must be the hardware? -- diligent examination found a moth's wing >>>preventing one of the contacts from closing. After that, every error was >>>jokingly attributed to a bug. >>> >>>Jerry >> >>Version of story i heard was said moth was taped to lab notebook page >>under some label as "bug removed" >> > > > Jerry, Richard, et al, > > Years ago, the tv show "60 Minutes" did an interview with her, and she > produced the actual notebook with the bug taped in it! She was really a neat > person (as she was portrayed in the interview). At her lectures, she was > known for handing out pieces of wire which were just under a foot long where > she had called the wires "nanoseconds", since their length corresponded to > the distance light travels in 1 nanosecond.
I had the pleasure of meeting her in my boss's (Jan Rajchman's, Q.V.) office after she gave a talk at Sarnoff Labs. Following her inspiration, I began to quote execution times in inches -- the distance a .22 bullet would go in the required time. After that, people stopped claiming that my 8-bitters were too slow to do their jobs. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On 1 Apr 2006 12:49:54 -0800, "robert bristow-johnson"
<rbj@audioimagination.com> wrote:

>here are other threads of old:
Here's another, starting at message #48: http://groups.google.com/group/comp.dsp/browse_frm/thread/ea8600839451a2ad/09c7be52e161d77b?tvc=1&q=%22returning+to+horrible+MATLAB+indexing%22+group%3Acomp.dsp&hl=en#09c7be52e161d77b Greg
"Clay S. Turner" <Physics@Bellsouth.net> wrote in message 
news:r4xXf.1558$ki.1418@bignews1.bellsouth.net...
> Hello Grant, > > It is great to see your wit has not waned. Thanks for writing on this > April Fool's Day. Maybe one day we will get indexing based on the > irrational numbers - but that uncountable thing will likely get in the way > ;-) > > Clay
I would like to propose indexing based on imaginary numbers....
> > > > "Grant Griffin" <nospam@yahoo.com> wrote in message > news:4a503$442e975f$4088dbc7$1304@EVERESTKC.NET... >> Am I the only person who's noticed that C's zero-based indexing is >> nothing short of...well...horrible? And it doesn't end there: C has been >> so influential that its insanity has spread to tons of other languages: >> C++, Java, C#, Python, Perl--heck, even LISP. >> >> Am I the only one here who's suffered a needless off-by-one bug as a >> result of C's horrible zero-based indexing? Let's see a show of hands... >> >> But more important, to those of us in DSP, is the fact that C's indexing >> doesn't conform to Matlab--which wisely employs one-based indexing in >> accordance with the centurys-old convention of linear algebra. Now, one >> might ask, "who died and left Matlab in charge?" Well, nobody, I guess. >> But if the Matlab folks hadn't gotten this right, why would so many DSP >> folks shell out *thousands* for Matlab, when zero-based alternatives like >> SciPy (http://scipy.org/) are absolutely, 100%, free? There can be only >> one answer: one-based indexing. >> >> OK, I can already hear some of you about to cite the old "legacy code" >> chestnut as a reason C can't be changed. True, there's a lot of C code >> out there. But there's absolutely no reason that C can't switch to >> one-based with a zero-based compatibility mode. OK, I know, I know: C++ >> programmers can easily create their own one-based array object. But what >> sense does it make for countless programmers to home-brew a solution when >> Dennis Ritchie could just get off his duff and fix the problem >> once-and-for-all? After all, Grace Hopper did it for FORTRAN. >> >> Sound radical? I don't think so: let's face it, we live in a one-based >> world. For example, ask a child to count their fingers, and they'll >> invariably assign "one" to the first (er, "zeroth") finger. >> >> Still not convinced? OK, what about the calendar?--what if today was >> "April 0th"? >> >> =g2 >> _____________________________________________________________________ >> >> Grant R. Griffin >> Publisher of dspGuru http://www.dspguru.com >> Iowegian International Corporation http://www.iowegian.com >> See http://www.iowegian.com/img/contact.gif for e-mail address > >
"Jerry Avins" <jya@ieee.org> wrote in message 
news:C7KdndLnrb4raLPZnZ2dnUVZ_uWdnZ2d@rcn.net...
> Clay S. Turner wrote: >> "Richard Owlett" <rowlett@atlascomm.net> wrote in message >> news:122ts312f384dc@corp.supernews.com... >> >>>Jerry Avins wrote: >>> >>>>Randy Yates wrote: >>>> >>>> >>>>>Hey Grant, >>>>> >>>>>Thanks for the reference to Grace Hopper, whom I had never heard of >>>>>(to my discredit). >>>>> >>>>>In finding out about her, I came across this fascinating website on >>>>>Women in Science that I thought others might enjoy. >>>> >>>> >>>>I'll check it out shortly. Do you know that she or her group gave the >>>>word "bug" its programming connotation? One of the programs her group >>>>had written gave errors. Tracing was very difficult in relay computers >>>>programmed in binary, as you can imagine. After concluding that the >>>>computer was broken, not the program -- was that the first case of "It >>>>must be the hardware? -- diligent examination found a moth's wing >>>>preventing one of the contacts from closing. After that, every error was >>>>jokingly attributed to a bug. >>>> >>>>Jerry >>> >>>Version of story i heard was said moth was taped to lab notebook page >>>under some label as "bug removed" >>> >> >> >> Jerry, Richard, et al, >> >> Years ago, the tv show "60 Minutes" did an interview with her, and she >> produced the actual notebook with the bug taped in it! She was really a >> neat person (as she was portrayed in the interview). At her lectures, she >> was known for handing out pieces of wire which were just under a foot >> long where she had called the wires "nanoseconds", since their length >> corresponded to the distance light travels in 1 nanosecond.
Here's a link showing the log book http://www.jamesshuggins.com/h/tek1/first_computer_bug.htm but IIRC, there was some discussion a few years ago as to the word "bug" being in use to describe mechanical poblems prior to that time.
> > I had the pleasure of meeting her in my boss's (Jan Rajchman's, Q.V.) > office after she gave a talk at Sarnoff Labs. Following her inspiration, I > began to quote execution times in inches -- the distance a .22 bullet > would go in the required time. After that, people stopped claiming that my > 8-bitters were too slow to do their jobs.
I had the pleasure of attending one of her talks. I still have a nano-second around somewhere...
> > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Grant Griffin <nospam@yahoo.com> wrote in news:4a503$442e975f$4088dbc7
$1304@EVERESTKC.NET:

Someday soon, this little rant is going to pop up in a Google search, 
probably by someone from Mathworks. They won't realize what day you 
posted it.

They will use this as evidence that all the other DSP guys must be 
smoking to relieve their glacoma symptoms This will be their 
justification for not making the obvious workaround.

Thanks Grant, you just set us back years. I think they were probably real 
close learning how to count from zero.

Welcome back...... 

Al 





> Am I the only person who's noticed that C's zero-based indexing is > nothing short of...well...horrible? And it doesn't end there: C has > been so influential that its insanity has spread to tons of other > languages: C++, Java, C#, Python, Perl--heck, even LISP. > > Am I the only one here who's suffered a needless off-by-one bug as a > result of C's horrible zero-based indexing? Let's see a show of
hands...
> > But more important, to those of us in DSP, is the fact that C's
indexing
> doesn't conform to Matlab--which wisely employs one-based indexing in > accordance with the centurys-old convention of linear algebra. Now,
one
> might ask, "who died and left Matlab in charge?" Well, nobody, I
guess.
> But if the Matlab folks hadn't gotten this right, why would so many > DSP folks shell out *thousands* for Matlab, when zero-based
alternatives
> like SciPy (http://scipy.org/) are absolutely, 100%, free? There can
be
> only one answer: one-based indexing. > > OK, I can already hear some of you about to cite the old "legacy code" > chestnut as a reason C can't be changed. True, there's a lot of C code > out there. But there's absolutely no reason that C can't switch to > one-based with a zero-based compatibility mode. OK, I know, I know:
C++
> programmers can easily create their own one-based array object. But > what sense does it make for countless programmers to home-brew a > solution when Dennis Ritchie could just get off his duff and fix the > problem once-and-for-all? After all, Grace Hopper did it for FORTRAN. > > Sound radical? I don't think so: let's face it, we live in a one-based > world. For example, ask a child to count their fingers, and they'll > invariably assign "one" to the first (er, "zeroth") finger. > > Still not convinced? OK, what about the calendar?--what if today was > "April 0th"? > >=g2 > _____________________________________________________________________ > > Grant R. Griffin > Publisher of dspGuru http://www.dspguru.com > Iowegian International Corporation http://www.iowegian.com > See http://www.iowegian.com/img/contact.gif for e-mail address
-- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Al Clark wrote:
> Grant Griffin <nospam@yahoo.com> wrote in news:4a503$442e975f$4088dbc7 > $1304@EVERESTKC.NET: > > Someday soon, this little rant is going to pop up in a Google search, > probably by someone from Mathworks. They won't realize what day you > posted it. > > They will use this as evidence that all the other DSP guys must be > smoking to relieve their glacoma symptoms. This will be their > justification for not making the obvious workaround. > > Thanks Grant, you just set us back years. I think they were probably real > close learning how to count from zero.
and after TMW gets that down, perhaps they can learn how to count from -32 or -512.
> > Welcome back...... > > Al > > > > > > > Am I the only person who's noticed that C's zero-based indexing is > > nothing short of...well...horrible? And it doesn't end there: C has > > been so influential that its insanity has spread to tons of other > > languages: C++, Java, C#, Python, Perl--heck, even LISP. > > > > Am I the only one here who's suffered a needless off-by-one bug as a > > result of C's horrible zero-based indexing? Let's see a show of hands... > > > > But more important, to those of us in DSP, is the fact that C's indexing > > doesn't conform to Matlab--which wisely employs one-based indexing in > > accordance with the centurys-old convention of linear algebra. Now, one > > might ask, "who died and left Matlab in charge?" Well, nobody, I guess. > > But if the Matlab folks hadn't gotten this right, why would so many > > DSP folks shell out *thousands* for Matlab, when zero-based alternatives > > like SciPy (http://scipy.org/) are absolutely, 100%, free? There can be > > only one answer: one-based indexing. > > > > OK, I can already hear some of you about to cite the old "legacy code" > > chestnut as a reason C can't be changed. True, there's a lot of C code > > out there. But there's absolutely no reason that C can't switch to > > one-based with a zero-based compatibility mode. OK, I know, I know: C++ > > programmers can easily create their own one-based array object. But > > what sense does it make for countless programmers to home-brew a > > solution when Dennis Ritchie could just get off his duff and fix the > > problem once-and-for-all? After all, Grace Hopper did it for FORTRAN. > > > > Sound radical? I don't think so: let's face it, we live in a one-based > > world. For example, ask a child to count their fingers, and they'll > > invariably assign "one" to the first (er, "zeroth") finger. > > > > Still not convinced? OK, what about the calendar?--what if today was > > "April 0th"? > > > >=g2 > > _____________________________________________________________________ > > > > Grant R. Griffin > > Publisher of dspGuru http://www.dspguru.com > > Iowegian International Corporation http://www.iowegian.com > > See http://www.iowegian.com/img/contact.gif for e-mail address > > > > -- > Al Clark > Danville Signal Processing, Inc. > -------------------------------------------------------------------- > Purveyors of Fine DSP Hardware and other Cool Stuff > Available at http://www.danvillesignal.com
Grant Griffin wrote:
> > Am I the only person who's noticed that C's zero-based indexing is > nothing short of...well...horrible? And it doesn't end there: C has > been so influential that its insanity has spread to tons of other > languages: C++, Java, C#, Python, Perl--heck, even LISP. > > Am I the only one here who's suffered a needless off-by-one bug as a > result of C's horrible zero-based indexing?
Nice one Grant. Here where I am, this arrived on April 2nd, so I initially didn't recognise it for what it was :-). Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "We are shut up in schools and college recitation rooms for ten or fifteen years, and come out at last with a belly full of words and do not know a thing." -- Ralph Waldo Emerson
Erik de Castro Lopo wrote:
> > Nice one Grant. > > Here where I am, this arrived on April 2nd, so I initially didn't > recognise it for what it was :-).
geez, it must be nice to live in the future. hey Erik, can you give me some tips on U.S. stocks, like when any stock takes a sudden dive or just as sudden ascent? you tell me what tomorrow's prices are today and i'll become a day trader and, i promise, i'll split the profits with you 50-50. honest! so, how 'bout it? you tell me what stocks to buy/sell a day in advance and we'll make a killing. r b-j