Hi..
I'm still looking for a way of checking one list of numbers against
another list of numbers and returning the any number that is included
in both.
Something like the [select] object but that passes the number rather
than a bang so I could add the number to a text file or list.
Thanks in advance,
mat
Mat Wall-Smith wrote:
Hi..
I'm still looking for a way of checking one list of numbers against another list of numbers and returning the any number that is included in both. Something like the [select] object but that passes the number rather than a bang so I could add the number to a text file or list.
May prepending an index to the number by [pack] and passing the [index number] package through [route] help?
Batuhan
On Sun, 2007-09-16 at 17:20 +1000, Mat Wall-Smith wrote:
Hi..
I'm still looking for a way of checking one list of numbers against another list of numbers and returning the any number that is included in both. Something like the [select] object but that passes the number rather than a bang so I could add the number to a text file or list.
something like this? (see attachment)
roman
Hallo, Mat Wall-Smith hat gesagt: // Mat Wall-Smith wrote:
I'm still looking for a way of checking one list of numbers against
another list of numbers and returning the any number that is included
in both.
Like the attached example? Requires objects in the the list-abs collection.
Frank Barknecht _ ______footils.org_ __goto10.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Like the attached example? Requires objects in the the list-abs collection.
Oh, list-union.pd is the wrong name, as a union collects all elements of both lists (following the [zl union] convention). It should be something like list-sect.pd (following the [zl sect] convention).
Frank Barknecht _ ______footils.org_ __goto10.org__
requires list-abs
right-inlet: cold inlet for second list
left-inlet: accepts messages 'unique' (common elements cancel out) or
'common' (common elements), then list
outputs a list
On Sep 16, 2007, at 12:20 AM, Mat Wall-Smith wrote:
Hi..
I'm still looking for a way of checking one list of numbers against
another list of numbers and returning the any number that is
included in both. Something like the [select] object but that passes the number
rather than a bang so I could add the number to a text file or list.Thanks in advance,
mat
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
(my mistake, right & left inlets are 'cold' for both lists to be
compared. list-sieve2.pd outputs when left-inlet recieves messages
'unique' or 'common' )
requires list-abs right-inlet: cold inlet for second list left-inlet: accepts messages 'unique' (common elements cancel out)
or 'common' (common elements), then list outputs a list
On Sep 16, 2007, at 12:20 AM, Mat Wall-Smith wrote:
Hi..
I'm still looking for a way of checking one list of numbers against
another list of numbers and returning the any number that is
included in both. Something like the [select] object but that passes the number
rather than a bang so I could add the number to a text file or list.Thanks in advance,
mat
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sun, Sep 16, 2007 at 05:20:34PM +1000, Mat Wall-Smith wrote:
Hi..
I'm still looking for a way of checking one list of numbers against
another list of numbers and returning the any number that is included
in both. Something like the [select] object but that passes the number rather
than a bang so I could add the number to a text file or list.
Install the python external, and make a simple extraction that does this?
[ x for x in set1 if x in set2 ]
/me ducks
On Tue, 18 Sep 2007, Ken Restivo wrote:
Install the python external, and make a simple extraction that does this?
[ x for x in set1 if x in set2 ]
Install the ruby external, and make a simple external that does this?
set1 & set2
and does it all in linear time too, instead of (presumably) quadratic.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
Am 18.09.2007 um 21:34 schrieb Mathieu Bouchard:
On Tue, 18 Sep 2007, Ken Restivo wrote:
Install the python external, and make a simple extraction that
does this?[ x for x in set1 if x in set2 ]
Install the ruby external, and make a simple external that does this?
set1 & set2
and does it all in linear time too, instead of (presumably) quadratic.
it's the exact same syntax for Python (starting with version 2.4)
greetings, Thomas
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, Sep 18, 2007 at 10:22:25PM +0200, Thomas Grill wrote:
Am 18.09.2007 um 21:34 schrieb Mathieu Bouchard:
On Tue, 18 Sep 2007, Ken Restivo wrote:
Install the python external, and make a simple extraction that
does this?[ x for x in set1 if x in set2 ]
Install the ruby external, and make a simple external that does this?
set1 & set2
and does it all in linear time too, instead of (presumably) quadratic.
it's the exact same syntax for Python (starting with version 2.4)
Thanks. I haven't done much with Python since the 2.3 days.
Um, actually, it looks like it's more like:
list( set(set1) & set(set2) )
But, anyway, back to PD now. :-)
Time for me to try to get RRAD running and play with it some.
On Tue, 18 Sep 2007, Ken Restivo wrote:
On Tue, Sep 18, 2007 at 10:22:25PM +0200, Thomas Grill wrote:
Install the ruby external, and make a simple external that does this? set1 & set2 and does it all in linear time too, instead of (presumably) quadratic.
it's the exact same syntax for Python (starting with version 2.4)
Thanks. I haven't done much with Python since the 2.3 days. Um, actually, it looks like it's more like: list( set(set1) & set(set2) )
Ok, it's not really the same. Ruby has no Set class, there's no & for Hashes, and the & for Arrays preserves order of elements of the left-hand side.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada