NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Knight of NI
Ray.R
Posts: 10,165

Re: Rube Goldberg Code

My turn at creating a RG code...

 

That's what happens when you try to do something quickly..

 

original code:

 

improved:

 

 

Yes... yes, I am aware of the coersion dots...  :smileytongue:

 

 

.
(starting to) See Life in a brand new way...

b* ^ )
Knight of NI
Knight of NI
tst
Posts: 10,220

Re: Rube Goldberg Code

Well, it could be simplified further - you're taking the 1D array of RGB values and then turning it into 3 2D arrays of RGB values and then making that into a 3D array.

 

So you could move the build array to be after the decimate and then do the reshape in a loop.

 

Or you could use the picture VI which converts a flattened pixmap to a 2D U32 array and then use split number on that array to extract the RGB arrays.


___________________
Try to take over the world!
Knight of NI
altenbach
Posts: 22,780
0 Kudos

Re: Rube Goldberg Code

[ Edited ]

Some code can only be described as tapeworms: ugly, unwanted, and hard to get rid of.

 

 

 

(Seen here)

 


LabVIEW Champion . Oh, by the way, I work for peanutsKudos .

Knight of NI
altenbach
Posts: 22,780
0 Kudos

Re: Rube Goldberg Code

[ Edited ]

Generating a regularly patterned 3D array, then slicing out one of the planes in a given orientation may need a multiscreen sized diagram, case structures with the same property node on all cases, shift registers, empty arrays, intermediary array of 1, 2, 3 dimensions, stacked loops, etc.

 

 

(note that the above picture is scaled to 50% of the actual size!).

Or it could all be done with some simple postcard sized code. :smileyvery-happy:

 

 

(seen here)

(more details)


LabVIEW Champion . Oh, by the way, I work for peanutsKudos .

Active Participant
danil33
Posts: 651
0 Kudos

Re: Rube Goldberg Code

Hi,

      I think. when I code some times,no need to purposefully make it as a Rube Goldberg Code,it will naturally turn to a Rube Goldberg Code:smileywink:Anyway I think Rube Goldberg Code will disappears gradually as experience build up...

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:smileyhappy:
Active Participant
Hornless.Rhino
Posts: 586
0 Kudos

Re: Rube Goldberg Code


danil33 wrote:

Hi,

      I think. when I code some times,no need to purposefully make it as a Rube Goldberg Code,it will naturally turn to a Rube Goldberg Code:smileywink:Anyway I think Rube Goldberg Code will disappears gradually as experience build up...


Either that or you just find more and more nitty-gritty things to optimise.

Trusted Enthusiast
SteveChandler
Posts: 2,249
0 Kudos

Re: Rube Goldberg Code

Example_VI_BD.png

 

Same thing

 

Example_VI_BD.png

 

 

=====================
LabVIEW 2012


Active Participant
danil33
Posts: 651
0 Kudos

Re: Rube Goldberg Code

Same can be easily represented as:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:smileyhappy:
Active Participant
danil33
Posts: 651
0 Kudos

Re: Rube Goldberg Code

In the above code just take few number of bytes and reversing it inside an array.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:smileyhappy:
Active Participant
danil33
Posts: 651
0 Kudos

Re: Rube Goldberg Code

In the above RGC,If the array size is getting bigger and bigger then definitely the first one will become a Rube Goldberg one.:smileyvery-happy:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:smileyhappy:
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page