Yabbut, none of youse guys will work as cheap as me.
Thanks, Rich
Yabbut, none of youse guys will work as cheap as me.
Thanks, Rich
I think he meant something more complex than "hello world"
I once did an RMS in a 68HC11 by using LUTS, but realized on the bench that it didn't make a significant difference in the regulation. It was just a(an?) SCR phase control power supply (well, smart industrial battery charger, 24V 40A), and so I had really loose tolerances to work with, so I went with simple. Unfortunately, at the time, I missed the part about "cheap", so it never made it to market. )-;
Thanks, Rich
Am I allowed to use fractional-brigtness adjacent pixels, to simulate dithering?
Thanks, Rich
wrote: [will work for drugs, alcohol, and pussy...]
...
If at that point I'd started drawing little diagrams of pixels and bytes and schtuff, what would my chances have been? ;-)
I once came up with a three-line Eratosthenes sieve on the back of an envelope at a bus stop. I didn't memorize it, but it's almost trivial - HEY!! I just had a profound revelation! This is where the power of drawing a picture lies! Dood, it's so simple! I feel like this guy:
----------------------- Dr. Oliver Wendell Holmes of Harvard Medical School inhaled ether at a time when it was popularly supposed to produce such mystical or "mind-expanding" experiences, much as LSD is supposed to produce such experiences today. Here is his account of what happened: "I once inhaled a pretty full dose of ether, with the determination to put on record, at the earliest moment of regaining consciousness, the thought I should find uppermost in my mind. The mighty music of the triumphal march into nothingness reverberated through my brain, and filled me with a sense of infinite possibilities, which made me an archangel for a moment. The veil of eternity was lifted. The one great truth which underlies all human experience and is the key to all the mysteries that philosophy has sought in vain to solve, flashed upon me in a sudden revelation. Henceforth all was clear: a few words had lifted my intelligence to the level of the knowledge of the cherubim. As my natural condition returned, I remembered my resolution; and, staggering to my desk, I wrote, in ill-shaped, straggling characters, the all-embracing truth still glimmering in my consciousness. The words were these (children may smile; the wise will ponder): `A strong smell of turpentine prevails throughout.'" -- The Consumers Union Report: Licit & Illicit Drugs
-----------------------
CHeers! Rich
Sorry, nothing that I can think of, of the sort.
Somewhat tangentially...
We are interviewing people for computer programmer positions. We are looking for those who can actually "do stuff" without too much babysitting.
Lots of people come in with impressive resumes. When I talk to them, I know that some peope are very good at bullshitting, so I give them a couple of actual tasks to do. Very small simple things. One is to write a nice function that reverses a string in place. For example, "Rich" would become "hciR".
Almost no one can actually do this without making mistakes, many people give up completely.
Very frustrating. I consider it the most basic capability of a programmer.
i
'Kay.
richgrise@thunderbird:~/Programming/C $ cat simple-reverse.c /* simple-reverse.c */ #include #include
void reverse_a_string(char *);
int main(int argc, char **argv) { char string[255];
strcpy(string,"Rich"); reverse_a_string(string); printf("Output = '%s'\\n", string); exit(0); }
void reverse_a_string(char *string) { int i, j, c, d;
for (i = strlen(string) - 1, j = 0; i > j; i--, j++) { c = string[i]; d = string[j]; string[i] = d; string[j] = c; } return; } richgrise@thunderbird:~/Programming/C $ gcc simple-reverse.c -o simple-reverse richgrise@thunderbird:~/Programming/C $ simple-reverse Output = 'hciR' richgrise@thunderbird:~/Programming/C $
Do I get the job? ;-)
Cheers! Rich
for (i = strlen(string) - 1, j = 0; i > j; i--, j++) {
It could probably be done a little less verbosely by writing a simple swap(char1, char2) thing, but, well, that's really just a matter of taking the above and putting it an a swap() routine.
Remember, I wanna telecommute, unless somebody wants to relocate me. :-)
Cheers! Rich
...
Probably not, Earth is pretty much the seat of humanity. The UFOs and s*it are just angels and other lower astral entities. I've been to heaven and back, and it's supremely boring - a vast, featureless, plain plane plain, with one ivory tower. And a hole in the floor where I blasted through once on the bow wave of an explosion of killing, flaming, fuming, blaming rage, with intent to kill God.
I beat on the door of his ivory tower, and he finally showed up at the door, an old, bedraggled-looking, scrawny, wrinkly guy, glasses at his forehead, looking confused, rubbing sleep out of his eyes, and he said, "Huh? Wha?"
I said "WHAT THE F*CK IS GOING ON HERE?!!!!!!"
He looked out at all of the pain and suffering and horror in the world, and kinda went, "Oh, my Me!" like he had had no clue.
Then, like the f*****ad that he is, he sweeps his hand, and the harps play, and he says, "Behold," and I behold that I've reached the light at the end of the tunnel, and the answer is that the answer is at the other end of the tunnel.
Nah, sounds like it just gives you all of the clumsiness with none of the pleasurable parts.
I accidentally smoked some PCP once. Well, twice, me and another guy were sitting at another friend's house while the friend borrowed guy B's Jeep to move some stuff. So, we were sitting at the kitchen table, and spot the guy's baggie, and my bud says, "Wanna smoke one?" And I said, "Sure, why not?" so he rolled one up and we smoked it, and he says, "Are you high yet?" and I said, "not really", since I was very young and had not yet learned to say, "Let's give it a minute or two, and see what we feel like", so he rolled up another one, and we started it.
About half-way through that second doobie, it felt like my brain had suddenly been hit by a ton of bricks. I got terrible tunnel-vision, I got paranoid, I got anesthesized with none of the benefits, it was TERRIBLE!
So I don't do PCP, and Ketamine sounds pretty similar, so, thanks but no thanks.
LSD, on the other hand... %-}
Cheers! Rich [if only it were possible to get real LSD these days]
That's interesting, although as you can well see, not the most efficient.
yep
That's interesting. How is your actual problem phrased? Just curious.
That's true... Much better that just chatting with people.
i
that's what we want, reverse in place.
scary stuff...
i
Isn't that kinda cheating?
Hm... not so different from my one (aside from no reentrancy, of course):
template void __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) { while (__first < __last) std::iter_swap(__first++, --__last); }
Best regards, Spehro Pefhany
P.S., I don't think you want those 'const' thingies up there..
Best regards, Spehro Pefhany
Yes, default argument is a nice added feature of C++ ...
ummm... well, I think in reality I'd probably use some inline assembler or something ;-) , but I think this is what you're looking for:
int x, y;
x ^= y; y ^= x; x ^= y; // swap x and y
or, alternatively, you could use
y ^= x; x ^= y; y ^= x; // swap y and x
I don't think I've seen this before, but ex-or seemed the way to go.
Best regards, Spehro Pefhany
when they point to const, yes. ;-)
Best regards, Spehro Pefhany
There are many reasons why and why not, and even when not or how not. The most direct answer is that below some level of detail, the program code is a better, more effective, and more efficient descriptive tool than any design language. It has to be, otherwise the design tool will have taken over as the programming tool, and that hasn't happened yet. Thresholds vary with the person, tools involved, and task at hand. There is no direct analogy in circuit design, leading directly to that inescapable conclusion: software and circuit design are very different tasks once you leave the broad brush-stroke level of talking.
Anyway, our young friend Iggie was asking about the world beyond "20 wires or so". No BGA involved there. Complexity at that level is next to nil, but the details are already too large to keep internally alone. That's quite a bit different from mashing code into a keyboard; the first line of code is likely still on the same screen as the last. At even 10 or 100 times that size, referencing decisions already made is just a keystroke or two away.
Man, you young'uns must think CPU cycles are free or something.
bool IsPowerOf2(unsigned val) { return !(val & (val-1)); }
-- jm
------------------------------------------------------
------------------------------------------------------
No. Something like this:
#include
void ReverseString(const char * pStr, size_t len = 0); void ReverseString(const char * pStr, size_t len) { if (!pStr) return; std::reverse(pStr, pStr + (len ? len : strlen(pStr))); }
As opposed to auto_ptr? In the kind of embedded stuff I do, we generally avoid dynamically allocated memory (and most reentrancy) entirely.
Best regards, Spehro Pefhany
Have something to add? Share your thoughts — no account required.
Ask the community — no account required