I'm still 29, and this shows correctly on StackOverflow and the rest of the "trilogy" because I entered my correct birth date. The data dump says I'm 30. I know this is happening to other users as well — you can see it here:
StackQL test site updated to March data
http://jcoehoorn.dyndns.org/stackql/default.aspx?qid=470
4 Answers
This will be fixed in the next dump.
-
6
-
1This is broken again, e.g.
select age from users where id = 2
on MSO shows you as 35.– RupCommented Mar 16, 2012 at 13:53 -
1
Maybe Jeff should post a question on StackOverflow asking how to calculate someone's age from their birthday and the current date...
Oh look, he did ask that in 2008.
Perhaps he now believes his current knowledge will be entirely obsolete in one year, not five, so he deliberately wipes his memory every 12 months to make room.
-
There are some good answers there - particularly this one - stackoverflow.com/questions/9/… - an obvious solution when it's shown, but not one I'd have come up with in a million years.– ChrisF ModCommented Mar 8, 2010 at 21:43
-
As homage to Jon Skeet, someone should post an answer that uses Noda Time code.google.com/p/noda-time– MarkJCommented Mar 9, 2010 at 17:57
Here are the results of twenty randomly chosen users:
User 218540: 28 years in data dump, 27 years on website User 160208: 25 years in data dump, 24 years on website User 23897: 40 years in data dump, 39 years on website User 86038: 23 years in data dump, 22 years on website User 20367: 39 years in data dump, 38 years on website User 106040: 31 years in data dump, 31 years on website User 2368: 27 years in data dump, 27 years on website User 116553: 23 years in data dump, 22 years on website User 191385: 15 years in data dump, 14 years on website User 214528: 24 years in data dump, 23 years on website User 18102: 35 years in data dump, 35 years on website User 58309: 42 years in data dump, 42 years on website User 110227: 32 years in data dump, 32 years on website User 98585: 26 years in data dump, 25 years on website User 184340: 39 years in data dump, 38 years on website User 250022: 24 years in data dump, 23 years on website User 8843: 39 years in data dump, 39 years on website User 234438: 33 years in data dump, 32 years on website User 5975: 27 years in data dump, 26 years on website User 251474: 34 years in data dump, 33 years on website
14 out of 20 differ, and where they do, the age on the website is exactly one less than the age in the db.
Code used:
import sqlite3, random, httplib2, re
# the <center> cannot hold it is too late
age_re = re.compile(r"<td>age</td>\s*<td>\s*(\d*)\s*</td>")
http = httplib2.Http()
db = sqlite3.connect("so201003.db")
with_age = db.execute("SELECT Id, Age FROM USERS WHERE Age IS NOT NULL").fetchall()
random.shuffle(with_age)
sample = with_age[:20]
for userid, db_age in sample:
url = "http://stackoverflow.com/users/%d" % userid
response, content = http.request(url, headers = {"User-Agent": "Hi Jeff! Joel says you're wrong. I'm checking that."})
if response.status != 200:
raise IOError("Response was %d" % response.status)
web_age = int(age_re.search(content).groups(1)[0])
print "User %d: %d years in data dump, %d years on website" % (userid, db_age, web_age)
-
1Could it be that those 6 that have a correct age have their birthdays in the first two months?– perbertCommented Mar 8, 2010 at 18:34
-
@voyager: Possibly. Or actually: Likely. That would concur with Pollyanna's assumption. Commented Mar 8, 2010 at 18:37
-
My birthday has already come and gone this year, so I'm guessing my ages will both be correct assuming Pollyanna has the right idea. Commented Mar 8, 2010 at 20:28
-
I expect they are doing the simple year calculation. If you were born in 1970, and it's 2010, then sometime during this year you have already or will turn 40. It's easier/cheaper than a full date calculation, and does it really matter?
It could also be to avoid minor privacy concerns - look at previous data dumps and determine the birthmonth. Seems a bit over concerned, though, so it's unlikely, but possible. Notably one can determine the exact birthdate by reading the user page once a day and waiting for the age to change, so it's already visible, but takes up to a year to find out.
Year(getdate()) - Year([Users].[dob])
is easy. The fact that it's been nearly a year before anyone noticed shows that this might even be the right approach.