1. stable sorting

I wrote:

> Subject: Re: Euphoria 2.4 Alpha-test Release!

[...]
> 5) Documentation of sort():
>    Nothing special with version 2.4, I just came across it.
>    I think it would be valuable to mention, whether or not the sorting
>    of sort() is stable, along with a short explanation for beginners,
>    what that means.
[...]

Probably I should have been somewhat more specific. I actually was
thinking more of custom_sort(), than of sort():
Say I have a list of records with student names and marks, already
sorted by name. Then i want to sort this list by mark, so that students
with the same mark remain listed in alphabetical order.

The following code (modified after 'csort.ex') does *not* perform a
stable sorting.

----------=----------=----------=----------=----- begin of code
include sort.e

constant MARK = 2
constant statistics = {
   {"Doe", 3},
   {"Einstein", 1},
   {"Goldberg", 1},
   {"Irving", 4},
   {"Jones", 3},
   {"Miller", 2},
   {"Neuman", 2},
   {"Petersen", 4},
   {"Smith", 2},
   {"Zander", 5}
}

function compare_mark (sequence a, sequence b)
   -- Compare two sequences (records) according to MARK.
   return compare(a[MARK], b[MARK])
end function

integer by_mark
sequence sorted_by_mark

by_mark  = routine_id("compare_mark")
sorted_by_mark = custom_sort(by_mark, statistics)

puts(1, "sorted by mark\n\n")
for i = 1 to length(sorted_by_mark) do
   printf(1, "%12s %d\n", sorted_by_mark[i])
end for
----------=----------=----------=----------=----- end of code

Is there a library in the archive, with which this can be achieved?
I didn't find one.

Ricardo, I saw that your functions GradeDown() and GradeUp() in
'genfunc.e' perform stable sorting. But given the above example, there
is no way to tell them just to sort by mark, and not to compare the
whole records, right?


Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |
 \ /  against HTML in       |  Superstition brings bad luck.
  X   e-mail and news,      |
 / \  and unneeded MIME     |

new topic     » topic index » view message » categorize

2. Re: stable sorting

On 25 Feb 2003, at 17:02, Juergen Luethje wrote:

> 
> I wrote:
> 
> > Subject: Re: Euphoria 2.4 Alpha-test Release!
> 
> [...]
> > 5) Documentation of sort():
> >    Nothing special with version 2.4, I just came across it.
> >    I think it would be valuable to mention, whether or not the sorting
> >    of sort() is stable, along with a short explanation for beginners,
> >    what that means.
> [...]
> 
> Probably I should have been somewhat more specific. I actually was
> thinking more of custom_sort(), than of sort():
> Say I have a list of records with student names and marks, already
> sorted by name. Then i want to sort this list by mark, so that students
> with the same mark remain listed in alphabetical order.

<snip>

> Is there a library in the archive, with which this can be achieved?
> I didn't find one.

Yes, sorttok(). Several examples of sorting multiple fields at the same time 
are in the readme.html : See: 
http://www.pell.net/warning/ai/strtok-v2-1.html#sorttok

It handles such things as a descending sort in one field, then an ascending 
sort within that sort, and a descending in that sort, etc,, as many internal 
sorts as you have fields in the list, mixing up-down sorts as you want.

If you want your list not sorted, but you want the trace route thru the list in 
the sort order you specify, see sortntok().

Strtok v2.2 is due out someday in March 2003.

Kat

new topic     » goto parent     » topic index » view message » categorize

3. Re: stable sorting

On Tue, 25 Feb 2003 17:02:05 +0100, Juergen Luethje <eu.lue at gmx.de>
wrote:

>>    I think it would be valuable to mention, whether or not the sorting
>>    of sort() is stable, along with a short explanation for beginners,
>>    what that means.

Personally, I would never trust a stable sort. Instead, if needed,
(fwiw, I always go with multi-key sort) I would suggest adding an
incrementing integer in place of the rest of the key.

If that does not help (performance, at a guessblink, ask yourself why
you are bothering with the original sort / re-sort subsets as they
come out / find a better way to solve the problem (eg store the data
in a database with an index you can just read down in the first place,
or munge/hash all sort keys into minimum bytes possible)

Pete
PS I see you're infected with Habeas blink I like the concept, not the
total shrouding of useful (and yet useless to spammers) information
about the poster that may be useful to help others help the poster.

new topic     » goto parent     » topic index » view message » categorize

4. Re: stable sorting

On Tue, 25 Feb 2003 16:51:05 +0000, Andy Serpa <ac at onehorseshy.com>
wrote:

Andy,
I instantly spotted the following lines in your post:
>integer sort_i
>    if integer(sort_i) then

Instantly, then, I suspect you cut down your example a little too much
to show off your true talent blink

Pete

new topic     » goto parent     » topic index » view message » categorize

5. Re: stable sorting

On Tue, 25 Feb 2003 19:02:12 +0000, Andy Serpa <ac at onehorseshy.com>
wrote:

>Messed up.  That should be "object sort_i"
Oh, sorry.

Pete

new topic     » goto parent     » topic index » view message » categorize

6. Re: stable sorting

As no one replied, and this is tested and working code, i'll re-post it. If i am
on your ignore list, it won't hurt you anyhow. If the game is to reinvent the 
wheel instead of acknowledging the existing code (you said there was none 
in the archives, but there is), then just keep ignoring me.

Kat


On 25 Feb 2003, at 17:02, Juergen Luethje wrote:

> 
> I wrote:
> 
> > Subject: Re: Euphoria 2.4 Alpha-test Release!
> 
> [...]
> > 5) Documentation of sort():
> >    Nothing special with version 2.4, I just came across it.
> >    I think it would be valuable to mention, whether or not the sorting
> >    of sort() is stable, along with a short explanation for beginners,
> >    what that means.
> [...]
> 
> Probably I should have been somewhat more specific. I actually was
> thinking more of custom_sort(), than of sort():
> Say I have a list of records with student names and marks, already
> sorted by name. Then i want to sort this list by mark, so that students
> with the same mark remain listed in alphabetical order.

<snip>

> Is there a library in the archive, with which this can be achieved?
> I didn't find one.

Yes, sorttok(). Several examples of sorting multiple fields at the same time 
are
in the readme.html : See:
http://www.pell.net/warning/ai/strtok-v2-1.html#sorttok

It handles such things as a descending sort in one field, then an ascending 
sort
within that sort, and a descending in that sort, etc,, as many internal sorts as
you have fields in the list, mixing up-down sorts as you want.

If you want your list not sorted, but you want the trace route thru the list in
the sort order you specify, see sortntok().

Strtok v2.2 is due out someday in March 2003.

Kat

new topic     » goto parent     » topic index » view message » categorize

7. Re: stable sorting

Hi Kat, you wrote:

> On 25 Feb 2003, at 17:02, Juergen Luethje wrote:

[...]

>> Say I have a list of records with student names and marks, already
>> sorted by name. Then i want to sort this list by mark, so that students
>> with the same mark remain listed in alphabetical order.
>
> <snip>
>
>> Is there a library in the archive, with which this can be achieved?
>> I didn't find one.
>
> Yes, sorttok(). Several examples of sorting multiple fields at the same time
> are in the readme.html : See:
> http://www.pell.net/warning/ai/strtok-v2-1.html#sorttok

Great, thank you!

> It handles such things as a descending sort in one field, then an ascending
> sort within that sort, and a descending in that sort, etc,, as many internal
> sorts as you have fields in the list, mixing up-down sorts as you want.
>
> If you want your list not sorted, but you want the trace route thru the list
> in
> the sort order you specify, see sortntok().

The functions are very useful and flexible! I downloaded 'strtok-v2-1.zip'
and am very curious to have a closer look at the source code, if I've
some more time. Hopefully I'll understand, how it works.


> Strtok v2.2 is due out someday in March 2003.

Well.. how about making sorttok() and sortntok() (or two additional
functions) even more generic? At the moment, one "record" must be a
string:

sorted = sorttok({"Fred,Astaire,45,Alberta,Canada",
                  "Lucy,Ball,56,Barre,North Dakota",
                  "Red,Skelton,34,London,England",
                  "Pierre,du Pont,12,Paris,France"},
                  3, ',')

I don't always have comma (or semicolon or whatever) delimeted fields.
So wouldn't it be more generic, if one field is an atom or a sequence?
E.g.:

sorted = sorttok({{"Fred","Astaire",45,"Alberta","Canada"},
                  {"Lucy","Ball",56,"Barre","North Dakota"},
                  {"Red","Skelton",34,"London","England"},
                  {"Pierre","du Pont",12,"Paris","France"}},
                  3, ',')

> Kat

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |
 \ /  against HTML in       |  Superstition brings bad luck.
  X   e-mail and news,      |
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

8. Re: stable sorting

Hi Pete, you wrote:

> On Tue, 25 Feb 2003 17:02:05 +0100, Juergen Luethje <eu.lue at gmx.de>
> wrote:
>
>>>    I think it would be valuable to mention, whether or not the sorting
>>>    of sort() is stable, along with a short explanation for beginners,
>>>    what that means.
>
> Personally, I would never trust a stable sort. Instead, if needed,
> (fwiw, I always go with multi-key sort) I would suggest adding an
> incrementing integer in place of the rest of the key.
>
> If that does not help (performance, at a guessblink, ask yourself why
> you are bothering with the original sort / re-sort subsets as they
> come out / find a better way to solve the problem (eg store the data
> in a database with an index you can just read down in the first place,
> or munge/hash all sort keys into minimum bytes possible)
>
> Pete

[...]

Thanks for these hints!

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |
 \ /  against HTML in       |  Superstition brings bad luck.
  X   e-mail and news,      |
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

9. Re: stable sorting

Hi Andy, you wrote:

<big snip>

>> Here's what I do:
>>
>> ----------------------
>> include sort.e
>>
>> -- Don't call this function directly, see below
>> integer sort_i
>
> Messed up.  That should be "object sort_i"

[generic function 'sort_by_element()']

Interesting, that is exactly the generalization of what Matt wrote,
it looks pretty straightforward. Maybe I'll compare it's speed to
Kat's sorttok(), when I've some more time.
Thank you!

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |
 \ /  against HTML in       |  Superstition brings bad luck.
  X   e-mail and news,      |
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

10. Re: stable sorting

Hi Matt, you wrote:

[...]

> try:
>
> function compare_mark (sequence a, sequence b)
>    integer c
>    -- Compare two sequences (records) according to MARK.
>    c = compare(a[MARK], b[MARK])
>    if c then
>       return c
>    end if
>    return compare(a[1],b[1])
> end function
>
>
> Matt Lewis

I spent some time, looking in some books for other sorting algorithms,
but didn't have the idea, to adapt the 'compare' function. sad
Thanks!

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |
 \ /  against HTML in       |  Superstition brings bad luck.
  X   e-mail and news,      |
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

11. Re: stable sorting

On 26 Feb 2003, at 13:09, Juergen Luethje wrote:

> 
> Hi Kat, you wrote:
> 
> > On 25 Feb 2003, at 17:02, Juergen Luethje wrote:
> 
> [...]
> 
> >> Say I have a list of records with student names and marks, already
> >> sorted by name. Then i want to sort this list by mark, so that students
> >> with the same mark remain listed in alphabetical order.
> >
> > <snip>
> >
> >> Is there a library in the archive, with which this can be achieved?
> >> I didn't find one.
> >
> > Yes, sorttok(). Several examples of sorting multiple fields at the same time
> > are in the readme.html : See:
> > http://www.pell.net/warning/ai/strtok-v2-1.html#sorttok
> 
> Great, thank you!

<curtsey> I try to get my favorite libs out the door before anyone knows they 
need them, so no one is waiting on them.

Hey Rob (again), maybe we could add keywords to the list that the archive 
search program uses? Versatile libs like strtok and win32lib and the internet 
programs like irc/http/ftp/tcp4u programs could use added keywords that 
don't currently appear in the archive webpage descriptions. This would be 
especially useful for programs that are hosted on other sites (like mine), or 
are zipped, in other languages, or can't be in the Eu webring because we 
can't get included in that either (they turned me down again last week).

> > It handles such things as a descending sort in one field, then an ascending
> > sort within that sort, and a descending in that sort, etc,, as many internal
> > sorts as you have fields in the list, mixing up-down sorts as you want.
> >
> > If you want your list not sorted, but you want the trace route thru the list
> > in the sort order you specify, see sortntok().
> 
> The functions are very useful and flexible! I downloaded 'strtok-v2-1.zip'
> and am very curious to have a closer look at the source code, if I've
> some more time. Hopefully I'll understand, how it works.

Don't get too comfy with the source, v2.2 changes some things. More 
options and such. I am trying so hard to not break backwards compatability, 
but make the functions more fault tolerant and possibly faster.
 
> > Strtok v2.2 is due out someday in March 2003.
> 
> Well.. how about making sorttok() and sortntok() (or two additional
> functions) even more generic? At the moment, one "record" must be a
> string:
> 
> sorted = sorttok({"Fred,Astaire,45,Alberta,Canada",
>                   "Lucy,Ball,56,Barre,North Dakota",
>                   "Red,Skelton,34,London,England",
>                   "Pierre,du Pont,12,Paris,France"},
>                   3, ',')
> 
> I don't always have comma (or semicolon or whatever) delimeted fields.

You know you can use any unique delimiter you want, right? As long as the 
char is not a member of the top sequences (this works only on two-deep 
sequences), you can use none, or anything.


> So wouldn't it be more generic, if one field is an atom or a sequence?
> E.g.:
> 
> sorted = sorttok({{"Fred","Astaire",45,"Alberta","Canada"},
>                   {"Lucy","Ball",56,"Barre","North Dakota"},
>                   {"Red","Skelton",34,"London","England"},
>                   {"Pierre","du Pont",12,"Paris","France"}},
>                   3, ',')

I considered this early on, but i myself didn't need that option at the time, 
and there wasn't a request for it when i issued a RFC for the next strtok lib 
version. Looks reasonable to do, since, if the program assumes the 
programmer knows what they are doing, such a list would be of nested 
sequences, and not atoms. I'll take a peek at it tonite. Maybe. I still am 
doing battle with the flu. I was going to make such things part of 2.2, but i 
could do a 2.15 release.

By the way, strtok should be fine with the new Eu versions, since there are 
no includes in the strtok lib.

Kat

new topic     » goto parent     » topic index » view message » categorize

12. Re: stable sorting

Juergen:

-- first sort by name
 xxxxxxxxxxxxxx
-- then do the following
sequence temp temp = {}
-- reverse name and mark
for i = 1 to length() do
  temp[i][1] = statistics[i][1] 
  temp[i][2] = statistics[i][2] 
end for
-- then sort
temp = custom_sort(by_mark, temp)
-- then reverse the name  
for i = 1 to length() do
  statistics[i][1] = temp[i][1]
  statistics[i][2] = temp[i][2]
end for
-- now statistics is sorted by name and mark
-- A seperate function could be used for swapping

Bernie

new topic     » goto parent     » topic index » view message » categorize

13. Re: stable sorting

Hi Ricardo, you wrote:

> Juergen:
> I have not tested it, but I think that substituting "compare" by a
> "custom_compare" in all places where "compare" appears will do the trick.
> For an example, please look at my diff package.
> Best regards.

[...]

Yes, that is, was I was looking for. Thank you!

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  while not asleep do
 \ /  against HTML in       |     sheep += 1
  X   e-mail and news,      |  end while
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

14. Re: stable sorting

Hi Kat, you wrote:

[...]

> Hey Rob (again), maybe we could add keywords to the list that the archive
> search program uses? Versatile libs like strtok and win32lib and the internet
> programs like irc/http/ftp/tcp4u programs could use added keywords that
> don't currently appear in the archive webpage descriptions.

Or maybe you add some more keywords to the description?
Even if I had read the description of 'strtok' on the archieves
webpage ...
------------==-------------------------------==-----------------------
A large set of routines for treating strings of text as streams of
"tokens". Check the on-line documentation. Dec 27: version 2.1, more
commands and options, faster parsing
------------==-------------------------------==-----------------------
... I believe that I wouldn't have got the idea, that this has something
to do with sorting.

[...]

>> The functions are very useful and flexible! I downloaded 'strtok-v2-1.zip'
>> and am very curious to have a closer look at the source code, if I've
>> some more time. Hopefully I'll understand, how it works.
>
> Don't get too comfy with the source, v2.2 changes some things.

OK.

> More
> options and such. I am trying so hard to not break backwards compatability,
> but make the functions more fault tolerant and possibly faster.
>
>>> Strtok v2.2 is due out someday in March 2003.
>>
>> Well.. how about making sorttok() and sortntok() (or two additional
>> functions) even more generic? At the moment, one "record" must be a
>> string:
>>
>> sorted = sorttok({"Fred,Astaire,45,Alberta,Canada",
>>                   "Lucy,Ball,56,Barre,North Dakota",
>>                   "Red,Skelton,34,London,England",
>>                   "Pierre,du Pont,12,Paris,France"},
>>                   3, ',')
>>
>> I don't always have comma (or semicolon or whatever) delimeted fields.
>
> You know you can use any unique delimiter you want, right? As long as the
> char is not a member of the top sequences (this works only on two-deep
> sequences), you can use none, or anything.

Yes, I know.

>> So wouldn't it be more generic, if one field is an atom or a sequence?
>> E.g.:
>>
>> sorted = sorttok({{"Fred","Astaire",45,"Alberta","Canada"},
>>                   {"Lucy","Ball",56,"Barre","North Dakota"},
>>                   {"Red","Skelton",34,"London","England"},
>>                   {"Pierre","du Pont",12,"Paris","France"}},
>>                   3, ',')
>
> I considered this early on, but i myself didn't need that option at the time,
> and there wasn't a request for it when i issued a RFC for the next strtok lib
> version.

It was just an idea, because I personally like generic routines. I don't
have much experience with sorting though.

> Looks reasonable to do, since, if the program assumes the
> programmer knows what they are doing, such a list would be of nested
> sequences, and not atoms. I'll take a peek at it tonite. Maybe. I still am
> doing battle with the flu.

I hope you get better soon.

> I was going to make such things part of 2.2, but i could do a 2.15 release.

I'm not in a hurry ...

> By the way, strtok should be fine with the new Eu versions, since there are
> no includes in the strtok lib.
>
> Kat

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  while not asleep do
 \ /  against HTML in       |     sheep += 1
  X   e-mail and news,      |  end while
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

15. Re: stable sorting

Hi Bernie,

thanks for your pseudocode.
I tried to translate it:

-------------------==--------------------==------------------------
include sort.e

constant NAME = 1, MARK = 2
constant statistics = {
   {"Doe", 3},
   {"Einstein", 1},
   {"Goldberg", 1},
   {"Irving", 4},
   {"Jones", 3},
   {"Miller", 2},
   {"Neuman", 2},
   {"Petersen", 4},
   {"Smith", 2},
   {"Zander", 5}
}

function compare_name (sequence a, sequence b)
   -- Compare two sequences (records) according to MARK.
   return compare(a[NAME], b[NAME])
end function

function compare_mark (sequence a, sequence b)
   -- Compare two sequences (records) according to MARK.
   return compare(a[MARK], b[MARK])
end function

integer by_name, by_mark
sequence sorted

by_name = routine_id("compare_name")
by_mark = routine_id("compare_mark")


> -- first sort by name

sorted = custom_sort(by_name, statistics)

> -- then do the following
> sequence temp temp = {}

sequence temp
temp = repeat({0,0}, length(statistics))

> -- reverse name and mark
> for i = 1 to length() do
>   temp[i][1] = statistics[i][1]
>   temp[i][2] = statistics[i][2]
> end for

-- I think, in the above lines there is a typo.
-- If not, I also could say:
--    temp = statistics   smile
-- So I tried:

for i = 1 to length(statistics) do
  temp[i][1] = sorted[i][2]
  temp[i][2] = sorted[i][1]
end for

> -- then sort
> temp = custom_sort(by_mark, temp)

temp = custom_sort(by_mark, temp)

> -- then reverse the name
> for i = 1 to length() do
>   statistics[i][1] = temp[i][1]
>   statistics[i][2] = temp[i][2]
> end for

-- Again a typo, I believe. So I tried:

for i = 1 to length(statistics) do
  sorted[i][1] = temp[i][2]
  sorted[i][2] = temp[i][1]
end for

> -- now statistics is sorted by name and mark
> -- A seperate function could be used for swapping

puts(1, "sorted by mark\n\n")
for i = 1 to length(sorted) do
   printf(1, "%12s %d\n", sorted[i])
end for
-------------------==--------------------==---------------------------

Now 'statistics' is sorted by name, it's not sorted by mark, so that
students with the same mark are listed in alphabetical order.
Did I make an error in translating your pseudocode?

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  I didn't have time to write
 \ /  against HTML in       |  a short letter, so I wrote
  X   e-mail and news,      |  a long one instead.
 / \  and unneeded MIME     |  [Mark Twain]

new topic     » goto parent     » topic index » view message » categorize

16. Re: stable sorting

On 27 Feb 2003, at 21:10, Juergen Luethje wrote:

> 
> Hi Kat, you wrote:
> 
> [...]
> 
> > Hey Rob (again), maybe we could add keywords to the list that the archive
> > search program uses? Versatile libs like strtok and win32lib and the
> > internet
> > programs like irc/http/ftp/tcp4u programs could use added keywords that
> > don't
> > currently appear in the archive webpage descriptions.
> 
> Or maybe you add some more keywords to the description?
> Even if I had read the description of 'strtok' on the archieves
> webpage ...
> ------------==-------------------------------==-----------------------
> A large set of routines for treating strings of text as streams of
> "tokens". Check the on-line documentation. Dec 27: version 2.1, more
> commands and options, faster parsing
> ------------==-------------------------------==-----------------------
> ... I believe that I wouldn't have got the idea, that this has something
> to do with sorting.

RobC wrote that, not me. But i'm not sure how to describe it then, since 
what you have is a string of text (names, grades, etc), and the functions that 
strtok provides is a way to handle each token (the name, the grade, the etc) 
as an Euphoric-like atom (the token) of the database, instead of a sequence 
of characters of real Euphoric atoms. Same way a sentence is a database of 
a thought, with the tokens in it having meaning, like your database, with 
each of it's tokens haveing meaning for you. Eu natively provides some 
functions, like s[x..y] where s is already parsed, but not even a tenth of what 
the strtok lib provides.

If you have a way i can get RobC to alter the description, and what that 
description should be, i am all ears. He can't reasonably put the readme.* 
from my webpage there. 

http://www.pell.net/warning/ai/strtok-v2-1.html


Kat

new topic     » goto parent     » topic index » view message » categorize

17. Re: stable sorting

When we send a submission to Rob for inclusion in the user contribution
archive perhaps we should suggest a short summary of text to be used?  Rob
may want to edit it a little but if it was concise enough I'm sure Rob
would appreciate the time it would save him having to think up something
from scratch.

Another idea.  How about we all try and include a readme.txt file in the
zip file we submit to Rob?  That way if Rob gets a submission with a
readme.txt then he could put on the RDS web site not only (for example) the:

  http://www.rapideuphoria.com/bcfrm001.zip

file but also:

  http://www.rapideuphoria.com/bcfrm001_readme.txt

or:

  http://www.rapideuphoria.com/readme_bcfrm001.txt

Include a little link to the readme in the description text for the
contribution and we have a way to browse the readme file without having to
download the whole zip (some of them are big), unzip and then read the
readme only to find out it isn't quite what we were looking for after all.

Such a system would also make contributors more likely to produce a
readme.txt file and to make it as concise and tempting as possible.

A great incentive would be for contributions which have a suitable
readme.txt to get an extra micro economy dollar smile

Just an idea...

Regards,

Andy Cranston.

At 02:58 PM 2/27/03 -0600, you wrote:
>
>On 27 Feb 2003, at 21:10, Juergen Luethje wrote:
>
>> 
>> Hi Kat, you wrote:
>> 
>> [...]
>> 
>> > Hey Rob (again), maybe we could add keywords to the list that the archive
>> > search program uses? Versatile libs like strtok and win32lib and the
internet
>> > programs like irc/http/ftp/tcp4u programs could use added keywords
that don't
>> > currently appear in the archive webpage descriptions.
>> 
>> Or maybe you add some more keywords to the description?
>> Even if I had read the description of 'strtok' on the archieves
>> webpage ...
>> ------------==-------------------------------==-----------------------
>> A large set of routines for treating strings of text as streams of
>> "tokens". Check the on-line documentation. Dec 27: version 2.1, more
>> commands and options, faster parsing
>> ------------==-------------------------------==-----------------------
>> ... I believe that I wouldn't have got the idea, that this has something
>> to do with sorting.
>
>RobC wrote that, not me. But i'm not sure how to describe it then, since 
>what you have is a string of text (names, grades, etc), and the functions
that 
>strtok provides is a way to handle each token (the name, the grade, the etc) 
>as an Euphoric-like atom (the token) of the database, instead of a sequence 
>of characters of real Euphoric atoms. Same way a sentence is a database of 
>a thought, with the tokens in it having meaning, like your database, with 
>each of it's tokens haveing meaning for you. Eu natively provides some 
>functions, like s[x..y] where s is already parsed, but not even a tenth of
what 
>the strtok lib provides.
>
>If you have a way i can get RobC to alter the description, and what that 
>description should be, i am all ears. He can't reasonably put the readme.* 
>from my webpage there. 
>
>http://www.pell.net/warning/ai/strtok-v2-1.html
>
>
>Kat
>
>
>
>TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

18. Re: stable sorting

On 27 Feb 2003, at 22:53, acran at readout.fsnet.co.uk wrote:


<snip>

> Include a little link to the readme in the description text for the
> contribution and we have a way to browse the readme file without having to
> download the whole zip (some of them are big), unzip and then read the
> readme only to find out it isn't quite what we were looking for after all.
> 
> Such a system would also make contributors more likely to produce a
> readme.txt file and to make it as concise and tempting as possible.

Mine is set up that way. There is a link to the readme.html and a link to the 
download, which includes the readme.txt and readme.html. The reason i 
didn't send the zip to RDS is the speed of updates, if i need to change my 
webpages, it takes only a couple minutes and i don't need to pester Rob.

Kat

new topic     » goto parent     » topic index » view message » categorize

19. Re: stable sorting

On Thu, 27 Feb 2003 21:10:07 +0100, Juergen Luethje <jlpost at arcor.de>
wrote:

I replied, privately, scathingly, to Bernie about that post.
I have not had a reply.

Changing the line
>   return compare(a[MARK], b[MARK])
to
>   return compare(a[MARK]&a[1], b[MARK]&b[1])

I believe will work. Let me know.

Pete
Pete

Confucius say: Life sucks.
Get over it. You fairy.

new topic     » goto parent     » topic index » view message » categorize

20. Re: stable sorting

Hi Kat, you wrote:

> On 27 Feb 2003, at 21:10, Juergen Luethje wrote:

[...]

>> Or maybe you add some more keywords to the description?
>> Even if I had read the description of 'strtok' on the archieves
>> webpage ...
>> ------------==-------------------------------==-----------------------
>> A large set of routines for treating strings of text as streams of
>> "tokens". Check the on-line documentation. Dec 27: version 2.1, more
>> commands and options, faster parsing
>> ------------==-------------------------------==-----------------------
>> ... I believe that I wouldn't have got the idea, that this has something
>> to do with sorting.
>
> RobC wrote that, not me. But i'm not sure how to describe it then, since
> what you have is a string of text (names, grades, etc), and the functions that
> strtok provides is a way to handle each token (the name, the grade, the etc)
> as an Euphoric-like atom (the token) of the database, instead of a sequence
> of characters of real Euphoric atoms. Same way a sentence is a database of
> a thought, with the tokens in it having meaning, like your database, with
> each of it's tokens haveing meaning for you. Eu natively provides some
> functions, like s[x..y] where s is already parsed, but not even a tenth of
> what
> the strtok lib provides.
>
> If you have a way i can get RobC to alter the description, and what that
> description should be, i am all ears. He can't reasonably put the readme.*
> from my webpage there.
>
> http://www.pell.net/warning/ai/strtok-v2-1.html

Of course. The description at the RDS page IMHO should give an
*overview*, not all the details. But currently it's really very short.

Maybe something along the lines of:

------------==-------------------------------==-----------------------
A large set of routines for treating strings of text as streams of
"tokens". It includes routines for parsing, searching, sorting, ...
For details check the on-line documentation. Dec 27: version 2.1, more
commands and options, faster parsing
------------==-------------------------------==-----------------------

See the idea? *You* as the author and the native Englisch speaker can
make it much better. Not too long, many people don't have much time
nowadays, and don't like to read long texts (unless they are sure, that
it's really important for them). But they should at least get an idea of
the capabilities of your lib. And for instance now there is the word
"sorting" in the text. Maybe then Rob's search engine finds your library,
when someone searches for 'sorting' the next time.
I can imagine, that Rob will update the text, when you send him a new
version.

> Kat

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  while not asleep do
 \ /  against HTML in       |     sheep += 1
  X   e-mail and news,      |  end while
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

21. Re: stable sorting

Hi Andy, you wrote:

> When we send a submission to Rob for inclusion in the user contribution
> archive perhaps we should suggest a short summary of text to be used?  Rob
> may want to edit it a little but if it was concise enough I'm sure Rob
> would appreciate the time it would save him having to think up something
> from scratch.

[...]

You are describing the experience, that I actually made. smile

Best regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  while not asleep do
 \ /  against HTML in       |     sheep += 1
  X   e-mail and news,      |  end while
 / \  and unneeded MIME     |

new topic     » goto parent     » topic index » view message » categorize

22. Re: stable sorting

Hi Pete, you wrote:

[...]
> Changing the line
>>   return compare(a[MARK], b[MARK])
> to
>>   return compare(a[MARK]&a[1], b[MARK]&b[1])
>
> I believe will work. Let me know.
[...]

No, unfortunately, it doesn't work as expected.
But the code in Bernie's most recent post works well, and now I can
see the principle, he is using.

> Pete

Best regards,
   Juergen

-- 
Q: How many Microsoft engineers does Bill need to change a light bulb?
A: None. He just declares darkness to be an industry standard.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu