From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code



@Ben wrote:
Now I have not checked recently but in LV 5 or there-abouts, the top input of the math operators was re-used...
I've never seen any difference (speed, memory, buffer allocation, etc.) if you swap the inputs to the multiplication. I think they are equivalent in recent LaVIEW versions.
Message 61 of 2,571
(26,688 Views)
In here there are several unnecessary operations.
 
1.  Let's take a number and subtract zero.
2.  Let's feed the size of the array into the for loop and also autoindex it.
3.  Let's step through an array of clusters, then unbundle and rebundle each one.
Message 62 of 2,571
(26,637 Views)
I get a chuckle out of this one. I guess it means that To Lower is not commutative.

Message Edited by Odd_Modem on 06-15-2007 05:38 AM

0 Kudos
Message 63 of 2,571
(26,561 Views)
I'm not sure I see what is "Rube Goldberg"-ish about this ("fun with caps" example). It seems more like an experiment to see what the behavior of those functions is with respect to numbers. The experiment makes sense when you see the actual behavior of the functions.

Message Edited by smercurio_fc on 06-15-2007 09:25 AM

0 Kudos
Message 64 of 2,571
(26,554 Views)

It just means that "to upper" and "to lower" both loose information. The "rube-ish" part is the fact that the loop runs for 1023 iterations (why not 1024), while we only have 256 characters. 🙂

Plot "toUpper-ToLower" vs "ToLower-ToUpper" for some real mess. 😉

0 Kudos
Message 65 of 2,571
(26,536 Views)
Yeah, I know. It just doesn't seem very "Rube Goldberg"-ish to me. At least based on the definition you had provided from Wikipedia, and prior examples. A curiosity nonetheless.
0 Kudos
Message 66 of 2,571
(26,530 Views)
Some easy path operations, the Goldberg way. 😄
 
As a substitute for a simple file dialog, we can use...
  1. "open file"
  2. convert the refnum to a file name
  3. then close the file.
  4. Why!!!!!!
As a substitute for strip path, we could ...
  1. convert the path to a string
  2. reverse the string
  3. search for "\" (will only work on windows :()
  4. get the remaining string
  5. Reverse the remaining string
  6. convert the string back to a path.
  7. Why!!!!!!!

Here are some literal simplifications:

(Of course we could configure the file dialog to select a folder, so we don't even have to strip anything! :))

(adapted from http://forums.ni.com/ni/board/message?board.id=170&message.id=263204. The actual VI had the code all over the place and not nicely aligned as shown here).

Message Edited by altenbach on 08-03-2007 12:09 AM

Message 67 of 2,571
(26,303 Views)

(Adapted from http://forums.ni.com/ni/board/message?board.id=170&message.id=264879&jump=true)

We need to read a simple two-column file (tabs between elements, linefeeds between rows) and place the first column into an x-array and the second column into a y array.

Lets do the following: We have a file path control that needs to be connected via a right-left wire to read the raw text. Now we first need to parse it into an interleaved array, throwing away the distinction between tab and newline. Of course we need to read 2048 points, no matter how many points are in the file. Since we now have an interleaved array, we need to decimate it again into the two colums. (A simple decimate array node with two terminals would be way too simple, we better use two FOR loops and index out the even and odd elements.

or we could just do the following:

Message Edited by altenbach on 08-11-2007 12:43 PM

Download All
Message 68 of 2,571
(26,225 Views)
 
If somebody would try to argue that stacked sequences are not that great, here are "supporting documents" (see comments on image). 🙂
 
 
Or we could add a lot of functionality (plotting of the best fit, etc.) and still have a much simpler diagram:
 

Message Edited by altenbach on 08-11-2007 01:08 PM

Download All
Message 69 of 2,571
(26,228 Views)
These are great. You should just start Alten's weekly fixes or something like that. Smiley Very Happy

___________________
Try to take over the world!
Message 70 of 2,571
(26,214 Views)