August, 2009

  • The Old New Thing

    Searching for Evil: Spot the scam


    Security researcher Ross Anderson gives a talk on how a search engine can be used to shed light on the various evils that lurk on the Web. It starts off slow, but picks up when he gets to the "Can you spot the scam?" game that he plays with each Web site. (If you're in a hurry, skip ahead to a little past the 20 minute mark.)

  • The Old New Thing

    How do you drop on the background of an Explorer window when it is in details view?


    When you set your Explorer to Details view, it can become tricky to drop an item onto the window background (in order to move it into the folder) because Details view sets full row select (starting in Windows Vista). This helps users of tablets and touch screens, because it increases the size of the target when dragging and dropping into a folder. On the other hand, when you have more items than fit on the screen, every pixel in the view corresponds to an item; there is no background any more. So how do you drop on the background?

    If you're using Windows 7, you can take advantage of a little gutter space to the left and right of the columns. There is a gutter to the left of the leftmost column and another gutter to the right of the rightmost column. Windows Vista doesn't have these gutters, but you can create a gutter on the right hand side by resizing your columns narrow, and then resizing the window wider than the sum of all the columns. Yes, it's clumsy.

    Less clumsy is dropping onto the Details panel at the bottom of the window, which works both on Windows Vista and Window 7. Dropping onto the Details panel is treated as a drop on the folder background. And the Details panel is a nice big target for your drag/drop operation, so those of you using a tablet or touch screen should have no trouble finding it. (Those gutters are nice for mouse-based users, but if you've got fat fingers, they're not much help on a touch screen.)

    If you've turned off the Details panel, you can also drop onto the title bar. It's not as big as the Details pane, but it's still bigger than the gutters.

    Finally, there's always the copy/paste approach instead of drag/drop. Multi-select the items you want to transfer, right-click them and select Copy (or Cut, as appropriate), then go to the destination folder, and under the Organize menu, select Paste.

    Except for the gutters, all of these techniques also work for Windows Vista.

    Bonus chatter: Commenter Medinoc complains that, with the switch to full row select, it's very hard to click on the background. Actually, it's not that bad. You can right-click on the blank space of any unselected item. For example, find an unselected item with a name that doesn't fill the entire Name column and look at all that white space to the right. You can right-click there and it will be treated as as a right-click on the background. The full row is still treated as part of the item when dropping, for the benefit of people using tablets and touch screens, or people who simply want to hit a target bigger than a 16×16 icon.

  • The Old New Thing

    Programming means that sometimes you have to snap two blocks together


    Part of the challenge of programming (and for some people, the reason why programming is fun in the first place) is looking at the building blocks provided to you and deciding how to assemble them to build something new. After all, if everything you wanted a program to do already existed ready-made, it wouldn't be called programming any more. It would be called shopping.

    Is there an API or a quick way to find out which window the mouse is in?

    I replied, "The LEGO Group does not make a piece for every possible object. Sometimes you just have to take two LEGO blocks and click them together. Here are some interesting blocks: GetCursorPos, WindowFromPoint."

    Thanks for your reply. But WindowFromPoint gives me the window of the object at the location of the cursor. But I'm looking for the top level window containing the cursor.

    Fine, then use a different block.

    I wonder how it is these people manage to write programs at all. I get the impression they write code by asking a million tiny questions and cutting and pasting together all the replies.

    No wait, pasting together the replies counts as snapping blocks together. Maybe they just ask for completed programs.

  • The Old New Thing

    A burglar tells you the best place to hide your money


    Jeffrey Strain chats with a former burglar and learns the best place to hide money. ("The bank," responds the former burglar. Oh, the best place to hide money in the house...)

    A month later, the follow-up article discussed the worst places to hide money (that sound like good ideas but aren't).

  • The Old New Thing

    When giving a presentation with a diagram, pretend the diagram doesn't exist


    ::Wendy:: suggested enabling a means of displaying pictures on the blog without messing up the display of the whole post.

    Actually, I've simply given up on the pretty diagrams since everybody seems to hate them. You may have noticed that I've been using ASCII art instead. It's certainly easier for me to write, though it's also a bit uglier.

    One thing readers may not have noticed is that I try to make the article readable even without any diagrams or pictures at all. Sure, you can look at the diagrams if you want, but the article should still make sense if you don't. (And if the image is essential, I'll at least give it some ALT text.) I do this out of consideration for my readers with visual impairments.

    When you're giving a talk, you have to make sure people can follow what you're saying even if they can't see your slides. They may be visually impaired. They may be stuck behind a pillar. They may be sitting so far back that they can't see your slides clearly. If your talk is being recorded, the person listening to your talk might have downloaded only the audio portion. Or your diagram may simply be unreadable.

    Don't just say, "You can see the trend from this graph." Describe the trend. "The system remains responsive until traffic reaches X requests per second, at which point the throughput nosedives very sharply."

    Don't just say, "This is the block diagram for our system." Describe the block diagram. "The XYZ component is the kernel-mode component upon which the user-mode components ABC and DEF are built."

    If you want to point out elements in your diagram in your talk, don't just point and say, "It goes from here to here." Describe where "here" is: "It goes from here, ABC at the top of the triangle, to here, DEF at the bottom left corner." That way, people who are too far away to see where you're pointing (but who have a hard copy of the slides in front of them) can still follow along.

    Basically, when you have a diagram, pretend you don't. Write your text (or give your talk) as if there were no diagram at all.

Page 4 of 4 (35 items) 1234