BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

HOLY COW!  Smiley Surprised Smiley Surprised


Message Edited by smercurio_fc on 11-19-2007 09:44 AM
0 Kudos
Message 101 of 2,571
(17,142 Views)

But you have to admit that it would scale very well on a massively multiCPU system. 😮

I am impressed how many times it goes to dynamic data and back for no reason at all. Even that last flipflop from dynamic-to array-to wavefirm. What would VI analyzer say?

 

BTW:
CC, your solution could be made a little bit more compact by eliminating the "array size+Initialize array" construct on top. Just use a plain multiply (multiply the array by zero). 😉

Message 102 of 2,571
(17,132 Views)


altenbach a écrit: ... CC, your solution could be made a little bit more compact by eliminating the "array size+Initialize array" construct on top. Just use a plain multiply (multiply the array by zero). 😉

Nice ! I forgot this trick. I think I have lost part of my mind trying to understand what was going on in that mess... :D:D:D
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 103 of 2,571
(17,131 Views)

Notice that I said "more compact". It might be a tiny little bit slower, but I have not done any systematic comparison. 😉

You can even eliminate the diagram constant by subtracting the array from itself but that would start to get into the range of obfuscated code.. 😮

Message 104 of 2,571
(17,129 Views)


chilly charly wrote:
Nice ! I forgot this trick. I think I have lost part of my mind trying to understand what was going on in that mess... :D:D:D

You still need to be careful with this trick. 🙂
 
Here we have integers, so there won't be a problem. However, IF you are dealing with floating point AND some of the array elements are NaN, Inf, or -Inf, you'll end up with NaNs in the initialized array. So, the result can be different between the two methods. This may, or may not, be acceptable. 🙂
Message 105 of 2,571
(17,100 Views)
But look at the art workSmiley Very HappySmiley Very Happy
Regards
Ray Farmer
Message 106 of 2,571
(17,080 Views)

Must have gone to the same coding school as whoever coded the stuff I was fixing a year ago..  😄

I still have sight problems since then.  When asked to fix the next code....  well... let's just say other things came up  LOL!!!! 😄

0 Kudos
Message 107 of 2,571
(17,062 Views)
Video Vertigo, I feel ill after scrolling down that BD.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 108 of 2,571
(17,048 Views)
  1. Seems we need to do every comparison twice, each instance with a fresh local of the same variable. (one for the case, one for the LED) 🙂
  2. The terminal of the 6 identical local most likely gets written way after all the locals are read by the code, so we have one big race condition. (which in this case fortunately clears up more or less after 10ms, but why!)




Message Edited by altenbach on 11-21-2007 01:36 PM
Message 109 of 2,571
(17,010 Views)
i had to look at some (very) old code this morning.
and look what i found out:
the untouchable! i could kill the guy who did that. and he is right now sitting in my office! on my chair! (hum....i wander who that is...)
 


Message Edited by Gabi1 on 12-12-2007 10:13 AM
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 110 of 2,571
(16,895 Views)