Countdown to upcoming seasons

Give us your thoughts on bobcatnation.com and look here for announcements from the staff.

Moderators: rtb, kmax, SonomaCat

WYCAT
Member # Retired
Posts: 2828
Joined: Sat Sep 18, 2004 5:19 pm
Location: Wyoming
Contact:

Post by WYCAT » Wed May 18, 2005 1:24 pm

HelenaCat95 wrote:kmax,
the msu athletics site has a countdown clock up from now until the first home game (Stephen F Austin) on Sept 10 - the clock says there is 104 days left - which is different than the clock here.
It doesn't take much, but I'm confused :?
Which one is right?

http://www.msubobcats.com/



I must say, that I am glad to see both clocks.
Keep up the great work on the site.
The one Kmax put up is correct. I am not surprised the other one is off. The roster is about 1/2 correct right now as well.



User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Wed May 18, 2005 3:09 pm

HelenaCat95 wrote:kmax,
the msu athletics site has a countdown clock up from now until the first home game (Stephen F Austin) on Sept 10 - the clock says there is 104 days left - which is different than the clock here.
It doesn't take much, but I'm confused :?
Which one is right?

http://www.msubobcats.com/



I must say, that I am glad to see both clocks.
Keep up the great work on the site.
Let's see here:
13 -- days left in May
+ 30 -- days in June
+ 31 -- days in July
+ 31 -- days in August
+ 3 -- days in September(or 10 if going to first home game)
--------------------------------------------------------------------------------------------
108 -- days till first game(or 115 if going to first home game)

Note that as of this writing it is actually 107 days and 20+ hours since we are already past my assumed start time of 1:00 pm. In other words, their timer should actually show 114 days and some change, so you guessed it, their logic is screwed up for how it determines the tens digit of the days. Translation, the CS student that coded their timer gets an F for not testing it first. :wink:

Okay, just cause I'm a computer geek, here's what's wrong with their countdown and how the Athletic dept. can fix their script. For anyone not interested in programming you can quit reading now.

Below is a section of the code that displays the day numbers for their countdown:

Code: Select all

function displayNumber(number)
			{
				if (number == 0) 			return c0.src;
				else if (number == 1) return c1.src;
				else if (number == 2) return c2.src;
				else if (number == 3) return c3.src;
				else if (number == 4) return c4.src;
				else if (number == 5) return c5.src;
				else if (number == 6) return c6.src;
				else if (number == 7) return c7.src;
				else if (number == 8) return c8.src;
				else if (number == 9) return c9.src;
				return c0.src;
			}
			
			document.images.days100.src = displayNumber(Math.floor(daysRemain/100));
			document.images.days10.src = displayNumber(Math.floor(daysRemain/10));
			document.images.days1.src  = displayNumber(daysRemain%10);
The problem is in this line:

Code: Select all

document.images.days10.src = displayNumber(Math.floor(daysRemain/10));
This would work fine when there are less than 100 days left, however when you have 114 days left, floor(114/10 ) gives you 11. Now look at the displayNumber function and notice that we have if statements to set the digit if the number is 0-9, but if it is any other number just display 0, so while there are more than 100 days left the tens digit of their countdown will be off. And actually, just due to luck, it will be correct as soon as it gets below 110 days remaining just because floor(109/10) will be 10 which while still incorrect will appropriately show a 0 due to the default case built into the displayNumber function.

So the Athletic department can just leave their countdown incorrect for 5 more days and then it will magically fix itself and bump back to the correct 109 days left(it'll be kinda like the end of daylight savings time :wink: ) or they can change the line I listed above to read as follows:

Code: Select all

document.images.days10.src = displayNumber(Math.floor((daysRemain-(Math.floor(daysRemain/100) * 100))/10));
Or something similar that takes into account that the number of days could be over 100.

Okay, end of geek lesson. Image

**Disclaimer: I by no means intend this to imply that there is nothing wrong with the stuff I code, just that nobody has found it yet.


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

User avatar
HelenaCat95
Golden Bobcat
Posts: 6968
Joined: Mon Mar 29, 2004 1:13 pm
Location: Helena, Montana

Post by HelenaCat95 » Wed May 18, 2005 3:25 pm

kmax,

you had me at hello.



User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Wed May 18, 2005 3:27 pm

HelenaCat95 wrote:kmax,

you had me at hello.
Yeah, I'm waiting for mslacat to amend his "which are bigger nerds" poll to include computer geeks. :oops:


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

User avatar
HelenaCat95
Golden Bobcat
Posts: 6968
Joined: Mon Mar 29, 2004 1:13 pm
Location: Helena, Montana

Post by HelenaCat95 » Fri May 20, 2005 9:14 am

The msubobcats.com countdown clock has been corrected.



User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Fri May 20, 2005 9:35 am

HelenaCat95 wrote:The msubobcats.com countdown clock has been corrected.
Yeah, I noticed that, though in fairness I will say that their solution was much more succinct and efficient than mine was.


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

Robcat
Honorable Mention All-BobcatNation
Posts: 887
Joined: Wed Mar 31, 2004 12:07 pm
Location: Billings

Post by Robcat » Fri May 20, 2005 9:53 am

Wow, I cannot belive I read this whole post. Makes me glad I am still on a County Road. Ouch, my head hurts.



User avatar
mquast53000
2nd Team All-BobcatNation
Posts: 1233
Joined: Wed Feb 16, 2005 4:45 pm
Location: Billings

Post by mquast53000 » Fri May 20, 2005 10:00 am

Robcat wrote:Wow, I cannot belive I read this whole post. Makes me glad I am still on a County Road. Ouch, my head hurts.

I can’t believe I have been following it, and waiting in great anticipation of the next post (yours was kind of weak).


FTG

User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Fri May 20, 2005 10:12 am

mquast53000 wrote:
Robcat wrote:Wow, I cannot belive I read this whole post. Makes me glad I am still on a County Road. Ouch, my head hurts.

I can’t believe I have been following it, and waiting in great anticipation of the next post (yours was kind of weak).
Ahh, the offseason. You know I hear the WNBA is starting up in a couple weeks, things oughta pick up around here then.


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

User avatar
HelenaCat95
Golden Bobcat
Posts: 6968
Joined: Mon Mar 29, 2004 1:13 pm
Location: Helena, Montana

Post by HelenaCat95 » Fri May 20, 2005 10:16 am

I actually found myself watching the last half of some Major League Soccer game on ESPN2 the other day.


i need a hobby. :oops:



Cat Grad
Golden Bobcat
Posts: 7463
Joined: Mon Dec 13, 2004 11:05 am

Post by Cat Grad » Fri May 20, 2005 10:38 am

Hummmm...some of us need some kind of football fix FAST!!!! I think I'm going to spend part of my summer vacation away from the beaches in Florida and work a summer football camp or two :lol: :lol: :lol: :lol: We lost a great kid and coach from northeast Montana to Gwinnett County in Georgia so his last day here on June 3d means he'll be at camps and combines in less than a month and issuing equipment the third week of July 8) Can't stand all this down time and it's getting pretty bad when I go to a thread and look at everybody else starved for football and all I gotta do is go back where they live the game 365 days a year...



Cat Grad
Golden Bobcat
Posts: 7463
Joined: Mon Dec 13, 2004 11:05 am

Post by Cat Grad » Fri May 20, 2005 11:07 am

...it's even gotten so bad that I've gone over to the fizzle site and watched them fight with each other...



User avatar
mquast53000
2nd Team All-BobcatNation
Posts: 1233
Joined: Wed Feb 16, 2005 4:45 pm
Location: Billings

Post by mquast53000 » Fri May 20, 2005 12:45 pm

I go over there and fuel some of the fights… Gives me something to fill the void…


FTG

Cat Grad
Golden Bobcat
Posts: 7463
Joined: Mon Dec 13, 2004 11:05 am

Post by Cat Grad » Fri May 20, 2005 12:52 pm

I don't want to get into it with them, but it's tempting to point out their colors look a little pink this year :wink:



User avatar
mquast53000
2nd Team All-BobcatNation
Posts: 1233
Joined: Wed Feb 16, 2005 4:45 pm
Location: Billings

Post by mquast53000 » Wed May 25, 2005 4:56 pm

How the hell are we still over a 100 days away from the 2005 season! Is there something wrong with this count down clock?


FTG

User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Wed May 25, 2005 5:06 pm

mquast53000 wrote:How the hell are we still over a 100 days away from the 2005 season! Is there something wrong with this count down clock?
Yeah, must be broken. Check back tomorrow a little after noon, should be fixed then.


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

User avatar
GOKATS
Golden Bobcat
Posts: 9271
Joined: Wed Apr 27, 2005 4:33 pm
Location: Bozeman

Post by GOKATS » Wed May 25, 2005 5:31 pm

Counting the days on the calendar it looks ok to me. Maybe I'm missing something.


FTG!!
[quote="GrizinWashington"]The Griz suck.
[quote=" tampa_griz"] (because China isn't a part of "Asia") .....

Image
Image

User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Wed May 25, 2005 7:23 pm

GOKATS wrote: Maybe I'm missing something.
Yep, sarcasm. :wink:


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

User avatar
kmax
Site Admin
Posts: 9780
Joined: Sat Mar 06, 2004 6:23 pm
Location: Belgrade, MT
Contact:

Post by kmax » Thu May 26, 2005 12:01 pm

mquast53000 wrote:How the hell are we still over a 100 days away from the 2005 season! Is there something wrong with this count down clock?
See, told ya. It's fixed now. 8)


“Arguing with anonymous strangers on the Internet is a sucker's game because they almost always turn out to be—or to be indistinguishable from—self-righteous sixteen-year-olds possessing infinite amounts of free time.” -- Neal Stephenson, Cryptonomicon

User avatar
mquast53000
2nd Team All-BobcatNation
Posts: 1233
Joined: Wed Feb 16, 2005 4:45 pm
Location: Billings

Post by mquast53000 » Thu May 26, 2005 1:10 pm

I feel a lot better now! Breaking that 100 was a huge barrier for me…





Boy is sure seems like we have been stuck in the nineties for a longtime now…


FTG

Post Reply