Just to satisfy your curiosity, you can see the source code of the guidance computer from the lunar module 40 years ago.
-
Archives
Date: -
Ads
Just to satisfy your curiosity, you can see the source code of the guidance computer from the lunar module 40 years ago.
Someone on Zuneboards has found the actual snippet of code that’s causing the recent Zune crashes:
year = ORIGINYEAR; /* = 1980 */
while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}
The Zune stores the current date by keeping a track of the number of days since ‘ORIGINYEAR’. The loop works out the current year by subtracting 365 or 366 from the days counter and adding one to ORIGINYEAR.
The problem is with the conditional if (days > 366), which means if the current year is a leap year, the loop will never finish as days is always 366 and will never be subtracted. What it’s meant to do is if (days >= 366), although with the conditional above of if (IsLeapYear(year)) it’s not necessary at all.
This means that unless Microsoft fix this bug, it will recur at the last day of every leap year.
If you’re getting this error with Twitterlicious:
System.Net.WebException: The remote server returned an error: (417) Expectation Failed.
You are experiencing a new regression bug with the Twitter API has affected all .NET Twitter clients, including Twitterlicious.
Twitterlicious seems to be less affected than other clients: it can still get your main timeline but you can’t update your status. The stated workaround doesn’t work, so for now all .NET Twitter applications won’t work with the Twitter API.
It’s awfully nice of Twitter to make this breaking change to their API during the holiday season, and even though they know about this bug, they haven’t rolled back the changes they made. All sane .NET developers will use the HttpWebRequest class to query the API, rather than reinventing the wheel themselves. But as far as I can see, the only way to work around this is to extend the HttpWebRequest class yourself to modify the headers it sends, or handle the entire thing yourself.
This change should never have been made to the API in the first place. Whatever is the correct behaviour according to HTTP specification, whatever Twitter adopted in the first place, they should keep. APIs are supposed to be very stable, you can add new features to APIs, but the existing functions should be kept the same. Twitter’s casual attitude to their API not only shows a lack of respect for developers using their API, but also a lack of experience or expertise in the design and implementation of their entire platform.
I will continue to update Twitterlicious 2 for the foreseeable future, but I may have to re-evaluate the amount of time I’m going to spend on the next major revision.
Today Microsoft released Visual Studio 2008 and .NET 3.5. My personal favourites are the new language features for C#; automatic properties, extension methods, lambda expressions and anonymous types.
Microsoft is promoting F# to be a fully supported programming language in Visual Studio.
F# offers developers many valuable and compelling features without sacrificing much runtime efficiency. F# supports type inference, pattern matching, high-order functions, and currying. F# also supports interactive execution, which means that F# programs can be run like scripts or inputted in an interactive top-level environment similar to the Python shell or Ruby’s IRB. F# also has full access to the .NET APIs and components written in other .NET languages.
Its a good day to be a .NET developer.
A handy tip I just discovered, if you want to convert a String into an Enum type in C#, you can call:
object Enum.Parse(System.Type enumType, string value, bool ignoreCase);You can then cast this into the required type, and it will save you from creating huge switch statements instead.
The following function is not a great way to test for fake names.
if (name.Has("fake"))
{
return false;
}
Shell Blog has the lowdown on how to incorporate new Vista UI designs into your own applications, with the slow death of the menu bar, and the rise of the command module.
One of the first things people notice when they start using Vista is the absence of menu bars. Explorer, photo gallery, media player, and IE all don’t show menus by default and just use the so-called “command module.â€? What is up with that? Do we hate menu bars? And more importantly — what is the guidance that third-party developers are supposed to follow?
RubyCLR is ruby for the .NET framework. You can now create full .NET applications with ruby.
I think it’ll take a lot for me to give up on C# with .NET, but you just have to love ruby.
Dave Thomas gives an interesting answer to what he thinks makes a good programmer:
I have seen a strong correlation between people who have some music in their background and programming skills. I have no idea why, but I suspect that some of the areas of the brain that make someone musical also make them good at software development. #
Everyone knows about HTML, it’s possibly the most popular language on the internet. Its utterly ubiquitous in its domination of web based documents, for some very good reasons too. However, if you haven’t heard already, I’m afraid to inform you that it’s dead. And you know what? I’m glad it is! HTML was flawed from its beginnings in CERN where it was still just a twinkle in Tim Berners-Lee’s eyes.
Recently, I’ve been seeing that a lot of blogs I read (notably, Binary Bonsai and Ordered List), have start to use their own radical designs, that break away from tradition.