• The Old New Thing

    My first death threat


    Actual feedback submitted to the microsoft.com web site many years ago.

    id: 13726
    Date: 1996-07-29 17:27:41.997
    Name: ***********
    Email: *************
    Area: Windows 95
    PLEASE read this entire email as it is quite serious. I just discovered today that in the Windows 95 operating system, there are no switches, command line options, or any way whatsoever to have the XCOPY command include hidden/system files in it's operations. It is clear that at some point in the development of the Windows 95 product, that somebody made a conscious decision to implement the xcopy command in this manner. It is also clear from looking at the Windows NT XCOPY command that it can be implemented in the manner I describe. Therefore, let me give fair warning. This may not be easy, and I will expect no help from Microsoft in finding out who this person (or persons) was that made this decision, but....eventually I will find out who made this decision, and I will kill them. This is not an idle threat - I will pursue this matter until it is resolved...whoever is responsible for this incredibly ridiculous implementation of what would be an otherwise useful tool will die at my hands, hopefully in a bloody, painful fashion. You will not get away. -J*hn ******

    J*hn, if you're still out there... the switch for copying hidden files on Windows 95 is /H. Same as Windows NT.

    Please don't kill me.

  • The Old New Thing

    Need to add 1.5kg and 350g?


    Need to add 1.5kg and 350g? Don't take any chances. Go to a Certified Metrication Specialist.

  • The Old New Thing

    The dreaded "main" threading model


    In the absence of an explicit threading model for your COM object, you get the "main" threading model. The "main" threading model is little-known, and that's a good thing. It's a relic from the days before multi-threading.

    The first thread in a process to initialize COM becomes declared the "main" thread. (It might be the first thread to initialize COM in apartment model; I forget.) When a "main" threaded object is created, COM marshals the creation call to the main thread, creates the object, then marshals the result back to the creator's thread. Similarly, when you invoke any method on the object, the call is marshalled to the main thread, invoked, then the result is marshalled back.

    In other words, a "main" threaded object is like an apartment threaded object, with the additional constraint that the only apartment that can use it is the one that the "main" thread belongs to.

    As you can imagine, this is a horrific performance penalty in any multithreaded application, since there is so much marshalling going on. Even worse, it completely bottlenecks the main thread because there are now all these objects that must be serviced on that thread and no other thread.

    Even worse than worse, all this marshalling creates new opportunities for re-entrancy. While waiting for the main thread to do its thing, the calling thread will likely process messages, which means that you can receive a window message at a time when you didn't expect it.

    So why does this awful threading model exist at all?

    For backwards compatibility with COM objects written before multithreaded support was added to COM. Back in those days, there was only one thread, so COM objects could be extremely lazy with their synchronization. In fact, they didn't need any! If you have only one thread, then you certainly don't need to coordinate your actions with other threads because there are none.

    That's also why "main" threading model is the default. Threading models were invented when multithreading support was added to COM. Before then, there were no threads, so no threading models. All old objects therefore didn't specify a threading model in their registration.

    The only reason you should even be aware of this ancient threading model in the first place is that if you forget to specify a threading model in your object registration, you will get the dreaded "main" threading model by default.

    And then you will wonder why your application's performance is horrible, and why you have all these strange re-entrancy problems.

  • The Old New Thing

    Letter carriers rebel


    Letter carriers in both Sweden and Scotland have taken to refusing to deliver political advertisements from parties they personally find offensive.

    This isn't quite the stunning synchronicity as it may appear at first glance: Europe is gearing up for a continent-wide election.

  • The Old New Thing



    One of the flags you can pass to the SHGetFileInfo function is SHGFI_USEFILEATTRIBUTES. What does this flag mean?

    It means, "Do not access the disk. Pretend that the file/directory exists, and that its file attributes are what I passed as the dwFileAttributes parameter. Do this regardless of whether it actually exists or not."

    You can use this flag to get the icon for a file type. For example, to get the icon for text files, pass a filename of "x.txt", pass SHGFI_USEFILEATTRIBUTES in the uFlags, and specify FILE_ATTRIBUTE_NORMAL as the file attributes.

    Why is the filename "x.txt"? Because you want it to have the extension ".txt", and you want it to be a valid filename. (Don't pass illegal filenames like "???.txt".)

    Why are the file attributes FILE_ATTRIBUTE_NORMAL? Because you want SHGetFileInfo to pretend that it is a normal file. (If you passed, say, FILE_ATTRIBUTE_DIRECTORY, then you would have gotten the folder icon back, since you told the function to pretend that "x.txt" was a directory.)

    Note that since you are telling SHGetFileInfo to "pretend", there are some things you lose by the nature of make-believe.

    For example, if the extension is a filetype whose icon changes depending on the contents of the file, then the dynamic icon will not be returned since there is no file. You told the function to "pretend", after all, and a pretend file has no contents.

  • The Old New Thing

    French schoolchildren invited to draw their impressions of the United States


    They choose fast food, fat people, and Bush in a tank.

    In January, a cartoon festival was held in the town of Carquefou, just outside of Nantes in the northwest corner of France. Students of all ages competed in a contest to illustrate their vision of the United States. They drew obese Americans devouring Coca-Cola and McDonald's hamburgers. They drew the Statue of Liberty with fangs or in chains or being run over by a wicked Uncle Sam on a motorcycle. And they drew George W. Bush: Bush riding a tank to war; Bush taking over the world; Bush as a liar; Bush as a monster.

    (I love the drawing of ravenous overweight superheroes.)

    The French image of the United States as the land of hamburgers and obesity extends beyond the minds of schoolchildren. It's also one of the salient features of "Belleville" (a thinly-disguised New York City) in the Academy Award-Nominated animated film The Triplets of Belleville. (Note: I saw Triplets and found it unsatisfying.)

    (In another case of blog synchrony, Eric Gunnerson discussed the frustrating trend of "size inflation".)

  • The Old New Thing

    Why is the default 8-bit codepage called "ANSI"?


    Reader Ben Hutchings wanted to know why the 8-bit codepage is called "ANSI" when it isn't actually ANSI.

    But instead of saying, "Oh well, some things mortals were never meant to know," he went and dug up the answer himself.

    A quick Google for Windows ANSI misnomer found me exactly what I was looking for [pdf]:

    "The term "ANSI" as used to signify Windows code pages is a historical reference, but is nowadays a misnomer that continues to persist in the Windows community. The source of this comes from the fact that the Windows code page 1252 was originally based on an ANSI draft, which became ISO Standard 8859-1. However, in adding code points to the range reserved for control codes in the ISO standard, the Windows code page 1252 and subsequent Windows code pages originally based on the ISO 8859-x series deviated from ISO. To this day, it is not uncommon to have the development community, both within and outside of Microsoft, confuse the 8859-1 code page with Windows 1252, as well as see "ANSI" or "A" used to signify Windows code page support.
  • The Old New Thing

    Chewing gum legalized in Singapore


    After twelve years, Singapore has relaxed its ban on chewing gum. But not so fast.

    Before Singaporeans think about unwrapping a pack of Wrigley's Orbit gum that's just started selling here -- and only in pharmacies -- they must submit their names and ID card numbers. If they don't, pharmacists who sell them gum could be jailed up to two years and fined 5,000 Singapore dollars ($2,940).

    Chewing gum, or more precisely the threat of chewing gum, is employed in the wonderful movie I Not Stupid, which I heartily recommend. It seems to revel in the mixed feelings Singaporeans harbor towards their own culture. (My favorite character is the chubby kid.)

  • The Old New Thing



    Apparently that's the term for knitting in public.

    The New York Times covered the online knitting community. I wasn't aware of the Yahoo knitlist group; I may have to go check it out.

    (The NYT article also mentions the yarn Fizz, which I have used, but I much prefer Splash, a totally knock-your-socks-off novelty yarn. Incorporate Splash into a scarf and you've got a friend for life.)

  • The Old New Thing

    How do you undo Minimize All and Show Desktop?


    It seems it's not well-known how to undo a Minimize All or a Show Desktop, two operations which I discussed briefly yesterday.

    To undo a Minimize All, you can right-click the taskbar and select "Undo Minimize All", or at least you used to be able to do that. Minimize All is no longer on the menus, presumably because it ended up redundant with Show Desktop.

    So after you do your ÿ+M to Minimize All, you can type ÿ+Shift+M to Undo Minimize All.

    To undo a Show Desktop, just click Show Desktop again. If you used the keyboard accelerator ÿ+D, just press it a second time.

Page 399 of 439 (4,383 items) «397398399400401»