January 5th, 2009
On Windows 7,
So we decided to ship the Windows 7 code as Windows 6.1 - which is what you will see in the actual version of the product in cmd.exe or computer properties.
Really now, is incrementing the major version number such a big deal?
We learned a lot about using 5.1 for XP and how that helped developers with version checking for API compatibility. We also had the lesson reinforced when we applied the version number in the Windows Vista code as Windows 6.0– that changing basic version numbers can cause application compatibility issues.
Let’s see here, the lesson is to avoid incrementing the major version number as it will help developers with version checking for API compatibility. So, it’s not the API changes that cause the compatibility issues, it’s changing the major version number. By this logic, if an API change is made in Windows 7 and I need to check the version number of the system to see how to make the call, it’s easier to check the version number if it’s 6.1 as opposed to 7.0 because the 6 was the major version number for Vista and … I’m going to stop, this makes no sense whatsoever.
Maybe I’m not being fair. Maybe it’s difficult for developers to programmatically check the version number. I’ve never done it, so I investigated a bit, and here’s how it’s done:
dwVersion = GetVersion();
// Get the Windows version.
dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
Well, that doesn’t seem difficult.
So why the mismatch between the name and the internal version number? My guess is a grand battle erupted across the cubicles and offices of Microsoft between those wanting the set the version number at 6.1 to represent the internal changes to the operating system and those wanting to set the version number at 7.0 to represent the seventh major release. In the end a truce was reached, where the release was named “Windows 7″ and the internal version number was set at 6.1. Illogical and stupid, but it was the price that had to be payed to end the carnage.
Tags: version number, windows 6.1, windows 7
Posted in Random | No Comments »
December 30th, 2008
Below is an email response to my aunt sometime in July, when Cuil was launched,
Yea, I read about cuil this morning. I played around with it a bit and they’re getting quite a bit of press due to the founders past employment w/ Google and their claim that they’ve indexed more pages than google. However, it’s a pretty poor launch: shoddy search results, mismatch between sites and images, useless results “summaries” and terrible performance…
I never bothered with Cuil again until I read this a few days ago,
Cuil isn’t performing well any way you look at it, and I can only imagine how nervous the startup’s management team and investors must be by now. Based on the numbers and graphs we gather from Google Trends, Alexa, Compete and Quantcast, you could even say search engine traffic is nearing rock bottom.
I decided to give Cuil another try to see if anything had changed since my first analysis. Unfortunately, I still encountered the same frustrations; here’s the first result in a search for “fallout 2″,
I think that’s Evander Holyfield in the associated image and, as far as I remember, he was not in Fallout 2.
Attempting to compete with good-to-better search results than google would have put Cuil in a steep uphill climb for success, but such poor results and mis-associations point to flaws in the technical architecture of the service itself. Not to mention simple usability flaws; results in a multi-column layout is a dumb idea - it’s completely alien from the way people actually read (well, read English, at least) - I’m supposed to read top to bottom, scrolling down… then scroll back up to continue?!
What’s amazing in all of this is that Cuil’s founders are apparently experts at search and managed to raise $33 million in funding! … and what’s even more amazing is that they were ranked as one of the most successful U.S. startups by Business Week. Business Week’s explanation for this apparent oddity is as follows,
Cuil raised $33.25 million in that period, and whatever you think of the company or their product, the amount raised indicates that investors judged them worthy of significant backing, as some TechCrunch commenters noted. Obviously, that’s different from them getting traction or becoming profitable. But they made the list under the criteria we used, which we made clear from the start.
I guess you have to buy into the idea that funding = success.
Tags: cuil, search engine, startup
Posted in Random | No Comments »
December 26th, 2008
Great graphic from washingtonpost.com,
Tags: voting
Posted in Random | No Comments »
December 22nd, 2008
John Hodgman has a great write up on the situation.
Somehow I got to thinking about this issue and Babylon 5; I saw the end of season 2, the episode “The Fall of Night” a few weeks ago, which ends as follows,
We came to this place because Babylon 5 was our last, best hope for peace. By the end of 2259, we knew that it had failed. But in so doing, it became something greater, as the war expanded, it became our last, best hope for victory because sometimes peace is another word for surrender…
I truly don’t know if Obama and Warren share beliefs here. There are no facts or deeds to show he supports gay marriage, but there is that gut feeling (hope?) that he truly does believe every homosexual individual should be have the same rights as every heterosexual individual. If this assumption is indeed true, Warren being tapped to speak at Obama’s inauguration is likely a matter of bringing peace to a, still, very politically and ideologically divided nation and Warren is a powerful mechanism is that effort. It’s a noble ideal to bring together people with different views and backgrounds, but when the faith and/or opinions of certain groups explicitly call for the suppressing the rights of others groups that are not like them, the nobility is quickly lost. Gay marriage is the issue of the day, but we’ve seen this before and we’ll see this again in the future. This isn’t true peace, this is keeping the peace. And in these instances, when we talk about coming together and putting aside our differences, what we’re really talking about it surrendering our freedoms and abandoning our liberties.
Tags: gay marriage, obama, rick warren
Posted in Random | No Comments »
December 19th, 2008
So, a little story. I was working on some code that periodically spawns off a child process to do its thing, then read the results in the output stream from the parent process. Now, this periodic spawning was being done asynchronously in the parent process via. a thread. All was well and good, but there was also another thread in the parent process which created a file with a temporary name, downloaded and wrote a bunch of bytes into it, then renamed the file to a proper name. Unfortunately, I began to notice that the rename operation was failing as the parent process couldn’t get access rights to the file that needed to be renamed due to a sharing violation. I checked, double checked, and triple checked that I was closing the file, and everything looked perfect. After a bit of headbanging, I figured I should probably check to verify that another process is not holding the file handle. I then ran a wonderful utility called Handle to see exactly what processes had the file handle and, to my surprise, it was a child process that was spawned. Now, this was weird as hell as the child process did nothing with this file or directory or any file i/o whatsoever. After a bit more headbanging, I made the unpleasant discovery of child process inheritance. This forum thread, discussing a similar issue with a .NET’s TcpListener, actually pointed me to the issue.
Now most of this was in C#. One tricky aspect of this issue is that the file i/o mentioned was done in a bit of native code using fopen/fclose. I never encountered the issue with similar code using a C# FileStream. My assumption is that the file handles from the C# functions were explicitly not inheritable, while those created by fopen were. The underlying Win32 CreateFile API function does provide for this feature, but it’s not exposed via. fopen.
If this parameter is NULL, the handle returned by CreateFile cannot be inherited by any child processes the application may create and the file or device associated with the returned handle gets a default security descriptor.
CreateFile ignores the lpSecurityDescriptor member when opening an existing file or device, but continues to use the bInheritHandle member.
The bInheritHandle member of the structure specifies whether the returned handle can be inherited.
Now it was time for the really tricky part, fixing this. I didn’t want to change the native code (which in retrospect may have been an appropriate course of action and much easier to do), so instead I tried to see if I could prevent the process from inheriting the handle. The Win32 CreateProcess function has a bInheritHandles argument that can be set to false to prevent child processes from inheriting handles. Unfortunately, I was using the C# Process class and it provides no means to set such a flag. I eventually P/Invoked the CreateProcess function (this blog entry helped a great deal), but faced disappointment as I discovered that I can’t redirect standard output from the child process without bInheritHandles being set to true. I eventually altered the child process’ code to write its output to a file (which was actually better behavior for the app) and finally closed the door on this issue.
Tags: .net, bInheritHandles, child process, CreateFile, CreateProcess, inheritance, process
Posted in Win32 Platform | No Comments »
December 17th, 2008
As hinted in my previous post I’m working on some bluetooth stuff. Specifically, I’m working with the OBEX-based File Transfer Profile. I’ve been utilizing my cell phone for all testing and cell phones are the likely target for this functionality in the product I’m working on (more on that in a later post). Having played around the the technology for a few months and written a library for file I/O on top of Windows’ sockets functionality, I have a fairly positive impression of the technology. As with all wireless tech, it’s great not having to deal with cables (especially vendor-specific ones), but more-so it provides a nice bedrock for device-to-device communication, which is something that’s not quite trivial with Wi-Fi.
With my love of bluetooth, it’s become quite perplexing to see such a dearth of devices that actually support it. I’m not referring to cell phones or headsets for cell phones, but other devices such as digital cameras. It could be argued that communication over bluetooth is slower than a USB cable; this is true, but bluetooth v2.0 has a respectable 2.1Mbit/s (respectable in the sense that most people have about the same throughput with a low-end broadband connection), and it’s certainly cheap enough to have a bluetooth adapter in addition to a USB port on a device for instances where convenience takes precedence over transfer speed.
In searching for any bluetooth devices out there other than cell phone and headsets, I came across Seagate’s DAVE; a battery powered external hard drive, supporting bluetooth, wi-fi, and usb connections. Now this seemed like a really cool idea, a completely wireless, external hard drive, in a beautifully small form-factor. The first mention of DAVE seems to be at San Jose’s Tech Museum in Jan. 2007, coming in 10gb or 20gb flavors. The next mention of DAVE seems to come over a year later, in Jan. 2008 at Digital Life, with DAVE now 60gb in size and the unfortunate mention that Seagate does not plan to sell the device directly, but instead sell it to smartphone manufacturers to rebrand and resell (and quite certainly limit compatibility to only their product lines) to users.
Unfortunately, 12 months later, and there’s no sight of DAVE from Seagate or a rebranded DAVE from any smartphone vendors. No Seagate product page exists on DAVE and this cool little hard drive seems to have disappeared from existence.
As for similar devices, I found an old announcement for the Toshiba Pocket Server which seems to have never seen the light of day. There was also the BluOnyx which was shown in early 2007, then a corporate merger (Agere - LSI), then new signs of life, but alas this seems to be another cool product that won’t make its way to market.
Tags: bluetooth, DAVE, hard drive, seagate
Posted in Hardware | No Comments »
December 13th, 2008
Surprisingly easy. I’m doing some bluetooth stuff and needed a way to see if the bluetooth support service (BthServ) was running before attempting bluetooth related system queries and socket IO.
try
{
ServiceProcess.ServiceController sc = new ServiceProcess.ServiceController("BthServ");
if (sc.Status != ServiceProcess.ServiceControllerStatus.Running)
{
// service not running
}
}
catch (Exception)
{
// service name not recognized
}
Tags: .net, bluetooth, c#, service
Posted in .NET Platform | No Comments »
December 12th, 2008
there may have been another universe!
LQC [Loop Quantum Cosmology] has been tantalising physicists since 2003 with the idea that our universe could conceivably have emerged from the collapse of a previous universe. Now the theory is poised to make predictions we can actually test. If they are verified, the big bang will give way to a big bounce and we will finally know the quantum structure of space-time. Instead of a universe that emerged from a point of infinite density, we will have one that recycles, possibly through an eternal series of expansions and contractions, with no beginning and no end.
Tags: big bang, big bounce, loop quantum cosmology, universe
Posted in Random | No Comments »
December 2nd, 2008
No. 2 and my favorite from the 7 Historical Figures Who Were Absurdly Hard To Kill:
Magellan agreed to kill a man named Lapu-Lapu, an enemy of two different Philippine kings that he was friendly with… Magellan and his crew landed on Lapu’s home island of Mactan. However, Lapu apparently knew they were coming, because he had an army waiting.
Magellan was hit with a poison dart almost immediately, but he trucked onward into the mass of native warriors, possibly shouting the Portuguese equivalent of “MOTHERFUCKERS!” as he did so.
He was stabbed in the face with a bamboo spear, to which he responded by burying his lance in the attacker. Magellan tried to draw his sword to keep fighting, but his arm was slashed and soon his leg as well, and he fell to the ground more or less mortally wounded.
The natives then surrounded him and began stabbing and clubbing him as he lay defenseless. He kept looking up to see if his crew had made it safely back to their boats and, upon seeing that they finally had, Magellan allowed himself to die.
Tags: death, magellan
Posted in Random | No Comments »
November 30th, 2008
I recently read about the Windows Advanced Rasterization Platform (WARP), which is a software rasterizer that will ship as part of Windows 7. WARP is targeted at:
Casual Games: Games have simple rendering requirements but also want the ability to use impressive visual effects that can be hardware accelerated. The majority of the best selling game titles for Windows are either simulations or casual games, neither of which requires high performance graphics, but both styles of games greatly benefit from modern shader based graphics and the ability to scale on hardware if present.
Existing Non-Gaming Applications: There is a large gamut of graphical applications that want to minimize the number of code paths in their rendering layer. WARP10 enables these applications to implement a single Direct3D 10, 10.1, or 11 code-path that can target a very large number of machine configurations.
Advanced Rendering Games: Game developers that want to isolate graphics card or driver specific rendering errors. We believe that all games, even extremely graphically demanding games would benefit from being able to render their content using WARP to validate that any visual artifacts they might experience are due to rendering errors or problems with hardware or drivers.
Using WARP as a tool for isolating rendering errors is understandable, but as a fallback for DirectX 10 casual games or non-gaming applications attempting to run on a PC w/o a DX10 GPU, a few things pop into my mind.
- As a fallback mechanism, it goes back too far. We’re talking about going from DX10 -> software rasterization. There’s still lots of graphics hardware out there that targeted previous versions of DirectX, at the very least DX7, DX8, and DX9. Why not allow for seamless fallback to these earlier classes of graphics hardware, instead of a making a gigantic leap backwards to software rasterization? From a developer’s perspective, there would be a real benefit here in writing a DX10 codepath and having it run on older hardware.
- DX10 adoption is slow to non-existent due to the slow adoption rate of Windows Vista. Unless Microsoft is able to generate massive demand for Windows 7, WARP will have little impact due to the little impact of DX10.
- A project like WARP seems to be based around the mentality that a GPU is something special for a PC instead of a requirement. Versus software rasterization, GPU rasterization is orders of magnitude faster and the price of a decent card is under $50. Why is setting a GPU requirement such an endeavor, for Microsoft of all companies?!
- On performance, WARP beats Intel integrated graphics. This really isn’t a surprise or any sort of accomplishment. Intel is really just selling overpriced garbage here.
- Perhaps Microsoft working on a project like WARP instead of setting stricter graphics hardware requirements for Windows 7 is due to another shady deal with Intel. Remember the one with Vista.
Tags: GPU, microsoft, rasterization, WARP, windows 7
Posted in Graphics and Rendering | No Comments »