Comment On Code Dendrochronology

As the seasons change and years pass, trees accumulate rings that can be used to determine the age of the tree. This is a result of seasonal growth — the inner section of each ring is formed in the early part of the rapid growth season; this wood is called "early wood" (*snicker*). Then as the temperature changes and growth slows, the darker outer portion of the ring forms ("late wood"). And who can forget the classic scene from Vertigo in which Kim Novak's character hints at a passion for dendrochronology as she finds the years of her birth and death on the rings of a tree. Why do I bring this up? Because seeing bits of the past frozen in time is fascinating. [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Re: Code Dendrochronology

2008-10-06 09:10 • by gabba
What? Are you suggesting the number of days in a week should be hardcoded? Sloppy.

Re: Code Dendrochronology

2008-10-06 09:12 • by snoofle
This is beautiful - it is ready to handle both solar and lunar weeks!

Also, when we finally get to another planet, the "week" will certainly have more/less than 7 days; we need to plan for this!

Re: Code Dendrochronology

2008-10-06 09:13 • by TopCod3rFan (unregistered)
wow. just wow.

Re: Code Dendrochronology

2008-10-06 09:15 • by iogy (unregistered)
Heh, neat. In my coworkers webapp I found the following table:

id year
1 1990
2 1991
3 1992
4 1993
(and so on)
36 2025

Oh well, at least this was beyond his planned lifespan.

Re: Code Dendrochronology

2008-10-06 09:24 • by Dave (unregistered)
Reminds me of the code for the timesheet software at a company I used to work at. That was written in good old VB as well.

Re: Code Dendrochronology

2008-10-06 09:25 • by m (unregistered)
"By the time he found the below snippet, he felt like he needed a cold shower."

The code made him horny?

Re: Code Dendrochronology

2008-10-06 09:29 • by Fair warning (unregistered)
If you haven't been around much:

When TopCod3r posts (and he *will* post) about how he used to require his team to code in such and such a manner, ignore it. He's trolling, and if you respond you will be mocked by all the kids here who are way cooler than you will ever be.

Re: Code Dendrochronology

2008-10-06 09:30 • by Luis Guerrero (unregistered)
Somehow, this is going to get blamed on good ol' trusty VB.

captcha wisi

As in wisi-washi code?

Re: Code Dendrochronology

2008-10-06 09:31 • by Smash King
221218 in reply to 221212
iogy:
Heh, neat. In my coworkers webapp I found the following table:

id year
1 1990
2 1991
3 1992
4 1993
(and so on)
36 2025

Oh well, at least this was beyond his planned lifespan.
I have read some magazine article a while ago about the best and fastest way to do some calculations needed for some yearly report. The answer was a stored procedure, and it had some queries perform joins to a table like the one in the TDWTF article.
It wouldn't take too long to become a WTF similar to this one, if the magazine article had not pointed out that the current year records should be deleted when you were to append next year's records

Re: Code Dendrochronology

2008-10-06 09:32 • by KenW
221219 in reply to 221216
Fair warning:
If you haven't been around much:

When TopCod3r posts (and he *will* post) about how he used to require his team to code in such and such a manner, ignore it. He's trolling, and if you respond you will be mocked by all the kids here who are way cooler than you will ever be.


And if you feel the need to prewarn people about TopCod3r in advance, it means you've fallen prey to him at least once and been embarrassed as a result.

Re: Code Dendrochronology

2008-10-06 09:32 • by tdb
221220 in reply to 221210
snoofle:
Also, when we finally get to another planet, the "week" will certainly have more/less than 7 days; we need to plan for this!

It might, or it might not. Week is a purely artificial unit of measure, as are the units shorter than a day. Even month is somewhat artificial these days, with the calendar makers wanting to have an integral amount of months in a year. I believe the 24/60/60 subdivision of day is a legacy of ancient Babylonians, and week probably has its origins in the Bible.

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.

Re: Code Dendrochronology

2008-10-06 09:38 • by Don't be fooled (unregistered)
221225 in reply to 221216
If you haven't been around much:

When TopCod3r posts (and he *will* post) about how he used to require his team to code in such and such a manner, ignore it. He's trolling, and if you respond you will be mocked by all the kids here who are way cooler than you will ever be.


...and if someone else post something that defends the practices in the article and you respond; you've been trolled by a n00b! I will mock you even more, since I am cool (way more than you'll ever be.)

Re: Code Dendrochronology

2008-10-06 09:38 • by Fair warning (unregistered)
221226 in reply to 221219
KenW:
And if you feel the need to prewarn people about TopCod3r in advance, it means you've fallen prey to him at least once and been embarrassed as a result.


Incorrect! But thanks for playing.

Re: Code Dendrochronology

2008-10-06 09:42 • by notme (unregistered)
221227 in reply to 221220
tdb:

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


See:
Discordian Calendar

Re: Code Dendrochronology

2008-10-06 09:42 • by Dirk Diggler (unregistered)
Instead of storing the calendar in a table, they should have used DATA statements. It's a lot faster than database access and you can make change right in the code.

Re: Code Dendrochronology

2008-10-06 09:43 • by akatherder
221229 in reply to 221220
tdb:

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


Maybe if you're one of the few who use metric system. Here in the US we like our measurements (whether they be time, length, or mass) to be intuitive. 12 inches = 1 foot, 3 feet = 1 yard, 1760 yards = 1 mile.

Re: Code Dendrochronology

2008-10-06 09:47 • by akatherder
We had a scheduling system with tables named 1998, 1999, 2000, etc. It stopped working every year right after the holidays.

I asked why we don't make the year a column. I was told that the table would get too big if we kept reusing the same table every year.

Re: Code Dendrochronology

2008-10-06 09:48 • by Stewie (unregistered)
221231 in reply to 221229
Here in the US we like our measurements (whether they be time, length, or mass) to be intuitive. 12 inches = 1 foot, 3 feet = 1 yard, 1760 yards = 1 mile.


My feet are under 11 inches, my yard is bigger than 3 feet and I don't have a mile, you insensitive clod!

Re: Code Dendrochronology

2008-10-06 09:50 • by Addison (unregistered)
221232 in reply to 221229
akatherder:
tdb:

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


Maybe if you're one of the few who use metric system. Here in the US we like our measurements (whether they be time, length, or mass) to be intuitive. 12 inches = 1 foot, 3 feet = 1 yard, 1760 yards = 1 mile.


*shivers*- if you weren't being sarcastic I would be very frightened.

Last time I checked well over 5.5 billion people used metric. I hope you like being in a club where you're the only member. Well, other then Burma and Liberia. But they don't count.

Once we colonize other planets there will develop a metric-style time system.

Re: Code Dendrochronology

2008-10-06 09:52 • by TopCod3r Fan Boy (unregistered)
221233 in reply to 221216
Fair warning:
If you haven't been around much:

When TopCod3r posts (and he *will* post) about how he used to require his team to code in such and such a manner, ignore it. He's trolling, and if you respond you will be mocked by all the kids here who are way cooler than you will ever be.


Oh TopCod3r, where art thou?

Re: Code Dendrochronology

2008-10-06 09:56 • by Ebs2002 (unregistered)
I hear that topcoder's account was banned...

Re: Code Dendrochronology

2008-10-06 09:57 • by Erikj (unregistered)
221235 in reply to 221220
tdb:
snoofle:
Also, when we finally get to another planet, the "week" will certainly have more/less than 7 days; we need to plan for this!

It might, or it might not. Week is a purely artificial unit of measure, as are the units shorter than a day. Even month is somewhat artificial these days, with the calendar makers wanting to have an integral amount of months in a year. I believe the 24/60/60 subdivision of day is a legacy of ancient Babylonians, and week probably has its origins in the Bible.

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


Any time unit other then second is a convience unit... the second is the official SI unit for time-measurement.

Both the day and the year measure cycles, but they are not the official units for time and indeed depend on the planet you happen to be on.

Re: Code Dendrochronology

2008-10-06 09:57 • by nobis (unregistered)
221236 in reply to 221232
Addison:
akatherder:
tdb:

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


Maybe if you're one of the few who use metric system. Here in the US we like our measurements (whether they be time, length, or mass) to be intuitive. 12 inches = 1 foot, 3 feet = 1 yard, 1760 yards = 1 mile.

Once we colonize other planets there will develop a metric-style time system.

What's this obsession with 10s? Hexi is sexy! 256 hours in a day, 16 minutes in an hour, 16 seconds in a minute.

Re: Code Dendrochronology

2008-10-06 10:00 • by durnurd
221237 in reply to 221232
There is an unfortunate inability to change the number of days it takes for a planet to revolve around its star, and this leads to some people's unnecessary hacks in the calendar to make everything fit. What we really need is either:

a) a planet that revolves around its star in a power of 10 days

or

b) to count all future time with systems base-x, based on this one thing we can't change. Of course, this still creates a problem if the number of days in a year is not an integer. And if it's a prime number, that doesn't really leave us much choice as to subdividing the year into months or weeks, etc.

Re: Code Dendrochronology

2008-10-06 10:04 • by Bernard (unregistered)
I come from the UK - we like to use imperial for milk, beer and speed limits. Everything else is metric. Not sure how we ended up like this...

Re: Code Dendrochronology

2008-10-06 10:05 • by Bob (unregistered)
Didn't you hear, 12 is the new 10.

Re: Code Dendrochronology

2008-10-06 10:06 • by Keith (unregistered)
100+ lines of code for something that can be done in nearly 5 lines (as long as you don't mind hard-coding the fact that there are 5 days in a work week). This is a common practice when you are dealing with people who want to keep their jobs secure. Here is one way to correct the code:


Function fDaysLeftInWeek(ByVal dateToTest As Date) As Integer
Select Case Weekday(dateToTest)
Case 1, 7: Return 0 'Or whatever you want to return if today is Saturday/Sunday
Case Else: Return 6 - Weekday(dateToTest) 'The "magic number" 6 is dangerously meaningful!!! - this will return 4 on a Monday.
End Select
End Function

Re: Code Dendrochronology

2008-10-06 10:07 • by Charles400
I am a star. My co-workers revolve around me. Redefine the year!

Re: Code Dendrochronology

2008-10-06 10:20 • by hvm
221243 in reply to 221229
Don't get this as an anti imperial system rant but why is 12inch=1foot, 3feet=1yard, 1760yards=1mile more intuitive than simple multiplication (or division) by 10 for each prefix? Also there are many people using the metric system, probably more than the ones using the imperial one: most of Europe, most of Asia (if I'm not mistaken China too which really boosts the number), probably most of South America etc. Imperial is used only in the former British Empire countries which don't amount to a large portion of the world population.

Anyway that is irrelevant to the idea of a non-legacy time measurement system. The current units are very well rooted in the systems and minds of today and it would be very hard and pointless to change them. I see no problem in having 24hour days, 60minute hours and 60 second minutes. Computers can calculate those pretty easily and it's not really hard for humans either. The real problem is the fact that the year has 365.24219 days. Also another issue is that the Earth doesn't have a constant angular speed around the Sun which makes finding the current time even harder. The orbit also shifts each year, the Polar Axis is rotating and oscillating and the Earth's spin is slowly decreasing. All those give huge headaches to people that need to calculate the day and time of day but the units of measurement are really of no importance.

Re: Code Dendrochronology

2008-10-06 10:22 • by Edward Royce (unregistered)
221245 in reply to 221238
Bernard:
I come from the UK - we like to use imperial for milk, beer and speed limits. Everything else is metric. Not sure how we ended up like this...


Because those are the important bits.

Re: Code Dendrochronology

2008-10-06 10:23 • by A. Cube (unregistered)
221246 in reply to 221220

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


The French tried a decimal time system--it didn't catch on.

Re: Code Dendrochronology

2008-10-06 10:25 • by Stewie (unregistered)
221247 in reply to 221236
nobis:

What's this obsession with 10s? Hexi is sexy! 256 hours in a day, 16 minutes in an hour, 16 seconds in a minute.


Errr... if we used hex it would still be 100 hours in a day, 10 minutes in an hour and 10 seconds in a minute (as long as you used both base 16 time and base 16 numbering).

Re: Code Dendrochronology

2008-10-06 10:25 • by guessed (unregistered)
221248 in reply to 221237
durnurd:
There is an unfortunate inability to change the number of days it takes for a planet to revolve around its star, and this leads to some people's unnecessary hacks in the calendar to make everything fit. What we really need is either:

a) a planet that revolves around its star in a power of 10 days


Just as I suspected -- it's a hardware issue.

Re: Code Dendrochronology

2008-10-06 10:26 • by Ossi (unregistered)
221249 in reply to 221241
Charles400:
I am a star. My co-workers revolve around me. Redefine the year!


Reminds me of the former German chancellor Helmut Kohl, who apparently got so fat he had two smaller chancellors orbiting him. Or so they say...

Captcha: usitas, the usual...

Re: Code Dendrochronology

2008-10-06 10:28 • by Lars Vargas
221250 in reply to 221238
Bernard:
I come from the UK - we like to use imperial for milk, beer and speed limits. Everything else is metric. Not sure how we ended up like this...
To make drinking and driving easier to compute?

Although that still doesn't explain the milk. Perhaps the metric system in England is simply lactose intolerant.

Re: Code Dendrochronology

2008-10-06 10:29 • by JR (unregistered)
Most of this conversation is irrelevant - once they introduce the metric calendar in 2020 it's all going to change. 20 hour days and 10 day weeks, with a totally different definition for the 'metric hour' and 'metric second'. It's going to be a nightmare, I'm truly dreading it.

Re: Code Dendrochronology

2008-10-06 10:29 • by ParkinT
What? No XML ?!!!

Re: Code Dendrochronology

2008-10-06 10:31 • by 50% Opacity (unregistered)
221254 in reply to 221251
JR:
20 hour days and 10 day weeks.


If they keep the 40 hour work week I'm all for it.

Re: Code Dendrochronology

2008-10-06 10:33 • by Not Wtf (unregistered)
221255 in reply to 221233
TopCod3r Fan Boy:

Oh TopCod3r, where art thou?


I also heard TopCod3r got banned. If you go back and look at some previous articles it seems like all of his comments got deleted. It is almost like he never existed now.

Why? I didn't think there was anything wrong with them, and have seen much, much worse comments on here, including some that have made it difficult for me to be able to read at work (due to language or offensive remarks). It seems the only moderation being done is to make sure someone else isn't TOO funny as to upstage Alex.

Re: Code Dendrochronology

2008-10-06 10:33 • by Mike D. (unregistered)
221256 in reply to 221232
Addison:
Last time I checked well over 5.5 billion people used metric. I hope you like being in a club where you're the only member. Well, other then Burma and Liberia. But they don't count.

It wouldn't be the first time. I used Linux back in the mid-90's.

Addison:
Once we colonize other planets there will develop a metric-style time system.

Already have it. It's simply the number of seconds since midnight, January 1, 1970.

The trick is going to be working out a simpler means of compensating for time dilation. Because, you know, traveling fast underclocks your computer... and you, as well.

Re: Code Dendrochronology

2008-10-06 10:34 • by Another TopCod3r fan (unregistered)
221257 in reply to 221234
Ebs2002:
I hear that topcoder's account was banned...


What? Why? I have started reading the comment threads almost exclusively these days to see TopCod3r's response!

Re: Code Dendrochronology

2008-10-06 10:42 • by TopCod3r Fan Boy (unregistered)
221258 in reply to 221255
Not Wtf:

I also heard TopCod3r got banned. If you go back and look at some previous articles it seems like all of his comments got deleted. It is almost like he never existed now.


TopCod3r post doubleplusungood refs unperson.
unbellyfill dwtf too luaghwise.
rewrite fullwise upsub anteposting.

Re: Code Dendrochronology

2008-10-06 10:47 • by snoofle
221259 in reply to 221237
durnurd:
What we really need is ... a planet that revolves around its star in a power of 10 days


Take all the rocket engines on Earth, put them on one side of the planet (the "back" to speed up, the "front" to slow down) and fire them up (compensating for rotation) long enough to speed up [slow down] the planet until a year is a power of ten days long.

Man prevails over nature and alters his environment.

Problem solved.

Re: Code Dendrochronology

2008-10-06 10:55 • by Crabs (unregistered)
221260 in reply to 221238
Bernard:
I come from the UK - we like to use imperial for milk, beer and speed limits. Everything else is metric. Not sure how we ended up like this...


Well, because a pint is the perfect amount of beer to be served in one glass.

Re: Code Dendrochronology

2008-10-06 11:01 • by JimM
221261 in reply to 221216
Fair warning:
If you haven't been around much:

When TopCod3r posts (and he *will* post) about how he used to require his team to code in such and such a manner, ignore it. He's trolling, and if you respond you will be mocked by all the kids here who are way cooler than you will ever be.

TopCod3r? Is that you? ;^)

Re: Code Dendrochronology

2008-10-06 11:01 • by vt_mruhlin
221262 in reply to 221232
Addison:
akatherder:
tdb:

If we designed a new system of measures for time with no legacy support, we'd probably end up with day divided into 100 thousand units (10/100/100) and possibly a week of 5 or 10 days.


Maybe if you're one of the few who use metric system. Here in the US we like our measurements (whether they be time, length, or mass) to be intuitive. 12 inches = 1 foot, 3 feet = 1 yard, 1760 yards = 1 mile.


*shivers*- if you weren't being sarcastic I would be very frightened.

Last time I checked well over 5.5 billion people used metric. I hope you like being in a club where you're the only member. Well, other then Burma and Liberia. But they don't count.

Once we colonize other planets there will develop a metric-style time system.


The whole reason there are 60 minutes in an hour, 24 hours in a day, 12 inches in a foot, etc is that the aliens who originally colonized earth had 6 fingers on each hand.

Re: Code Dendrochronology

2008-10-06 11:02 • by Biggles (unregistered)
221263 in reply to 221238
Bernard:
I come from the UK - we like to use imperial for milk, beer and speed limits. Everything else is metric. Not sure how we ended up like this...


O RLY?

My milk comes in 500 ml cartons, which is lessthan a pint. Sure, they charge me as if it's a pint, but it's not really.

Re: Code Dendrochronology

2008-10-06 11:03 • by JimM
221265 in reply to 221262
vt_mruhlin:
The whole reason there are 60 minutes in an hour, 24 hours in a day, 12 inches in a foot, etc is that the aliens who originally colonized earth had 6 fingers on each hand.
Amen. After all, digital just means "Can be counted on ones fingers"... ;^)

Re: Code Dendrochronology

2008-10-06 11:06 • by JimM
I'd make a snarky comment about this, but only last Friday I found myself putting the following comments in one of my code files:

/*
* old agency listing code starts here ----
* this is why I need to implement proper source control!!!

<snip>

* end of removed agency code. If only I had source control I could've
* just deleted all that and saved myself this huge inline comment...
*/

Yes, metaWTFs in my own code. I am rightly ashamed...

Re: Code Dendrochronology

2008-10-06 11:09 • by Justice
Metric division of the day isn't so hard, as long as you keep a day defined as the length of one rotation of the planet on its axis. In fact, you could design a near-perfect calendar under a metric scheme. Dividing a year into days will almost always require minor hacks (see: leap year).

The only problem with colonizing a planet with a longer (or shorter) day is an evolutionary one; assuming a sleep cycle of 16 Earth hours awake, 8 Earth hours asleep, the first settlers will be dealing with the mother of all jet lag.

This discussion reminds me of an old Doctor Who (Tom Baker years) which featured a planet with winters that were roughly 16 earth years (I may be off on the actual number). If humanity ever colonizes such a place, I hope they can recruit plenty of astronauts from upstate New York.
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Add Comment