comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Array Dimensions and WRITE_GIF
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: array dimensions [message #24665 is a reply to message #24578] Mon, 09 April 2001 08:20 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
David Fanning wrote:
>
> Richard G. French (rfrench@wellesley.edu) writes:
>
>> Now that you mention SMOOTH, one of my pet peeves is that
>> y=SMOOTH(array,n) gives an error message when n=1. There are lots of
>> instances where the degree of smoothing is calculated on the fly,
>> and one common instance is that you want no smoothing at all - i.e.
>> just give me the original array, unsmoothed. I've ended up writing
>> my own routine MYSMOOTH which is identical to smooth except that
>> it does not barf when n=1. Perhaps this has been changed recently,
>> but I don't think so. Does anyone have a good explanation for why
>> n=1 does not have the expected behavior of returning the array
>> unsmoothed? Or is there a keyword I have not been noticing that
>> can handle this case?
>
> Having had some modest experience these past few years
> writing programs for public consumption, allow me to
> make an observation or two.
>
> I don't know how it is done in the real world, but
> in my world a program idea is generated as a result
> of a problem I have encountered (usually more than once)
> in my own work. I come up with what I almost always
> mistakenly believe is a clever idea and I code it up.
>
> The program stays at this stage for some indeterminate
> amount of time, usually until someone runs into a similar
> problem and asks a question on the newsgroup. "Oh", I think,
> "I have a clever solution to *that* problem. I'll clean
> it up for them and offer it on my web page."
>
> In the course of "cleaning it up", I usually discover
> that my clever solution is really not as clever as I
> thought it was and that it tends to work only in the
> narrow confines of its original purpose. So I
> make it more general. In fact, I usually try to imagine
> all the ways it might be used.
>
> Now, I am known in some circles as having a pretty
> fertile imagination, but I have to admit that one of the
> things that would *never* occur to me if I was writing
> a SMOOTH function is that someone would use it if they
> *didn't* want to smooth anything. Are you sure it would
> have occurred to you?

It would have occurred to me; part of my group's standard testing
routine is to check all boundary cases, which would have focused my
attention on n=1. One of my own design rules is to avoid interpreting
unusual values for arguments as errors unless I have to. I look for ways
to interpret them as instructions to do something unusual (but
consistent with the meaning attached to more normal values). Thus, I
don't normally treat a count of 0 as an error, but as an instruction to
process 0 of whatever is being counted; i.e., to skip processing.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: A third-party example
Next Topic: Problem with ".cdf" files on Windows

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:02:37 PDT 2025

Total time taken to generate the page: 0.00246 seconds