06-28-2013 12:45 PM - edited 06-28-2013 12:47 PM
@paulmw wrote:
@JÞB wrote:
@altenbach wrote:
Well, to be fair, your code is not equivalent, because it omits the error handling. 😮
Nor does it remove all whitespace characters
missed that the first time myself
That will probably become a big bug for someone to discover in the future. "Why can't I insert a 32, it keeps chaning to 0!" (unless that is intended...)
That is not intended. It should properly handle any number of the range 1 - 100 (that's from a check outside this SubVI). Apparently this VI comes from a copy of another that does the same thing... only with a Uint32. Just take the unbundle and rebundle part near the end and expand those down to 4 indexes and more horizontal lines across.
As for the error handling. It happens again external to this subVI. "Just to be sure!"
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books
07-01-2013 04:52 AM
@bsvare wrote:
That is not intended. It should properly handle any number of the range 1 - 100 (that's from a check outside this SubVI). Apparently this VI comes from a copy of another that does the same thing... only with a Uint32. Just take the unbundle and rebundle part near the end and expand those down to 4 indexes and more horizontal lines across.
As for the error handling. It happens again external to this subVI. "Just to be sure!"
- But the point of a subVI (as well as block diagram tidiness) is code packaging for re-use later, so you should not assume the the input conditions here will the same if this function is reused elswhere in the smae or a similar project. That is a VERY dangerous ASSumption to make Do not assume errors will always be handled exernally with this VI, there is probaly a very good reason for coding it like this even if there are no commments to explain it!
James
07-16-2013 03:20 PM - edited 07-16-2013 03:41 PM
Manipulating some integer arrays.... (top of image) (seen here)
(An equivalent alternative is shown at the bottom of the image. The first three primitives replace the two FOR loops and trimmings!)
07-17-2013 07:20 PM - edited 07-17-2013 07:20 PM
07-18-2013 02:11 AM
Hmmm, this coercion dot is annoying here.
Luckily it's already CARred.
07-18-2013 11:05 AM
@altenbach wrote:
Do some hex formatting.... (Seen here)
Also notice that the while loop will iterate two extra times (should be i+1 >= array size for the stop condition).
07-18-2013 11:08 AM
@crossrulz wrote:
Also notice that the while loop will iterate two extra times (should be i+1 >= array size for the stop condition).
Yes, I did not worry about commenting on the loop code. Since the number of iterations is known before the loop starts, a FOR loop would be correcter anyway.
07-18-2013 12:03 PM
@ThiCop wrote:
Hmmm, this coercion dot is annoying here.
Luckily it's already CARred.
That coercion dot is a bit more than annoying. If I remember correctly it blows up the [U8] into a [U64] or [I64]. This is one of those rare moments when a G implementation can outperform a primitive, albeit a botched primitive.
This is much faster than the primitive for [U8], simply by avoiding the wasteful coercion. Not all red dots are created equal, this is one of the worst offenders. At least the default conversion is not [CEXT].
07-18-2013 12:41 PM
@Darin.K wrote:
@ThiCop wrote:
Hmmm, this coercion dot is annoying here.
Luckily it's already CARred.That coercion dot is a bit more than annoying. If I remember correctly it blows up the [U8] into a [U64] or [I64]. This is one of those rare moments when a G implementation can outperform a primitive, albeit a botched primitive.
This is much faster than the primitive for [U8], simply by avoiding the wasteful coercion. Not all red dots are created equal, this is one of the worst offenders. At least the default conversion is not [CEXT].
Like it!
I wonder if you couldn't eek a bit more performance autoindexing out (probably with 'Auto-Concatenating' turned on, LV2012+) and parallelizing? Ostensibly, the compiler could be able to handle the pre-allocation without all the explicit prims, since output size could be constrained through static analysis of that snippet.
07-18-2013 12:43 PM
@JackDunaway wrote:I wonder if you couldn't eek a bit more performance autoindexing out (probably with 'Auto-Concatenating' turned on, LV2012+) and parallelizing?
Come to think of it... i seem to recall conversations about performance characteristics of Auto-Concatenating closer approaching Build Array for each iteration rather than Auto-Indexing .... for this reason, may need to wait for LV2013 or beyond for the performance! 🙂