July, 2007

Larry Osterman's WebLog

Confessions of an Old Fogey
  • Larry Osterman's WebLog

    Live search thinks I'm who?



    Live search added face recognition to their image search the other day (which is way cool).  Someone decided to see what various bloggers looked like, so they tried searching for: "larry osterman" filter:face


    What shows up?  I'll give you a hint, it isn't my smiling mug.




    It's Hagrid.



    Way too funny.  It turns out that I know why this one came up - it comes from Dan Fernandez's blog, on his post "Microsoft Bloggers, the Movie". 

  • Larry Osterman's WebLog

    Actually, the Internet IS a series of tubes...


    Alaska's Senior Senator Ted Stevens was widely disparaged for a speech he gave back in June of 2006 when he compared the Internet as a "series of tubes"[1].  The backlash against the comment was quite remarkable, IMHO. People seemed to believe that this was an example of how stupid senators could be when dealing with technology (John Stewart did an awesome bit on it where he got John Hodgeman to admit "I'm a PC" on TDS (I can't find a link to the video unfortunately)).

    The other day, I was chatting with a developer from the networking group, and I commented to him that I thought that Stevens was right.  The Internet really IS a series of tubes.  The other developer looked at me strangely until I explained my reasoning to him.


    If I was to describe the whole "Net Neutrality" debate (a subject on which I am completely agnostic) to a layman, I think I'd end up describing it by using something like the "series of tubes" analogy (I'd probably talk about pipes and hoses though).

    It turns out that when discussing bandwidth, pipes that carry water almost perfectly model the Internet.  Bigger pipes can carry more water, smaller pipes can carry less water.  There's no way of forcing more water through a pipe than the pipe can physically hold, and you simply aren't going to get 1Mb/s download rates through a 56kb/s modem.    Similarly, pipes don't have to be filled to capacity - you don't have to use the bandwidth.

    You could model the Internet as a series of interconnected pipes of varying diameters and length which carry data from the servers to the client computer, and not be too far wrong.  Water (data) flows more quickly through the larger pipes and slower through the smaller pipes.  Since the pipes are interconnected, data can travel via multiple paths between the server and the client, choosing the optimal path.  If large sections of the pipes are blocked (water main breaks), the data is redirected via another path, potentially at a loss of bandwidth.


    If you think about the Internet as a series of pipes, the "Net Neutrality" debate then boils down to a discussion about allowing paying customers to reserve space within the pipes (which reduces the capacity that the non paying customers have available) or equivalently allowing paying customers to use alternate pipes that are only available to those customers (thus allowing the companies to reduce the size of the pipe that's available for the non paying customers, since they don't use as much bandwidth as the paying customers).  The people who are in favor of "Net Neutrality" want to force the pipe companies to keep the high volume traffic on the same pipes as their traffic (thus enabling more bandwidth for everyone), the people who oppose "Net Neutrality" (mostly the people who own the pipes) want to build an mechanism that allows them to gain additional revenue from the people who put the most data into their pipes.


    If I had to guess, Stevens asked one of his staffers to explain the "Net Neutrality" issue to him, and the staffer came up with the "series of tubes" as a way of explaining it to Stevens, then Stevens ran with the idea, much to his later embarrassment.


    [1] I am now officially flabbergasted.  The wikipedia has an article explicitly about "a series of tubes".  For the record, I wrote this post before I read it (since some of my comments above are reflected in the article).

  • Larry Osterman's WebLog

    Playsound is failing on Vista! What's wrong?


    Recently BillP, the author of the antispyware application WinPatrol asked on the MSDN forums about a problem he was having with his application.

    His app called PlaySound(MAKEINTRESOURCE(IDR_WOOF), hInst, SND_RESOURCE | SND_SYNC | SND_NOWAIT) but it was failing (returning false).

    He was wondering if this might be a bug in Vista's playsound implementation - a reasonable assumption given that his application worked just fine on previous versions of Windows.


    I knew that we were passing all the PlaySound regression tests, and there are a number of elements of Windows that use SND_RESOURCE (the pearl startup sound is one of them), so the SND_RESOURCE functionality wasn't broken.  I was puzzled for a bit and then I realized that there WAS one change to PlaySound in Vista (other than some general code cleanup, the addition of support for the SND_SENTRY and SND_SYSTEM flags and support for accessibility events on PlaySound).

    For Vista, I tightened up the validation logic that's used when checking files before the PlaySound call.  Among other things, we check to make sure that:

    a) The cbSize field in the "fmt " tag in the WAV file is less than 1K in length and
    b) The WAVEFORMATEX in the "fmt " tag in the WAV file fits inside the "fmt " tag (done by checking that the waveformatex->cbSize+sizeof(WAVEFORMATEX) is less than the size of the "fmt " chunk[1]).

    I downloaded BillP's app, and checked the resources in the file.  And in sure enough, the WAVEFORMATEX in the file had a length of 0x38 when it should have been 0.  Once I patched his binary to change the 0x38 to a 0, his application stared barking away.

    At this point there are two options:  (1) BillP can fix his application to correct the corrupted resource or (2) Microsoft can change the PlaySound API to allow this kind of corruption (either to allow a bogus cbSize or to edit the app's WAVEFORMATEX to "fix" the bogus cbSize).  Changing PlaySound is not trivial at this point, and it's not clear what the right fix is - the error might be in the size of the "fmt " chunk, which means that the information in the cbSize field might be accurate.  In addition, the downstream audio rendering APIs are likely to choke on these malformed structures anyway. 


    It's this kind of subtle breaking change that makes modifying any of the older Windows APIs such a nightmare. 


    [1] We only check if the "fmt " chunk size is greater than sizeof(WAVEFORMAT) - if the "fmt " chunk is sizeof(WAVEFORMAT) than we assume that this structure is a WAVEFORMAT structure, which doesn't have a cbSize field. 

  • Larry Osterman's WebLog

    How do I compare two different NetBIOS names?


    On one of our internal aliases, someone asked the following question:

    [i]s there any API that I can use to do case insensitive comparison of two OEM strings? (NetBIOS names are encoded in OEMCP.)

    Wow, that's question was a blast from the past.  Windows Networking before NT 3.1 (which includes NetBIOS) had this undeclared and undefined construct called the "network codepage". Essentially an administrator was required to decide what the single codepage was for every computer on the network, and ensure that all computers were running in the same codepage.

    History lesson: A NetBIOS "name" is actually a series of 16 octets, and as such can only be compared by memcmp. In DOS 3.1 (1984, which was before DNS was designed), Microsoft layered the concept of a "computer name" on top of a NetBIOS name. It did that by uppercasing (using the internal DOS case mapping table) the computername being contacted and setting that as the NetBIOS name on the PC Lan Adapter.

    When DOS 3.3 came out, it's major innovation was to borrow the concept of a "code page" from IBM's mainframe systems. Essentially it meant that instead of the case mapping table being hard coded into the OS, it was loaded by an application (chcp). Note that there was still only one codepage per system, and that codepage case maping was still per-machine. As such, if you have machines with more than one codepage on the network, you're likely to have issues if those computernames contain internationalized characters. We received complaints from customers at the time about this Microsoft's answer was essentially "don't use international characters in your computer names".

    Windows 1.0 added a second codepage to DOS, called the "ANSI Codepage" (or Windows Codepage). Windows applications used this codepage, while MS-DOS continued to use the codepage loaded by chcp. This MS-DOS codepage became known as the OEM codepage.

    Fast forward 8 years when NT 3.1 came out. NT 3.1 still had a single OEM codepage, but added support for Unicode. Millions rejoiced, especially those customers who got pissed off by our answer from 8 years earlier. NT 3.1's rules were slightly better than MS-DOS's rules. NT 3.1 took the Unicode computername and uppercased it using the current active codepage. It then converted that uppercase Unicode string to the single OEM codepage and used that series of octets as the computer name.

    The customers who had been pissed off by our answer 8 years earlier were somewhat happier, but not very much. If you have more than one codepage on the network, you STILL can have issues because the upper casing rules are still per-machine, and characters uppercase differently depending on the character set on the machine. Essentially NT 3.1 helped things for some computer names, but we STILL had this undefined, undeclared concept of a "network codepage".


    As far as I know, this is still the state of the world w.r.t. NetBIOS names.

    In general, you're better off matching two computernames (i.e. before the Unicode to OEM conversion) before you try matching two NetBIOS names).


    If you were to root cause the problem, the issue is that most networking protocols were not designed with internationalization in mind - as a result, most of them seem to have an assumption that the both sides of the network transaction are running with the same internationalization rules.  It's not surprising, honestly - I was involved in some of the efforts to define internationalization extensions to the IMAP4 protocol and it turned into a swamp pit (the problem is that at the time (late 1990s) there weren't many international standards for case folding and thus the group was stuck with essentially punting the problem to the host OS, which wasn't considered a good solution because many OS's had limited support for supporting multiple case folding tables).  As a result, networking protocols that specify case insensitivity tend to describe their command verbs as being in the 7bit ASCII set (which has relatively straightforward case folding rules) and punt the problem of case folding to the server (which essentially means that you either support case sensitivity or you assume some kind of network codepage). 

  • Larry Osterman's WebLog

    Is there a difference between an "Administrator" and a "person with an admin account"?


    Yuhong Bao pointed me to his blog post (about Raymond's post "The admin is an idiot") which referenced this snippet from an Apple Style Guide:

    To maintain the distinction between professional administrators and
    Mac OS X users with administrator accounts, avoid using the noun
    administrator by itself to describe a person who has an administrator
    account in Mac OS X. Instead, say an admin user or a user with an
    administrator account-typically, the owner (or owners) of a particular 
    Macintosh computer.

    Yuhong's comment was that maybe we need to differentiate the professional administrator from someone who happens to be running as an admin.

    I'm not sure that there's any meaningful difference, unfortunately, except for the fact that the professional administrator hopefully has more training (this is not always guaranteed unfortunately).

    Except in certain environments (mostly large corporations), the idea of a professional administrator is essentially gone.  Back before my mom retired, she ran a number of professional organizations (the last of which was the Society of Women Engineers).  All of these organizations had relatively small offices - essentially your typical small business.  There were a half a dozen full time employees, and they didn't have the budget to have an administrator.  Instead they contracted out with a company to setup and troubleshoot their email servers (which sat in a storage room in the office).  They treated the systems as same way they treated the HVAC - the box sat there in the corner doing its thing, and (just like the HVAC system), they called in the professionals when it broke (and paid about the same obscene hourly rate as they would for the HVAC repair).  But for the half dozen or so computers in the office, the various people working there managed them themselves.

    Raymond's right - these days users are expected to perform all of the tasks that were normally associated with a professional administrator.  The professional administrator (or BOFH if you'd rather) of many machines is the 12 year old kid that lives next door (or the person who rides at your barn whose husband happens to have worked at Microsoft for a long time :)).

    For consumer operating systems, there is no meaningful distinction between a professional administrator and a user with admin rights.

    I believe that the Apple style guide quote is an attempt to make this clear - when you use the word "Administrator", it implies that the comment applies only to professional administrators, and not your riding instructor, when in fact it does apply to her, she just doesn't know it.

  • Larry Osterman's WebLog

    My mother will be happy, her grandson's going to be a Dentist!


    Well, he's going to be playing a dentist on stage :).

    Tuesday Evening, Daniel was cast as Orin Scrivello, DDS in the Seattle Children's Theater summer season production of "Little Shop Of Horrors".  He'll be playing in the Green cast, and performing the first couple of weeks in August (I don't have dates of the performances yet :().


    I'm totally stoked - at a minimum, he's got a huge opportunity to totally chew the scenery.  As Valorie commented: "I'm not sure I'm ready to see my son beat up a woman, die of suffocation while overdosing on inhaled drugs, and then eaten by a carnivorous plant", but I guess I'll have to cope :)

Page 1 of 1 (6 items)