The Old New Thing

Excursions in composition: Adding rewind support to a sequential stream

Here's a problem "inspired by actual events": I have a sequential stream that is the response to a request I sent to a web site. The format of the stream is rather messy; it comes with a variable-length header that describes what type of data is being returned. I want to read that header and then hand the stream to an appropriate handler. ...

Excursions in composition: Sequential stream concatenation

As we've seen a few times already (when building context menus and exploring fiber-based enumeration), composition is an important concept in object-oriented programming. Today, we're going to compose two sequential streams by concatenation. There really isn't much to it. The idea is to take two streams and start by reading from the first...

You don't know what you do until you know what you don't do

Many years ago, I saw a Dilbert cartoon that went roughly like this. Frame 1: Supertitle - "Dogbert's guide to project management." Frame 2: Supertitle - "Not a project." Dilbert answers the phone. "Sure, we do that." Frame 3: Supertitle - "A project." Dilbert answers the phone. "No, we don't do that."† I've seen a lot of software ...

The early stages of Joshua Roman groupie-dom

The first time I saw the Seattle Symphony's new principal cellist Joshua Roman, it was at a subscription performance of Mahler's Seventh Symphony in June 2006, shortly after the then-22-year-old took the principal's seat from the retiring Raymond Davis. We noticed that there was a new face in the orchestra, and wondered afterwards, "Who was ...

How do the menu functions find items?

Most of the menu item functions such as allow you specify the menu item either by position or by command. Some of them use the and flags. Others separate the search algorithm into a separate flag. Searching for menu items by position is straightforward: The specified position is used as a zero-based index into the menu. In other words, ...

Verizon backs down on made-up fees and then adds them anyway

I ranted a few years ago about rate hikes disguised as fees or taxes, but Verizon's unabashed deceptive practices still gets me all worked up. Last year, the FCC decided that Verizon didn't have to pay the Universal Service Fund fee any more, but that didn't stop them from charging for it anyway. What galls me is their explanation of the ...

The format of accelerator table resources

Continuing in the extremely sporadic series on the format of resources, today we'll take a look at accelerator tables. This topic is so simple, I'll cover both 16-bit and 32-bit resources on the same day! In 16-bit Windows, the format of an accelerator table resource was simply an array of structures. This array is the same array you ...

Email tip: Don't forget to ask your question

Sometimes people get so caught up in their problem that they forget to ask a question. My customer has noticed that blah blah blah blah, but if they do blah blah, then they get blah blah blah. This is different from blah blah blah, where blah blah blah. But neither is what the customer is expecting, which is blah blah blah. After installing ...