Leap Year Woes in Japan
joerg writes, "The Heise-Newsticker says that Japan had several intercalary day-related computer problems like weather stations delivering wrong data.
" Finally! A Y2K bug! The hype was justified! (cough, cough)
Anyone have a birthday today?
Just for the record, I was born on Feb 29, 1980 in the middle of a massive snowstorm.
Gee, usually people are conceived during massive snowstorms. (Hey, ya gotta do something...;-)
Ooh, a sarcasm detector. Oh, that's a real useful invention.
OTOH -- I have to say that to blow off Y2K issues at this point is a mistake. The mystique of the rollover was a bunch of nonsense -- and we all knew it. But that doesn't mean that there are no real problems. I have seen quite a few screwed up perl scripts, for example. And it really seems to me that, had we done nothing, some bad things could have happened.
I'd wait until a few billing cycles are through before I called the problem over.
--
-- Slashdot sucks.
Motorola 6800 (HC11: needs ACCD and IDIV) machine language:
Store the year in the address (two bytes) pointed to by INDEX Y, The result 1-True/0-False is stored in accumulator A. The two bytes pointed to by INDEX X is used as a scratch area. Run time: 166 clock cycles. (not counting final NOP.)
Those IDIVs are expensive at 41 cycles each. Is there a better way to do mod?
should have known....the link ended in ".de" *lol*
Computer breakdowns by intercalary day in Japan
The intercalary day on today's Tuesday, 29 February, caused some
surprising computer disturbances in the Hightech country Japan. As
the press agency Reuters announces, in post offices due to
Jahr-2000-Fehlern, which were released by the intercalary day, 1200
cash machines failed. The Japanese weather service has problems with
the entry of local temperatures and precipitation. According to the
report 43 stations distributed over the country transmit false data
since this morning. Already on Monday some 24-Stunden-Vorhersagen
with an error had been printed out: Instead of " 29. " became " 1. "
as end of the validity period indicated. In north Japan the devices
failed for the display of seismic activities with 20 local offices.
Differently than to the change of year however no breakdowns were
announced in the Japanese nuclear power stations (cp/c't)
I really can't be arsed to do an x86 assembler version :)
Will MIPS do? :-)
la t0,year
lw t1,0(t0)
add t5,zero,zero
andi t2,t1,3
bnz t2,1f
addi t5,zero,1
addi t0,zero,100
div t1,t0
mflo t0
bnz t0,1f
addi t0,zero,400
div t1,t0
mflo t0
beqz t0,1f
add t5,zero,zero
1:
la t0,isleap
sw t5,0(t0)
I could give you sparc, M68k or x86 code also, but this will have to do for now...
If you've any interest in calendar manners you'll know that the current 97 leap years in 400 years calendar was introduced by Pope Gregory because the time of the Equinox was slipping away from the date of the equinox - 10 days by the time the calendar was imposed.
The funny thing is - the 97/400 calendar is in fact inferior to the 8/33 year cycle of the Persian calendar, but for 'political reasons it wasn't introduced. The persian cycle has 7 leap years spaced by 4 years, and one spaced by 5.
The reason that the Persian Calendar is better is that the 97/100 cycle lets the dae of the equinox wander by about 56 hours. While the Persian calendar lets it wander by only 24....
Anyway - there's a load of fun political wrangles and a plan by Queen Elisabeth I of Britain to use this better calendar as a secret weapon against the catholic church.... fun fun fun...
> Correct me if I?m wrong
Consider yourself corrected.
Leap years occur when the year is divisible by 4, except when the year is divisible by 100, unless the year is also divisible by *400* (not 1,000).
-- Don't Tase me, bro!
The lunar month is approximately 29.53059 days.
Mea navis aericumbens anguillis abundat
Check out http://linux berg.mirror.ac.uk</a> in Netscrape 4.x for Linux. Look for the big date in red.... doesn't happen in IE, or in Netscrape for non-Linux platforms (Windoze and AIX tested so far). Silly javascript :)
~Tim
--
Rushing on down to the circle of the turn
bissextile year \bye-SEKS-tuhl-YEAR\ (noun)
: a leap year in the Julian or Gregorian calendar
The year 2000 is a bissextile year, but the year 1900 was
not because leap years can only occur in century years that are
divisible by 400.
When Julius Caesar reformed the calendar in 45 BC, he
stipulated that an extra day be added to February every four
years. But the Romans didn't add the extra day at the end of the
month; they inserted it after the 24th day of the month. They
also reckoned days near the end of a month by counting backwards
from the first of the following month rather than forward from
the beginning of the current one. The day we call February 24 is
six days before March 1, so it was known as the sextus, or "sixth
day." When Caesar's extra day was added, it became a "second
sextus" or bissextus (appending the Latin "bis," meaning
"doubled"). English speakers adopted "bissextile" to refer to
that extra day, even though its placement in the modern calendar
makes that term a misnomer.
-- Virtual Windows Project
Just for the record, I was born on Feb 29, 1980 in the middle of a massive snowstorm.
So today is my 5th birthday. Everyone send me a present!
Kintanon
Check out JoshJitsu.info for Brazilian Ji
My 1892 Hamilton perpetual got the date correct. It even rolled over to '2000' for me on New Years. I believe it will keep the correct date until 2199. Amazing to think that the engineer had the foresight to see that someone would still be using it more than 300 years in the future. Perhaps the FORTRAN and RPG programmers of the 1960's should have taken a clue from the watchmakers of the 1890's.
.sig: Now legally binding!
I heard a request for birthdays on this day -
,Indian prime minister who was imprisoned with Mahatma Gandhi.
Born on this day:
1736: Anne Lee , British blacksmith's daughter who emigrated to the USA and founded
the religious group, the American Society of Shakers.
1792: Gioacchino Rossini , Italian composer who wrote 36 operas, including The Italian
Girl in Algiers, William Tell' The Barber of Seville and The Thieving Magpie - and
invented a number of recipes, notably Tournedos Rossini.
1840: John Holland , Irish-American
1896: Ranchhodji Morarji Decal
1920: Actress Michele Morgan
1920: Actor Arthur Franz
1920: Actor James Mitchell
1928: Actor Joss Ackland
1936: Actor Alex Rocco
1936: Former space shuttle astronaut Jack Lousma
1944: Actor Dennis Farina
1944: Actress Phyllis Frelich
1972: Actor Antonio Sabato Junior
Correct me if I'm wrong but the leap year rules are as follows, leap years occur when the year is divisible by 4, except when the year is divisible by 100 unless the year is divisible by 1000. I find it ironic that programmers have to implement one but not both exceptions to the basic rule in order to have a problem. Those programmers who just implemented the /4 basic rule can rest until 2100 before having problems.
Actually, try this bit of code instead :)
isleap = false;if !(year % 4) {
isleap = true;
year % 100 == 0 ? isleap = false;
year % 400 == 0 ? isleap = true;
}
It's a 400 year exception, not a 1000 year exception...
Firstly, we need a calendar to identify the seasons. In month X it is summer, in month Y it is winter.
Secondly, a year doesn't last X months, it lasts 365 days, six hours and a bit.
Even an earth day doesn't last 24 hours (oh no it don't) it lasts 23 hours 59 minutes and 58 seconds.
Lastly, they had the leap year wrong a long time. When Christmas started falling in summer, European countries 'invented' the leap year and between 1534 and 1538 all countries in Europe scratched one month, i.e. any date November 1536 does not exist in Holland.
Bizar technology?
A grandfather is set to fulfil a lifetime's ambition by holding his official 21st birthday party - 63 years after handing out the invitations.
Martin Grundy was born on February 29 in the leap year of 1916 and so celebrates a proper birthday every four years.
As a law student in 1937, he held an informal 21st party with a few drinks on February 28 - and told undergraduates to come to the proper party in 2000.
The power of accurate observation is commonly called cynicism by those who have not got it. - G.B. Shaw
Gotta love Drude this made the headline on DrudgeReport....check it out here at yahoo....the report makes more sense in straight english :)
I remember watching a number programs displaying the date 29 FEB 1990 to me a decade ago. That wasn't a leap year. Fortunately for the vendor, who responded quite quickly, the dates were stored internally in Julian format and converted for display, so no data was corrupted. The bug was introduced during some maintenance on some old software. I suspect that they were among the first to start Y2K fixes.
This particular problem arose from the fact that far few programmers completely understand the leap year rules, and the code that does the calculations is rarely touched, usually for some reason not directly related to leap year calculations, such as Y2K remediation. It is all wound up in the reasons why software maintenance gets expensive in nearly every case. The specs were either never written down to the level of individual functions, or they are out-of-date. Comments are incomplete or misleading. There's no automated regression tests to give assurance that nothing has been broken.
Why should we care about this? This particular instance was probably due either to Y2K work or a latent bug from some programmer who over-applied the century portion of the leap year rules. Once it gets fixed, this code won't need to be touched for ages. First of all, Y2K was just a single instance of a justification for going through bodies of code making huge numbers of small changes. Porting is another one. And any programmer with a bit of experience can name at least one or two others.
Earlier, I provided a link to the description of the Extreme Programming practice of automated unit tests. Doing that might not have caught these bugs before they got loose. Testing generally only catches the bugs you know to look for, and the tests can be wrong too. But I'm lobbying here to try to overcome the natural resistance many programmers feel toward testing. I know I'd certainly rather be writing code. The reason I've started automating it is because I have no such aversion to building tools to take that dull task away from me. Larry Wall pointed out that laziness is a virtue for programmers. Use it.
The net will not be what we demand, but what we make it. Build it well.
A friend of mine's son was born today! Although his wife went in to labor at 3am yesterday, we encouraged her to hold off for 24 hours to deliver just for the cool birthday.
I don't think she was amused.
SteveIt may be the case that there have been many more Y2K problems occur than have actually been reported. It may well be that organizations have tried to cover up to avoid looking like they were the only ones who didn't prepare for the worst.
It just so happens that the organisation which I work for had at least 20 Y2K related incidents occur in the first week of 2000 but we have all be told to keep quiet (hence I don't give the organisation name) I can say this: we are one of the largest organisations in the UK and we must have done damn well to keep information about these problems away from the trade press.....
Ripping an new rectum in the fabric of spacetime.
Here.
It's intersting to note they did have problems with Y2K (according to the BBC), so this shouldn't have been *too* much of a surprise...