The Nightstar Zoo

Nightstar IRC Network - irc.nightstar.net
It is currently Sun Sep 24, 2017 1:40 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Jan 15, 2010 3:25 am 
Offline
Intern
Intern
User avatar

Joined: Sun May 12, 2002 12:18 am
Posts: 1134
Location: Idaho
Why? Why can't people learn from past mistakes?

http://ghewgill.livejournal.com/140515.html

_________________
Fandemonium!
August 1st, 2nd, 3rd, 2014

"I am a machine. I am a weapon of war. I am a destroyer of life in the service of life, the sword and shield of my human creators." Bolo Invincibilus, Mark XXIII, Model B (Experimental) 0075-NKE "Nike".


Top
 Profile  
 
PostPosted: Sun Jan 17, 2010 4:57 pm 
Offline
Concession Worker
Concession Worker
User avatar

Joined: Tue Jul 01, 2003 5:26 pm
Posts: 1479
Location: R'lyeh
A friend of mine was one of the Germans affected by Y2.01k. Of course, the real Fail here wasn't so much the moronic date checking bug as the bank's only response to his requests for help: "Just go to your home office and withdraw cash manually". Very helpful advice to someone living abroad...

_________________
Living in a state free from the burdens of privacy and democracy since 2008-06-18.


Top
 Profile  
 
PostPosted: Fri Dec 18, 2015 3:40 pm 
Offline
Intern
Intern
User avatar

Joined: Wed Apr 08, 2009 7:02 pm
Posts: 1074
Location: Puget Sound, WA
Of course, they didn't really fix the Y2K problem. Years are now encoded as four digits, which means they'll roll over from the year 9999. I'm considering having myself frozen and revived in time to get paid obscene amounts of money to fix the Y10K problem. If you think that 8,000 years is plenty of time to fix the issue, keep in mind that banks and investment houses started seeing Y2K issues in the 1970's when 30-year loans and bonds made their software barf when it tried to calculate yields & charges out past 01-01-2000.

Of course, more imminently, we have the 2038problem. UNIX clocks will roll over some time in 2038 because they count in seconds from 00:00:00 01-01-1970. Since the counter uses a signed 32-bit integer, it will overflow to a negative number about 68 years before 1970. Changing to 64-bit numbers would push the date out to around the year 292 billion. If you used unsigned 64-bit numbers and started at the instant of the Big Bang, you could get all the way to 584 billion. That should be enough unless you're building a time machine that can reach the year 100 Trillion.

_________________
===============================================
"A sufficiently-advanced technology is indistinguishable from magic."
Arthur C. Clarke
"Sufficiently advanced magic is indistinguishable from technology."
Jack L. Chalker
"Magic is just another way of saying 'I don't know how it works.'"
Larry Niven
"Any technology, no matter how primitive, is magic to those who don't understand it."
Florence Ambrose


Top
 Profile  
 
PostPosted: Fri Dec 18, 2015 3:52 pm 
Offline
Intern
Intern
User avatar

Joined: Wed Apr 08, 2009 7:02 pm
Posts: 1074
Location: Puget Sound, WA
bizzybody wrote:
Why? Why can't people learn from past mistakes?

http://ghewgill.livejournal.com/140515.html


Because they're lazy and sloppy. The issues cited not only point out poor programming practices, but a failure to properly test one's code.

_________________
===============================================
"A sufficiently-advanced technology is indistinguishable from magic."
Arthur C. Clarke
"Sufficiently advanced magic is indistinguishable from technology."
Jack L. Chalker
"Magic is just another way of saying 'I don't know how it works.'"
Larry Niven
"Any technology, no matter how primitive, is magic to those who don't understand it."
Florence Ambrose


Top
 Profile  
 
PostPosted: Fri Dec 18, 2015 7:40 pm 
Offline
Intern
Intern
User avatar

Joined: Sun May 12, 2002 12:18 am
Posts: 1134
Location: Idaho
Regarding the 2038 issue, why does anyone ever use a signed number for a value that should not ever be negative? Just because you never expect the thing to still be in use that long or for the value to get that high, doesn't mean you should just leave everything as a signed value.

One fun example was in the old Dune II game. The amount of spice was stored in an 8 bit signed integer. If you harvested more than 64K spice in a level the counter would roll over to negative. You'd still get credit for all harvested spice in the score.

ISTR there have been plenty of cases where an unsigned value was used when a signed one should have been, with various unwanted or even disastrous results because the software was unable to measure/monitor/display a critical negative value.

So the question should be "Does this *need* to monitor negative values, ever? No? Then it needs to be set as unsigned so if the value goes unexpectedly high it will be able to handle it."

Another common programming counting gaffe is using plural words with 1. "There are 1 pages" "You have won 1 rewards!". I've been using mPoints to get free gift cards. Everywhere in their mPlaces app they have that wrong. 1 points, 1 rewards, 1 prize boxes. Can we have one fired programmers who is too lazy to do that correctly?

IMDB had that on their search results "There are 1 pages" until some years ago I sent them an e-mail explaining why it was wrong. I got a reply thanking me for pointing it out and they had it fixed within a day. It's not *difficult* to do, so there's no excuse for it getting into anything facing the public.

That's a Day 1 basic how to program example, testing if a variable is 1 or not then displaying non-plural words if the value is one and only if it is 1 or -1. Zero and all other positive or negative numbers get plurals. Why plural for zero? Dunno, that's just what I was taught in grade school in the 70's. Zero hits, one hit, two hits.

_________________
Fandemonium!
August 1st, 2nd, 3rd, 2014

"I am a machine. I am a weapon of war. I am a destroyer of life in the service of life, the sword and shield of my human creators." Bolo Invincibilus, Mark XXIII, Model B (Experimental) 0075-NKE "Nike".


Top
 Profile  
 
PostPosted: Sun Jan 10, 2016 9:07 pm 
Offline
Aquarium Exhibit
Aquarium Exhibit

Joined: Tue Jun 30, 2015 3:24 am
Posts: 5
bizzybody wrote:
Regarding the 2038 issue, why does anyone ever use a signed number for a value that should not ever be negative? Just because you never expect the thing to still be in use that long or for the value to get that high, doesn't mean you should just leave everything as a signed value.
...


Umm, because Jan 1 1969 is a perfectly valid date?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group