BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


altenbach wrote:

 

Random sightings.... 


Ah, Altenbach, again you show how you just don't understand computers. This is clearly done because the value is also changed elsewhere and the new value is written between the writing in the top terminal and the reading in the low terminal. I mean, come on.


___________________
Try to take over the world!
Message 381 of 2,635
(12,935 Views)

tst wrote:

altenbach wrote:

 

Random sightings.... 


Ah, Altenbach, again you show how you just don't understand computers. This is clearly done because the value is also changed elsewhere and the new value is written between the writing in the top terminal and the reading in the low terminal. I mean, come on.


 

Concidering that there an outstanding bug where LV is NOT doing all of the property stuff in a single switch to the UI thread, your description could actually occur!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 382 of 2,635
(12,933 Views)

How to get a index in a time array:

  1. Get the dT from the samplefrequency
  2. Build an array from the dT and the size of the original array via auto-indexing
  3. Find the wanted T

Or

  1. Calculate the index from the samplefrequency and the T


Found here (with more RG-code)

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 383 of 2,635
(12,838 Views)

 

To allow an angle setting with either a numeric control or a set of 66 LEDs, we could code it with:

 

  • 600+ local variables
  • 67+ event cases
  • 67 case structures, one with 66 cases that will never match because of FP math)
  • hundreds of diagram constants
  • a couple of days of coding
  • a couple of days of debugging, because some boolean diagram constant got accidentally clicked/switched.

 

 or we could get away with:

 

  • 2 local variables
  • 2 event cases
  • no case structures
  • one diagram constant
  • a few minutes of coding (slowest step is arranging the 66LEDs in the radio control, that will still take a while without scripting)
  • no debugging.

 

If our salary depends on the number of locals, the first solution is preferred. 😄 

 

(read more here)

Message 384 of 2,635
(12,756 Views)

We want an output array containing the difference between adjacent elements of a given array.

 

The lumberjack version uses two "split array", discarding 50% of the outputs.

 

A simpler version could use "array subset" instead.

 

 

 

(spotted here)

Message Edited by altenbach on 12-04-2008 05:08 PM
Message 385 of 2,635
(12,701 Views)

Oh, I'm a lumberjack and I'm Okay, I sleep all night and I work all day...

 

Just had to say that. 🙂

 

The splits aren't discarding 50% of the arrays though... Only one element. One at each end. So, I'm in a strange enough mood today to argue that that's not throwing out 50% of the outputs.

 

     Rob

0 Kudos
Message 386 of 2,635
(12,646 Views)

Well, we have 4 outputs and only 2 are used. That's exactly 50% for me. 😄

 

 

The problem is less well defined if we want to express it in terms of array contents. In the special case of an input array with two elements it would be 50% of the array contents and with an input array containing only one element, we would throw away 100% overall. There is nothing left at the end.

 

We don't know what the compiler does, it might not even generate the values for the disconnected outputs. Who knows? 😉

 

Of course you can use a pair of pliers to loosen a bolt, a knife to tighten a screw, a blowtorch to heat your lunch, or a Mack truck to get coffee. It still does not make it the right tool. 😄

 

The array tools are often incorrectly used. This is along the same lines of using "delete from array" to take a subset. We see that all the time here. 😮

 

 

Message 387 of 2,635
(12,641 Views)

My father always said that you should always use the right tool for the right job and that if it worked it was obviously the right tool. 🙂

 

It took a while, but I finally got him to admit that some tools are faster and more efficient than others.

 

My favourite tool has always been explosives. I just haven't figured out how to program in LabVIEW with them yet. 😉

 

     Rob

Message 388 of 2,635
(12,636 Views)

Rob, real programmers use butterflies!

 

 

 

Of course, if you set the explosives just right, they should move the mouse by as much as you want.


___________________
Try to take over the world!
Message 389 of 2,635
(12,593 Views)

This weekend I picked up this golden nugget from the Labview forum. I have decided not to disclose the user behind it. I have not even decoded the function. But it has something to do with selecting time intervals in a random fashion. I have programmed a Cray supercomputer to decode the function. And I will have an answer next week perhaps. In the meantime I will give kudos to all users who are able to solve the problem. I guess even the programmer behind it, is somewhat uncertain about the function. I quote

“Hi,

I have found a solution but it is very heavy, with multiple case structure. I guess that it will work but it is very difficult to check if there is no mistake”

 I have posted it as I found it on this forum. It is quite large The top level VI is "essai VI 30.vi" Have fun
Message Edited by t06afre on 12-07-2008 11:24 AM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 390 of 2,635
(12,562 Views)