Re: What the heck do they teach in college??
"remco" <whybcuzREMOVE@THISyahoo.com> wrote in message
news:9CIYe.979$dl2.2@fe08.lga...
>
> "Michael Pardee" <michaeltnull@cybertrails.com> wrote in message
> news:Zr2dnXg1cs5j1K7enZ2dnUVZ_s-dnZ2d@sedona.net...
>> If you think about it, everything we plan is a program. Understanding how
> to
>> structure and modularize plans (including "exception handling" - dealing
>> with potential snags) is the key to carrying off any big project.
> Outlining
>> provides the same sort of benefit for small projects but doesn't have the
>> potential for minimizing interactions or handling vagaries of fate that
>> structured logic does.
>>
>
> Yup, I think so too. There's no better teacher than getting utterly
> frustrated at a problem, requiring some hair pulling. Besides teaching
> good
> logic thinking skills, it also teaches tenacity.
>
>
>
Oh, yeah! My favorite was a decibel conversion we were trying to incorporate
into a simple baseband monitor. We had a nice SBC that had everything we
needed in a compact and cheap package... but it booted to a version of BASIC
that was limited to 8 bits and had no floating point math. Not ideal for the
task: convert a digitized input to the nearest dB over a 10 dB (a bit more
than a 3:1) range. The formula is <20 log (input)>. Huh. A couple days later
it hit me and the algorithm fit into fewer than a dozen lines of code. The
trick was to choose a seed, initialize a loop counter to 10 (decrementing to
0), and subtract the integer divide by ten from the seed (effectively
multiplying the seed by 0.9) with each pass. When the input value exceeded
the result, the counter was the dB value. One mid-loop correction brought it
within spec. I love it! It should be taught in college! ;-)
I suppose it could have been done with a lookup table, but what's the fun in
that?
Mike
|