If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
array index size?
11 posts
• Page 1 of 2 • 1, 2
array index size?
Is there a primitive, that shows how many elements (index size) are inside array of elements?
Array builder could output that information...
Array builder could output that information...
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: array index size?
If I understand correctly, the 'ARRAY' primitive has an integer out that shows the total number of entries in the array.
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: array index size?
Which one primitive? Ah, that one. No. "Array builder" (paralel inputs) - this one outputs only the array, no index size. I used chain of "sort array" and "find max", to get the index, but I wonder if I'm missing something obvious/else.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: array index size?
Hey MyCo, dummy is the best!
I did not knew that trick.
I did not knew that trick.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: array index size?
tester wrote:Is there a primitive, that shows how many elements (index size) are inside array of elements?
Tester, I usually love your questions, because they always leave me completly headf**ked
There's always a bit of "twisted genius" there, that sends my brain reeling...
But this question above had me ...
After all this time mate, How did you miss something like that....????
maybe your never working in green???
Anyway, good to know that your actually human.
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: array index size?
I think 'tester' was just trying to give me an easy one to return help on !
More importantly .... MyCo ... Big thanks for the multiple techniques !
The 'dummy' and the RUBY were new for me ... THANKS!
But let me ask this ... from a programming perspective, is there any advantage using one or the other
I'm thinking in terms of efficiencies ... like speed of execution, or RAM usage, or file size, etc. This may not be the ultimate example to question this on, but I'm trying to get a better understanding how to best optimize.
Thanks again!
More importantly .... MyCo ... Big thanks for the multiple techniques !
The 'dummy' and the RUBY were new for me ... THANKS!
But let me ask this ... from a programming perspective, is there any advantage using one or the other
I'm thinking in terms of efficiencies ... like speed of execution, or RAM usage, or file size, etc. This may not be the ultimate example to question this on, but I'm trying to get a better understanding how to best optimize.
Thanks again!
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: array index size?
billv wrote:tester wrote:Is there a primitive, that shows how many elements (index size) are inside array of elements?
Tester, I usually love your questions, because they always leave me completly headf**ked
There's always a bit of "twisted genius" there, that sends my brain reeling...
But this question above had me ...
After all this time mate, How did you miss something like that....????
maybe your never working in green???
Anyway, good to know that your actually human.
"Hello world. I'm human."
-- tester
Never used (manually) that part/aspect, never knew it existed that way. But it proves (in both directions), that SM/FS is intiutive, i.e. you can get a lot of things even if you don't know how... For some reason I thought that single-value prims just indicate that the array is not empty, and overlooked the whole thing.
RJ - I guess, the dummy method is for those who know/remember/understand, and step-by-step methods - for everyone else (like ruby for ruby-fans). On more practical side, I guess you just need to remember to set up smart prims and selectable connectors into specific types manually; otherwise when you mess up with your project, some of them may change, nobody knows when.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: array index size?
RJHollins wrote:But let me ask this ... from a programming perspective, is there any advantage using one or the other
I'm thinking in terms of efficiencies ... like speed of execution, or RAM usage, or file size, etc. This may not be the ultimate example to question this on, but I'm trying to get a better understanding how to best optimize.
Thanks again!
The "dummy" method is propably the most effictive in RAM/CPU usage. Although I have to note this: the dummy itself does nothing. I just use it in the Schematic to convert a string into an array. You can always connect an Integer input to an array output, with the same result.
The version with the "Array" primitive is not so good, because it duplicates an array everytime the array changes. So it doubles the RAM for a single array and the duplicating takes much CPU.
The Ruby version is just for demonstration, it doesn't make sence. I'm not sure how much CPU/RAM this takes, but I think the array is also duplicated on the input, so this might even be worse than the "Array" primitive.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: array index size?
tester wrote:SM/FS is intiutive, i.e. you can get a lot of things even if you don't know how...
Your not kidding there mate. I havn't got a clue what i'm doing but still getting results
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 82 guests