Support

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

finding duplicates in array

For general discussion related FlowStone

finding duplicates in array

Postby tester » Sun Oct 06, 2013 8:59 pm

How to automatically find/remove duplicated entries witin an array?

Can be with sorting, but... doable without sorting?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: finding duplicates in array

Postby RJHollins » Sun Oct 06, 2013 9:29 pm

RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: finding duplicates in array

Postby tester » Sun Oct 06, 2013 9:56 pm

As a module with input and output to connect something - it could help. Could you make it?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: finding duplicates in array

Postby RJHollins » Mon Oct 07, 2013 6:16 am

tester wrote:As a module with input and output to connect something - it could help. Could you make it?


Not following you here :?:

The link I posted was to highlight the 'UNIQ' command.
'Returns a new array by removing duplicate values in self.'

There are several variations too.

Unless I'm misunderstanding :?
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: finding duplicates in array

Postby tester » Mon Oct 07, 2013 11:39 am

I have no idea how to compile working ruby module in FS from that thing. I'm not kidding :-) I really don't get the ruby part yet, and my head is offline on that.
Attachments
and-then-what.fsm
(327 Bytes) Downloaded 908 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: finding duplicates in array

Postby Nubeat7 » Mon Oct 07, 2013 5:25 pm

just that
Attachments
and-then-what.fsm
(385 Bytes) Downloaded 915 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: finding duplicates in array

Postby tester » Mon Oct 07, 2013 9:20 pm

Now you killeed me... :lol:
It looks that my thinking is just too complex. I tried various things (none worked of course). But not this one.

Thanks!
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: finding duplicates in array

Postby trogluddite » Mon Oct 07, 2013 9:59 pm

Yes - those API documents are "auto-created" from the Ruby interpreter's source code, so they take some getting used to! :?

The thing to look for is the "#=>" - that's not any kind of special Ruby code; "#" just means that the rest of the line is a programmer's comment (i.e. ignored by Ruby). But in the doc's they often write "#=>" to mean "Here's the result of that example".
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: finding duplicates in array

Postby tester » Tue Oct 08, 2013 6:41 pm

Yep, and every language has their own scheme of marking and explaining things. These rubyish examples should be converted into FS pieces of simple codes, with addidional simple comments on that. Like the old SM-style user packs. I read these descriptions, and make very big eyes, trying to figure out what the writer of that wanted to say....
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: finding duplicates in array

Postby RJHollins » Tue Oct 08, 2013 8:29 pm

I hear ya !

When I look for a RUBY solution, I hit GOOGLE to find related topics.

If there is a related solution, some of them can be 'way out there', and other RUBY guys will post different solutions or optimizations. It can be most helpful, AND confusing ... but at least it gets me started.

Just typing in the code in FS is helpful to a nube as me ... it forces me to think about the syntax and logic. I'm still at a snails pace understanding ... but a little success spurs me on :lol:

Just got to keep at it. There are definately things RUBY brings to a possible solution that would take many primitives to replicate. It can really clean up a schematic. It may not be for everything, but when I have gone the RUBY route ... it was very much worth it.

Thanks for all the Guys here who help with ALL of this FS stuff ... my project ideas have become a reality :D
8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 63 guests