Postings are provided as is with no warranties, and confer no rights. Opinions expressed here are my own delusions; my employers at best shake their heads and sigh, at worst repudiate the content with extreme prejudice, whenever it manages to appear on their radar.
This blog is unsuitable for overly sensitive persons with low self-esteem and/or no sense of humour. Proceed at your own risk. Use as directed. Do not spray directly into eyes. Caution: filling may be hot. Do not give to children under 60 years of age. Not labeled for individual sale. Do not read 'natas teews ym' backwards. Objects in mirror are closer than they appear. Chew before swallowing. Do not bend, fold, spindle or mutilate. Do not take orally unless directed by a physician. Remove baby before folding stroller. Not for use on unexplained calf pain.
A nice FLAIR (FLuid Attenuated Inversion Recovery) view from the not-too-distant past. Every abnormality you can see on this scan (and there is more than one!) is asymptomatic at present. Alongside is a picture of me walking the walls at Fremont Studios, a sign of a damaged brain.
More non-technical content....
You know the step you miss at the bottom of the stairs, or the one you try to take that is not there at the top? It takes your breath away. Kind of like today's news did. I'll explain...
I am taking Copaxone every day, for my MS. It's like taking Insulin or something.
I used to take Avonex and to be frank I liked the schedule better (just once a week). But I'd kind of feel like I had the flu for the next 36 hours, which kind of stunk, if you know what I mean.
So I was biding my time with the Copaxone.
Though some time this month I was going to be switching to the new drug that used to be called Antegren but was then renamed to Tysabri.
I was kind of annoyed at the wait (the hospital wanted to set up stuff and the infusions have to be in the doctor's office). But a drug that you only have to take once a month seemed like a dream some true, you know?
But then everything changed.
Yesterday morning, my brother-in-law forwarded me an article through email and asked if I had heard about it -- a headline today on cnn.com. It read MS drug pulled after patient dies. The drug companies (Biogen Idec and Elan Pharmaceuticals) voluntarily pulled Tysabri for an investigation after one patient died and another contracted Progressive Multifocal Leukoencephalopathy (PML), a rare but often fatal disease of the central nervous system. Both patients were taking Avonex and Tysabri together for over two years.
My first thought was how terrible that was. And I will admit my second thought was that maybe that would have been me some day, if they had actually rushed through that process stuff at the UWMC neurology clinic a bit faster.
The stock both companies reportedly dropped on the news (small wonder, huh?).
Now tonight, I am looking at this Copaxone syringe and wondering if I am taking my life into my hands by falling into this trap that the drug companies have set up. It's a pretty profitable scam they have going there, you know?
Drugs that have a statistically significant chance of helping me will by definition have a statistically significant chance of doing the fractional value diddly/squat.
And I don't even want to think about the miniscule chance that the rush to get what seemed like a promising drug "fast tracked" through the FDA could do to someone about to be on the bleeding edge of MS treatment. The Copaxone may be doing nothing at all for me (one has to love a $1000 per month placebo), but no one has died yet from taking it after over ten years. I'll take those odds over 1 in 5000 after just two years any day.
Now I know none of this probably even applies to me -- they have a ton of Avonex data and nothing like this has ever been seen. Same thing for Copaxone. and even if I were on the Tysabri, I would never have gone on a combination therapy with Avonex. Even bothering to think that I had a close call is like thinking I had a close call when I was stranded in Los Angeles on 9/11, waiting for a next day flight to San Jose. In other words, I was never in any kind of danger.
I am simply not feeling quite so experimental, if you know what I mean. I think waiting for the longer studies sounds like a safer plan....
WARNING: No technical content, though I am technically a little pissed
A few months ago, I was in my scooter riding some my recyclables over to the large bins in my apartment complex. It is easy to scoot right over there, recyclables in the back basket of the scooter, and dump them in there.
The space right next to the bins is a handicapped spot. I know because back before I had the scooter I used to drive the stuff over, and I always loved that I could park there when I dumped the stuff (yes, I do have the proper state-issued disabled parking placard).
Anyway, there was a car parked there, tightly enough that I could not even squeeze myself in to get to the bin, let alone the scooter. Not the end of the world, but I noticed that the person had no disabled parking placard or license plate. Same thing for the car next to them (which was not blocking me, but it was yet another handicapped space being illegally parked in).
I'm generally not one to raise a fuss (I'm still getting used to the whole disability thing), so I turned around and figured I'd try my luck another day.
Time passes, and every time I come home I look over there I see that these folks are still parked there. And it is the same cars. I am starting to get mad.
Did I mention that the two cars who seem to be the reqgular offenders here both have current Microsoft parking permits? Don't even gt me started on how obnoxious I think that is.
Anyway, I finally scoot down to the main office for the complex. I pick up the mail, then mention to the person there that there are people who are parking in the handicapped parking spots every day. Should I complain to them or to the Redmond police directly?
She asks me whether there are signs posted.
I have no earthly idea, so I scoot out there and look. No signs, just the pavement nicely painted with the little wheelchair dude. I scoot back and pass this on.
She explains to me that the law in Washington is such that if there is no sign then the police can neither ticket nor tow. They cannot even give a warning.
Hmmmm.
I checked later, she was right. In RCW 46.61.581:
A parking space or stall for a disabled person shall be indicated by a vertical sign, between thirty-six and eighty-four inches off the ground, with the international symbol of access, whose colors are white on a blue background, described under RCW 70.92.120 and the notice "State disabled parking permit required."Failure of the person owning or controlling the property where required parking spaces are located to erect and maintain the sign is a class 2 civil infraction under chapter 7.80 RCW for each parking space that should be so designated. The person owning or controlling the property where the required parking spaces are located shall ensure that the parking spaces are not blocked or made inaccessible, and failure to do so is a class 2 civil infraction.
That's all it says -- no sign, then its not a handicapped spot.
So I ask this person at the office whether these spaces are being repurposed, and she assures me they are not. Its just that the signs are expensive.
Double hmmmm.
At this point I start to complain a bit more and point out the fact that there are actually laws about this sort of thing (there are -- RCW 70.92.140, for example).
They sober up quickly enough on that one and finally agree to get a couple of signs (one outside where my apartment is, one next to the recycle bin), leaving the other three "faux handicapped" spaces in their FAUX state, since signs are expensive.
One of those two spaces where the two cars used to park still has a car in it every day. It seems to be one of those same two cars (I guess they are fighting for "their" space). Maybe I should start posting license plates and descriptions. Or maybe I should consider the handicap of their lack of decency as one that entitles them to park there? I hope they are contingent staff and their contracts don't get renewed. Most people at Microsoft are a lot nicer.
I realize that by posting this I may be enabling a whole new crowd of jerks to start taking advantage of this particular loophole, but I hope that people can perhaps be a little better than that. They can rise above their technical right to park in a parking space and see that it is marked on the pavement as a handicapped spot. And at least tey to respect that....
There is currently no HANDICAPPED SYMBOL in Unicode, though it would have loved to have been the sponsor.
The other day in Not all interview questions are created equal I explained why I did not personally care much for the types of questions that Scott Hanselman gave in his post (What Great .NET Developers Ought To Know (More .NET Interview Questions)). I then blathered for a bit about what I try to not do in interview questions, and never said much about what I did try to do. Some people rightfully pointed out that it is not entirely cool to say I disagree with someone without at least a concrete example of something that I think is a good question....
So, I thought I would give an example of one I have used before (though probably won't use again, sorry! Staying awake while reading this blog is impressive but I don't want people to have an edge in interviews just because of they put up with my blatherings!).
I model it after a question that Dave Kaplan (no relation to me!) gave me way back in 1997 in my very first interview of the very first interview loop I ever went through at Microsoft.
You see, Dave (who is no longer at Micrsosoft) was one of the developers who helped design the Intelli-Join feature that is used in many of the Access wizards like the Form Wizard, since Access 95. It allows you to pick fields from different tables all over a database and then using the relationships between those tables would create the most efficient query it could manage, to return the expected results. It is a hard problem to solve at all, a fiendish problem to solve well, and I believe at least one patent came out of the solution that was developed. He had moved to another team at Microsoft, but was very willing to be part of an interview loop for a "wizard developer" (not the term I would have used, myself!).
Now Dave felt reasonably comfortable with his expertise in the area (with good reason), and by giving the original problem suggested above (how to let the user pick fields from different tables all over a database and then create a query to return the expected results), he was comfortable with the knowledge that no one could really "solve" the problem in an hour. It can actually be an excellent question for a candidate who has to do database development that involves UI for filtering raw resultsets, and one that they may not have previously considered. The methods used by a candidate to try to find a solution can often be illuminating.
Of course, there are risks to a 'top down' question like this one, which asks the hard question first, that can work against the person asking questions. It can make a candiate feel like they are failing pretty quickly -- if you put up a huge wall of unfamiliar materials, it is not always clear how to scale it. Definitely it can put the pressure on in an uncomfortable way.
In my case, the question kind of backfired in the other direction. I had actually just written the Partial Replica Wizard, as a proof of concept that such a wizard should be added to Microsoft Access1. It solves a similar problem in a totally different way (I think I cowrote an article about it in Smart Access explaining the concept, too). I had no access at the time to any of the Intellijoin stuff (if I did I probably would have used it; coming up with clever solutions is not necessary when you have something on the shelf that will get the job done. All I would have lost was a publishing credit that does not even end up in Google Scholar!). But I basically had a solution in my mind that I was able to use here. Technically my solution was easier to implement, though admittedly with fewer features. I laid out my suggested solution in just a few minutes and I think I shocked him. The fact that it was a problem I had solved outside the context of the interview did not phase him; we ended up spending most of the interview walking through the algorithm I suggested as he convinced himself it would work!
(I knew it would work, since I had tested code that used it <grin>)
I am fairly certain I aced that one particular interview, though it could have gone either way, if he were less cool of a guy. There are plenty of people in the world who would take that sort of thing personally. Luckily he was much more about the technology than about ego, so a different solution was just really interesting. It was not something to feel weird about. :-)
I don't think I have ever been able to do that in an interview since then, so it is not the kind of thing I expect is common2, 3. At least it is not for me -- though I'll teach would-be candidates a cool trick in a future column that can be used favorably in interviews, if there is interest....
Anyway, taking that idea of asking a question in an area in which I have some expertise, I instead try more of a 'bottom up' approach -- start the question simply in an area and then make it progressively more complex:
So for example, I tell them about what I do and about how one my foci is about collation. I then have them write a simple string comparison function. Take two strings and return -1, 0, or 1 depending on whether the first string comes before, in the same place, or after the second string.
Easy, right?
Well, yes. But here is where it gets tricky. The question morphs depending on how well people are doing, such that any of the following can then be added:
Some of these questions lead to code changes, others are just more in the realm of conceptual questions about how they might change the algorithm or what data would be needed to support things, or people to explain how they would approach the problem. And I am sure you can imagine even more beyond these few....
Things that are cool about this type of question, in my mind:
I have asked similar questions with Unicode, encodings, parsing, formatting, calendars, normalization, casing, string iteration, and more. They seem to work well, and I can usually get a good idea of how a candidate approaches a new technical problem. Folks definitely come in and have to think about the problem, and sometimes come up with quite novel solutions. There has not yet been a case that has impacted actual product development or caused a design to change, but when you talk to smart people, you never know what may come out of the conversation. :-)
I guess that kind of gave you two questions that I consider to be good ones, rather than just one, huh? I have learned about intelli-Join since then, and even owned that code for a few years. Ah well, I have only ever asked a question like Dave's once, usually we are not seeing database developers in this end of the world. And it is not just about having a cool question, it is about having it be relevant to something.
So, would I recommend these questions (or ones like them)? Yes, if (a) you feel you can speak intelligently to what is behind them and (b) they are relevant to either what you do or what the candidate might do if they are hired. But the principle can be applied to anything you are good at (or that applies to the job in question). The principle? RELEVANCY.
1-I demo'ed it to a PM on the Access team as proof of concept and said "if you gave a it a litte time you could even do something lame like this" and they turned around and bought it. I was released on the web for Access 97 and was added to the core product in Access 2000. Only minor changes have ever been made to it since that original release, though there was one cool internationalization bug that I will talk about another time....
2- Another time, I may tell the story about a time when I asked a "top down" sort of question about collation and someone managed to shock me just as I did Dave eight years ago. That person now works down the hall from me, on MUI. :-)
3 - For what it is worth, the interview after that was with a guy who is also no longer at Microsoft. He had a bunch of those questions I love so much (not!) like XORing strings in clever ways that if I ever had received a CS degree or had gone to a bunch of interview web sites I might have done well at. But I hadn't, I hadn't, and so I am pretty sure that I didn't. But he was a tester so I asked him questions about test (a subject about which I knew little at the time) and that made them think I should maybe be trying to be a tester -- a notion I had some difficulty shaking them of, back then. They did eventually make a dev offer a few months later (no hurry since I was under contract anyway), but by then I decided to hang back and perhaps find a group that would have me do something more than VB/VBA code (that is a hard reputation to shake at Microsoft, believe me!). I get a little wistful when I think about what I would have in the bank now had I started fulltime with Microsoft when the stock was where it was in 1997.... but then I realize that I may not have stayed this long had things not happened as they did, and then I get over myself. Even oldtimers at MS get wistful about what they did with stock options during the 90's. :-)
This post brought to you by "ส" (U+0e2a, a.k.a. THAI CHARACTER SO SUA)
Someone just asked me this question in mail, and he is not the first to ask, either. The whole idea behind the question is an open disbelief that I can maintain the pace of at least one technical post each day that I floated back when I first said Welcome to Sorting It All Out. They assume I will run out of topics eventually.
Of course some people seem to forget that I have the whole world to draw on. And all the stuff I am not an expert on (which is lots), I usually know someone else who is. So I think I can keep going for quite a spell. I assume that people will get sick of listening to me long before I get sick of saying stuff. :-)
And no, this is not the sort of post I count!
The other day I posted about the Microsoft Win32 to Microsoft .NET Framework API Map and commented that there were some mistakes in the NLS functions there.
Here is a quick list of things I would change (I will send the link as feedback, too). The key to the changed table:
The APIs that were not included here but were put elsewhere, or not included at all:
System.Globalization.CultureInfo.CurrentCultureSystem.Globalization.CultureInfo.InstalledUICulture
Actually, you would use the static System.Globalization.CultureInfo.CreateSpecificCulture() method to create a specific culture from a neutral one, which is what that API does.
Access the System.Globalization.CultureInfo.DateTimeFormat property to get a System.Globalization.DateTimeFormatInfo object, and then access its properties:System.Globalization.DateTimeFormatInfo.AbbreviatedDayNamesSystem.Globalization.DateTimeFormatInfo.AbbreviatedMonthNamesSystem.Globalization.DateTimeFormatInfo.DayNamesSystem.Globalization.DateTimeFormatInfo.LongDatePatternSystem.Globalization.DateTimeFormatInfo.MonthNamesSystem.Globalization.DateTimeFormatInfo.ShortDatePattern
Let's not forget the most important part -- you need to look at the information after setting the desired Calendar on the culture, first!
System.DateTime.GetDateTimeFormats(System.Globalization.CultureInfo)
Or alternately, DateTimeFormatInfo.GetAllDateTimePatterns()
Iterate through the calendars:System.Globalization.CultureInfo.DateTimeFormat.Calendar = System.Globalization.CultureInfo.OptionalCalendars[i];System.DateTime.GetDateTimeFormats(System.Globalization.CultureInfo)
The various code page properties of System.Globalization.CultureInfo.TextInfo
This will not get all of the code pages and will show many repeats of those it does get -- it will also sometimes retrieve IDs that are not supported. There is not a good enumeration methodology for the supported code pages in .NET 1.1 -- but look for new enumeration methods in 2.0!
Retrieve an array of CultureInfo by calling System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures), and then access the following CultureInfo properties: System.Globalization.CultureInfo.ThreeLetterISOLanguageNameSystem.Globalization.CultureInfo.ThreeLetterWindowsLanguageNameSystem.Globalization.CultureInfo.TwoLetterISOLanguageName
GeoID is not supported in .NET 1.1 and it is actually region-based, not language based. .NET 2.0 will support a RegionInfo.GeoId property.
System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures)System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.InstalledWin32Cultures)
Note that there is no method that can be used to get the alternate sorts, one of the important features this API supports.
System.DateTime.GetDateTimeFormats
System.Globalization.CultureInfo.InstalledUICulture.TextInfo.ANSICodePage
Try Encoding.Default.CodePage, instead.
System.Globalization.CultureInfo.DateTimeFormat
This will only work for the currently selected Calendar -- make sure to set the Calendar from which you would like information, first.
System.Globalization.CultureInfo.DateTimeFormatSystem.Globalization.CultureInfo.NumberFormatSystem.Globalization.CultureInfo.TextInfo
Well, instead of that, how about everything under:System.Globalization.CultureInfoSystem.Globalization.RegionInfo
System.Globalization.CultureInfo.InstalledUICulture.TextInfo.OEMCodePage
The real OEMCP of a system is based on the default system locale, which can be changed. The Installed UI language cannot be.
System.Globalization.CultureInfo.InstalledUICulture
The default LANGID of a system is based on the default system locale, which can be changed. The Installed UI language cannot be.
The system default LCID is the default system locale, which can be changed. The Installed UI language cannot be.
Either of the following:System.Globalization.CultureInfo.CurrentCultureSystem.Threading.Thread.CurrentCulture
The most important change that occurs when the thread locale is changed is the resource language in the thread, meaning System.Threading.Thread.CurrentUICulture may be more accurate here.
System.Globalization.RegionInfo
GeoID is not supported in .NET 1.1, but 2.0 will support a RegionInfo.GeoId property.
Compare to the code page properties of System.Globalization.CultureInfo.TextInfo
Yikes! This is time consuming and will not detect all valid code pages, and will claim some are valid that may not be supported. How about calling Encoding.GetEncoding() with a CodePage identifier and trapping both ArgumentException and NotSupportedException, instead?
System.Globalization.SortKey
This is only one of the many possible uses of LCMapString, which also supports uppercase/lowercase, Hiragana/Katakana, fullwidth/halfwidth, traditional/simplified mappings. Of these, only the case mappings are supported in .NET.
Note Sets langid only.
This post brought to you by "E" (U+0045, a.k.a. LATIN CAPITAL LETTER E)
The title of this post is a slightly sanitized version of an actual email title I received, from a developer named Nancy who says she has been a faithful reader of this blog since it started. She noticed that usually passing it has no effect, but it occasionally makes a code page non-functional. And looking at a flag that either does nothing or makes the API do nothing, she wondered whether it was actually a flag that should be renamed to MB_DONTSTARTNONEWONTBENONE.
I'll put in that request right away. :-)
Seriously Nancy, I'll explain what this flag does now....
The MultiByteToWideChar API has a flag that it can be called with, MB_USEGLYPHCHARS. The documentation for this flag is quite vague, saying only:
Use glyph characters instead of control characters.
Not very descriptive, is it? :-)
The glyph characters are an OEM code page only contraption, with the same table in every one of them1, even code pages for languages that cannot be used in the console like Hebrew and Arabic. They are great for a little bit of legacy artwork in the console, I suppose. All of this stuff is just inherited from a DOS world and these things are so hardly used that they are not exposed in the .NET Framework at all.
If a code page has such a "glyph" table and you specify the MB_USEGLYPHCHARS flag then these are the only mappings you will get when converting to Unicode. Which is probably why people often don't use the flag -- getting no results back for data does not seem like a very useful exercise....
Here for the sake of completeness is the full "glyph" table:
That and "ASCII art" style things is about the best you can do in the console....
1 - The only exception is code page 864 ("Arabic - OEM") which has a completely broken table that gave me wildly different info when I called MultiByteToWideChar with the MB_USEGLYPHCHARS flag. Given that Arabic does not work well in the console, this probably does not cause a big loss in functionality....
This post brought to you by "☼" (U+263c, a.k.a. WHITE SUN WITH RAYS)A proud member of the glyph chars collection for more years than Seattle has seen sun
TrueType fonts under Win32 support multiple names, stored as resources inside the font file. This name is then used to identify the font in code. That resource string, like all resources, is read according to the machine's language settings. As anyone who understands localization will realize, this is very bad since it means that the functionality is changing when the language does (this string is not only used for display, it is used for programmatic purposes as well!). The font should be made to either accept only one name worldwide, or all names worldwide.... not to accept a different name depending on the machine's locale.
Fortunately, very few languages have ever taken advantage of this "feature" of font files.
Unfortunately, most Asian fonts do take advantage of it.
Thankfully, Windows 2000, XP, and Server 2003 have fixed the problem to the point where they will accept either name. For prior versions of Windows, the only practical solution is to try one font, then if that attempt fails to try the other. Thus, the list. :-)
This table is provided to give you both the English name and the localized name -- the latter will work only on that specific locale, and the former will work on every locale but that specific one. Feel free to use this information in your own applications that need to use specific fonts for East Asian data on different locales, on downlevel platforms.
Note: The question marks that appear in the English list of font names below is intentional. Due to what can only be considered really bad design decisions, these fonts were given Asian names for non-Asian locales (and such characters always become question marks when the resource file is not a Unicode one. Oops!!!). The ones marked in red do not exist -- in other words the font has but one name, which in this case is a good thing....
Looks like I may be speaking at Tech Ed 2005 in Orlando, FL. They have not contacted me yet about travel plans, and I am not willing to say whether its definitely happened until someone has forked out money for a plane ticket. So for now I'll just say I may be speaking. Though they seem pretty sure otherwise.
But I will go out on a limb and talk about the sessions now, for those who might be interested....
The topics:
Databases for the World: Designing Multilingual Databases Using SQL Server 2005
Track(s): Database DevelopmentYukon introduces new and enhanced international features such as those that are important to customers in East Asia - like the handling of supplementary characters (which has not been the case in prior versions). This session highlights the new features and provide code samples and best practices to exploit them.
Databases for the World: Optimizing Search in Multilingual Data Sets Using SQL Server Collation for Sorting and Indexing
Track(s): Database AdministrationMany SQL customers have poor understanding of how collation (sorting/indexing) works in multilingual databases and what the best practices are for searching multilingual data sets. This is an opportunity to learn the in's and out's of multilingual data set searching.
The titles/abstracts were not mine (honestly, do they sound like me? <grin>), but the sessions will be 100% me. And they will both be way cooler than the .NET Developers Association database talk I did last August since I will be able to say so much more about Yukon here than I was almost a year prior....
And there are people down in that part of the country who were wanting to find a means to send me briefcases full of money to talk about/train on these very topics in a consulting deal who can get the expertise at bargain prices if they show up for TechEd, which does not require the money in cash (small, non-sequential bills only, please!) the way I might have! :-)
Let's take a look at Korean for a moment.
Korean is encoded two different ways in Unicode. There are the Jamo (the pieces of characters that are used to make Hangul syllables):
and the actual Hangul syllables:
I'll talk more about the specifics of Jamo another day.
Now everything that is modern Hangul can be found in that Hangul syllables block, which was largely based on existing standards from Korea. Each of those can (in theory) also be encoded as the underlying Jamo, though in practice people do not tend to use them that way, in part because IMEs do not use this method and in part because the typography is mostly not there yet.
But Unicode normalization considers the Hangul syllables to be "Form C" (composite/composed) and the underlying Jamo to be "Form D" (decomposed). Thus e.g. the string "Korean" has these two different forms:
한국어 (d55c ad6d c5b4)
한국어 (1112 1161 11ab 1100 116e 11a8 110b 1165)
Even if you do not know anything about Korean at all, if you can see the text you can probably see how the former is made up of the pieces of the latter.
Now in actual practice, Modern Korean uses the Hangul Syllables.
But the Jamo serve another purpose -- to create Hangul Syllables that are not representable in the modern block. This is usually referred to as Old Hangul. The easiest way to detect whether a string is Old Hangul is try to normalize it to Form C; if that operation does nothing, then it usually means that it is not modern Hangul. For example, a string like "ᄇᄉᄐ" (1107 1109 1110).
Now there are times that even in Modern Hangul that one might have individual Jamo in with the syllables without it being considered "Old Hangul", something that products like Windows 2000 and SQL Server 2000 support.
And then starting in Windows XP, collation of Old Hangul as a scenario is supported, which is interesting since of course (as I said before) we do not yet have a typography story to fully support it. But there is a great deal of data that already exists for Old Hangul and being able to get that into computers is a good thing. And the strings are intelligible, at least.
As a matter of practical implementation, the work to equate the decomposed and composite forms of Korean in collation did not happen. While such an equivalence is interesting in theory, in practice Modern Hangul usually is the composed Hangul syllables. So while it may make for a useful operation in theory, the need to equate the two in collation is less important in practice. It is generally better to have data in Unicode Normalization Form C anyway when one is doing operations like collation in Microsoft products (and most data entered by MS keyboards is in Form C already).
So does Microsoft do the right thing here? Well, I have asked different people this question over the past few years (the last person I asked just days ago). And every time I talk to people who are native speakers of or experts in Korean I am more convinced that we are. Which is not to say that making the equivalence is wrong -- it's not (and no one has said that it is). But it simply does not seem to be something that impacts actual usage, if the equivalence is not made in collation. Those who do need it can of course use Unicode Normalization to have Form C data prior to comparisons, with no need to force everyone to go through this process. This way, everybody wins. :-)
And in my mind, user expectations beat the benefit of following a theoretical practice, every time....
This post brought to you by "ᄐ" (U+1110, a.k.a. HANGUL CHOSEONG THIEUTH)
The scene is familiar -- you are typing along and suddenly you are not seeing the letters you typed. And suddenly you imagine you are channeling your inner Homer Simpson as you say
D'oh, stupid keyboard!
But the computer has not been possessed. It may be the situation the inestimable Kate Gregory describes in Language bar have a mind of its own? :
For several months now, I've been plagued by unexpected language changes while I'm typing. I'll type one character, maybe a quote or a question mark, and I'll get a really strange character instead, say a capital E with an accent on it. I came to realize that it was the language settings, and I keep the language bar on my toolbar so I can flip back to English whenever this strange thing happens. But I didn't know why it was happening, and I found stopping what I was doing to mouse over to the bar and click back to the language I wanted very frustrating. Well, now I know what was going on! ALT-SHIFT rotates through the languages. I'm a huge ALT-TAB user, and I ALT-SHIFT-TAB when I need to cycle backwards through that list. I also use a fair amount of other ALT-things, like ALT-A to bring up the favourites menu in IE, then arrow keys to choose an item. I really prefer the keyboard to the mouse. Well I guess every once in a while an ALT-SHIFT gets through to the language bar and flips my language. So now when I go to type a URL and see ццц I can quickly make it right. Лфеу (er, Kate)
For several months now, I've been plagued by unexpected language changes while I'm typing. I'll type one character, maybe a quote or a question mark, and I'll get a really strange character instead, say a capital E with an accent on it. I came to realize that it was the language settings, and I keep the language bar on my toolbar so I can flip back to English whenever this strange thing happens. But I didn't know why it was happening, and I found stopping what I was doing to mouse over to the bar and click back to the language I wanted very frustrating.
Well, now I know what was going on! ALT-SHIFT rotates through the languages. I'm a huge ALT-TAB user, and I ALT-SHIFT-TAB when I need to cycle backwards through that list. I also use a fair amount of other ALT-things, like ALT-A to bring up the favourites menu in IE, then arrow keys to choose an item. I really prefer the keyboard to the mouse. Well I guess every once in a while an ALT-SHIFT gets through to the language bar and flips my language. So now when I go to type a URL and see ццц I can quickly make it right.
Лфеу (er, Kate)
That's actually one very common issue. And there is no shame in at all, though I admit to curiousity in wondering if Kate really has a cyrillic keyboard in her list? :-)
Happens to me all the time!
I was once trying to repro a bug that occurred only if you have more than 50 keyboard selected, and then one never knew what one was getting when one ALT-SHIFT'ed, or how to get back where one was before. I finally found a brilliant workaround though -- I added the US English keyboard 51 times, under 51 different languages. That way no matter what I accidentally switched to the letters would look the same. At the point things only sucked in one application -- can you guess which one?
It was Word. Can you guess how? Well, Word which chooses the language to tag the text with based on the input language, causing what I thought was a brilliant workaround to be one of the most non-intuitive blocker to proper spell checking since the time my dictionary fell off my balcony back when I lived on the third floor and viciously attacked a house plant. It did manage to prove that the book is mightier than the plant, though. Much to the chagrin of my former downstairs neighbor, who was quite happy when I finally moved several buildings away.
Where was I?
Oh yes, when keyboards seem to be misbehaving. Maybe this one seems familiar to you?
I have a couple computers at the office that run Word 2000 and lately whenever I try to put an accent mark on a vowel it just inserts two accent marks instead. (Quite annoying!) I've tried reinstalling the keyboard language and reinstalling and updating Office but to no avail.
I have a couple computers at the office that run Word 2000 and lately whenever I try to put an accent mark on a vowel it just inserts two accent marks instead. (Quite annoying!)
I've tried reinstalling the keyboard language and reinstalling and updating Office but to no avail.
Unfortunately, this one turned out to be the Bugbear.B worm. Luckily Symantec has a removal tool. But it is best to not ignore this sort of problem when it happens (the person who reported this particular problem admitted it had been going on for months).
One more -- similar to the last one but with a happier ending:
This has been bugging me for months. I am not sure when it started, but any time I try to put an apostrophe into a document, nothing happens. Then if I hit the key again I get two of them. I have to hit the backspace key to get what I wanted. So it takes three keystrokes to get me what should have taken one. Is this some sort of virus? Help!
This has been bugging me for months. I am not sure when it started, but any time I try to put an apostrophe into a document, nothing happens. Then if I hit the key again I get two of them.
I have to hit the backspace key to get what I wanted. So it takes three keystrokes to get me what should have taken one. Is this some sort of virus? Help!
Ah, no virus this time. However, it turns out that this person had installed the "United States - International" keyboard layout. This layout has the apostrophe as a dead key for an acute accent. And as I have said before, dead keys are not intuitive. In his case either the apostrophe and a space or uninstalling the layout were both okay options. He chose the latter since he did not need the international layout....
This post brought to you by "Я" (U+042f, a.k.a. CYRILLIC CAPITAL LETTER YA)
Eric Gunnerson has posted a link to a great resource: the Microsoft Win32 to Microsoft .NET Framework API Map.
Of course there are a bunch of mistakes in the NLS/MUI stuff (called National language functions on the map). I'll have to talk to some people about fixes there.... :-)
(It looks like pinvoke.net has none of these present for "managed alternatives")
Scott Hanselmen recently posted What Great .NET Developers Ought To Know (More .NET Interview Questions) and has been getting a fair amount of positive coverage for the list.
Now I won't say I don't like the list. And I obviously like Scott's blog (its on the list of the Blogs I read, after all!). But in my opinion I think the list has a lot to do with why I don't like many Microsoft interviews. When I do interviews myself, I generally like to avoid:
That last point maybe suggests what I do try to find -- questions that make people think about our scenarios (which are usually new to them) because I want to see them think. The hint of understanding how they pick up new ideas and work through problems in unfamiliar areas are the real test of how well someone will do at Microsoft, in my opinion. Because technologies change and knowing all about something today tells me nothing about what they will know next week or next month or next year. And once you hire someone, you kind of expect they will be around for those things....
There have been several times in posts here that I have hinted or outright stated that something might make an interesting interview question -- globalization is full of things like that. It is unlikely that one i mention here will be used because I'll have found other stuff by then, since most of the ones I use actually come from things that I was working on recently -- what better way to see if someone finds an area interesting than to see if something akin to what is being worked on (admittedly simplified to fit in a short timeframe) is engaging to them?
So, definitely you can pay attention to Scott's list and go the sites and read the books for some of the interviews you'll have on your interview day. But I am looking for something else, though -- I want to see the wheels turn. And there isn't a good technique to prepare for that....
1 - One exception to this rule -- sometimes when they did just get a CS degree or it seems like they have been visiting those web sites, I will take one of these sorts of questions but add some detail that turns the conventional question on its ear and requires them to think about the problem. But that is the key -- not to let anyone feel that their web browsing habits give them an edge. They have bring their brain with them to think, not to store trivia....
This post brought to you by U+fffc (OBJECT REPLACEMENT CHARACTER)
Last month, I mentioned about Calendars on Win32 -- Not all there yet and Calendars on Win32 -- just there for show.... and really did not do much more than hint about what was going on in the world of .NET. Well, I have good news and bad news.
The good news -- in .NET, calendars are not "just for show." Every date you format is also one you can parse back, and even convert to another calendar. And that is pretty freaking cool.
The bad news -- they still pick up a few of the silly litle quirks that existed in Win32, like the poor localization story for everything other than Gregorian.
Of course, it is not just an issue of recyled bits retaining problems. There are also new issues as well.
Like (for instance) the fact that although none of the various calendars that derive from the Calendar class are sealed (so in theory you can inherit and extend any of them), that you cannot do anything useful by extending the interface yourself. Because all of the formatting and parsing work that .NET does is not built into the calendar itself -- there are no interfaces that a developer could implement in their own WayCoolCalendar class to answer the "how do you format ______?" or "How do you parse ______?" questions. The fact that the formating and parsing functionality comes from outside of the calendar itself seems to violate some sort of OO principle, though I would have trouble explaining which one. It just seems wrong to me.
Not to mention the fact that it is hard to "get out of the way" when one is blocking the path so fully! :-)
In my opinion though, the biggest problem is not a limitation, but a thorny conceptual issue -- how to distance calendars from cultures when it is appropriate. There are many new calendars being added to Whidbey that are very useful as converters but which cannot be directly plugged into cultures or custom cultures since they (a) do not have parsing/formatting support or (b) make no sense as a primary calendar for a locale. Now the first problem may just be a schedule/resources issue that will be addressed eventually, but the second will not be "fixed" since it makes no sense for the calendar itsef. Unfortunately, there is really no other place to put calendars. Users will simply try to use the new calendars based on the existing paradigm. To fit that, we have to fix the intuitive expectation of users that we created by using the same type (Calendar) in so many different places.
Which means we need a way to keep people from intuitively expecting that calendars like for example the ChineseLunisolarCalendar would be used for the default calendar of a culture. There has to be a way to describe them as supplementary calendars that have real utility without making people think that all dates that are formatted for a culture would use them.
And it is not like I would expect the JulianCalendar to be the default for any locale or culture. Though I know of more than a few software products inside and outside of Microsoft over the years that use the Julian calendar for internal build numbers. And I guess software developers make up an interesting subculture, if nothing else....
The dilemma, in a nutshell? How to explain that some calendars are "cultural" without really being expected to influence a CultureInfo.
Perhaps the switch from the word "locale" to "culture" will get in the way here? :-)
This post brought to you by "B" (U+0042, a.k.a. LATIN CAPITAL LETTER B)
WARNING: No technical content whatsoever. I am just in a weird mood right now. If you want technical then wait a bit, I am sure something technical will happen soon enough....
I headed over to Trader Joe's last night. Not to shop, mind you. But to pick up my Limonata order. You see, I order it in bulk, usually about ten cases at a time. But I can easily go through a case a week between what I drink at work and what I drink at home, so it does not hang around too long.
On my way in, I saw my cousin's daughter. Well, she is actually my cousin, too. but I first met him and his wife when Maya was just a toddler, so it is hard to adjust to all of that and think of that little Maya who was unable to stand still as the young woman in front of me now. She was the great source of extremely silly questions in a survey I wrote about in Pinnacle's Smart Access about 157 years ago when she was a teenager and I was in Seattle for something or other (pre-Microsoft contracting). Now she is smart and funny and can take on anyone in a verbal spar, not that anyone is sparring at the moment. We just have an interesting family that way. :-) And she is right there with her fiance -- they are getting married this year, in the summer. They are a wonderful couple, they both look great together. I am as amazed as I was the first time I saw them together -- totally in love, etc. And it still seems just as awsome to me.
Anyway, after we say our goodbyes (we should really try to run into each other intentionlly some time!), I head into the store.
They knew exactly who I was, before I even said a word. They remembered from last time. It's the sort of thing that can take months at restaurants yet I am memorable after showing up once every 2- months. I'm sure they laugh about this weird guy with the cane who hobbles in to pick up his Limonata. Its not the sort of thing one forgets. And they do not laugh at me to my face, so if I can make their day then it does not cost me anything other than the price of the ten cases of Italian beverage, and I was going to buy that anyway.
Someone to the back to get the Limonata.
I am standing in the checkout line, it's my turn but the cans are not there yet. I tell the woman behind me cut in line. She looks at the cane with a litle worry in her eyes and says I should go ahead. I explain that I am waiting for something so she should definitely go ahead. She asks me something or someone and smiles. I say something and smile back. We are not really flirting at this point as far as I can tell, but maybe I just don't remember what that is like (it has been a while). Weird. Ten years ago I would have probably tried to ask for her phone number or something but I guess I have outgrown that (it is amazing how often mature wisdom resembles being simply way too flipping tired!).
Just then, the Limonata shows up and she has to smile again (I feel like everyone up there is smiling at me at that point -- or maybe laughing). She asks if this is for my group (when I look confused she points to my Microsoft cardkey, still on my belt). I explain no, it's for me. But there are worse substances one can be addicted to. This time she laughs, as does the person who is ringing me up, the manager who stands nearby, and the young lady with the handcart and the Limonata.
I pay for the ten cases, kind of catch the eyes of the three employees standing around watching the ten cases and my line colleague and say maybe I'll see them all in 10 weeks when I run out of Limonata again, and with one last smile head out....
On the way out, the young lady who works for Trader Joe's has the ten cases on a handcart. She asks me where I am parked and says she will take them to wherever I need them (she quickly realizes how that sounds, turns red and says she did not mean that like it sounded). I tell her no worries, I did not assume anything inappropriate. I point to my car, parked right in the handicapped space in front of the store. She laughs and says I'm easy, then predictably gets embarrassed again. She puts down the cart and I start to unload it. She tells me I had better not be doing that because she is female, and I assure her it is not. I would just feel weird standing there while someone else loaded up my car for me, like as if they were my personal sherpa or something. She says okay and pulls out the handcart. She is back in the store before I can give her a tip. Damn, I did not think she would be back in the store that fast. Maybe she thought I was unloading it to avoid tipping her -- now I feel guilty. :-(
And then I about to pull out, to head home. And I think about all the people who were by the checkout, smiling that one last time. Or maybe they are just laughing about the Limonata. I know I would be. It is not as eccentric as a Howard Hughes type of thing, but maybe it is in the same ballpark. After seeing The Aviator this last weekend, I guess I am paying attention to that sort of thing.
Maybe it will all happen again soon -- I'll be heading back in a few months, after all, for more Limonata. :-)
So, is this what people do with non-technical blogs? Not sure I could do it every day. I think I will have to stick to technical topics....
The March 2005 issue of MSDN Magazine is now online, and it contains an article written by yours truly. The article is entitled Make the .NET World a Friendlier Place with the Many Faces of the CultureInfo Class and attempts to capture many of the possible uses of CultureInfo (and how to choose the correct one to use in a managed application).
It is interesting how the article came about. Stephen Toub is a man who tends to prove wrong the (unfair) conventional notion of an editor since he is pretty astute technically. Maybe this explains why his title is "Technical Lead" and not "Editor" although he does work for Joshua Trupin, the Executive Editor of MSDN Magazine (and the guy who I have written articles for in the past). Anyway, Stephen often answers technical questions internally on Microsoft aliases. He and I tend to cross paths a whole lot since we hang out on the same aliases. After a particular question I had answered we started talking about how it clear that the "which culture should I use?" question was pretty commonly asked, and that perhaps a short piece that would try to go through the various uses and how to pick the right one in each case could come in handy.
Before you knew it, there was an article. :-)
Anyway, there are several interesting topics that I have covered here in various ways and others that I have not (yet). Hope you enjoy....
This post brought to you by "٪" (U+066a, a.k.a. ARABIC PERCENT SIGN)