Re: [PD] simple message/list parsing

2007-10-05 Thread Mathieu Bouchard

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___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-18 Thread Ken Restivo
-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. 

- -ken
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG8DbWe8HF+6xeOIcRAr8oAJ9KPNYYWgY1u4dq/yoQzmT72TjWEQCg+wNy
KHFwR9v5ywkQi7sGe+1QhEg=
=0eQx
-END PGP SIGNATURE-

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-18 Thread Thomas Grill

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



___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-18 Thread 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.

 _ _ __ ___ _  _ _ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-18 Thread Ken Restivo
-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

- -ken
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFG7/7ne8HF+6xeOIcRAkdaAKCEQFFHWvoXPVBgETV41nYvBUPHzQCggxVA
5AN5YUVkkpOclVQ57VpFJPg=
=mk55
-END PGP SIGNATURE-

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-16 Thread Owen Cannon
(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


___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-16 Thread Owen Cannon



list-sieve2.pd
Description: Binary data
requires list-absright-inlet: cold inlet for second listleft-inlet: accepts messages 'unique' (common elements cancel out) or 'common' (common elements), then listoutputs a listOn 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 listUNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list ___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-16 Thread Frank Barknecht
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).

Ciao
-- 
 Frank Barknecht _ __footils.org_ __goto10.org__

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-16 Thread Frank Barknecht
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.

Ciao
-- 
 Frank Barknecht _ __footils.org_ __goto10.org__


list-union.pd
Description: application/puredata
___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-16 Thread Roman Haefeli
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


> 
#N canvas 497 -1 415 472 10;
#N canvas 0 0 199 178 seralize 0;
#X obj 14 112 list split 1;
#X obj 14 69 until;
#X obj 14 91 list append;
#X obj 132 96 bang;
#X obj 14 41 t b a;
#X obj 14 15 inlet;
#X obj 14 134 outlet;
#X connect 0 0 6 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 4 0 1 0;
#X connect 4 1 2 1;
#X connect 5 0 4 0;
#X restore 98 131 pd seralize;
#N canvas 0 0 199 178 seralize 0;
#X obj 14 112 list split 1;
#X obj 14 69 until;
#X obj 14 91 list append;
#X obj 132 96 bang;
#X obj 14 41 t b a;
#X obj 14 15 inlet;
#X obj 14 134 outlet;
#X connect 0 0 6 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 4 0 1 0;
#X connect 4 1 2 1;
#X connect 5 0 4 0;
#X restore 98 204 pd seralize;
#X obj 98 228 sel;
#X obj 98 180 list;
#X obj 98 152 t b f;
#X obj 98 276 f;
#X obj 98 251 t b b;
#X msg 248 53 0 1 2 3 4 5 6 7 8 9;
#X msg 72 73 1 5 9;
#X msg 52 54 2 3 4;
#X msg 247 77 0 2 4 6 8;
#X msg 246 103 1 3 5 7 9;
#X obj 98 308 list prepend;
#X obj 201 308 t a;
#X obj 47 96 t b a b;
#X obj 47 339 list;
#X msg 17 32 0 2 4 6 8 9;
#X obj 47 363 route bang;
#N canvas 0 0 450 300 show 0;
#X obj 129 107 list prepend set;
#X obj 129 129 list trim;
#X obj 129 79 inlet;
#X obj 129 154 outlet;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 2 0 0 0;
#X restore 112 391 pd show;
#X msg 112 414 1 5 9;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 3 0 1 0;
#X connect 4 0 3 0;
#X connect 4 1 5 1;
#X connect 4 1 2 1;
#X connect 5 0 12 0;
#X connect 6 0 5 0;
#X connect 7 0 3 1;
#X connect 8 0 14 0;
#X connect 9 0 14 0;
#X connect 10 0 3 1;
#X connect 11 0 3 1;
#X connect 12 0 13 0;
#X connect 12 0 15 1;
#X connect 13 0 12 1;
#X connect 14 0 15 0;
#X connect 14 1 0 0;
#X connect 14 2 12 1;
#X connect 14 2 15 1;
#X connect 15 0 17 0;
#X connect 16 0 14 0;
#X connect 17 1 18 0;
#X connect 18 0 19 0;
___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] simple message/list parsing

2007-09-16 Thread Batuhan Bozkurt
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


___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


[PD] simple message/list parsing

2007-09-16 Thread Mat Wall-Smith

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