 JÞB
		
			JÞB
		
		
		
		
		
		
		
		
	
			11-12-2010 11:19 PM
@altenbach wrote:
The Sudoku solver posted here has a pretty front panel, but the code could probably be reduced to 10% of the current monstrosity of locals and stacked sequences.
Here's a quick example:
We need to copy a 9x9 Array to a different 9x9 Array. Here's an animation showing the current hard way and a possible alternative. 😄
Locals are evil-  wouldn't a property node work
 JÞB
		
			JÞB
		
		
		
		
		
		
		
		
	
			11-12-2010 11:27 PM
@James W wrote:
@broken Arrow wrote:
To sequentially index an array, so many people wire sequential numbers to individual Index Array functions rather than just expanding the function. I see it all the time, even by experienced wire slingers.
OK - What is wrong with that? If you want really quick traceability of a wire halfway down a large index array function that you are then going to bundle after performing an operation on it, coming back to the code in 6 months time it's really useful to see which index is connected to which wire. Then you KNOW you have done what you intended or can see what the original programmer intended without having to count e.g. 13 lines down the index funtion which indexes 24 lines of a 1x36 array starting at index 5.
James
OK I'll bite. What's wrong may be any number of the following:
11-14-2010 04:53 PM - edited 11-14-2010 04:54 PM
Did you know that inefficient code can prevent out of memory errors??? 😮
The proof is here:
While both code alternatives grow the data structures by the same amount per iteration, one does so more efficiently and thus runs into the wall quicker. 😄
 GregFreeman
		
			GregFreeman
		
		
		 
		
		
		
		
		
	
			11-17-2010 10:55 AM - edited 11-17-2010 10:56 AM
Why use "array subset" when you can use "delete from array" and use the deleted portion, but never use the "array w/ subset deleted"?
 RayFarmer
		
			RayFarmer
		
		
		
		
		
		
		
		
	
			11-18-2010 01:40 AM
@for(imstuck) wrote:
Why use "array subset" when you can use "delete from array" and use the deleted portion, but never use the "array w/ subset deleted"?
Is there any difference in memory uses?
 Cory_K
		
			Cory_K
		
		
		
		
		
		
		
		
	
			11-19-2010 11:58 AM
@Ray Farmer wrote:
@for(imstuck) wrote:
Why use "array subset" when you can use "delete from array" and use the deleted portion, but never use the "array w/ subset deleted"?
Is there any difference in memory uses?
I would think it uses the same amount of memory. Even though you aren't doing anything with the array output, the delete from array function will still allocate the memory and perform that operation. I don't think you would save anything by simply not displaying that data (aside from the memory of the indicator, but you get the point).
11-19-2010 01:19 PM - edited 11-19-2010 01:21 PM
Cory K wrote:
@Ray Farmer wrote:
Is there any difference in memory uses?
I would think it uses the same amount of memory.
Personally, I would not rely on "thinking" here. 😮 Design some careful benchmark instead! 🙂
(Did you know that "built array" is orders of magnitude faster than "insert into array" for appending an element to an existing 1D array, even though they do the same thing. Would you have guessed?)
 James_W
		
			James_W
		
		
		
		
		
		
		
		
	
			11-22-2010 04:29 AM
@altenbach wrote:
(Did you know that "built array" is orders of magnitude faster than "insert into array" for appending an element to an existing 1D array, even though they do the same thing. Would you have guessed?)
This makes logical sense.
A built array just adds data to the end of the existing array,
Insert into array needs to split the array into 2 memory spaces to add the data into a gap in the middle (even if the "gap in the middle" is a gap at the end between Data and no data.)
- I would expect Insert into array to copy/ the data at least once. Build array should only need to move the array if the data space next to it is already alloacted - insert into array will also haveto perform this check before creating the new array.
 
					
				
		
 Ray.R
		
			Ray.R
		
		
		 
		
		
		
		
		
	
			11-22-2010 07:48 AM
I wonder if it would be the same as comparing Linked Lists and Arrays in C language...
12-04-2010 11:56 AM - edited 12-04-2010 11:58 AM
Who needs scalars????
We could just use arrays with 1 element each. Same difference!
(seen here. Look for Kings law.vi and also Pressure Transducers' Calibration.vi for some confusion)
Here's the code of Kings law (top) and a possible alternative (bottom).
