Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-30 Thread Roger Light
Hi Frank,

In my opinion if you need the tool, write it - don't worry about what
anybody else thinks. If other people want it as well then that's the
point to worry about distro support.

Cheers,

Roger



Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-30 Thread Frank Stähr

Am 26.09.2015 um 16:49 schrieb Gianfranco Costamagna:

Thanks for this hint, and Gianfranco, also thanks for your answer,
especially the link. I should have stated more precisely that setop
shall be a command line tool. Python sets and combine are interesting
but not as much universal as I plan my program to be.



well, I fail to understand a system where python is not available, but well
if you want bash I can't complain


Just I don't think the final usage of the tool will be the example you provided,
so I guess python might be the best way to script some easy programming.


I don’t want python to be not available. The examples you and others 
provided just look like “scripting in a special language”. Python and 
LISP are nice and probably mighty, but not universal for processing streams.


Here are other examples:


I had to use these when I needed set operations. There must be a better 
solution.




but if you want to write it, nobody can stop you, and if it is good enough
you will even find a sponsor eventually :)


I am going to do so and hoping for support when it’s ready.



Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-28 Thread Rick Thomas

On Sep 25, 2015, at 9:11 AM, Frank Stähr  wrote:

> I am ,,,  going to program a tiny tool:
> 
> “setup" takes as inputs several lists/sets, calculates desired (mathematical) 
> set operations on them and outputs the final set (or depending on operation 
> resulting number of elements, answer yes/no, …).
> …
> So my questions is: Is there a need for such a program or is there already 
> something very similar?
> 
> I would be very grateful for your feedback,
> Frank

If it were a Debian package, I’d use it.
Rick


Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-28 Thread Alex Vong
Hi Frank,

I think I know a language that will do what you want, it is called
LISP! Lisp stands for `list processing language' or `lots of
irritating superfluous parentheses' when it doesn't. Lisp allows you
to program as if you were writing mathematics, aka functional
programming.

I learned Lisp from the 1986 6.001 lectures
.
The dialect of Lisp I am using is called Scheme and the implementation
I am using is called Guile
.

For examples on doing sets operations on list, see
,
but you would need to know basic Scheme first. (Just watch the 6.001
lectures, they should blow your mind if you haven't seen Lisp before!)

Examples:
(lset-union eq? '(a b c d e) '(a e i o u))
=> (u o i a b c d e)
(lset<= eq? '(a) '(a b a) '(a b c c))
=> #t

Explanations:
Q: What is the union of (a b c d e) and (a e i o u)
A: (u o i a b c d e)
Q: Is (a) a subset of (a b a) and (a b a) a subset of (a b c c)?
A: True

Cheers,
Alex

2015-09-26 0:11 GMT+08:00, Frank Stähr :
> Hello everybody,
>
> I am not yet looking for a sponsor, but going to program a tiny tool:
>
> "setop" takes as inputs several lists/sets, calculates desired
> (mathematical) set operations on them and outputs the final set (or
> depending on operation resulting number of elements, answer yes/no, …).
>
> For example: File A contains 3 3 2 5 1 (each number an extra line). Then
> setop A
> would result in 1 2 3 5. This is equivalent to
> sort | uniq
>
> With a file B containing 5 90 2 7 the command
> setop -i A B
> would yield 2 5.
>
> Here, -i stands for intersection. Of course, there is no limitation to
> numbers, elements can be any non-empty strings. Other operations are
> union, symmetric difference, difference, contains element, is subset,
> cardinality and so on.
> Is this tool senseful, is there a certain need for it?
>
> As you can see on
> 
> nearly all these operations can already be done with other tools, but
> the according command lines are mostly very tortuous. There doesn’t seem
> to be a tool that directly works with sets.
>
> So my questions is: Is there a need for such a program or is there
> already something very similar? (Is this the right place for asking?)
> I even exactly know what options setop should have and what it can do
> (how it is used), but am waiting for some responses from you before
> programming.
>
> Note: I already asked two years ago but didn’t get satisfactory
> responses. Only now I remembered my idea.
>
> I would be very grateful for your feedback,
> Frank
>
>



Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-26 Thread Gianfranco Costamagna
Hi,


>Thanks for this hint, and Gianfranco, also thanks for your answer, 
>especially the link. I should have stated more precisely that setop 
>shall be a command line tool. Python sets and combine are interesting 
>but not as much universal as I plan my program to be.


well, I fail to understand a system where python is not available, but well
if you want bash I can't complain


Just I don't think the final usage of the tool will be the example you provided,
so I guess python might be the best way to script some easy programming.


>Still one open question: Do you find such a program useful? I’d like to 
>program it, but want to be sure that there is a realistic chance of it 
>to be included somewhere.


not for me, but I'm just a little voice :)


as said, I would prefer to use python and the native library, instead of a
not so well tested new program that might be even buggy somewhere.

(nothing against you, but python has a +20 years of usage and bugfixing)

>>> Note: I already asked two years ago but didn’t get satisfactory
>>> responses.

>>
>> Linking to the original thread would have been helpful:
>> https://lists.debian.org/1383147779.1944.30.camel@storch-desktop>
>
>No, it wouldn’t.


yes, it would :)

having no answer usually might be a sign that nobody has this need
for such a tool, and this might become in nobody interested in sponsoring it.

but if you want to write it, nobody can stop you, and if it is good enough
you will even find a sponsor eventually :)

cheers,

Gianfranco



Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-26 Thread Frank Stähr

Am 25.09.2015 um 22:20 schrieb Jakub Wilk:

* Frank Stähr , 2015-09-25, 18:11:

So my questions is: Is there a need for such a program or is there
already something very similar?


There's combine(1) in moreutils for boolean operations on sets.


Thanks for this hint, and Gianfranco, also thanks for your answer, 
especially the link. I should have stated more precisely that setop 
shall be a command line tool. Python sets and combine are interesting 
but not as much universal as I plan my program to be.


So finally there is nothing similar to setop.



(Is this the right place for asking?)


(I don't think so.)


Then sorry for spamming.

Still one open question: Do you find such a program useful? I’d like to 
program it, but want to be sure that there is a realistic chance of it 
to be included somewhere.




Note: I already asked two years ago but didn’t get satisfactory
responses.


Linking to the original thread would have been helpful:
https://lists.debian.org/1383147779.1944.30.camel@storch-desktop


No, it wouldn’t.



Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-25 Thread Jakub Wilk

* Frank Stähr , 2015-09-25, 18:11:

I am not yet looking for a sponsor, but going to program a tiny tool:

"setop" takes as inputs several lists/sets, calculates desired 
(mathematical) set operations on them and outputs the final set (or 
depending on operation resulting number of elements, answer yes/no, 
…).

[...]
So my questions is: Is there a need for such a program or is there 
already something very similar?


There's combine(1) in moreutils for boolean operations on sets.


(Is this the right place for asking?)


(I don't think so.)

Note: I already asked two years ago but didn’t get satisfactory 
responses.


Linking to the original thread would have been helpful:
https://lists.debian.org/1383147779.1944.30.camel@storch-desktop

--
Jakub Wilk



Re: Suggestion of new program: execute mathematical set operations on lists

2015-09-25 Thread Gianfranco Costamagna
Hi, a quick googling returns me this link [1]

seems that python natively do some sort of this

python3


>>> a = set([3, 3, 2, 5, 1])
>>> a
{1, 2, 3, 5}
>>> b = set([5, 90, 2, 7])
>>> b
{90, 2, 5, 7}
>>> a | b
{1, 2, 3, 5, 7, 90}
>>> a & b
{2, 5}
>>> 




[1] 
http://unix.stackexchange.com/questions/11343/linux-tools-to-treat-files-as-sets-and-perform-set-operations-on-them


cheers,

G.




Il Venerdì 25 Settembre 2015 18:11, Frank Stähr  ha 
scritto:
Hello everybody,

I am not yet looking for a sponsor, but going to program a tiny tool:

"setop" takes as inputs several lists/sets, calculates desired 
(mathematical) set operations on them and outputs the final set (or 
depending on operation resulting number of elements, answer yes/no, …).

For example: File A contains 3 3 2 5 1 (each number an extra line). Then
setop A
would result in 1 2 3 5. This is equivalent to
sort | uniq

With a file B containing 5 90 2 7 the command
setop -i A B
would yield 2 5.

Here, -i stands for intersection. Of course, there is no limitation to 
numbers, elements can be any non-empty strings. Other operations are 
union, symmetric difference, difference, contains element, is subset, 
cardinality and so on.
Is this tool senseful, is there a certain need for it?

As you can see on 
 
nearly all these operations can already be done with other tools, but 
the according command lines are mostly very tortuous. There doesn’t seem 
to be a tool that directly works with sets.

So my questions is: Is there a need for such a program or is there 
already something very similar? (Is this the right place for asking?)
I even exactly know what options setop should have and what it can do 
(how it is used), but am waiting for some responses from you before 
programming.

Note: I already asked two years ago but didn’t get satisfactory 
responses. Only now I remembered my idea.

I would be very grateful for your feedback,
Frank



Re: Suggestion of new program: execute mathematical set operations on lists

2013-11-03 Thread Elmar Stellnberger

Am 03.11.13 15:43, schrieb Frank Stähr:

Am Mittwoch, den 30.10.2013, 16:21 + schrieb Elmar Stellnberger:

Well, I had once programmed a tool like this called mset (multiset)

Yes, it seems to be possible to combine set and multiset operations by
an option (i. e. -m switches to multisets), I didn’t thought of that.

Of course, your answer is not the one I wanted to here (wanted to
program it ;-)), but still better than double work.

Good luck with leutils in the future, perhaps I think of another nice
project for me.

Frank

Hi Frank,

  If you want we can share our sources, agree upon a license for them,
discuss the future UI and then program what hasn`t been implemented
yet. However don`t expect a tool which is ready to publish, yet. I have
just written that as a few-hourer for a specific purpose and not used it
much afterwards. However if you can contribtue with further use-cases
testing and development work let us tackle a (multi-)set utility for Linux
which can then be published along with some other useful utilities like
f.i. dircmp, a console directory comparison.

Cheers,
Elmar






--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/52768f55.8080...@gmail.com



Re: Suggestion of new program: execute mathematical set operations on lists

2013-11-03 Thread Frank Stähr
Am Mittwoch, den 30.10.2013, 16:21 + schrieb Elmar Stellnberger:
> Well, I had once programmed a tool like this called mset (multiset)

Yes, it seems to be possible to combine set and multiset operations by
an option (i. e. -m switches to multisets), I didn’t thought of that.

Of course, your answer is not the one I wanted to here (wanted to
program it ;-)), but still better than double work.

Good luck with leutils in the future, perhaps I think of another nice
project for me.

Frank


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1383489809.4001.6.camel@storch-desktop



Re: Suggestion of new program: execute mathematical set operations on lists

2013-10-30 Thread Elmar Stellnberger
Well, I had once programmed a tool like this called mset (multiset)
and it is still on my hard disk though releasing it would require some
kind of testing and quality assurance (I call the package leutils).
First of all the xchroot package I have just released would need to
get accepted before I can go on publishing and packaging more of my
software stock.
For the meanwhile you can use the following programs:
sort -u, comm, join, uniq, column, paste, colrm, etc.
which do almost provide an equivalent functionality if you use them in
the right way:
comm: set difference, intersection, union, delta
sort -u: set union, etc.

Elmar Stellnberger


2013/10/30, Frank Stähr :
> Hello everybody,
>
> I am not yet looking for a sponsor, but going to program a tiny tool.
> Because I am unexperienced and don’t want to do all the work for
> nothing, first of all:
>
> Is this tool senseful, is there a certain need for it? I am very
> interested in your opinions, hoping that this list is the right place
> for that.
>
>
> And here it is: setop takes as inputs several lists/sets, calculates
> desired (mathematical) set operations on them and outputs the final set
> (or depending on operation resulting number of elements, answer yes/no,
> …).
>
> For example: File A contains 3 3 2 5 1 (each number an extra line). Then
> setop A
> would result in 1 2 3 5. This is equivalent to
> sort | uniq
>
> With a file B containing 5 90 2 7 the command
> setop -i A B
> would yield 2 5.
>
> Here, -i stands for intersection. Of course, there is no limitation to
> numbers, elements can be any non-empty strings.
>
> Other operations are union, symmetric difference, difference, contains
> element, is subset, cardinality and so on. As you can see on
> 
> nearly all these operations can already be done with other tools, but
> the according command lines are mostly very tortuous. There doesn’t seem
> to be a tool that directly works with sets.
>
> I even exactly know what options setop (name ok?) should have and what
> it can do (how it is used), but am waiting for some responses from you
> before programming.
>
> I would be very grateful for your feedback,
> Frank
>
>
> --
> To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmas...@lists.debian.org
> Archive: http://lists.debian.org/1383147779.1944.30.camel@storch-desktop
>
>


--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAHgGK3RSDQ_=avjuyqvf6fyq7m4kgaaowndwmwr1qs1aoy2...@mail.gmail.com