On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com
wrote:
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with the next letter, eg. display the
list from
Gilles Ganault nos...@nospam.com writes:
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com
wrote:
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with the
Arnaud Delobelle arno...@googlemail.com writes:
Gilles Ganault nos...@nospam.com writes:
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com
wrote:
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with the next letter, eg. display the
list from
Gilles Ganault wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with the next letter, eg.
Jean-Michel Pichavant wrote:
Gilles Ganault wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault nos...@nospam.com
wrote:
I see that dictionaries can be sorted using the... sort() method, but
is it possible to have Python start sorting from a different letter?
Looks like the solution is to read the list of keys into a list, sort
the list,
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in order
to be listed at the top, I'd like to sort the list differently every
minute so that
On Fri, 22 Jan 2010 13:24:05 +, Steven D'Aprano wrote:
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault wrote:
[...]
I see that dictionaries can be sorted using the... sort() method, but
is it possible to have Python start sorting from a different letter?
You can write a customer sort
On 2010-01-22, Gilles Ganault nos...@nospam.com wrote:
Hello
I use a dictionary to keep a list of users connected to a web
site.
To avoid users from creating login names that start with digits
in order to be listed at the top, I'd like to sort the list
differently every minute so that
On 22 Jan 2010 13:35:26 GMT, Neil Cerutti ne...@norwich.edu wrote:
Resorting is more work than is needed. Just choose a different
starting index each time you display the names, and set up your
lister to wrap-around to your arbitrary starting index.
Thanks. In this case, it means that in each
On Fri, 22 Jan 2010 14:09:43 +0100, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Sorry, the code I provided produce this output:
['1a', 'a', 'ac', 'av', 'b', 'c']
['a', 'ac', 'av', 'b', 'c', '1a']
['b', 'c', '1a', 'a', 'ac', 'av']
['c', '1a', 'a', 'ac', 'av', 'b']
['1a', 'a', 'ac', 'av',
22-01-2010 Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Fri, 22 Jan 2010 13:17:44 +0100, Gilles Ganault wrote:
To avoid users from creating login names that start with digits in order
to be listed at the top, I'd like to sort the list differently every
minute so that it'll
Gilles Ganault wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with the next letter, eg.
On Fri, 22 Jan 2010 09:49:32 -0500, Dave Angel da...@ieee.org wrote:
Seems to me the other solutions I've seen so far are more complex than
needed. I figure you either want an unordered list, in which case you
could use random.shuffle(), or you want a list that's sorted, but starts
somewhere
Gilles Ganault nos...@nospam.com writes:
On Fri, 22 Jan 2010 09:49:32 -0500, Dave Angel da...@ieee.org wrote:
Seems to me the other solutions I've seen so far are more complex than
needed. I figure you either want an unordered list, in which case you
could use random.shuffle(), or you want a
Jean-Michel Pichavant jeanmic...@sequans.com wrote:
Here is one possible solution
l = ['1a', 'a', 'b','c','av','ac'] # you mentioned a dictionary in your
post, if so, l = myDict.keys()
l.sort() # sort your list once and for all
for start in '1abcd':
result = [name for name in l if
PS.
22-01-2010 o 15:44:28 Jan Kaliszewski z...@chopin.edu.pl wrote:
22-01-2010, 14:58:58 Gilles Ganault nos...@nospam.com wrote:
On 22 Jan 2010 13:35:26 GMT, Neil Cerutti ne...@norwich.edu wrote:
Resorting is more work than is needed. Just choose a different
starting index each time you
On Fri, 22 Jan 2010 13:35:26 +, Neil Cerutti wrote:
On 2010-01-22, Gilles Ganault nos...@nospam.com wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd
On 2010-01-22, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
On Fri, 22 Jan 2010 13:35:26 +, Neil Cerutti wrote:
On 2010-01-22, Gilles Ganault nos...@nospam.com wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating
Gilles Ganault wrote:
On Fri, 22 Jan 2010 14:09:43 +0100, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Sorry, the code I provided produce this output:
['1a', 'a', 'ac', 'av', 'b', 'c']
['a', 'ac', 'av', 'b', 'c', '1a']
['b', 'c', '1a', 'a', 'ac', 'av']
['c', '1a', 'a', 'ac', 'av',
On Fri, 22 Jan 2010 09:49:32 -0500, Dave Angel wrote:
Seems to me the other solutions I've seen so far are more complex than
needed. I figure you either want an unordered list, in which case you
could use random.shuffle(), or you want a list that's sorted, but starts
somewhere in the middle,
Jean-Michel Pichavant wrote:
Gilles Ganault wrote:
On Fri, 22 Jan 2010 14:09:43 +0100, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Sorry, the code I provided produce this output:
['1a', 'a', 'ac', 'av', 'b', 'c']
['a', 'ac', 'av', 'b', 'c', '1a']
['b', 'c', '1a', 'a', 'ac', 'av']
On Fri, 22 Jan 2010 15:57:07 +, Neil Cerutti wrote:
On 2010-01-22, Steven D'Aprano st...@remove-this-cybersource.com.au
wrote:
Unless you can predict what index to use for (say) names starting with
B, then your scheme doesn't work. In order to find that index, you
have to do a linear
On 2010-01-22, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
O(N*Log N) + O(N) == O(N**2)?
Oops! :(
Of course, the sort is in fast C, and the linear search is in
relatively slow Python, so it is quite conceivable that for
realistic amounts of data, the time could be dominated
Gilles Ganault wrote:
On Fri, 22 Jan 2010 09:49:32 -0500, Dave Angel da...@ieee.org wrote:
Seems to me the other solutions I've seen so far are more complex than
needed. I figure you either want an unordered list, in which case you
could use random.shuffle(), or you want a list that's
On 22 Jan 2010 15:24:58 GMT, Duncan Booth
duncan.bo...@invalid.invalid wrote:
Here's another:
Thanks for the sample. It work great, except that it also runs when
the header character doesn't match any item in the list:
===
import bisect
connected = []
connected.append(_test)
On Fri, 22 Jan 2010 17:21:02 +0100, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Ok I realized that picking up a random index prevent from grouping names
starting with the same letter (to ease visual lookup).
Then go for the random char, and use char comparison (my first example).
Yup, I
Steven D'Aprano wrote:
On Fri, 22 Jan 2010 09:49:32 -0500, Dave Angel wrote:
Seems to me the other solutions I've seen so far are more complex than
needed. I figure you either want an unordered list, in which case you
could use random.shuffle(), or you want a list that's sorted, but starts
On 1/22/2010 7:17 AM, Gilles Ganault wrote:
Hello
I use a dictionary to keep a list of users connected to a web site.
To avoid users from creating login names that start with digits in
order to be listed at the top, I'd like to sort the list differently
every minute so that it'll start with
30 matches
Mail list logo