Blog - Title

July, 2005

Sorting it all Out
Michael Kaplan's random stuff of dubious value
Be sure to read the disclaimer here first!
  • Sorting it all Out

    Why doesn't FoldString take an LCID?

    • 11 Comments

    I actually recall asking Julie Bennett this question (why doesn't FoldString take an LCID?) a few years ago, and her answer was that none of the foldings that the function did were locale-dependant.

    Now that is true for some of the foldings:

    • MAP_FOLDCZONE (Fold compatibility zone characters into standard Unicode equivalents.)
    • MAP_PRECOMPOSED (Map accented characters to precomposed characters, in which the accent and base character are combined into a single character value.)
    • MAP_COMPOSITE (Map accented characters to composite characters, in which the accent and base character are represented by two character values.)

    Now it would be nice if MAP_FOLDDIGITS (Map all digits to Unicode characters 0 through 9) were a reversible opration. And the only way it ever could be would be to have an LCID parameter to specify what to map it to. Though as a workaround you could use the GetLocaleInfo function with the LCID you wanted to use and the LOCALE_SNATIVEDIGITS flag to map them. So this is not the end of the world.

    However, that last flag, MAP_EXPAND_LIGATURES, is the tough one.

    The flag as a simple job -- it expands all ligature characters so that they are represented by their two-character equivalent. Expand all ligature characters so that they are represented by their two-character equivalent. For example, the ligature 'æ' expands to the two characters 'a' and 'e'.

    And this flag works by consulting the very same table that the collation functions use to find these characters that expand. Generally this will all work.

    EXCEPT there are many languages (for example) where æ is considered to not be one of those characters to expand. This includes Danish, Norwegian, and Icelandic. And if FoldString took an LCID it could have at its disposal, the exact list for each circumstance might change as needed.

    Unfortunately, there really is no good way to do this language-specific type of thing right now. Which means we may be expected to try and tackle the issue in some future release....

     

    This post brought o you by "æ" (U+00e6, a.k.a. LATIN SMALL LETTER AE)

  • Sorting it all Out

    Getting intermediate forms

    • 19 Comments

    Unicode has a certain complexity to it that can at times be challenging.

    Let's take for example U+1ec5, a.k.a. LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE. Here is what it looks like (how good will depend on your OS and browser support!):

    Now obviously that is pretty fully precomposed (in Unicode Normalization Form C). If it is fully decomposed, we get U+0065 U+0302 U+0303, a.k.a. LATIN SMALL LETTER E + COMBINING CIRCUMFLEX ACCENT + COMBINING TILDE. Here is what it looks like (again, how good will depend on your OS and browser support!):

    ễ

    And here is where the problems come in. Because between these two extremes lies as third case: U+00ea U+0303 a.k.a. LATIN SMALL LETTER E WITH CIRCUMFLEX + COMBINING TILDE. Here is what it looks like (again, how good will depend on your OS and browser support!):

    ễ

    Now if you convert that third case to NFC you will get the first case, and to NFD you will get the second. How does that happen?

    Well, the rules for normalization are that you have to keep on performing the compression or decompression until you can't anymore.

    So, there are two ways to get the information of that last case:

    1. You can cart around the decomposition info from the Unicode Character Database so you can get it all yourself.
    2. You can take the NFD string and start converting to NFC with one additional character at a time, thus:

    Step 1:   Convert the string to NFD; we now have: U+0065 U+0302 U+0303

    Step 2:   U+0065 + U+0302 to NFC == U+00ea; we now also have U+00ea U+0303

    Step 3:   U+00ea + U+0303 to NFC == U+1ec5; we now also have U+1ec5

    Now this is not what I would call a perfect algorithm by any stretch of the imagination. But it is a quick and dirty way to get the information on a bunch of equal forms.

    But it certainly leaves open the question of whether the operating system and/or the .NET Framework should expose this information at some point....

     

    This post brough to you by "ễ" (U+1ec5, a.k.a. LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE)

  • Sorting it all Out

    Real developers use CompareInfo's Compare (Part 1)

    • 5 Comments

    In the not too distant past, I pointed out that String.Compare is for sissies (not for people who want SQLCLR consistency). Well, today I am going to start to wrap that functionality I described, so that it can be used without a ton of work being done. Because real developers don't eat quicheuse CompareInfo's Compare. :-)

    I will likely take my time with this and talk about other related topics. Never fear, when I am done I will put all of the code together in one place....

    Part 1 of our saga has us getting the flag values right. I will add function for both directions. Since my eventual intent will be to call the NLS API funtions (which define the flags as DWORD) I will use System.Uint32 and mark them private (the right balance between CLS compliancy and header file accuracy, in my opinion!). They are internal functions, anyway. :-)

    As a side note, I once tried to find out why the the values were changed, and no one could really remember. I guess I could start an Every Constant Has a Story category of posts, but I honestly don't think I know enough to sustain a series. I'll bet Raymond Chen or Larry Osterman could do a number of these, though!


    using System.Globalization;

    private const System.UInt32 NORM_IGNORECASE = 0x00000001; // ignore case
    private const System.UInt32 NORM_IGNORENONSPACE = 0x00000002; // ignore nonspacing chars
    private const System.UInt32 NORM_IGNORESYMBOLS = 0x00000004; // ignore symbols
    private const System.UInt32 NORM_IGNOREKANATYPE = 0x00010000; // ignore kanatype
    private const System.UInt32 NORM_IGNOREWIDTH = 0x00020000; // ignore width
    //private const System.UInt32 SORT_STRINGSORT = 0x00001000; // use string sort method

    private System.UInt32 NativeCompareFlagsFromManagedCompareOptions(CompareOptions options) {
        System.UInt32 flags = 0;
               
        if ((options & CompareOptions.IgnoreCase) != 0) { flags |= NORM_IGNORECASE; }
        if ((options & CompareOptions.IgnoreNonSpace) != 0) { flags |= NORM_IGNORENONSPACE; }
        if ((options & CompareOptions.IgnoreSymbols) != 0) { flags |= NORM_IGNORESYMBOLS; }
        if ((options & CompareOptions.IgnoreKanaType) != 0) { flags |= NORM_IGNOREKANATYPE; }
        if ((options & CompareOptions.IgnoreWidth) != 0) { flags |= NORM_IGNOREWIDTH; }
        //if ((options & CompareOptions.StringSort) != 0) { flags |= SORT_STRINGSORT; }

        return flags;
    }

    private CompareOptions ManagedCompareOptionsFromNativeCompareFlags(System.UInt32 flags) {
        CompareOptions options = CompareOptions.None;

        /*
        if((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) != 0) {
            throw new ArgumentOutOfRangeException("options");
        }
        */
                
        if ((flags & NORM_IGNORECASE) != 0) { options |= CompareOptions.IgnoreCase; }
        if ((flags & NORM_IGNORENONSPACE) != 0) { options |= CompareOptions.IgnoreNonSpace; }
        if ((flags & NORM_IGNORESYMBOLS) != 0) { options |= CompareOptions.IgnoreSymbols; }
        if ((flags & NORM_IGNOREKANATYPE) != 0) { options |= CompareOptions.IgnoreKanaType; }
        if ((flags & NORM_IGNOREWIDTH) != 0) { options |= CompareOptions.IgnoreWidth; }
        //if ((flags & SORT_STRINGSORT) != 0) { options |= CompareOptions.StringSort; }

        return options;
    }

    I thought about possibly making NativeCompareFlagsFromManagedCompareOptions throw if CompareOptions.Ordinal or CompareOptions.OrdinalIgnoreCase were passed but for now decided not to bother, and commented that check out. Also, SQL Server never seems to pass SORT_STRINGSORT in its ComparisonStyle data, so that code is commented out, too.

    Now about 100 years ago I wrote an article for Smart Access that did a reverse engineering job on mswstr10.dll and sqlsort.dll, the Jet and SQL Server DLLs that gave the ability for these database products to do comparisons independent of the operating system. However:

    • I wasn't really able to find a copy of the article since I am in Amsterdam right now;
    • I wanted to point people at the OS functions anyway;
    • sqlsort.dll is not a part of Yukon (it is an internal engine function -- the hazard of playing with undocumented function calls!);
    • further to the previous point, mswstr10.dll does not have the new SQL Server collations in it;
    • further to the previous two points, the whole reason for the wrapper is to act like SQL Server, not Jet, anyway.

    So I decided not to bother with the Jet/SQL Server functions. Like I said, they are horribly out of date, so we are better off with the OS functions here.

    I'll post some more tomorrow, as we slowly build up the code for our wrapper objects that gives SQL Server comparison semantics....

     

    This post brought to you by "Ʃ" (U+01a9, a.k.a. LATIN CAPITAL LETTER ESH)
    A letter that is sometimes confused with its Greek cousin, U+03a3 (GREEK CAPITAL LETTER SIGMA), though I cannot imagine why. :-)

  • Sorting it all Out

    Was it or weren't it? It's No Myth, either way

    • 4 Comments

    The Michael referred to in the title is actually Michael Penn, not I. :-)

    It started several years ago when singer/songwriter Michael Penn wrote and performed a song entitled No Myth. The lyrics for this song as published (on several fan and official lyrics sites) are as follows:

    So, she says it's time she goes
    but wanted to be sure I know
    she hopes we can be friends.
    I think, yeah, I guess we can say I
    but didn't think to ask her why
    she blocked her eyes and drew the curtains
    with knots I've got yet to untie.
    what if I was Romeo in black jeans
    what if I was Heathcliff, it's no myth
    maybe she's just looking for
    someone to dance with.
    See, it was just too soon to tell
    and looking for some parallel
    can be an endless game.
    We said goodbye before hello
    my secrets she will never know
    and if I dig a hole to China
    I'll catch the first junk to Soho.
    what if I was Romeo in black jeans?
    what if I was Heathcliff, it's no myth.
    maybe she's just looking for
    someone to dance with.
    Sometime from now you'll bow to pressure.
    some things in life you cannot measure by degrees.
    I'm between the poles and the equator.
    don't send no private investigator to find me please
    'less he speaks Chinese
    and can dance like Astaire overseas.
    what if I was ...
    so what if I was...
    maybe she's just looking for
    someone to dance with.
    what if I was Romeo in black jeans?
    so what if I was Heathcliff, it's no myth.
    maybe she's just looking for
    someone to dance with.

    I have heard Michael Penn perform this song a few times, most recently at the Tractor Tavern with Teresa and Kevin (Cathy's husband, who has better taste in music than she does at times like that!), and Michael actually talked about the fact the song was inspired was a breakup. Which seems fairly obvious from the lyrics. But he gave a hint of how bad the breakup was when he sang the song by replacing the last "someone to dance with" with "someone to f*** with". I wonder if this ex knows that in her games she managed to inspire what has been the song most often associated with him? Quite ironic, that! :-)

    Back to linguistic matters now.

    Some fan sites take the couplet under question here (we'll label the options in faux Language Log fashion):

    1a:

    what if I was Romeo in black jeans
    what if I was Heathcliff, it's no myth

    and instead quote it this way:

    1b:

    what if I were Romeo in black jeans
    what if I was Heathcliff, it's no myth

    while still others quote it this way:

    1c:

    what if I were Romeo in black jeans
    what if I were Heathcliff, it's no myth

    Anyway, every time I have heard Michael Penn perform this song solo (I think maybe five times to date), he sang it like 1a. And I once heard a report of Aimee Mann and Michael singing the song together at an Acoustic Vaudeville1 show where Aimee sang with 1c while Michael sang with 1a, and this apparently had the tongue waggers putting in overtime about some sort of implied insult to Michael's artistic choices (which seems silly to me, for what it is worth). I saw them both once at an Acoustic Vaudeville show myself not too long after that and they both sang with 1a. I have heard a recording of the 02-13-2000 A.V. show where they both used 1a. As perhaps an official authority, it is further confused by the original No Myth track on March and March w/Bonus Tracks, both of which clearly have Michael using 1b for the first two instances and 1a for the last two. Though I have never heard either of then do it that way live, maybe the folks who were assuming a lover's quarrel over the lyrics were just hearing what they wanted to, and in fact DID hear such a version.

    Now to anyone with any even high school level literary background, the two character references are to Romeo of Shakespeare's Romeo and Juliet and Heathcliff of Emily Bronte's Wuthering Heights.2 And there are probably fewer more beautifully tragic (or maybe tragically beautiful?) love stories than those of Romeo Montague/Juliet Capulet and Heathcliff/Catherine Earnshaw (though the latter seems more tragic in some ways since it was unconsummated, while we assume that since former young couple at least had that one night before the exile to Mantua3.

    Now the difference between was and were is not just an artistic one. If you look at the dictionary:

    was -- First and third person singular past indicative of be.

    were -- (1) Second person singular and plural and first and third person plural past indicative of be. (2) Past subjunctive of be.

    Since we know that the song is referring to 'I' we know it is neither second person singular nor first/third person plural. Thus the only differences for us to deal with are:

    • The latter is the past subjunctive case, while the former is simply the past indicative
    • There is a known phenomenon going on with the use of were here, description quoted in the were definition at dictionary.com:

      Although many irregular verbs in English once had different singular and plural forms in the past tense, only one still does today - be, which uses the form was with singular subjects and the form were with plural subjects, as well as with singular you. The relative simplicity in the forms of most verbs reflects the long-standing tendency of English speakers to make irregular verbs more regular by reducing the number of forms used with different persons, numbers, and tenses. Since past be is so irregular, speakers of different vernacular dialects have regularized it in several ways. In the United States, most vernacular speakers regularize past be by using was with all subjects, whether singular or plural. This pattern is most common in Southern-based dialects, particularly African American Vernacular English (AAVE). Some speakers use were with both singular and plural subjects; thus, one may hear she were alongside we were. However, this usage has been much less widespread than the use of was with plural subjects and appears to be fading. · In some scattered regions in the South, particularly in coastal areas of North Carolina, Virginia, and Maryland, vernacular speakers may regularize past be as was in positive contexts and regularize it as weren't in negative contexts, as in He was a good man, weren't he? or They sure was nice people, weren't they? At first glance, the was/weren't pattern appears to come from England, where it is fairly commonplace. However, in-depth study of the was/weren't pattern in coastal North Carolina indicates that it may have developed independently, for it is found to a greater extent in the speech of younger speakers than in that of older coastal residents. ·Other forms of negative past be include warn't, common in American folk speech in the 18th and 19th centuries, and wont, as in It wont me or They wont home. Wont, which often sounds just like the contraction won't, historically has been concentrated in New England and is also found in scattered areas of the South.

    I think we may be able to set aside that second issue given the strong literary background Michael has and deal with the first one.

    That dictionary site helps us with the definitions of these terms, and the definitions match my not entirely forgotten notions of grammar:

    indicative -- Of, relating to, or being the mood of the verb used in ordinary objective statements.

    subjunctive -- Of, relating to, or being a mood of a verb used in some languages for contingent or hypothetical action, action viewed subjectively, or grammatically subordinate statements.

    Of course, the actual linguists over on the Language Log might need to correct my 'armchair linguist' definitions if they were to notice them. In fact, Mark Liberman, Geoff Pullum, and Arnold Zwicky have perhaps already been doing so, before I even stumbled onto the scene. I'll pretend I did not know about this for the rest of the post so I can at least empty the cache on the whole issue. :-)

    Now when one is comparing one's bitter breakup to a tragic couple in literature (while pointing put that in this case it is not, in fact, a myth -- it is real life, dammit!), one is certainly speaking more hypothetically or subjectively. Comparing oneself to fictional characters in a real and painful situation suggests this, doesn't it?

    I suppose one could make the claim that Michael is inventing new characters (Romeo obviously never wore black jeans, and Heathcliff was indeed part of a 'myth' or story), and in a song it could just be shorthand for saying "what if I was to you like Romeo while I wore my black jeans on the terrace -- would you still have left?" or alternately "what if was to you like the mythical Heathcliff, come to life and to love -- would you still have dumped me?"

    Which perhaps makes was more palatable since it is more literally talking about the past, Michael's past, when he did wear the darn jeans, and while still hypothetical, it is being couched in a way to suggest he was asking as if it were not so hypothetical to him (or maybe he just did not want it to be, as might be common in such a 'trying to talk the jumper off the breakup ledge' scenario).

    Though the bitter version he sang at that recent Tractor Tavern show makes me wonder how real he thought the options actually would have been; even if they seemed real at the time, they obviously seem theoretical now. And if cynicism can see dance transformed into f*** then certainly was can find itself transformed into were. And in truth the were feels more natural to me, anyway. 'Were I from North Carolina I might feel differently (though had that been in my vernacular, I would have said 'Was I from North Carolina', I guess. Maybe I am just blathering, now.

    Maybe the best choice is actually the original on the March album -- doesn't a man in the middle of a breakup start with the theoretical past tense? And then, once that is clearly failing, try to move to the real past tense? Not only that, but he actually is saying it's no myth when he talks about Heathcliff -- which is pretty much stating the less than theoretical nature of the issue. I guess you could say Michael had it right the first time, in that case. :-)

    Personally I think Michael should stick with Aimee. She seems to be a better choice emotionally than this ex-girlfriend of his, and they both do seem to be quite taken with each other. And that is no myth whatsoever.

     

    1 - Yes, this link is to the Internet Archive site, as Aimee and Michael seem to have let lapse their domain ownership, the last sad poof that they will likely never release the Acoustic Vaudeville album they were once thinking about doing at some point.
    2 - Although I have heard at least one person ask (after the song was performed) what a cartoon cat has to do with Shakespeare, and he seemed quite serious. No comment on this, other than to say it's like fingernails on the chalkboard to me.
    3 - Could this be why the French word for orgasm (reportedly) means "little death"? Probably not, as I think that might be sleep anyway, and I do not want to start making bad etymological references. Forget I said a word....

  • Sorting it all Out

    Bottles sometimes talk, they never say the right things though

    • 4 Comments

    As Mike Gunderloy pointed out, if the wine talks to you, maybe it's time to stop.

    Of course, in the spirit of 'prior art' other spirits have been talking already. Unfortunately, Jack [Daniels], Jim [Beam], and Johnny [Walker], always have such great ideas like how you can to beat up the 300 pound biker with no problem.

    And then when you wake up next you think it's the Aunt Jemimah syrup bottle talking to you, but it is actually the ICU nurse who is checking your vitals....

  • Sorting it all Out

    Calling it a night, for the party at least

    • 4 Comments

    Ok, I went back to the party, but could not find any of the people I knew among the 1000+ people milling about. I settled in to get a drink, maybe people watch a bit by the band, and figured I'd perhaps see somebody. Then, a bit behind me on to the left, I overhear someone doing that 'I think I am being quiet but instead am being loud and drunk' thing and asking the girl he was standing with "What, is he going to take his moped onto the dancefloor?" and starts guffawing.

    I did perhaps turn a bit sharply at that, but he was a little too drunk to notice. She was mortified, though. I decided to leave, I had plenty to do back at the hotel room (not least of which was to do a couple of intro slides for keyboard BoF that I hope some people show up for!), and it did not look like anyone I knew would be coming by anytime soon. Better to leave without being a target for the drunk guy anymore.

    I make my way as far as the hallway outside the party room and the girl who was so embarrassed catches up to me and apologizes -- "he is not usually this much of a jerk, or this much of a drunk," she says. "Oh, my name is Annette," she continues.

    "It's ok Annette," I assure her. "I could not find any of the people I knew, so I was leaving anyway." She asks if I want to talk about it (though honestly she seemed a lot more upset than I felt, by that point). I tell her that I am okay and that she get back in to the party. She gives me a hug and a kiss on the cheek and tells me I am a good guy. I slink offscoot back to the Okura.

    Probably the whole thing was not worthy of a kiss and a hug, but she might have just been a little drunk, too. Maybe a little out of place, since she was a total stranger. But I guess it was nice, in any case. Kind if sweet....

    Tomorrow night is the Speakers' party, that might work out a little better (usually fewer insults, and I know a bunch of them).

    Plenty to do though, including a little work (a few engine tweaks to do!). And those slides, but they are not really needed. I mean, Julie Lerman did not have any for her BoFs and if you ask me those rocked. Plus, the day I cannot talk impromptu about the good and not-as-good about keyboards is when I'll be saying 'stick a fork in me; I am done.' So maybe I will not bother.

    Anyway, I went to see 1.5 of Kim's talks today -- VLDB Availability and Recovery Strategies for SQL Server 2005 and the last half of Understanding Transaction Isolation in SQL Server 2000 and SQL Server 2005. I would have seen more but the Ask the Experts booth required my presence there. And today was actually the first day I felt useful there, with people finding us (and me!) and asking questions. So that was very cool (and of course I have a few customer questions to f/u on when I am back in Redmond, as well!).

    And I went to see another BoF -- one on whether user group memberships should be paid or free. The attendees were: one guy who was thinking of starting a group who was not in one now, one guy who was in a small group that had no dues, one who had a huge user group, and me (a technical VP of PNWADG, where dues are there, but non-members get to come to the meetings and all, too). Oh yeah, and Pauline (I mentioned her before) who came in late. Not a whole lot to work with, but they did their best....

    Ok, then I went to the party, along with Pauline, which brings everyone up to date (see the prior post to get the story after that!). Maybe I will tell the story in order next time!

    I was going to give the set list at Paradiso but I can't find where I wrote it down. I hate that I do not remember stuff like that anymore -- I can remember the set list of a Kinks show from 1993. One that (ironically enough) Aimee Mann opened for. Heck, I think I even remember most of her set from that show and I did not even know who she was til the end -- Put Me On Top, Will She Just Fall Down, It Could Have Been Anyone, and a jarring version of Voices Carry which made me realize that this was the spikey-haired blonde from MTV a decade before.

    Maybe it is Early Onset ALZ.

    Grrr, let me try here: Dear John, Goodbye Caroline, Going Through the Motions, Humpty Dumpty, Save Me, Wise Up, Video, Driving Sideways, She Really Wants You, King of the Jailhouse, One, and then she closed on Deathly. I know there was no Ray, or Susan, or Invisible Ink, or It's Not. But there are at least five songs I am missing there. Where did I put that piece of paper? :-(

    I'll talk about the keynote tomorrow....

     

    This post brought to you by "a" (U+0061, a.k.a. LATIN SMALL LETTER A)

  • Sorting it all Out

    So why I am I not at the party?

    • 2 Comments

    It is Thursday night, I can hear the party from where I am sitting (in room 3c, while the party is down in 3a). I was actually there for a while. I was originally going to skip it but essentially ended up going with a woman named Pauline I met at a BoF this afternoon since she did not know where her friends were and did not want to just randomly go by herself. We hung out for a while but never found the karaoke bar. We did fine her friends and they all decided to play human Fooz-ball (a game that my team back home would probably love!) so I decided to look for a bathroom.

    Anyway, on the way down the hall I noticed that my scooter charge was in the red -- almost empty. So I tucked in here to charge up a bit. Maybe I will head back to the party soon, for a bit. I'll blog more later and talk about the two cool sessions I saw and David V's keynote, which was also cool. And maybe a bedtime story or two.

    I have that BoF tomorrow on keyboards -- I hope people show up but I am afraid they will all have partied too hard (I know the SQL Server party hurt the early sessions today, I would have probably been there last night if I had not gone to see Aimee Mann play at Paradiso instead).

    Ok, I am going to head back to the party. More to come....

  • Sorting it all Out

    Coming soon

    • 0 Comments

    When I showed the differences between the CLR and Yukon collation support in this post, I definitely left a lot of assembly required. I will soon be posting more direct samples to help here. Keep your eye on this spot....

    Oh, I saw Betsy Aoki's TechEd session today, and it was very interesting. Of course she was very hard on herself, but don't be fooled. She did a great job! :-)

  • Sorting it all Out

    Change is in the cards for ConvertDefaultLocale....

    • 2 Comments

    For some time now, the model being used for neutral locales in Windows, described in this post, has been geting more and more problematic.

    After all, there are more and more new neutral locale LCID values that do not look like ordinary PRIMARYLANGID values. Like 0x7c04 for Traditional Chinese. And these values currently do not work well with ConvertDefaultLocale.

    I guess we on the Windows side could claim that since Windows did not return the value, it is under no obligation to accept it. And we could say that the people generating the values are the ones who made the mess; they should be the ones to fix it.

    Unfortunately, we are not only the victims of the crime here, we are also the perpetrators. So now is not the time to get defensive, since no one really cares what "aspect" of us is at fault. We should just make it work properly.

    Luckily there are only a few cases. :-)

    It is also important for you (the customer) to do something, too. When you are using the macros to construct LCID values that you make sure you are using the values properly and building the LCIDs correctly. Use the right SUBLANGID value from the list, rather than just assuming that SUBLANG_DEFAULT is good enough. Since sometimes it is not!

    But we'll take care of ConvertDefaultLocale -- it needs a little tweaking to handle some of these corner cases....

     

    This post brought to you by "փ" (U+0583, a.k.a. ARMENIAN SMALL LETTER PIWR)

  • Sorting it all Out

    'Need more input, Stephanie!'

    • 3 Comments

    Since these immortal words were spoken by the voice of Tim Blaney to Ally Sheedy, I think every one of us has at times felt like the industrious Number 5 who would read the encyclopedias and dictionaries if only you could point at the information, at the input.

    I have talked about the New String Recommendations doc that Dave Fetterman reported on (full paper here). It inspires the same feeling in me, and in other people. More input is needed to make the choices about what methods to call, and under what circumstances. In the present form, there is too much that is unknown.

    Now I did make the bold and somewhat audacious claim that you can summarize with use appropriate comparison methods and leave it at that. Now I will backpedal a little and show an example of when that can be difficult....

    Let's take the seemingly simple (hah!) case of authentication in SQL Server. There are for our purposes usually three basic scenarios:

    • SQL Authentication, where USERs and GROUPs are created within SQL Server. Validation of logons is done with SQL Server's collation mechanisms, using the SERVER collation setting (not the database). There are no specific functions one can call from Windows or the .NET Framework on a client machine to get identical results to those on the server (which is calling built-in, private versions of the Win32 CompreString and/or LCMapString functions). You can emulate the behavior for the most part by following the guidance in this post, assuming the client and the server are the same OS and service pack level.
    • Windows Authentication, not using AD, where the NT symbolic idedntifier rules are used (the uppercase and then binary comparison that the .NET Framework emulates very effectively with its new in Whidbey OrdinalIgnoreCase semantics). This will usually be seen any time one is using a local user or group account defined on the machine, and could also be seen in larger domain scenarios if Active Directory is not being used.
    • Windows Authentication, using AD, where the OS CompareString and/or LCMapString are used to authenticate, with most ignore flags passed, including NORM_IGNORECASE, NORM_IGNORENONSPACE, NORM_IGNOREWIDTH, and NORM_IGNOREKANA. This will be seen any time Active Directory gets involved in the picture. It is straightforward to emulate, assuming the client and the server are the same OS and service pack level.

    There are other slight variations that can happen when other providers get involved in the OS security story. But let's leave those aside for the moment -- you can keep them in mind if these three alone do not scare you off. :-)

    Anyway, given all of the above, how difficult do you think it would be to come up with a mechanism to emulate the authentication behavior of a SQL Server, for the purpose of providing a deny/grant mechanism for a database resource?

    Pretty fiendishly difficult, I would say.

    In all honesty, your best bet would be to always pass through to the server and let it decide who is authenticated. Not that navigating the above is impossible, but it is difficult to the point of being improbable, or at least impractial. Unless you are paid by the hour and are not required to show significant progress....

     

    This post brought to you by "ƹ" (U+01b9, LATIN SMALL LETTER EZH REVERSED)

  • Sorting it all Out

    I think I am getting old

    • 5 Comments

    (nothing all that technical here)

    I had dinner with Andrea last night (yes, the same Andrea who I was talking with about the Korean Unicode sort) in the before time, in the long long ago.

    Just dinner folks. She has a boyfriend now, and he is not me. Man, if my life were only as interesting as people who email me seem to think it is! :-)

    Anyway, she is not attending TechEd, but she figured it would be nice to have dinner and catch up. She did smile when she saw that old post, and was amazed at how much detail I remembered. She even asked if I had recorded the  conversation (no, I didn't!) or if she was that interesting (ordinarily I'd probably say yes to that but she was fishing so I just said maybe and smiled), or am I just that much of a geek (yes, I definitely am!).

    But after dinner we parted ways and I went back to my hotel room. I shot up with the appropriate sub/q meds I am supposed to, and took all of the pills I am supposed to take (now I have them in one of those caddies with separate little bins for AM and PM of each day, easier to be sure I am taking all I am supposed to). And as I looked at the pill container, I realized that I am getting old.

    Darn, when did that happen?

    It's not just the M.S. thing, though of course that makes it a lot more apparent, a lot more often.

    I was having a conversation with someone at Maya's wedding, a friend of the family who practically wanted to see ID when I told her I was almost 35 (though when she looked closer and saw the grey she grudingly admitted that she could maybe see it). She did go on for a while about how well I seemed to be dealing with it all, though of course her only sampling was seeing me in a Tux at a wedding reception, so it is probably hard to judge.

    I didn't dance with anyone at the reception. But I did watch a lot of people dance. And got to talk to a bunch of people, some of whom I have not seen for years.

    That reminds me, I will get up a tux picture as soon as I can, the adapter to take them off the camera is at home so it will not be right away unless someone forwards a picture to me sooner!

    Of course I do seem to regress a little at events like TechEd, but in the end not all that much. It is astounding how often 'mature wisdom' resembles being just too damn tired. :-)

    But I went back to my room and worked for a while, some cool engine/tool type stuff. Can't say what it is yet, but one day.

    I am getting old, though. I guess we all are. The problem with M.S. is that it makes denial a lot harder to do convincingly....

  • Sorting it all Out

    Is 'International' stuff sexy?

    • 4 Comments

    I was talking to an attendee of TechEd who had just registered. He was looking at all of the sessions that were available, and asked me what I was talking about in my sessions.

    When I told him, he thought for a moment and then asked me the question that is the title of this post -- are your 'International' topics sexy?

    Hmmm, never thought about it that way before. So I explained for a minute what I thought 'sexy' meant in this context....

    Well, perhaps not as sexy as topics like SQL Server performance and how to maximize it. But then I'll be talking about that this week.

    And maybe not as sexy as topics like SQL Server upgrade, migration, and/or conversion. But I'll be damned is those are not topics I'll be talking about, too!

    Certainly not as sexy as topics like SQL Server Security that people like Don Kiely cover in articles like Keep Bad Guys at Bay with the Advanced Security Features in SQL Server 2005 (great stuff, Don!). But after several requests from folks in TechEd Orlando I am going to be covering some interesting security issues that come up related to interntional issues in SQL, Windows, and mixed mode authentication scenarios.

    And definitely not as sexy as topics like Yukon (SQL Server 2005) and its new features. But I even talk about some of those, too!

    And that is before you get into all of the cool issues about language support and really using all that Win32, the .NET Framework, and SQL Server bring to the mix that is truly the most important topic for the world!!!

    Seems pretty sexy to me, in a geeky technical sense at least. :-)

     

    This post brought to you by "Í" (U+00cd, a.k.a. LATIN CAPITAL LETTER I WITH ACUTE)

  • Sorting it all Out

    Yet another TechEd session

    • 0 Comments

    I am also doing a BOF:

    BOF018: Keyboards on Windows --  What Works, What Doesn't?

    This will be taking place on Friday, July 8, 8:30 -- 9:45. So I will be fighting the natural tendency of people to be too hung over from the Thursday night party to attend a Friday morning session.

    My hopes for this Birds of a Feather session is a good dialog with people who are having either good luck or bad luck when it comes to keyboards. This is a chance to get answers to questions (and perhaps give them!), to hear some of the interesting stories behind a few of the keyboards, and to get your feedback and problems heard by the person responsible for the next version of MSKLC.

    I will have some stuff to give away in a drawing type thing, for those who show up! :-)

  • Sorting it all Out

    The road to Amsterdam is paved with....

    • 0 Comments

    Well, I'll explain about the title in a minute. :-)

    But I made it to Amsterdam! I have registered for TechEd Europ e, gotten my speaker badge, shirts,  and swag, and am ready to go.

    My sessions:

    DAT290: Databases for the World: Designing Multilingual Databases Using SQL Server 2005

    Tuesday, July 5th, 12:00 -- 13:15

    DAT319: Databases for the World: Best Practices for Search in Multilingual Data Sets Using SQL Server Collation for Sorting and Indexing

    Wednesday, July 6th 16:30 -- 17:45

    Also, I am scheduled in the "Ask the Experts" area, located in the Exhibition Hall, at the following times:

    Tuesday, July 5th, 13:30 -- 15:00

    Thursday, July 7th, 13:30 -- 15:00

    And I will be around an about throughout the event....

    The screw-up that made a portion of the trip here stressful did not happen until the plane landed. I had some miles to burn so I had upgraded my ticket and it was a very comfortable flight. But once we were on the ground they did not bring the scooter up. The KLM folks were not being very helpful, either. I mostly kept my cool and I ran into Mike Hernandez who hung out and was also very supportive in this rough time. Turns out they sent it down to oversize baggage (despite the info where the delivery was to be planeside was clearly on the slip).

    But I am here now, and everything I need is here now, too -- and I am ready to talk to customers!

  • Sorting it all Out

    T minus 19.5 hours to Amsterdam

    • 3 Comments

    Those who

    • (a) read this blog, and
    • (b) will be at TechEd Europe

    should try and say hello, I will be there all week for TechEd. Be sure to mention that you read the blog, I may even have some swag for a lucky few of you!

    And then after TechEd is done I will be in Ireland for a few days to meet with our sister GIFT team there, maybe even do a presentation for them. It is a known fact that I am willing to talk bout anything for at least 15 minutes longer than anyone would be willing to listen to it. :-)

    Tonight I'll see my cousin get married, which totally rocks, I am so happy for her. I am sure it will be a wonderful ceremony....

    I have my camera here so I will try to get some pictures. You may even see me in a tux if I can get someone to take a picture of it. :-)

    And then a direct flight on Northwestern tomorrow and I am ready to go.

    See you at TechEd!

Page 4 of 5 (63 items) 12345