February, 2008

  • The Old New Thing

    The 2008/2009 Seattle Symphony subscription season at a glance

    • 12 Comments

    Every year, I put together a little pocket guide to the Seattle Symphony subscription season for my symphony friends to help them decide which ticket package they want. As before, you might find it helpful, you might not, but here it is anyway.

    Weekend Program Comments 22 13 10A 10B 7AB 7CD 7EF 7G 4A 4B MS BB MM PC BS
    09/25/2008 Mahler: Symphony #8 Polarizing                              
    10/02/2008 Albert: Anthems and Processionals
    Shostakovich: Cello Concerto #1
    R. Strauss: Ein Heldenleben
    Nervous?
    Good
    Good
                                 
    10/09/2008 Tchaikovsky: Piano Concerto #2
    Rimsky-Korsakov: Scheherazade
    Good
    Awesome
                                 
    10/17/2008 Handel: Concerto Grosso Op. 6, #6
    Vivaldi: Violin Concertos
    Bach/Respighi: Three Choral Preludes
    Respighi: Ancient Airs and Dances #1
    Bach/Schwarz: Art of the Fugue, Nos. I, III, VII, IX
    Good
    Excellent
    Good?
    Excellent
    Good?
                       
     
     
     
     
     
           
    10/23/2008 Haydn: Symphony #16
    Mozart: Horn Concerto #4
    Mozart: Eine Kleine Nachtmusik
    Haydn: Symphony #82 "The Bear"
    Excellent
    Awesome
    Awesome
    Awesome
                                 
    11/06/2008 Mozart: Overture to Le nozze di Figaro
    Mozart: Symphony #39
    Vaughan Williams: Symphony #5
    Awesome
    Awesome
    Okay?
                                 
    11/13/2008 Gerschwin: Concerto in F
    Beethoven: Symphony #7
    Excellent
    Awesome
                                 
    11/20/2008 Tchaikovsky: Romeo and Juliet Overture-Fantasy
    Rachmaninov: Rhapsody on a Theme of Paganini
    Sibelius: Symphony #2
    Awesome
    Awesome
    Awesome
                                 
    12/11/2008 Handel: Concerto Grosso
    Vivaldi: Oboe Concerto in C, RV 447
    Tchaikovsky: Symphony #1
    Good
    Awesome
    Excellent
                       
     
     
           
    01/02/2009 Beethoven: Symphony #1
    Beethoven: Symphony #9
    Excellent
    Awesome
                                 
    01/09/2009 Bach: Orchestral Suite #1
    Bach: Violin Concerto #1 in a
    CPE Bach: Symphony
    Leclar: Suite from Scylla et Glaucus
    Excellent
    Awesome
    Good
    Wildcard
                                 
    01/15/2009 M. Haydn: Symphony in G, MH 334
    Mozart: Piano Concerto #24, K 491
    Haydn: Symphony #60 "Il distratto"
    Excellent
    Awesome
    Good
                                 
    01/21/2009 Tilson Thomas: Street Song
    Prokofiev: Piano Concerto #5
    Tchaikovsky: Symphony #5
    Wildcard
    Polarizing
    Awesome
                                 
    01/29/2009 Borodin: Symphony #2
    Tchaikovsky: Rococo Variations
    Shostakovich: Symphony #9
    Awesome
    Awesome
    Okay
                                 
    02/05/2009 Berlioz: Béatrice et Bénédict Overture
    R. Strauss: Burleske
    Liszt: Piano Concerto #1
    Hanson: Symphony #1 "Nordic"
    Good
    Excellent
    Awesome
    Nervous
                                 
    02/12/2009 Ravel: La Valse
    Rachmaninov: Piano Concerto #1
    Fauré: Requiem
    Awesome
    Awesome
    Good
                       
     
     
     
           
    02/19/2009 Mozart: Symphony #41 "Jupiter"
    Vanhal: Double Bass Concerto
    Schubert: Symphony #5
    Awesome
    Nervous?
    Awesome
                                 
    03/06/2009 Vivaldi: The Four Seasons
    Patterson: Lusławice Variations
    Piazzolla: The Four Seasons
    Awesome
    Wildcard
    Nervous
                                 
    03/12/2009 Elgar: Violin Concerto
    Dvořák: Symphony #6
    Okay
    Excellent
                                 
    03/19/2009 Friedman: Revelation
    Stravinsky: Violin Concerto
    Berlioz: Symphonie fantastique
    Wildcard
    Wildcard
    Excellent
                                 
    03/26/2009 Grieg: Piano Concerto
    Bruckner: Symphony #3
    Awesome
    Polarizing
                                 
    04/02/2009 Diamond: Rounds for String Orchestra
    Samuel Jones: Trombone Concerto†
    Brahms: Violin Concerto
    Nervous?
    Nervous?
    Awesome
                                 
    04/16/2009 Schumann: Symphony #4
    Hovhaness: Lousadzak "The Coming of Light"
    Bartók: The Miraculous Mandarin Suite
    Excellent
    Nervous?
    Okay
                                 
    04/23/2009 Liszt: Mazeppa
    Schubert-Liszt: Wanderer Fantasy
    Liszt: Totentanz
    Schubert: Symphony #3
    Okay
    Awesome
    Awesome
    Awesome
                                 
    05/07/2009 Donizetti: Concertino
    Ravel: Tzigane
    Saint-Saëns: Havanaise
    R. Strauss: Le Bourgeois Gentilhomme
    Good?
    Excellent
    Excellent
    Polarizing?
                                 
    05/28/2009 D. Stock: Cello Concerto†
    Rachmaninov: Symphonic Dances
    Nervous?
    Awesome
                                 
    06/04/2009 Stravinsky: Song of the Nightingale
    Conus: Violin Concerto
    Liadov: Baba Yaga, Kikimora, A Musical Snuff-Box
    Scriabin: The Poem of Ecstasy
    Nervous
    Nervous
    Nervous
    Nervous
                                 
    06/11/2009 Mussorgsky: Night on Bald Mountain
    Adès: Violin Concerto "Concentric Paths"
    Stravinsky: The Firebird
    Awesome
    Nervous
    Excellent
                                 
    06/18/2009 J. S. Bach: Violin Concerto #2 in E
    Schnittke: Rondo
    Schubert: Rondo in A
    Prokofiev: Symphony #5
    Awesome
    Nervous
    Good
    Polarizing
                                 
    06/25/2009 Kernis: New Work†
    Holst: The Planets
    Nervous
    Awesome
                                 
          22 13 10A 10B 7AB 7CD 7EF 7G 4A 4B MS BB MM PC BS
    † Premiere
    MS Musically Speaking
    BB Basically Baroque
    MM Mainly Mozart
    PC Popular Classics
    BS Boeing Symphony

    Notes:

    This chart doesn't include "one-off" concert series such as the Visiting Orchestras or Distinguished Artists series.

    Explanations for the partial blocks: The Musically Speaking concert on 10/19 includes only one of the Vivaldi concertos, and the concert on 2/12 omits the Rachmaninov.

    The comments column very crudely categorizes the works to assist my less-classically-aware friends. This is, of course, a highly subjective rating system, but I tried to view each piece from the ears of somebody new. Thus, I rated downward pieces that I personally like but which others might not and rated up pieces that I may not find musically satisfying but which nevertheless tend to be crowd-pleasers. These predictions have, of course, proven wrong in the past. For example, last season, my rating of "Okay" for Copland's Music for the Theatre was too optimistic.

    Here's what the comments mean. Note that they do not indicate whether the piece is significant in a musicological sense; they're just my guess as to whether my friends are going to like it.

    • Awesome: Guaranteed crowd-pleaser.
    • Excellent: You will definitely like this piece.
    • Good: You will probably like this piece.
    • Okay: You may like this piece.
    • Nervous: I have a bad feeling about this one.
    • Polarizing: Some people will love it; others will hate it.
    • Wildcard: I have no idea what will happen.

    A question mark means that I am not familiar with the piece and am basing my evaluation on what I know about the composer (or am just guessing).

    And who knows, maybe by next season they'll know who their concertmaster is.

  • The Old New Thing

    Why can't I get FormatMessage to load my resource string?

    • 14 Comments

    A common mistake I see is people confusing message tables with string resources. This basically shows up in one place: FormatMessage.

    The folks who were designing Win32 decided that plain string resources weren't fancy enough, so they invented message tables, which is just another way of storing strings in resources. Why string resources weren't good enough I don't know.

    The FormatMessage function accepts a message number, which is looked up in a message table, not in a string resource. In other words, if you have something like this:

    #define IDS_MYMESSAGE 100
    
    STRINGTABLE BEGIN
        IDS_MYMESSAGE "Hello, %1"
    END
    
    TCHAR szBuffer[256];
    FormatMessage(FORMAT_MESSAGE_FROM_HMODULE, g_hInstance,
                  IDS_MYMESSAGE, 0, szBuffer, 256, Arguments);
    

    the call to FormatMessage will fail because you passed in a string resource identifier, not a message identifier. Since nobody actually uses message tables, you almost certainly want to pass the FORMAT_MESSAGE_FROM_STRING flag.

    TCHAR szMessage[256];
    LoadString(g_hInstance, IDS_MYMESSAGE, szMessage, 256);
    TCHAR szBuffer[256];
    FormatMessage(FORMAT_MESSAGE_FROM_STRING, szMessage,
                  IDS_MYMESSAGE, 0, szBuffer, 256, Arguments);
    

    The only place you will normally want to format a message from a message table is when you want to access the system message table to get the text associated with an error code. (But don't forget the FORMAT_MESSAGE_IGNORE_INSERTS flag!)

  • The Old New Thing

    Coca-Cola for breakfast: It's not just for computer geeks any more

    • 34 Comments

    It's not just orange juice for breakfast any more. Soft drinks are making inroads into the world traditionally dominated by milk, orange juice, coffee, and tea. According to the article, over one in seven people order a soft drink to accompany their breakfast. (Among people who eat at home, the rate is 2.4%.)

    If this trend continues, can Doritos for breakfast be far behind?

  • The Old New Thing

    Why are process and thread IDs multiples of four?

    • 51 Comments

    On Windows NT-based operating systems, process and thread IDs happen always to be a multiple of four. Is this just a coincidence?

    Yes, it's just a coincidence, and you shouldn't rely on it since it is not part of the programming contract. For example, Windows 95 process and thread IDs were not always multiples of four. (By comparison, the reason that kernel handles are always a multiple of four is part of the specification and will be guaranteed for the foreseeable future.)

    Process and thread IDs are multiples of four as a side-effect of code re-use. The same code the allocates kernel handles is also used to allocate process and thread IDs. Since kernel handles are a multiple of four, so too are process and thread IDs. This is an implementation detail, so don't write code that relies on it. I'm just telling you to satify your curiosity.

  • The Old New Thing

    Making a reservation at the Asteroid and interrupting a cookie-bake

    • 7 Comments

    Some months ago, I wanted to make a reservation at my favorite Seattle restaurant for special occasions: the Asteroid Cafe. (Asteroid trivia: Their original Wallingford location was so small, you had to go into the kitchen to use the rest room. When they moved to Fremont, they made a special point of putting the rest room in the kitchen for old times' sake.)

    One evening, I called to make a reservation, and since they aren't open on Sundays, I was taken off guard when a live human being answered. I said that I was expecting the answering machine since I thought they were closed. The person who answered explained, "Well, we are closed. I'm not really supposed to be here. I'm just baking some cookies." And then he took my reservation.

    I'm assuming he actually works there and wasn't some guy who broke into the restaurant to bake cookies.

  • The Old New Thing

    If you ask for STANDARD_RIGHTS_REQUIRED, you may as well ask for the moon

    • 13 Comments

    One of the predefined security access masks is STANDARD_RIGHTS_REQUIRED. You see it used in defining the _ALL_ACCESS masks for various objects. Here are just a few examples:

    #define PROCESS_ALL_ACCESS        (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
                                       0xFFF)
    #define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
    #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF)
    

    The STANDARD_RIGHTS_REQUIRED mask is meant to be used when defining access masks for object types. I'm guessing it's called STANDARD_RIGHTS_REQUIRED because it's the set of access masks that all securable objects must support. Look at the documentation or just at the definition:

    #define DELETE                           (0x00010000L)
    #define READ_CONTROL                     (0x00020000L)
    #define WRITE_DAC                        (0x00040000L)
    #define WRITE_OWNER                      (0x00080000L)
    
    #define STANDARD_RIGHTS_REQUIRED         (0x000F0000L)
    

    Notice that STANDARD_RIGHTS_REQUIRED is just an abbreviation for the union of the four access bits DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER.

    Now that you see what it's for, you can also see what it's not for: You're not expected to pass it as the mask of requested access bits when you attempt to open an object. In other words, the following is wrong:

    // wrong!
    HANDLE hProcess =
        OpenProcess(dwProcessId, FALSE,
                    STANDARD_RIGHTS_REQUIRED | PROCESS_QUERY_INFORMATION);
    

    The person writing this code probably thought, "Well, I just want to be able to query information, so I need to pass PROCESS_QUERY_INFORMATION. There's this other thing here called STANDARD_RIGHTS_REQUIRED; since it's required, I'll pass that too."

    The "required"ness of STANDARD_RIGHTS_REQUIRED doesn't apply to you, the program opening the object. It applies to the person who is designing the object.

    Your attempt to be a "good security citizen" and ask only for the access you need (namely, PROCESS_QUERY_INFORMATION) has backfired due to the addition of STANDARD_RIGHTS_REQUIRED. If you ask for STANDARD_RIGHTS_REQUIRED, you are asking for everything.

    Why is that? Notice that STANDARD_RIGHTS_REQUIRED includes WRITE_DAC. If you have WRITE_DAC permission, that means that you have permission to change the security descriptor on the object, at which point you totally 0wnz0r it. You want PROCESS_VM_WRITE access but the security descriptor doesn't let you? No problem. Just set a new security descriptor that grants you PROCESS_ALL_ACCESS to the process object. Tada! You now have all the access in the world.

    Moral of the story: Don't ask for STANDARD_RIGHTS_REQUIRED, because only somebody with full control will be able to get it. Ask for what you actually want.

  • The Old New Thing

    TechDays 2008 learns the sneaky way of getting me to show up at your conference

    • 8 Comments

    The organizers of TechDays 2008 Portugal have decided to lower their standards and invite me to speak at their conference in Lisbon, which by an amazing coincidence takes place during the same week as my appearance at XV Semana Informática do Instituto Superior Técnico (though fortunately not the same day). You don't need to attend both events, since I will be giving basically the same talk at both of them, although the precise mix may vary based on audience reaction, my mood, and the presence of video cameras. (More video cameras means I tell less provocative stories.)

    The TechDays folks found a sneaky way of getting me to attend your conference without having to hold it in Redmond: Wait for Raymond to travel to your city and hold your conference while he's there!

    Commenter Rick C sort of missed the set-up for the entire blog entry on what it takes to get me to attend your conference. I wasn't writing about conferences where it's my job to be there. Naturally, if it's part of my job, Microsoft will pay my expenses. But as I noted in the base article, going to conferences around the world is not part of my job. My job is to stay in Redmond and bang on code. This blogging thing is just a side activity I do in my personal free time.

    If somebody at Microsoft decided that it would be beneficial to send me to a conference (and that someone has the money in their travel budget), then I won't object, assuming it doesn't interfere with my day job. But the odds of that happening are pretty slim, because, as people seem to forget and I have to remind them, blogging is not my job.

  • The Old New Thing

    Losing the game of Last Checkin Chicken two products in a row

    • 21 Comments

    Some time ago, Larry Osterman wrote about the unofficial game of Last Checkin Chicken, wherein teams "compete" to avoid being the one responsible for the last change to a product. The competition is purely virtual; nobody really keeps score, and the "winner" is soon forgotten.

    Unless you're that winner.

    I know someone who won the Last Checkin Chicken prize not once, but twice! My colleague made the last checkin for Windows 2000, and purely coincidentally, also made the last checkin for Windows XP. It's not something to be proud of, but it's not a badge of shame either.

    As part of the game, teams will try to make "remora" checkins. (I just made up that term.) These are fixes that you want to get in at the last minute, but which you cannot justify on their own merits as worth delaying the release of the product another day for. You still have to argue your fix to the release management team (and your fix had better be rock solid), and if release management grants you remora status, then your bug fix is set aside. If a serious bug is discovered elsewhere, then your remora bug gets to hitch a free ride on the window opened by that other bug. On the other hand, if no serious bugs are found that force a delay of the product's release, then your fix goes into the next update (be it an online update, a service pack, whatever).

    It's sort of the developer version of bug bar limbo.

    Pre-emptive snarky comment: "This is why Microsoft products suck."

    Pre-emptive Igor Levicki comment: "Windows Vista sucks."

  • The Old New Thing

    The United Kingdom of Great Britain, Northern Ireland, and France?

    • 18 Comments

    Recently-unearthed documents reveal that back in the 1950's, France proposed merging with United Kingdom into a single country or at least joining the Commonwealth. Apparently, Churchill proposed a similar alliance in the 1940. It too was rejected. (Other coverage. There's a secret joke in that article: Check out the URL.)

    Apparently, the proposal was never seriously considered.

    Ah, what could have been...

  • The Old New Thing

    When somebody gives you a gift of code, it's more often than not a burden in disguise

    • 43 Comments

    Why doesn't Microsoft bundle third-party programs?

    Yes, it has been done in the past, but the results were hardly a slam dunk success.

    Who ports the software to 64-bit Windows? (Answer: Me, personally. I spent a good chunk of the year 2000 porting millions of lines of code to 64-bit Windows. Just for fun, I did a wc -l on a couple of the "gifts" that I ported. Over 100,000 lines of code in one of them, and over 50,000 in another.)

    Who fixes the security holes in the software? (Answer: Me and people I work with.)

    Who has to pay all the software taxes that the original software vendor failed to address? (Answer: Me and people I work with.)

    Who has to update the program to keep up with new Windows design guidelines? (Answer: Me and people I work with.)

    Who has to make the program localizable? (Answer: Microsoft.)

    Who has to translate the software into 20+ languages? (Answer: Microsoft.)

    Who gets sued if there is a patent violation in the software? (Answer: Microsoft.)

    Will people realize that the bundled tools are included merely as a courtesy and that applications should not rely on their continued presence? (Answer: No.)

    I know this from personal experience. When somebody gives you a gift of code, it's more often than not a burden in disguise.

    And that's not counting the legal and public relations challenges some commenters in the linked article have raised. I mean, heck, Windows Vista simply included some photographs from the user community and look at all the anger that generated, both in the comments and elsewhere. And those were just photos!

    (Some people might notice that this is the flip side of free code samples.)

Page 1 of 4 (37 items) 1234