Yahoo Response Time

Everything started with me trying to enter my home town, Osijek, on stackoverflow careers. I was quite annoyed with auto change of Osijek to Esseg - name that my town had before year 1918 (during Habsburg Monarchy).

I got information that this is taken from geo.places Yahoo table and that this is place to complain. On contact page it was clearly said that all technical questions or bugs should be addressed in support forums (“Please use our developer forums for both issues so that other developers can benefit from the conversations.”). I did just that - I created new post in Yahoo developer forum. I tried to be as specific as possible and I avoided to be too annoying with constant repost.

It has been a month now and error remains. I am little bit disappointed since I haven’t seen any action at all. I would understand if somebody challenged my claim. I would understand if somebody said that independent verification is needed. I cannot understand that there is no answer at all. If you say that forums are your only official support, you better post some replies there.

Since original approach didn’t work, I will probably start to annoy everybody and repost this from time to time. I am quite sure that Jeff Atwood (meta stackoverflow moderator) will bother them too. Hopefully some time next year I will be able to have my city named correctly.

Hotel International

Illustration

Malfunctioning plane was all it took to ground me once more and to award me free stay in hotel, early wake up to catch next flight and feeling awful for whole next day.

I got free ride to hotel (courtesy of Croatia Airlines) and I got free bus pick-up at 05:00. Standard bus ride this early is not something you see too often.

Room was quite fine but real gem was free wireless Internet access through-out hotel. This is something every hotel should have!

Best surprise was dinner. While mighty Sheraton only offered me stale meal, here I could choose what I wish to eat from six three-course menus. To make it even better, you could mix-and-match them to get your favorite combination.

Although I didn’t pay dime for this stay, I felt welcomed and like a proper guest. What more can one ask?

Microsoft Connect

Illustration

Microsoft started Connect site a while ago and I understood it as central hub for all bug reports. If came handy for taking bug reports for Windows 7 (now closed) and Visual Studio. Interface was simple and you could be sure that you would get some response. Even if that response is “Won’t Fix”.

This is probably why I am so furious on Microsoft Office team. Only thing they did is to include link to page full of marketing. Microsoft already has full infrastructure in place for reporting bugs but they decide not to use it.

Yes, I know that there is Send-a-Smile program available for Office 2010 and I am aware that it may be easier for most of people. However, this should not be an excuse. Windows 7 team managed to include their stand-alone utility with Connect without big issues.

Now you must excuse me since I need to reboot my computer in order to boot into another Windows instance with Office 2010 beta in order to report a bug. Only if there was a web interface for that… :)

We're Sorry, but the Clip You Selected Isn't Available From Your Location

Illustration

As I live in Croatia, I am used to videos being blocked.

With all this Conan vs. Leno controversy, I decided to check what exactly is going on. One of videos I tried to watch was on The Jay Leno Show page. It featured standard “We’re sorry”, but only after giving me advertisement message before.

If they decide not to offer their program in my country, I can live with this. But how can one in straight face say that while actual program may not be available for me, advertisements are fine.

And it is not only videos. It apply when you are buying stuff too. It is books on Amazon, audio books on Audible, and quite a few other places.

I hate when I need to download content from unauthorized source (e.g. torrents) just because they do not want my money. If you do not consider my money “green” enough, it is fine, but then do not complain that piracy is wide-spread when you are one that is forcing it.

GetLastWin32Error

static void Main(string[] args) {
    if (!NativeMethods.DeleteFileW(@"X:\NonExisting.txt")) {
        throw new Win32Exception(Marshal.GetLastWin32Error().ToString());
    }
}

private static class NativeMethods {
    [DllImportAttribute("Kernel32.dll", EntryPoint = "DeleteFileW", CharSet = CharSet.Unicode)]
    [return: MarshalAsAttribute(UnmanagedType.Bool)]
    public static extern bool DeleteFileW([InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpFileName);
}

This code looks quite straightforward. Function should delete file and in case of failure exception will be raised. In this particular case one would be expect either 2 (ERROR_FILE_NOT_FOUND) or 3 (ERROR_PATH_NOT_FOUND) as raised exception’s text.

However this example will most probably return 0. You can already guess from highlight that problem is in DllImport line. To make function behave properly, one parameter needs to be added:

[DllImportAttribute("Kernel32.dll", EntryPoint = "DeleteFileW", CharSet = CharSet.Unicode, SetLastError = true)]

When SetLastError is set to true, .NET will make all necessary plumbing in order to catch and store error code. This code will be available to you in GetLastWin32Error() function until some other P/Interop call overwrites it.

Although I knew all of that, I fell as a pray to this annoying bug. Reason lies in great tool - PInvoke Interop Assistant. It will generate all necessary P/Interop signatures and it is just too easy to rely on it’s judgement. At least until you find out that all those API signatures are generated without SetLastError parameter set.

If this little issue goes unnoticed, you have quite a big bug on your hands. Worse still, since GetLastWin32Error() will almost always return 0, bug will probably go unnoticed and it will manifest itself somewhere far away from function. Catching that one can be tricky.