Go Back   Zune Boards > News and Website Related > Zune News

Zune News All Zune news.

Closed Thread
 
LinkBack (620) Thread Tools
Old 01-06-2009, 02:26 PM   #81 (permalink)
"Dear Agony"Out Sept 29th
Senior Writer
Support Team
GFX Crew
Global Moderator
Ultimate Zuner
 
Charge's Avatar
 
Join Date: Aug 2007
Location: England
Posts: 6,369
Charge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant future
Default

What is the problem, maybe we can help





Charge is offline  

Advertisement [Remove Advertisement]
Old 01-06-2009, 07:27 PM   #82 (permalink)
Zewbie
 
Join Date: Dec 2008
Posts: 5
ghst is on a distinguished road
Default

hmm i don't know if i'll even have my zune 30 in four years




ghst is offline  
Old 01-08-2009, 01:03 PM   #83 (permalink)
Zuner
 
Join Date: Jun 2008
Posts: 96
MercifulBoss is on a distinguished road
Default

Quote:
Originally Posted by twhoffman View Post
That would prevent the infinite loop, but would introduce a new bug where it advances the year on the last day of a leap year. It would have thought today was December 31, 2009. That's better than locking up, but it also would mean that all time-limited DRM media would stop working. So, if you have a Zune Pass, none of your songs would play.

What's needed is a break within an else like this (I hope, my C's a little rusty, and was never that good to begin with):

Code:
year = ORIGINYEAR; /* = 1980 */

while (days > 365)
{
    if (IsLeapYear(year))
    {
        if (days > 366)
        {
            days -= 366;
            year += 1;
        }
        else
        {
            break;
        }
    }
    else
    {
        days -= 365;
        year += 1;
    }
}
Why would doing "days >= 366" advance forward a year? Wouldn't it simply say that if days = 366 or greater than 366 then do the below code?



MercifulBoss is offline  
Old 01-09-2009, 11:01 AM   #84 (permalink)
Zewbie
 
Join Date: Dec 2008
Posts: 6
twhoffman is on a distinguished road
Default

Quote:
Originally Posted by MercifulBoss View Post
Why would doing "days >= 366" advance forward a year? Wouldn't it simply say that if days = 366 or greater than 366 then do the below code?
You're correct. If days == 366 or days > 366, it would execute the code. That code includes advancing the year:

Code:
  days -= 366;
  year += 1;
Here's what would happen. On December 31, 2008, days == 366 and year == 2008, with the original code, it would enter the loop because days > 365, but never execute the leap year code because it expects days > 366. If you change that to days >=366, it will execute the code, which is subtract 366 from days, making it 0, and add 1 to year, making it 2009.

What you're left with is day 0, 2009. Besides the year being off, you also wind up with an invalid day, since day == 1 on January 1. Day 0 would be a day that doesn't exist. That code wouldn't cause an infinite loop, but it would think it was January 0, 2009. I'm not sure what kind of bugs that would introduce, but at the very least, the year will be 2009.

I might be wrong. As I said, my C is rusty, but I'm pretty sure that's what will happen.



twhoffman is offline  
Old 01-09-2009, 05:31 PM   #85 (permalink)
Purger of Ignorance
zB Programmer
Retired Staff
Expert Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 2,804
Netrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to allNetrix is a name known to all
Send a message via MSN to Netrix
Default

Quote:
Originally Posted by twhoffman View Post
I'm not sure what kind of bugs that would introduce, but at the very least, the year will be 2009.
If that is the only problem, it would be rather easy to add a check to make sure that there is no day "0". If there is, they could simply add one to the number of days, fixing that problem.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune! http://www.zuneboards.com/forums/dow...ne-v2-0-a.html

Zune Book Reader! http://www.zuneboards.com/forums/app...ew-thread.html




Netrix is offline  
Old 01-10-2009, 05:39 PM   #86 (permalink)
Jr. Zuner
 
sono2351's Avatar
 
Join Date: Jan 2008
Location: Belleville, IL
Posts: 36
sono2351 is on a distinguished road
Send a message via AIM to sono2351 Send a message via Yahoo to sono2351
Default

just another reason why leap year babies are ruining the world...
__________________

"The problem with everywhere is that it's full of people." ~me




sono2351 is offline  
Old 01-13-2009, 10:41 AM   #87 (permalink)
Squirt
 
switchblade5984's Avatar
 
Join Date: Jun 2007
Posts: 19
switchblade5984 is on a distinguished road
Default

mine still doesnt work... funny, the 30 thats not working is my wife's pink one too
__________________
Do NOT open your 30gb zune to Disconnect the battery... it will reboot and go back to the loading screen

Last edited by switchblade5984; 01-13-2009 at 10:44 AM.



switchblade5984 is offline  
Old 01-14-2009, 01:33 AM   #88 (permalink)
"Dear Agony"Out Sept 29th
Senior Writer
Support Team
GFX Crew
Global Moderator
Ultimate Zuner
 
Charge's Avatar
 
Join Date: Aug 2007
Location: England
Posts: 6,369
Charge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant futureCharge has a brilliant future
Default

Thats probably cuz you opened them. Am i correct?





Charge is offline  
Closed Thread

Bookmarks

Thread Tools