Discussion:
Palindromic date
(too old to reply)
Kerr-Mudd, John
2021-12-02 12:26:15 UTC
Permalink
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!


Spoiler:



















3001 10 03
(top of my head, other answers might be available, etc.)
--
Bah, and indeed Humbug.
Snidely
2021-12-02 12:36:38 UTC
Permalink
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
I can mirror that now ....

-d
--
"What do you think of my cart, Miss Morland? A neat one, is not it?
Well hung: curricle-hung in fact. Come sit by me and we'll test the
springs."
(Speculative fiction by H.Lacedaemonian.)
Snidely
2021-12-03 02:03:41 UTC
Permalink
Snidely suggested that ...
Post by Snidely
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
I can mirror that now ....
I think I also heard it described as an ambidrome ... if you use
7-segment-style numerals, you can turn it upside down as well.

/dps
--
There's nothing inherently wrong with Big Data. What matters, as it
does for Arnold Lund in California or Richard Rothman in Baltimore, are
the questions -- old and new, good and bad -- this newest tool lets us
ask. (R. Lerhman, CSMonitor.com)
Richard Heathfield
2021-12-03 07:44:43 UTC
Permalink
[Context: Second of December this year written as 20211202:]
Post by Snidely
I think I also heard it described as an ambidrome ... if you use
7-segment-style numerals, you can turn it upside down as well.
Nearly 40 years ago Douglas Hofstadter labelled such formulations
"ambigrams".

"An ambigram is a visual pun of a special kind: a calligraphic design
having two or more (clear) interpretations as written words. One can
voluntarily jump back and forth between the rival readings usually by
shifting one’s physical point of view (moving the design in some way)
but sometimes by simply altering one’s perceptual bias towards a design
(clicking an internal mental switch, so to speak). Sometimes the
readings will say identical things, sometimes they will say different
things." - DH

The Internet seems to know all about ambigrams, but has never heard of
ambidromes, so you might want to use "ambigram" if you're interested in
finding similar examples of word play.
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within
Bob Martin
2021-12-03 08:06:14 UTC
Permalink
Post by Kerr-Mudd, John
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!
3001 10 03
2030 03 02
Kerr-Mudd, John
2021-12-03 11:11:46 UTC
Permalink
On 3 Dec 2021 08:06:14 GMT
Post by Bob Martin
Post by Kerr-Mudd, John
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!
3001 10 03
2030 03 02
Ok, perhaps I'll stay up for that one.
--
Bah, and indeed Humbug.
occam
2021-12-03 11:43:41 UTC
Permalink
Post by Kerr-Mudd, John
On 3 Dec 2021 08:06:14 GMT
Post by Bob Martin
Post by Kerr-Mudd, John
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!
3001 10 03
2030 03 02
Ok, perhaps I'll stay up for that one.
Or you may consider to defecting to the American way of writing dates:
yyyy-dd-mm (a variant of mm-dd-yyyy)

2022 22 02
lar3ryca
2021-12-04 22:20:14 UTC
Permalink
Post by Kerr-Mudd, John
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!
3001 10 03
(top of my head, other answers might be available, etc.)
I've been thinking about this, and decided to write a program to
find palindromic dates in the yyyymmdd format.

#!/usr/bin/rexx
startyear = 2021
endyear = 2099
monthlength = ("1 0 1 0 1 0 1 1 0 1 0 1")

do y = startyear to endyear
do m=1 to 12
do d = 1 to 31
if m = 2 & d = 29 then do
d=31
iterate
end
else if word(monthlength,m) = "0" & d=31 then do
iterate
end
if length(d) = 1 then d = 0||d
if length(m) = 1 then m = 0||m
fulldate = y||m||d
if fulldate = reverse(full) then say full
end
end
end

For this century, the results are:
20211202
20300302
20400402
20500502
20600602
20700702
20800802
20900902
Ken Blake
2021-12-04 22:49:01 UTC
Permalink
Post by lar3ryca
Post by Kerr-Mudd, John
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!
3001 10 03
(top of my head, other answers might be available, etc.)
I've been thinking about this, and decided to write a program to
find palindromic dates in the yyyymmdd format.
#!/usr/bin/rexx
startyear = 2021
endyear = 2099
monthlength = ("1 0 1 0 1 0 1 1 0 1 0 1")
do y = startyear to endyear
do m=1 to 12
do d = 1 to 31
if m = 2 & d = 29 then do
d=31
iterate
end
else if word(monthlength,m) = "0" & d=31 then do
iterate
end
if length(d) = 1 then d = 0||d
if length(m) = 1 then m = 0||m
fulldate = y||m||d
if fulldate = reverse(full) then say full
end
end
end
20211202
20300302
20400402
20500502
20600602
20700702
20800802
20900902
Bummer. All my nice indentation is gone.
It was fine on what I read here.
lar3ryca
2021-12-04 22:55:52 UTC
Permalink
Post by Ken Blake
Post by lar3ryca
Post by Kerr-Mudd, John
On Thu, 02 Dec 2021 12:15:15 +0000
Today's date is palindromic for those of us who write the date
20211202
aka
2021 12 02
Long time til another one of that sort!
3001 10 03
(top of my head, other answers might be available, etc.)
I've been thinking about this, and decided to write a program to
find palindromic dates in the yyyymmdd format.
#!/usr/bin/rexx
startyear = 2021
endyear = 2099
monthlength = ("1 0 1 0 1 0 1 1 0 1 0 1")
do y = startyear to endyear
do m=1 to 12
do d = 1 to 31
if m = 2 & d = 29 then do
d=31
iterate
end
else if word(monthlength,m) = "0" & d=31 then do
iterate
end
if length(d) = 1 then d = 0||d
if length(m) = 1 then m = 0||m
fulldate = y||m||d
if fulldate = reverse(full) then say full
end
end
end
20211202
20300302
20400402
20500502
20600602
20700702
20800802
20900902
Bummer. All my nice indentation is gone.
It was fine on what I read here.
Ahh... I got it in my email, and it was indented properly. I think it's just
the web view that messed it up. Not surprising. HTML doesn't really
like spaces or tabs.
Athel Cornish-Bowden
2021-12-05 10:54:04 UTC
Permalink
Post by Ken Blake
On Thu, 02 Dec 2021 12:15:15 +0000 "Peter Duncanson [BrE]"
Today's date is palindromic for those of us who write the date
20211202
aka 2021 12 02
Long time til another one of that sort!
3001 10 03 (top of my head, other answers might be available, etc.)
I've been thinking about this, and decided to write a program to find
palindromic dates in the yyyymmdd format.
#!/usr/bin/rexx startyear = 2021 endyear = 2099 monthlength = ("1 0 1 0
1 0 1 1 0 1 0 1")
do y = startyear to endyear do m=1 to 12 do d = 1 to 31 if m = 2 & d =
29 then do d=31 iterate end else if word(monthlength,m) = "0" & d=31
then do iterate end if length(d) = 1 then d = 0||d if length(m) = 1
then m = 0||m fulldate = y||m||d if fulldate = reverse(full) then say
full end end end
For this century, the results are: 20211202 20300302 20400402 20500502
20600602 20700702 20800802 20900902
Bummer. All my nice indentation is gone.
It was fine on what I read here.
For me too.
--
Athel -- French and British, living mainly in England until 1987.
Stefan Ram
2021-12-05 17:19:23 UTC
Permalink
Post by lar3ryca
#!/usr/bin/rexx
startyear = 2021
endyear = 2099
monthlength = ("1 0 1 0 1 0 1 1 0 1 0 1")
FWIW, in Python:

import datetime
date = datetime.datetime( 2021, 1, 1 )
while date < datetime.datetime( 2100, 1, 1 ):
text = date.strftime( "%Y%m%d" )
if text == text[ ::-1 ]: print( text )
date += datetime.timedelta( days=1 )

, with the same results.
Peter Moylan
2021-12-06 22:35:17 UTC
Permalink
I never did use REXX on an IBM system. My introduction to it was
ARexx, on the Amiga. What made is especially useful was that some
programs had a built-in Arexx interface, allowing an ARexx program
to do pretty much whatever the programmer wanted to expose to ARexx.
I've written one myself. On my OS/2 mail server you can specify filters
to be run (for spam detection, etc) at various stages of receiving the
mail. It turns out that most people write those filters in Rexx. The
filters that I supply are also in Rexx, not because I like the language
(I don't) but because that makes the source code available to anyone who
wants to customise them.
--
Peter Moylan Newcastle, NSW http://www.pmoylan.org
lar3ryca
2021-12-07 04:47:12 UTC
Permalink
Post by Peter Moylan
I never did use REXX on an IBM system. My introduction to it was
ARexx, on the Amiga. What made is especially useful was that some
programs had a built-in Arexx interface, allowing an ARexx program
to do pretty much whatever the programmer wanted to expose to ARexx.
I've written one myself. On my OS/2 mail server you can specify filters
to be run (for spam detection, etc) at various stages of receiving the
mail. It turns out that most people write those filters in Rexx. The
filters that I supply are also in Rexx, not because I like the language
(I don't) but because that makes the source code available to anyone who
wants to customise them.
I must admit that even though I wrote my first program in about 1966, and
have been paid for programming since about 1995, I am self-taught, and
have only used a few languages to write more than few trivial programs.

I do like Rexx, quite a lot. Within a few days of starting to program in ARexx,
I wrote a 'uniq' program that was short simple, and had one advantage
over the Unix/Linux uniq. You did not have to sort the input file prior to
running it. It takes input from stdin.

#!/usr/bin/rexx
/* Show only one copy of each line in a whole file */
seen. = 0
Do While Lines() > 0
Parse Pull this_line
If seen.this_line Then Iterate
seen.this_line = 1
Say this_line
end
Madhu
2021-12-07 14:05:40 UTC
Permalink
I never did use REXX on an IBM system. My introduction to it was
ARexx, on the Amiga. What made is especially useful was that some
programs had a built-in Arexx interface, allowing an ARexx program to
do pretty much whatever the programmer wanted to expose to ARexx.
You can reduce the brute force problem space by half because the 4 year
;; YYYY-MM-DD: ABCD-DC-BA
;; YYYY-DD-MM: ABCD-DC-BA
And you can check if a year is a palindrome or not and you are done
without generating all the strings for every day and month.
[snip]
And quickly my eyes glazed over. I knew there was a reason I never
learned LISP. I cannot, for the life of me, figure out how you are
making the determination that the year is a palindrome.
Sorry, I did spring it on you to see if it was readable and the
algorithm was understandable and I guess that answers it. The posted
code has at least one off-by-one bug and is missing 2 lines in one
function lost in cut & paste
Nice. I can only assume that it's fasfter than mine, which takes about
0.033 seconds for 2021 to 2099.
The range is too small for any comparison and i dont think you can
compare script executions with the `time' command meaningfully

I downloaded and installed regina-rexx and read the wikipedia page for
the syntax for 2-3 hours I came up with this: the algorithm should be
faster. maybe you can check or comment


#!/usr/bin/rexx
startyear = 2021
endyear = 2099

do y = startyear to endyear
if value(palindrome_year_p(y)) then
say y||reverse(y)
end
return 0

gregorian_leap_year_p:
parse arg year
p = year // 4
q = year // 400
return (p = 0) & ^ (q = 100 | q = 200 | q = 300)

days_in_month:
parse arg year month
select
when month = 1 | month = 3 | month = 5 | month = 8 | month = 10 | month = 12 then return 31
when month = 4 | month = 6 | month = 9 | month = 11 then return 30
when month = 2 then do
if gregorian_leap_year_p(year) then return 29
else return 28
end
otherwise
say "invalid month" month
exit 1
end

/* ABCD-DC-BA = YYYY-MM-DD*/

palindrome_year_p:
parse arg year
parse var year 1 ab 3 3 cd 5
mm = reverse(ab)
dd = reverse(cd)
return 0 < mm & mm < 13 & 0 < dd & dd < 1 + days_in_month(year mm)
lar3ryca
2021-12-07 18:07:18 UTC
Permalink
Post by Madhu
I never did use REXX on an IBM system. My introduction to it was
ARexx, on the Amiga. What made is especially useful was that some
programs had a built-in Arexx interface, allowing an ARexx program to
do pretty much whatever the programmer wanted to expose to ARexx.
You can reduce the brute force problem space by half because the 4 year
;; YYYY-MM-DD: ABCD-DC-BA
;; YYYY-DD-MM: ABCD-DC-BA
And you can check if a year is a palindrome or not and you are done
without generating all the strings for every day and month.
[snip]
And quickly my eyes glazed over. I knew there was a reason I never
learned LISP. I cannot, for the life of me, figure out how you are
making the determination that the year is a palindrome.
Sorry, I did spring it on you to see if it was readable and the
algorithm was understandable and I guess that answers it. The posted
code has at least one off-by-one bug and is missing 2 lines in one
function lost in cut & paste
Nice. I can only assume that it's fasfter than mine, which takes about
0.033 seconds for 2021 to 2099.
The range is too small for any comparison and i dont think you can
compare script executions with the `time' command meaningfully
I downloaded and installed regina-rexx and read the wikipedia page for
the syntax for 2-3 hours I came up with this: the algorithm should be
faster. maybe you can check or comment
First, let me say that I didn't mean to nerdsnipe you. I should have
realized that you were susceptible when I saw your LISP program.

In case you aren't familiar with the term, see https://xkcd.com/356/

Of course, the entire Palindromic Dates thread nerdsniped me.

Anyway, thanks for the Rexx program. I now know how your algorithm
works, and it is VERY much faster than mine. Just for grins, I timed
both of them. Mine stutters when writing to the terminal, and yours
just slaps them all up faster than I can see it happening.

Mine:
real 0m2.884s
user 0m2.845s
sys 0m0.004s

Yours:
real 0m0.010s
user 0m0.010s
sys 0m0.000s

This time is for starting year = 1753, ending year = 9999.
This also showed me that the first palindromic year of the Gregorian
calendar is 2001/10/02, and that there are 288 palindromic years in
that range.

Your program looks good to me. There are a few things I need to
study. I have never used a parse like
parse var year 1 ab 3 3 cd 5
but it looks real handy.

I just checked, and it was also documented in ARexx. Can't believe I
missed it.
Post by Madhu
#!/usr/bin/rexx
startyear = 2021
endyear = 2099
do y = startyear to endyear
if value(palindrome_year_p(y)) then
say y||reverse(y)
end
return 0
parse arg year
p = year // 4
q = year // 400
return (p = 0) & ^ (q = 100 | q = 200 | q = 300)
parse arg year month
select
when month = 1 | month = 3 | month = 5 | month = 8 | month = 10 | month = 12 then return 31
when month = 4 | month = 6 | month = 9 | month = 11 then return 30
when month = 2 then do
if gregorian_leap_year_p(year) then return 29
else return 28
end
otherwise
say "invalid month" month
exit 1
end
/* ABCD-DC-BA = YYYY-MM-DD*/
parse arg year
parse var year 1 ab 3 3 cd 5
mm = reverse(ab)
dd = reverse(cd)
return 0 < mm & mm < 13 & 0 < dd & dd < 1 + days_in_month(year mm)
Stefan Ram
2021-12-07 18:36:52 UTC
Permalink
Supersedes: <palindrome-***@ram.dialup.fu-berlin.de>
[added an underscore]
Post by lar3ryca
I just checked, and it was also documented in ARexx. Can't believe I
missed it.
[off topic, only for readers interested in programming!]

Since this thread is still ongoing, I feel encouraged to post
a variant of my Python program. The new variant tries to make
the main program more readable by using a date generator for
the date range and a name for the palindrome check. So, the
main program of the new Python version now is just:

for date in date_range( from_=( 2021, 1, 1 ), to=( 2100, 1, 1 )):
if date_is_palindrome( date ): date_print( date )

. I think this is quite readable! For this to work, however,
it needs to be preceded by the following source code, which
imports names from a library and then adds some definitions:

import datetime

def date_range( from_, to ):
start = datetime.datetime( *from_ )
top = datetime.datetime( *to )
one_day = datetime.timedelta( days=1 )
date = start
while date < top:
yield date
date += one_day

def date_to_text( date ):
return date.strftime( "%Y%m%d" )

def date_is_palindrome( date ):
text = date_to_text( date )
return text == text[ ::-1 ]

def date_print( date ):
print( date_to_text( date ))

. You can see that I take readability as the most important
quality criterion while others seem to take the running time
of the process or the shortness of the source code as the most
important criterion of quality.
Richard Heathfield
2021-12-07 19:36:23 UTC
Permalink
On 07/12/2021 18:07, lar3ryca wrote:

<snip>
Post by lar3ryca
Anyway, thanks for the Rexx program. I now know how your algorithm
works, and it is VERY much faster than mine. Just for grins, I timed
both of them. Mine stutters when writing to the terminal, and yours
just slaps them all up faster than I can see it happening.
real 0m2.884s
user 0m2.845s
sys 0m0.004s
real 0m0.010s
user 0m0.010s
sys 0m0.000s
That's impressive.
Post by lar3ryca
This time is for starting year = 1753, ending year = 9999.
For the same date range, the best I can manage in C is:

real 0m0.063s
user 0m0.063s
sys 0m0.000s
Post by lar3ryca
This also showed me that the first palindromic year of the Gregorian
calendar is 2001/10/02, and that there are 288 palindromic years in
that range.
Both confirmed.
Post by lar3ryca
Your program looks good to me.
FWIW here's my C:


#include "jdate.h"
#include <stdio.h>

static int is_paldate(int y, int m, int d)
{
return y / 1000 == d % 10 &&
(y / 100) % 10 == d / 10 &&
(y / 10) % 10 == m % 10 &&
y % 10 == m / 10;
}

int main(void)
{
long startdate = to_julian(1753, 1, 1);
long enddate = to_julian(9999,12, 31);
long date = startdate;
int y, m, d;

while(date <= enddate)
{
from_julian(&y, &m, &d, date);
if(is_paldate(y, m, d))
{
printf("%d%02d%02d\n", y, m, d);
}
++date;
}
return 0;
}
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within
Peter Moylan
2021-12-07 23:03:12 UTC
Permalink
Post by Richard Heathfield
printf("%d%02d%02d\n", y, m, d);
That reminds me of a situation where I failed to see the obvious.
Because I write a lot of internet server applications, I have often
needed to produce a timestamp in a format specified by some standard.
Initially I wrote a module with a couple of routines to produce the
timestamp. But, standards being standards, the number of different
"standard" formats I had to handle just grew and grew.

It literally took me years before I realised that I needed just one
procedure that would let me make calls like

FormatDateTime (dt, "the time is ddd/mm HH:MM", timestamp)

with a small range of possibilities for the format string.

In some ways FORTRAN was ahead of its time with the FORMAT statement. C
copied some of this, but to make it work it had to introduce a major
weakness in the language: the concept of a function with a variable
number of parameters.
--
Peter Moylan Newcastle, NSW http://www.pmoylan.org
Mark Brader
2021-12-07 23:10:09 UTC
Permalink
Post by Peter Moylan
In some ways FORTRAN was ahead of its time with the FORMAT statement. C
copied some of this, but to make it work it had to introduce a major
Strength, that is.
Post by Peter Moylan
the concept of a function with a variable number of parameters.
Even FORTRAN had that, with its AMAX1 and family.
--
Mark Brader, Toronto | "I like work; it fascinates me. I can sit and
***@vex.net | look at it for hours." -- Jerome K. Jerome
Anders D. Nygaard
2021-12-09 18:34:53 UTC
Permalink
Post by Peter Moylan
Post by Richard Heathfield
printf("%d%02d%02d\n", y, m, d);
That reminds me of a situation where I failed to see the obvious.
Because I write a lot of internet server applications, I have often
needed to produce a timestamp in a format specified by some standard.
Initially I wrote a module with a couple of routines to produce the
timestamp. But, standards being standards, the number of different
"standard" formats I had to handle just grew and grew.
It literally took me years before I realised that I needed just one
procedure that would let me make calls like
 FormatDateTime (dt, "the time is ddd/mm HH:MM", timestamp)
with a small range of possibilities for the format string.
How come the range of possibilities for the format string is small,
and by implication smaller than the growing number of standard formats?

Or am I misreading you?

/Anders, Denmark
Madhu
2021-12-10 01:51:51 UTC
Permalink
I'd better rephrase that. The format string can be anything at all, so
there are unlimited possibilities. My "small range of possibilities"
referred to the symbols with special meanings, like HH and yyyy. There
don't need to be many of those to cover the many standard formats.
My complete list of special symbols is
dd day, numeric
ddd day, three-letter name
mm month, numeric
mmm month, three-letter name
yy year, including Y2K bug
yyyy year, all four digits
HH hours
MM minutes
SS seconds
zz first time: sign and hours of time zone
zz second time: minutes part of time zone
I could add a few more to that list, but so far I haven't needed to.
Unless I misunderstood, C has strftime and strptime which does pretty
much the same thing in both directions.

the `date' program tries to accomodate a bunch of formats using this
mechanism but it still commonly fails in my experience

Jerry Friedman
2021-12-07 20:09:41 UTC
Permalink
...
Post by lar3ryca
Post by Madhu
I downloaded and installed regina-rexx and read the wikipedia page for
the syntax for 2-3 hours I came up with this: the algorithm should be
faster. maybe you can check or comment
First, let me say that I didn't mean to nerdsnipe you. I should have
realized that you were susceptible when I saw your LISP program.
In case you aren't familiar with the term, see https://xkcd.com/356/
...

There is no need to bring up what almost happened during a street
crossing in San José, Costa Rica, when a flock of parrots flew over.
--
Jerry Friedman resents being worth fewer points than a mathematician.
Quinn C
2021-12-07 23:16:20 UTC
Permalink
Post by Jerry Friedman
...
Post by lar3ryca
Post by Madhu
I downloaded and installed regina-rexx and read the wikipedia page for
the syntax for 2-3 hours I came up with this: the algorithm should be
faster. maybe you can check or comment
First, let me say that I didn't mean to nerdsnipe you. I should have
realized that you were susceptible when I saw your LISP program.
In case you aren't familiar with the term, see https://xkcd.com/356/
...
There is no need to bring up what almost happened during a street
crossing in San José, Costa Rica, when a flock of parrots flew over.
Can this be raised to a higher power by a flock of snipes?
--
The universe hates you - deal with it.
-- Seamus Harper
Sam Plusnet
2021-12-08 00:21:09 UTC
Permalink
Post by Quinn C
Post by Jerry Friedman
...
Post by lar3ryca
Post by Madhu
I downloaded and installed regina-rexx and read the wikipedia page for
the syntax for 2-3 hours I came up with this: the algorithm should be
faster. maybe you can check or comment
First, let me say that I didn't mean to nerdsnipe you. I should have
realized that you were susceptible when I saw your LISP program.
In case you aren't familiar with the term, see https://xkcd.com/356/
...
There is no need to bring up what almost happened during a street
crossing in San José, Costa Rica, when a flock of parrots flew over.
Can this be raised to a higher power by a flock of snipes?
Factor in a few sn!pes & try it.
--
Sam Plusnet
Snidely
2021-12-09 03:54:38 UTC
Permalink
Post by Sam Plusnet
Post by Quinn C
Post by Jerry Friedman
...
Post by lar3ryca
Post by Madhu
I downloaded and installed regina-rexx and read the wikipedia page for
the syntax for 2-3 hours I came up with this: the algorithm should be
faster. maybe you can check or comment
First, let me say that I didn't mean to nerdsnipe you. I should have
realized that you were susceptible when I saw your LISP program.
In case you aren't familiar with the term, see https://xkcd.com/356/
...
There is no need to bring up what almost happened during a street
crossing in San José, Costa Rica, when a flock of parrots flew over.
Can this be raised to a higher power by a flock of snipes?
Factor in a few sn!pes & try it.
That's a divisive post. Let's subtract it from the message list.

/dps
--
We’ve learned way more than we wanted to know about the early history
of American professional basketball, like that you could have once
watched a game between teams named the Indianapolis Kautskys and the
Akron Firestone Non-Skids. -- fivethirtyeight.com
Kerr-Mudd, John
2021-12-08 09:48:37 UTC
Permalink
On Wed, 8 Dec 2021 09:50:53 +1100
Post by Jerry Friedman
...
Post by lar3ryca
Post by Madhu
I downloaded and installed regina-rexx and read the wikipedia
page for the syntax for 2-3 hours I came up with this: the
algorithm should be faster. maybe you can check or comment
First, let me say that I didn't mean to nerdsnipe you. I should
have realized that you were susceptible when I saw your LISP
program.
In case you aren't familiar with the term, see
https://xkcd.com/356/
...
There is no need to bring up what almost happened during a street
crossing in San José, Costa Rica, when a flock of parrots flew over.
I had that reaction in Brisbane when a possum tried to jump from one
power line to another and its front feet hit the destination line before
its back feet had left the source line.
That doesn't count as nerdsniping, though. Nerdsniping is when I was
almost sucked into giving my program for palindromic dates.
Well, I'm half-caught; I've written one, but I won't publish it (cos I didn't handle leap years^w the one leap year case).
--
Bah, and indeed Humbug.
Richard Heathfield
2021-12-08 10:46:15 UTC
Permalink
Post by Kerr-Mudd, John
Well, I'm half-caught; I've written one, but I won't publish it (cos I didn't handle leap years^w the one leap year case).
Then you need a better date library. I didn't bother to consider leap
years specially because I could just iterate through the Julian dates
and let the library worry about what the actual date was.
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within
Lewis
2021-12-08 12:13:21 UTC
Permalink
Post by Richard Heathfield
Post by Kerr-Mudd, John
Well, I'm half-caught; I've written one, but I won't publish it (cos I didn't handle leap years^w the one leap year case).
Then you need a better date library. I didn't bother to consider leap
years specially because I could just iterate through the Julian dates
and let the library worry about what the actual date was.
I don't think Julian date means what you think it means.

<https://en.wikipedia.org/wiki/Julian_date>
--
A man, in a word, who should never have been taught to write and whom
if unhappily gifted with that ability, should have been
restrained by a Act of Parliament from writing Reminiscences.
- PG Wodehouse
Kerr-Mudd, John
2021-12-08 16:54:31 UTC
Permalink
On Wed, 8 Dec 2021 12:13:21 -0000 (UTC)
Post by Lewis
Post by Richard Heathfield
Post by Kerr-Mudd, John
Well, I'm half-caught; I've written one, but I won't publish it (cos I didn't handle leap years^w the one leap year case).
Then you need a better date library. I didn't bother to consider leap
years specially because I could just iterate through the Julian dates
and let the library worry about what the actual date was.
I don't think Julian date means what you think it means.
<https://en.wikipedia.org/wiki/Julian_date>
Redirects to Julian Day

Iterating through all days seems quite wasteful; "ccyy mmdd" will only be palindomic at most once a year.

Who needs a Library?
Post by Lewis
--
A man, in a word, who should never have been taught to write and whom
if unhappily gifted with that ability, should have been
restrained by a Act of Parliament from writing Reminiscences.
- PG Wodehouse
--
Bah, and indeed Humbug.
Richard Heathfield
2021-12-08 17:13:29 UTC
Permalink
Post by Kerr-Mudd, John
On Wed, 8 Dec 2021 12:13:21 -0000 (UTC)
Post by Lewis
Post by Richard Heathfield
Post by Kerr-Mudd, John
Well, I'm half-caught; I've written one, but I won't publish it (cos I didn't handle leap years^w the one leap year case).
Then you need a better date library. I didn't bother to consider leap
years specially because I could just iterate through the Julian dates
and let the library worry about what the actual date was.
I don't think Julian date means what you think it means.
<https://en.wikipedia.org/wiki/Julian_date>
Redirects to Julian Day
And, surprise surprise, it turns out that Julian date means pretty much
what I thought I meant.
Post by Kerr-Mudd, John
Iterating through all days seems quite wasteful; "ccyy mmdd" will only be palindomic at most once a year.
What is wasteful is spending a long time on writing an optimised curio
when one may in a short time write an unoptimised curio that will run in
next to nothing flat anyway.
Post by Kerr-Mudd, John
Who needs a Library?
A man who feels no particular need to write the same code over and over
again.
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
"I suppose you burned the library -- barbarians always do." - James Blish.
Loading...