It’s almost weekend, and time for a lighthearted post on the two realtime 3D computer graphics libraries that are available on Windows in 2011: OpenGL and Direct3D. The reason I mention the year is simply because of the fact that two years from now, this information will be as untrue as the Wikipedia article* on this matter due to rapid hardware and software developments. But for now, let’s bash it out.
Read the rest of this entry »
You’ve heard of Intel’s recent “Cougar Point” chipset screwup causing all motherboards for Sandy Bridge-based Core i7 processors to be pulled from the market until next month when new parts will appear. We’ve also all read the reviews that show the new i7 processors to be very fast and beating AMD’s current lineup in terms of performance. So where does AMD stand?
Well, AMD still has a nice selection of processors in the $100 – $150 range, but they can’t compete with the higher performing Intel processors priced higher. At that $150+ point it just makes more sense to load up your new rig with an i5-2400 or an i7-2600K if you have the cash.
But since you can’t purchase a Sandy Bridge based machine at the moment, doesn’t that leave a market gap for AMD to fill up? Oh, and isn’t it tax return season in the USA? Well, yes to both questions.
People can’t wait to splurge their tax return money on stuff, and many will spend it on a new computer. If you’ve filed your taxes in January or early this month, you should be getting that money pretty soon, and not in time for Sandy Bridge to return if Intel’s statements are correct.
In this spirit, AMD launched its “Ready. Willing. And Stable” ad campaign to take away Intel’s customers. But if you really think about it, why on earth would you buy an old AMD processor when: 1.) Sandy Bridge will be back soon if you can just keep that burning cash in your pocket for a little bit longer, 2.) the current AMD lineup is less than impressive when it comes to performance, and 3.) AMD is poised to release its new “Bulldozer” processor later this year?
I see no reason whatsoever. Bulldozer based chips will be able to compete with Sandy Bridge if we’re to believe AMD’s preliminary reports of a 50% performance increase over Core i7 950, so AMD should put its focus on that instead of launching a FUD campaign.
So, come on AMD, show us what you’re made of. Show us the AMD of the late 1990s and early 2000s that delivered competing products at a lower cost point, not this finger-pointing toothless shell of past achievements.
My dearest VB.NET programmers (and C# programmers up to a point), I once again have to inform you of one of my pet peeves. This is pretty much a follow-up to one of my previous posts, but more than two years after, I still work in projects from various online sources as well as professionally that are littered with the warnings about undefined variables:
warning BC42104: Variable 'X' is used before it has been assigned a value. A null reference exception could result at runtime.
At runtime, these warnings usually translate into the dreaded NullReferenceException:
NullReferenceException was unhandled, Object Reference not set to an instance of an object.
So, what causes this and how can can we fix this? Let’s take a look at a piece of code that demonstrates something incredibly common, especially in VB circles:
Dim MyString As String
If ThisAndThat Then
MyString = "Some Value"
End If
...
SomeFunction(MyString)
If the boolean ThisAndThat evaluates to False, MyString will never be defined, and a NullReferenceException will arise when the SomeFunction function tries to do anything with MyString. Remember that The System.String class does not have a default constructor, so no constructor is implicitly called. MyString is NOT String.Empty, but NULL.
To fix this, all you need is an Else statement in your code and some default value that you’d like to assign to MyString:
Dim MyString As String
If ThisAndThat Then
MyString = "Some Value"
Else
MyString = String.Empty
End If
...
SomeFunction(MyString)
in fact, the best way to handle default values is to define the variable upon declaration:
Dim MyString As String = String.Empty
If ThisAndThat Then
MyString = "Some Value"
End If
...
SomeFunction(MyString)
Or you could even eliminate the If statement entirely by using the IIf function:
Dim MyString As String = IIf(ThisAndThat, "Some Value", String.Empty).ToString() ... SomeFunction(MyString)
And even though I’m using the class System.String as an example, this should be applicable to any variable of any data type. It’s a good practice and will eliminate many of those pesky runtime errors that can be difficult to trace.
Scriptionary 