Article View: news.software.readers
Article #155815Re: [xpn] : Python-Based News Reader
From: Cousin Stanley
Date: Sat, 18 Sep 2004 00:09
Date: Sat, 18 Sep 2004 00:09
123 lines
6148 bytes
6148 bytes
On 2004-09-14, Nemesis <nemesis@nowhere.invalid> wrote:
> Mentre io pensavo ad una intro simpatica "Cousin Stanley" scriveva:
>
> ....
>
> No, at the moment you can only get the Day-Mont-Year format.
>
> But I can't understand wich is the difference between
> a sort on Y-M-D and another one on D-M-Y. A date is a date,
> and you always have one date that is greater than the other one.
>
> Maybe you are confused by the fact that the sort is made on a thread
> base. I.e. the first threads are sorted (using the first article of the
> thread) and then the article are sorte inside the thread.
>
>
>> The Day-Month-Year sorts are VERY confusing to me ....
>
> It's also a cultural confusion,
>
> in Italy we never use YMD dates,
> we alway use DMY :-D
Cousin Nemesis ....
Sorry for the delay but it took me a couple of days
to figure out how I might better explain the confusion
I have with the date sorts in xpn ....
In xpn when a group is first selected and the list of headers
is presented, they seem to be in chronological order from oldest
to newest ....
However, if the header list is re-sorted
by clicking on the Date label in the header pane,
the list no longer seems to be in chronological order,
e.g. the months are mixed up ....
In my mind and in your mind the difference
in Da-Mo-Year and Year-Mo-Da formats
is only cultural and I could probably adapt
to the former after using it for a while ....
However, common sort algorithms don't adapt quite as easily
as a human might and will not render a list of dates
into *chronological order* unless presented with data
that is pre-formatted in just the right manner ....
The necessary input date format for a chronological order sort
entails not only the [ Da-Mo-Year , Year-Mo-Da ] order,
but the number of digits used to specify the Month and Day as well ....
That is, Month and Day can be both be coded as either 1 or 2 digits,
where the 2 digit codes are zero-filled as required when <= 9 ....
[ 1 : 01 , 2 : 02 , 3 : 03 .... ]
As humans, we can cope with either 1 or 2 digits, no probelm,
but when sorting dates, the 1-digit codes and 2-digit zero-filled
code behave quite differently ....
Consider the following results from sorting a list
of randomly generated dates that are formatted
in 4 different ways ....
Year-M-D D-M-Year Year-Mo-Da Da-Mo-Year
2004-1-10 10-1-2004 2004-01-10 01-03-2004
2004-1-10 10-1-2004 2004-01-10 04-07-2004
2004-6-21 21-6-2004 2004-01-18 05-09-2004
2004-4-20 20-4-2004 2004-02-11 06-12-2004
2004-9-28 28-9-2004 2004-02-14 07-12-2004
2004-6-14 14-6-2004 2004-02-24 08-10-2004
2004-10-9 9-10-2004 2004-03-01 09-10-2004
2004-12-15 15-12-2004 2004-03-14 09-10-2004
2004-2-14 14-2-2004 2004-03-16 10-01-2004
2004-8-15 15-8-2004 2004-04-15 10-01-2004
2004-7-16 16-7-2004 2004-04-20 10-06-2004
2004-4-15 15-4-2004 2004-04-27 11-02-2004
2004-2-24 24-2-2004 2004-05-25 11-11-2004
2004-11-11 11-11-2004 2004-06-10 11-11-2004
2004-12-6 6-12-2004 2004-06-14 14-02-2004
2004-4-27 27-4-2004 2004-06-21 14-03-2004
2004-10-8 8-10-2004 2004-07-04 14-06-2004
2004-1-18 18-1-2004 2004-07-16 15-04-2004
2004-6-10 10-6-2004 2004-07-27 15-08-2004
2004-7-27 27-7-2004 2004-08-15 15-12-2004
2004-5-25 25-5-2004 2004-09-05 16-03-2004
2004-11-11 11-11-2004 2004-09-19 16-07-2004
2004-7-4 4-7-2004 2004-09-28 18-01-2004
2004-9-5 5-9-2004 2004-10-08 19-09-2004
2004-3-1 1-3-2004 2004-10-09 20-04-2004
2004-12-7 7-12-2004 2004-10-09 21-06-2004
2004-9-19 19-9-2004 2004-11-11 24-02-2004
2004-10-9 9-10-2004 2004-11-11 25-05-2004
2004-2-11 11-2-2004 2004-12-06 27-04-2004
2004-3-14 14-3-2004 2004-12-07 27-07-2004
2004-3-16 16-3-2004 2004-12-15 28-09-2004
In columns 1 and 2, where 1-digit Month and Day format is used,
and the dates are mirror images, the columns are sorted
into exactly the same sequence ....
However, neither column 1 or column 2 is in chronological order ....
In columns 3 and 4, where 2-digit Month and Day format is used,
column 3 is in chronological order, but column 4 is not,
e.g. the months are mixed ....
The Python code that generated the above lists
is at ....
http://fastq.com/~sckitching/Python/dates_sort.py
[ 3.3 KB ]
Hopefully, this better explains that I don't think
all of my confusion is totally cultural ....
--
Cousin Stanley
Human Being
Phoenix, Arizona
Technical Details
Message-ID:
<2r1cmhF14k7fuU1@uni-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!not-for-mailReferences:
<2qkds0FvtaokU1@uni-berlin.de> <v5n4ic.0v1.ln@orion.homeinvalid> <2qoq5fF1138c3U1@uni-berlin.de> <i2h7ic.612.ln@orion.homeinvalid>Show Full Headers
Complete Article Headers
Message-ID: <2r1cmhF14k7fuU1@uni-berlin.de> Subject: Re: [xpn] : Python-Based News Reader Date: Sat, 18 Sep 2004 00:09:53 +0000 From: Cousin Stanley <cousinstanley@hotmail.com> References: <2qkds0FvtaokU1@uni-berlin.de> <v5n4ic.0v1.ln@orion.homeinvalid> <2qoq5fF1138c3U1@uni-berlin.de> <i2h7ic.612.ln@orion.homeinvalid> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!not-for-mail Newsgroups: news.software.readers Lines: 123 X-Trace: news.uni-berlin.de LXe/dE2+18e7kya6w3X+ygsrfy5n21RNPPYFCSdCQCgPvOqU5y User-Agent: slrn/0.9.8.0 (Linux)