Scott Hanselman

Baby Sign Language

November 21, 2006 Comment on this post [24] Posted in Musings | Parenting | Z
Sponsored By

UPDATE: Check out http://www.babysignlanguage.com for more info on Babies and Sign Language!

Z and the Giant DogZ's fast approaching his first birthday (can you believe it?) and he's really started letting us know that he's in there. There's a real little person in there who's not just hanging out and pooping.

We've been teaching Z American Sign Language (ASL) since he was about 4 months old. I say "teaching" loosely, because we've just used it every time we talk to him, and figure he'll get the just sooner or later.

Mo and I have both taken ASL at the local community college from a non-verbal deaf instructor and we've taken Z to formal Baby Sign Language classes that use ASL (and as an aside, have a specific respect for the deaf community and don't 'invent' signs) as the source of signs.

We started getting discouraged around his 8 month birthday as it just didn't seem like he was signing back. It was pretty clear he "got" what we were saying, but he just didn't reciprocate.

Then, he started showing intense interest in turning on and off lights. So, we showed him the sign for light, which is a downward turned hand with straight, splayed fingers representing the light rays. Sounds complex, but it's pretty obvious when you see it. Anyway, he immediately started using this sign. He just got it. He started signing light frantically one day, and my wife couldn't figure out why; then she realized she was buying a bulb in the light section of Home Depot and was surrounded by chandeliers.

Ceiling fans were next and Z happily announced their arrival with the sign for fan. It seemed he was getting the concrete signs for things, but not the abstract concepts like "more."

Just after Z started walking, he started signing things like "more" when he wanted more food. At this point, it's getting really exciting.

I truly believe that Sign Language is encouraging Z to communicate earlier. I don't keep track of other kids' accomplishments at this age or that, so I have nothing to measure against (nor am I interested) but I feel like I haven't had to wait long to connect with Z. Just a month later, we "talk" about such thrilling escapades as "the Man in the Boat" and "the Banana in your Hair" as well as "the Giant Dog" as seen in the picture at the upper right.

He's also starting to attempt to speak the word while he signs it, like "lala" while signing "Light." The amount that he understands verbally, even at under a year old, is amazing to me. I don't know what I expected, nor again, what other kids do, but tonight I said "ok, let's go take a bath!" and he ran from he kitchen to the stairs, climbed the stairs by himself and ran into the bathroom and tried to turn on the water. That's crazy to me that babies can hold a thought that long. Hell, I can't hold a thought that long.

This tiny little man has something to say, but his tongue just isn't ready yet. His hands though, are starting to tell quite the tale, and I look forward to talking with him daily.

I had a chat with a German fellow while in Spain this last week who had a 15-month old, and I mentioned that we were teaching the baby sign language and that many Americans were trying this technique.

I explained that we felt that there was a window of time, from about 9 months old to whenever the baby starts talking, that was had great potential for not just communicating with your baby, but connecting and letting the baby know their needs matter. That many of us had the idea that babies cry when their needs aren't met and sign language was a good way for the baby to effectively express their intent.

He looked at me like I was from Mars. "My wife knows what the baby needs. There's no need for sign language." The 'that's stupid' was implied, if not expressed. I respect his opinion, but I beg to differ. It really is a joy, and others agree.

We use the Baby Signing Time videos, as well as Dr. Joseph Garcia's Baby Signers, but really any ASL dictionary will do. Z's got about 12 words now, but I suspect he's picking them up as fast as we can learn them ourselves.

If you've got an infant, I really encourage you to try Sign Language. We're a multi-lingual house already and hope Z will speak English and some Ndebele, and I plan to have him in a Spanish immersion program. If you treat ASL as just another language, it helps (me at least) the mental model. We just move our hands while we talk to him, and I'm very happy with the results.

Have you signed to your baby? When did you start? When did they sign back? Do any of you have older (4, 6, 8...) kids that still sign? Do any of you think this is all nonsense? Discuss.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Hanselminutes Podcast 41 - WS-*

November 17, 2006 Comment on this post [1] Posted in Podcast | Web Services
Sponsored By

My forty-first Podcast is up.  In this one, Carl and I talk about some of the underlying specs that make up what everyone calls "WS-star". It's a confusing bunch of specs, and I hope I explain it correctly as I think it is a useful thing for folks to know.

We're listed in the iTunes Podcast Directory, so I encourage you to subscribe with a single click (two in Firefox) with the button below. For those of you on slower connections there are lo-fi and torrent-based versions as well.

Subscribe: Feed-icon-16x16 Subscribe to my Podcast in iTunes

Links from the show are also always on the show site, although this show had no links to speak of. Do also remember the archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Our sponsors are CodeSmith Tools, /nsoftware and the .NET Dev Journal.

There's a $100 off CodeSmith coupon for Hanselminutes listeners - it's coupon code HM100. Spread the word, now's the time to buy. This coupon is good for the CodeSmith Professional With 1 Year Premier Support option.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

  • The basic MP3 feed is here, and the iPod friendly one is here. There's a number of other ways you can get it (streaming, straight download, etc) that are all up on the site just below the fold. I use iTunes, myself, to listen to most podcasts, but I also use FeedDemon and it's built in support.
  • Note that for now, because of bandwidth constraints, the feeds always have just the current show. If you want to get an old show (and because many Podcasting Clients aren't smart enough to not download the file more than once) you can always find them at http://www.hanselminutes.com.
  • I have, and will, also include the enclosures to this feed you're reading, so if you're already subscribed to ComputerZen and you're not interested in cluttering your life with another feed, you have the choice to get the 'cast as well.
  • If there's a topic you'd like to hear, perhaps one that is better spoken than presented on a blog, or a great tool you can't live without, contact me and I'll get it in the queue!

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Downloading Vista RTM

November 16, 2006 Comment on this post [16] Posted in Reviews | Tools
Sponsored By

Only 18 minutes left. I'm downloading Vista off of MSDN right now at a speedy 2 megs a second.

I've been running RC2 on my main machine at home since it came out and I've had a MUCH better experience than RC1.

My RC1 experience was very Beta 3, shall we say, and it kind of soured me.

However, I got to play with RTM on a few Microsoftie's machines at TechEd Europe last week, and my own experience with RC2 and ReadyBoost (using an Apacer Handy Steno) has been stellar. Only one blue screen in the last three weeks, and that was an ATI Display Driver bug.

I'm hoping to upgrade over RC2 (ya, I know, that's not very clever, but I'll try it if it's possible, as I REALLY don't feel like paving my machine again this year) and I'm wondering what order I should do things in.

I think I will:

  • Remove all things Office 2007 Beta 2 TR from my current Vista RC2 installation
  • Upgrade to Vista RTM
  • Upgrade to the Beta ATI Drivers for Vista RTM (Catalyst 8.31.100)
  • Install Office 2007 Professional
    • I'll skip the other apps like InfoPath, OneNote, and Visio, until I hear that they've got this whole product key thing fixed. (Right now, even though a product key is supposed to allow 10 activations (and really should be 10 PCs) it only allows one application!)

Sound like a plan? 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Making the ASP.NET Mobile Controls render RTL languages

November 16, 2006 Comment on this post [4] Posted in ASP.NET | Internationalization
Sponsored By

When you're rendering HTML for an Arabic or Hebrew speaking audience (or Farsi, or Divehi, or Urdu, or Syriac) you usually want to change the direction of the entire page, and that's done by adding dir="rtl" to a containing element of your page, typically the HTML outer element if you want the scrollbar to switch from the left to the right. RTL, of course, means Right To Left, as these languages are typically read right to left.

In ASP.NET 1.x, this was difficult programmatically, necessitating the BODY or HTML tag being runat="server" as you went hunting for it and manually added the dir="rtl" attribute yourself. I talked about this on the blog three years ago.

It gets a little easier in ASP.NET 2.0 with the addition of the ContentDirection enumeration/property that's added to the Panel and WebPart controls.

However, if you're working with the MobileControls, it appears to be quite a bit harder, as the whole "form" metaphor changes. The Mobile stuff in ASP.NET has the notion of multiple "forms" per page where only one is active. It is that active form that does the actual rendering of the <html> element.

That means even if you have "<html xmlns="http://www.w3.org/1999/xhtml">" in your ASPX markup, you might end up with just <html> because it is the mobile:Form control that does the rendering via a PageAdapter that inherits from MobileTextWriter.

The mobile stuff in ASP.NET is very powerful, but very obtuse. I wanted to add dir="rtl" programmatically, but there's no support for custom attributes on a mobile:Form, and the Alignment="right" attribute is semantically different from dir="rtl."

Here's a page with Hebrew on it that has dir="ltr," which is also the default if you include no dir= attribute. Notice that the there are three labels for Account Name, Number, and Amount, and the labels that are within strings that include numbers have the labels on the RIGHT with the colons (:) within the label to the LEFT of the label.

That is, NUMBER COLON LABEL.

While the line without numbers, or more specifically with English included has the Hebrew labels with a colon to the right.

That is LABEL COLON ENGLISHWORD.

This is because the browser, independent of dir= attribute (or lack of one) is trying to "do the right thing" with this mixed content page (that happens to be Unicode). You can override this behavior with markup like dir= or with CSS styles like unicode-bidi: bidi-override or unicode-bidi: embed. More details on that are in the very good W3C I18N FAQ on CSS vs. Markup for BIDI (BiDirectional) support. In this post, I'm just talking about markup.

I tried to do this:

this.ActiveForm.CustomAttributes.Add("dir","rtl")

but I got this funny error message. Why funny you ask? Because it's telling me that I can't set dir="rtl" but if you do a view source (or just notice where the scrollbar is!) you'll see that it DID in fact successfully apply dir="rtl". 

This error goes away if I add this to my web.config.

<mobileControls cookielessDataDictionaryType="System.Web.Mobile.CookielessData" allowCustomAttributes="true"/>

However, the CustomAttributes bag isn't the way to effectively manipulate the rendering of the mobile controls. 

Instead, I needed creating my own PageAdapter, specifically a DirectionAwareHtmlPageAdapter:

   1:  namespace Corillian.Web.Mobile
   2:  {
   3:      public class DirectionAwareHtmlPageAdapter : System.Web.UI.MobileControls.Adapters.HtmlPageAdapter
   4:      {
   5:          public override void RenderForm(System.Web.UI.MobileControls.Adapters.HtmlMobileTextWriter writer, System.Web.UI.MobileControls.Form form)
   6:          {
   7:              writer.BeginFile(this.GetFormUrl(form), "text/html", this.Page.Response.Charset);
   8:   
   9:              //Added by me to support RTL - sucks!
  10:              writer.WriteBeginTag("html");
  11:              if (Corillian.Voyager.Web.Globalization.CurrentCulture.IsRightToLeftCulture(Thread.CurrentThread.CurrentUICulture.Name))
  12:              {
  13:                  writer.WriteAttribute("dir", "rtl");
  14:              }
  15:              writer.Write(System.Web.UI.MobileControls.Adapters.HtmlMobileTextWriter.TagRightChar);
  16:   
  17:              form.RenderControl(writer);
  18:              if (this.Device.RequiresDBCSCharacter)
  19:              {
  20:                  writer.Write("<!--\u3000-->");
  21:              }
  22:              writer.WriteEndTag("html");
  23:              writer.EndFile();
  24:          }
  25:   
  26:      }
  27:  }

This kind of sucks, because the only CUSTOM code is between line 9 and 15. The rest is copy/pasted directly out of HtmlPageAdapter using Reflector. I really think the mobile guys (and the whole ASP.NET team) should have considered the need for dynamically changing page direction for both mobile and desktop HTML. Perhaps this adapter technique is what they recommend, or perhaps there's a hidden or simpler way that I haven't figured out yet. If so, I'll post that and retract all this silliness...but until then...

You'll notice the call to a custom method called "IsRightToLeftCulture." I couldn't find anywhere in the Globalization namespace where one could just ASK a CultureInfo object if it referred to a RTL or LTR language. I know this was the case in .NET 1.1, and I'm 99% sure it doesn't exist in .NET 2.0 either. I'd love to be told otherwise.

UPDATE: I can use System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft() in .NET 2.0 so there's no need for this function under 2.0.

So, here is this little gem, but what price my immortal soul?

   1:  /// <summary>
   2:  /// Returns true if the supplied culture (or its parent) is read from Right-to-Left
   3:  /// </summary>
   4:  /// <returns>True if the supplied culture (or its parent) is read from Right-to-Left</returns>
   5:  public static bool IsRightToLeftCulture(string culture)
   6:  {
   7:      //Only look at the parent culture.
   8:      string myCulture = culture.Split(new char[]{'-'})[0];
   9:      switch (myCulture)
  10:      {
  11:          case "ar":        //Arabic
  12:          case "fa":        //Farsi
  13:          case "div":        //Divehi
  14:          case "syr":        //Syriac
  15:          case "he":        //Hebrew
  16:          case "ur":        //Urdu
  17:              return true;
  18:      }
  19:      return false;
  20:  }

Now that I have this new PageAdapter, I need to tell the world about it by editing my web.config:

<mobileControls cookielessDataDictionaryType="System.Web.Mobile.CookielessData" allowCustomAttributes="true">
    <device name="DirectionAwareHtmlDeviceAdapters" inheritsFrom="HtmlDeviceAdapters" pageAdapter="Corillian.Web.Mobile.DirectionAwareHtmlPageAdapter,App_Code"/>
</mobileControls>

Note the Assembly Qualified Name (QN) in the pageAdapter attribute. See how the ClassName,AssemblyName uses "App_Code" for the assembly name? That's because my DirectionAwareHtmlDeviceAdapter.cs file is in my App_Code directory. That's one of the well-known directories that automatically gets compiled when there's a .cs file in it. The assembly that's generated is App_Code.dll. A little confusing. Alternatively, I could have put the class in a separate and more manually-compiled assembly and referenced it from there.

Now that the dir="rtl" is added to the HTML element the whole page renders correctly with the labels and all page elements not only right aligned, but rendered right-to-left. The direction changes dynamically based on the browser's Accept-Language HTTP Header.

Thanks to Patrick Cauldwell and Travis Illig for their help debugging today!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

How to convert a text file with a specific Codepage to UTF-8 using Visual Studio .NET

November 15, 2006 Comment on this post [6] Posted in Internationalization
Sponsored By

A partner recently sent me a RESX (.NET Resource) text file in Hebrew for a project I'm working on. When I opened it, it looked really bad, as seen in the screenshot below.

I assumed this was a classic ANSI vs. UTF-8 problem, so I tried to do a quick conversion within Notepad2, but that resulted in nonsense East Asian characters from all over:

This means that the original file was in fact in ASCII, but just not using an English codepage. I've talked a little about codepages in the Hanselminutes Podcast on Internationalization in the past and regularly point folks to the Joel on Software article on Internationalization.

In a nutshell, a codepage is a "view" that someone can use to look

Ordinarily, I recommend that everyone (including Israelis) use Unicode/UTF-8 to represent their Hebrew characters, however, a lot of folks who write Hebrew use the Windows 1255 codepage for their encoding. (BTW, go here, scroll down, and bask in the glory of this reference site.)

So, how do I convert from one codepage to another, or in my case, from Hebrew 1255 to UTF8?

We start with Visual Studio.NET.

  • From the File menu, select Open to bring up the dialog. Note that you'll have to select a file before the Open button is un-grayed.
  • Select the tiny down-arrow on the right side of the Open button and select "Open With..."
    • -5 points for obscure UI design here
  • Next, select "Source Code (Text) Editor with Encoding." The With Encoding part is crucial, otherwise the next dialog won't appear.
  • From the Encoding Dialog, select the source document's encoding - in my case, that's Hebrew 1255.
    • -10 points for obscure UI design here.
  • At this point the document should appear correctly in Visual Studio.NET. Now, reverse the process by selecting File|Save As and clicking the tiny down arrow on the Save button, and selecting both the desired Encoding and Line Endings.

Now you've successfully normalized your document to UTF-8, and it should be usable as a RESX file or whatever you like. Here's that same document loaded into Notepad2.

And it was Good.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.