Monthly Archives: December 2011 - Page 3

What’s new for EWS in Exchange 2010 SP2?

The Exchange 2010 SP2 Web Services SDK was released in October but Exchange 2010 SP2 was only recently made available for download earlier this month. With the update to the SDK, there’s the common section detailing What’s New in the SDK. While this information is very helpful, I felt the need to aggregate and summarize what’s there so that I could get a better understanding of the changes.

For the benefit of the rest of the world, I’ve shared my notes below…

New Exchange2010_SP2 RequestServerVersion value. Obviously, there’s a new schema version value which must be requested to take advantage of the changes outlined below.

ConvertId, GetUserOofSettings, SetUserOofSettings, and GetUserAvailability now support impersonation.  GetUserOofSettings and SetUserOofSettings support for impersonation might have been added in a previous rollup update to Exchange 2010 SP1 but ConvertId and GetUserAvailability support for impersonation is new to SP2.

GetPasswordExpirationDate operation added.  Pass an email address and get back a date indicating when the user’s current password will expire.

FindItem and GetItem get a new SOAP header, DateTimePrecision.  This allows you to request that you would like the millisecond values returned in DateTime property values. By default, EWS does not return milliseconds with DateTime values – it always returns zeroed out milliseconds. Unless you really need millisecond precision in some use case, I wouldn’t recommend using this level of precision.

StoreEntryId element added to Item schema.  This new schema property maps to PidTagStoreEntryId and could be used for interoperability with MAPI code. It could also be used to determine which items came from the same mailbox.

New elements added to the contacts schema:

  • Alias – Contact’s alias from AD
  • DirectoryId – This is the GUID or DN identifying the AD user object
  • DirectReports – An array of Mailbox elements for each direct report of the contact
  • ManagerMailbox – A Mailbox element for the contact’s manager
  • MSExchangeCertificateuserCertificate attribute on AD user object
  • Notes – Returns the info attribute of the AD user object
  • PhoneticFullName – Returns the msDS-PhoneticDisplayName attribute of the AD user object which would be used to phonetic pronounce the contact’s display name by a speech system. For example, my full name is “Matt Stehle” but by phonetic full name would be “Matt Steel” to make sure Lync or some other system doesn’t butcher the pronunciation of my last name.
  • PhoneticFirstName – Returns the msDS-PhoneticFirstName attribute of the AD user object.
  • PhoneticLastName – Returns the msDS-PhonecticLastName attribute of the AD user object.
  • Photo - A byte array of the photo property of the AD user object.
  • UserSMIMECertificate – Returns the userSMIMECertificate attribute of the AD user object.
  • ProxyPartnerToken – This is only used internally right now.

IsArchive added to AlternateIdType.  Enables support for ConvertId with archive mailboxes.

NoForward added to DeliverMeetingRequestsType.  This means that meeting items will NOT be forwarded to the delegate.

ErrorAttachmentNestLevelLimitExceeded error code added.  Error thrown if an item has attachments nested one past the allowed max for EWS (currently this limit is 10).

ContactDataShape added to ResolveNames.  Same type as the shapes used in FindItem, GetItem, etc. – AllProperties, Default, IdOnly. Only affects the ContactData returned so if ReturnFullContactData is set to false then this element does nothing. IdOnly returns only the mailbox data and DirectoryId.

IsAssociated added to the UploadItemType.  Enables uploading streams to the associated contents of a folder.

What’s new for EWS in Exchange 2010 SP2?

The Exchange 2010 SP2 Web Services SDK was released in October but Exchange 2010 SP2 was only recently made available for download earlier this month. With the update to the SDK, there’s the common section detailing What’s New in the SDK. While this information is very helpful, I felt the need to aggregate and summarize what’s there so that I could get a better understanding of the changes.

For the benefit of the rest of the world, I’ve shared my notes below…

New Exchange2010_SP2 RequestServerVersion value. Obviously, there’s a new schema version value which must be requested to take advantage of the changes outlined below.

ConvertId, GetUserOofSettings, SetUserOofSettings, and GetUserAvailability now support impersonation.  GetUserOofSettings and SetUserOofSettings support for impersonation might have been added in a previous rollup update to Exchange 2010 SP1 but ConvertId and GetUserAvailability support for impersonation is new to SP2.

GetPasswordExpirationDate operation added.  Pass an email address and get back a date indicating when the user’s current password will expire.

FindItem and GetItem get a new SOAP header, DateTimePrecision.  This allows you to request that you would like the millisecond values returned in DateTime property values. By default, EWS does not return milliseconds with DateTime values – it always returns zeroed out milliseconds. Unless you really need millisecond precision in some use case, I wouldn’t recommend using this level of precision.

StoreEntryId element added to Item schema.  This new schema property maps to PidTagStoreEntryId and could be used for interoperability with MAPI code. It could also be used to determine which items came from the same mailbox.

New elements added to the contacts schema:

  • Alias – Contact’s alias from AD
  • DirectoryId – This is the GUID or DN identifying the AD user object
  • DirectReports – An array of Mailbox elements for each direct report of the contact
  • ManagerMailbox – A Mailbox element for the contact’s manager
  • MSExchangeCertificateuserCertificate attribute on AD user object
  • Notes – Returns the info attribute of the AD user object
  • PhoneticFullName – Returns the msDS-PhoneticDisplayName attribute of the AD user object which would be used to phonetic pronounce the contact’s display name by a speech system. For example, my full name is “Matt Stehle” but by phonetic full name would be “Matt Steel” to make sure Lync or some other system doesn’t butcher the pronunciation of my last name.
  • PhoneticFirstName – Returns the msDS-PhoneticFirstName attribute of the AD user object.
  • PhoneticLastName – Returns the msDS-PhonecticLastName attribute of the AD user object.
  • Photo - A byte array of the photo property of the AD user object.
  • UserSMIMECertificate – Returns the userSMIMECertificate attribute of the AD user object.
  • ProxyPartnerToken – This is only used internally right now.

IsArchive added to AlternateIdType.  Enables support for ConvertId with archive mailboxes.

NoForward added to DeliverMeetingRequestsType.  This means that meeting items will NOT be forwarded to the delegate.

ErrorAttachmentNestLevelLimitExceeded error code added.  Error thrown if an item has attachments nested one past the allowed max for EWS (currently this limit is 10).

ContactDataShape added to ResolveNames.  Same type as the shapes used in FindItem, GetItem, etc. – AllProperties, Default, IdOnly. Only affects the ContactData returned so if ReturnFullContactData is set to false then this element does nothing. IdOnly returns only the mailbox data and DirectoryId.

IsAssociated added to the UploadItemType.  Enables uploading streams to the associated contents of a folder.

Windows Phone Keyboard: Speed demon or just a demon?

Is the Windows Phone Keyboard just another piece of crud from the “soft” keyboard crowd?  Or is it something that has a lot of thought behind it?  I am going for the lot of thought behind it. As a person who views the lame keyboard system on the iPad as a way to slow down thinking and entering information, having to use a softkeyboard was not something I looked forward to.  When I first got my WP7 phone, I longed for the handwriting recognition that was on the earlier Windows Phones…(read more)

Windows Phone Keyboard: Speed demon or just a demon?

Is the Windows Phone Keyboard just another piece of crud from the “soft” keyboard crowd?  Or is it something that has a lot of thought behind it?  I am going for the lot of thought behind it. As a person who views the lame keyboard system on the iPad as a way to slow down thinking and entering information, having to use a softkeyboard was not something I looked forward to.  When I first got my WP7 phone, I longed for the handwriting recognition that was on the earlier Windows Phones…(read more)

Windows Phone Keyboard: Speed demon or just a demon?

Is the Windows Phone Keyboard just another piece of crud from the “soft” keyboard crowd?  Or is it something that has a lot of thought behind it?  I am going for the lot of thought behind it. As a person who views the lame keyboard system on the iPad as a way to slow down thinking and entering information, having to use a softkeyboard was not something I looked forward to.  When I first got my WP7 phone, I longed for the handwriting recognition that was on the earlier Windows Phones…(read more)

Windows Phone Keyboard: Speed demon or just a demon?

Is the Windows Phone Keyboard just another piece of crud from the “soft” keyboard crowd?  Or is it something that has a lot of thought behind it?  I am going for the lot of thought behind it. As a person who views the lame keyboard system on the iPad as a way to slow down thinking and entering information, having to use a softkeyboard was not something I looked forward to.  When I first got my WP7 phone, I longed for the handwriting recognition that was on the earlier Windows Phones…(read more)

Getting Your Notes Into OneNote

How easy is it to take notes in OneNote?  Simple, just run OneNote and start taking notes, right?  Well, for some it may be that easy.  But for others, there’s the added overhead of organization.  For example, you might have a section for shopping, or a To Do list of things that need to be done around the house, or a notebook of notes you take at work, or school, etc.  Before you take notes, you have to think about where those notes go.  So, if you’re out shopping and you see a great deal on that television you’ve been thinking about purchasing, or meet a friend who suggests a book for you to read, or you’re in a meeting and hear something you want to capture quickly without distracting yourself from the discussion.  Do you really want to take the time to figure out where these notes will go before you take them?  Or do you want an easy way to quickly take a note and deal with the organization later?

This is where Side Note comes in. What is Side Note you ask? It’s a smaller, compact version of the same OneNote you’ve grown to love over the years. Think of it as a sticky note. It’s there when you need to take a quick note. Just press the <Windows + N> keys on your keyboard and you’ll see a new clean surface appear where you can jot down that quick little note and not have to worry about where to file it. Then close the application and continue about your business. Each time you press <Windows + N> you get the same experience, a compact, clean surface for which to take your notes.

image

When you finally get that extra minute and you’re ready to organize your notes, just go to your Unfiled Notes section and you’ll see your notes there. You can then organize them by moving them to the section/notebook of your choice.

With SkyDrive and many other means of storage available, you can access your notes in the cloud and get to them from anywhere.  Your PC at home or at work, your Windows Phone, or at the kiosk on your college campus.  This makes it even easier to get notes into OneNote from anywhere.  But there’s a catch!  Unfiled Notes in OneNote 2010 does not come preconfigured for the cloud, so there’s a little bit of work you’ll have to do if you want your Unfiled Notes to be accessible from anywhere.

  1. Make sure your Unfiled Notes section lives inside a web notebook (by default, the Unfiled Notes section generally lives at the root of all your OneNote notebooks, not inside of an existing notebook).  This can be any web notebook you choose, but for simplicity sake, you may want to create a new “Miscellaneous” notebook on SkyDrive.
    • Click File –> New, select Web and sign into SkyDrive, (you may have to create a new Hotmail or Live account first).
    • Then type “Miscellaneous” into the name field and click Create Notebook.
  2. Move the Unfiled Notes into the Miscellaneous notebook.
    • Right-click on the Unfiled Notes section –> click on Move or Copy –> select the Miscellaneous notebook –> click Move.
  3. Point OneNote to the Unfiled Notes section in your web notebook.
    • Click File –> Options –> Save & Backup –> select Unfiled Notes Section –> click Modify –> select Unfiled Notes in the Miscellaneous notebook.

You can also set your Windows Phone to point quick notes to the Unfiled Notes on your web notebook by following these steps:

  1. Go to the Notes area of the Office hub.
  2. Tap the Notebooks button.
  3. Go into the Miscellaneous notebook.
  4. Tap and Hold the Unfiled Notes section.
  5. Select Set as Default.

Now that you’ve completed these steps, anytime you press <Windows + N> or tap the New button in the Notes area of the Office hub to create a new note, it will automatically be synced to SkyDrive and accessible from anywhere.

Waiting for Your Windows Phone Beta App

Publishing a beta version of a WP7 app is both exciting (“does it work on someone else’s phone?”) and frustrating (“when is it going to actually show up?”). Having submitted maybe five beta versions over the holidays I wanted to improve the latter problem.

The beta submission process today looks like this:

  • Submit your app in the App Hub as a beta app
  • At some random point in time (1-8 hours in my experience) you receive an email from Windows Phone Marketplace claiming it is available to your beta testers, including a zune: link
  • You try the zune: link and it says “sorry this item is no longer available in this marketplace” and you curse
  • At some other random point in time (2-24 hours in my experience) the link will start working
  • You send email to your beta testers for them to beat on your app

What follows is a simple PC tool I wrote that at least will tell me when the download is available. There isn’t much I can do about the delay in getting the email, but once the email arrives I copy the appid out of the link (the appid is the guid portion), paste it into this fugly WinForms app, and click Wait.

I won’t insult you (or embarrass myself) by showing you the WinForms code, but here is the crucial part:

private void button1_Click(object sender, EventArgs e)
{
    Guid appid;
    string guid = textBox1.Text;
    if (!Guid.TryParse(guid, out appid))
    {
        MessageBox.Show("Not a valid guid");
    }
    else
    {
        string uri = "http://catalog.zune.net/v3.3/en-us/apps/" + guid + "?store=Zest&clientType=WinMobile+7.1";
        this.Text = "Waiting now...";

        for (; ; )
        {
            try
            {
                string result = new WebClient().DownloadString(uri);
                Debug.WriteLine("Download found at " + DateTime.Now.ToString());
                break;
            }
            catch (Exception ex)
            {
            }
            // Wait for 10 minutes
            System.Threading.Thread.Sleep(10 * 60 * 1000);
        }

        this.Text = "Found it!";
    }
}

Of course you could extend this idea to emit a loud beeping sound, or send yourself or your beta testers an email, or even turn it into a Phone app with a background agent and Live Tile notification. (If you do the latter, be sure to send me a beta!).

7.0 Apps

I only do Mango apps myself these days: if you are still creating 7.0 apps, change the url to use 3.2 and 7.0 instead of 3.3 and 7.1.

Detecting Non Beta Apps

This same idea can also be used to detect when an update to a non-beta app is available, but it requires a little more work: you will need to parse the string returned from DownloadString for the current version, and trigger your alarm only when it has changed. This is left as an exercise for the reader.

In an ideal world the App hub would publish beta apps in minutes from submission, but until it does I hope this tool proves useful.

We call ‘em ShortestDayNames for a reason; they’re as short as they’re EVER gonna be!

Once upon a time, Windows had two kinds of day names.

There were the actual day names, which could be queried via the LOCALE_DAYNAME* constants, and eventually the DateTimeFormatInfo.DayNames Property.

And there were the abbreviated day names, which could be queried via the LOCALE_SABBREVDAYNAME* constants, and eventually the DateTimeFormatInfo.AbbreviatedDayNames Property.

The second group was in theory more suited to calendars and such, where space could be quite constrained.

Now when I say abbreviated day names, I should have put it differently.

And called them “abbreviated” day names, instead.

Or perhaps <air quotes>abbreviated<air quotes>, if you know what I mean!

Because for many locales, the informants giving us data just shrugged and responded simply:

We don’t abbreviate these!

Not such a great story for mythical calendars, mind you, but their principal argument drowned out the theoretical scenario quite handily.

After all, we weren’t in the localizable calendar business back then!

We did have a MonthCal common control. And a DTPicker common control. But their built-in calendar “grid” pieces were not localized (and incidentally only supported Gregorian) – a long drawn out point of contention, as I mentioned in WinForms DateTimePicker and MonthCalendar do not support culture settings.

It made abbreviated names pretty freaking theoretical!

Until Vista, that is.

That is when we saw the updates described in my blog New in Windows Vista: updates to clock and calendar.

Underneath those changes, we realized that the LOCALE_SABBREVDAYNAME* constants simply would not do. And there was no algorithmically way to reliably create them

Thus were born the LOCALE_SSHORTESTDAYNAME* Constants, and of course the DateTimeFormatInfo.ShortestDayNames Property.

But before finally settling on those names, it is important to point out the original name.

From an evidentiary standpoint, the defense lawyer might object by claiming this would be circumstantial but A.D.A. Ben Stone would say “goes to state of mind”.

The judge would agree.

Way too much Law & Order in my past, obviously — but the idea of Ben Stone trying my Law & Order: World-Readiness Unit is too seductive to ignore!

We called them:

LOCALE_SONELETTERDAYNAME*

initially, and

LOCALE_STWOLETTERDAYNAME*

when data started coing in that was often two letters and people started complaining on technical and suability grounds about the name. We even ntertained

LOCALE_SUPERSHORTDAYNAME*

at one point!

And when the request for data went out to all of our subsidiary program mangers, we gave the name prominent placement so our intent would be obvious.

But sometimes they would simply copy and paste the full day names, saying

We don’t abbreviate these!

And our answer was unambiguous and unchanging, in the manner of “tough love”:

Look, we’ve wanted the MonthCal to be localizable/localized for years now, and we are doing that. But in order for it to succeed, we need very very short day names.

You are welcome to ignore the directive, but in that case we are going to truncate the names for you.

Consider this data request to be your chance to decide how things will be truncated!

For some locales they realized how dangerous that would be. Like Hebrew, with day names of like ??? ????? and ??? ??? and so on, where truncation would make them look the same, they realized the risk of trying to call our bluff!

Some of them continued to push back, insisting that the needed two letters or maybe even three in select cases, e.g. for Hungarian:

H K Sze Cs P Szo V

and we shrugged and said fine, though on occasion they may find themselves truncated. But we knew that if they were calendars that even the truncations would be okay in such cases, since no user would ever expect calendars to re-order their day names!

When you get down to it, in a calendar grid, no English speaking user will find a top row of:

S M T W T F S / M T W T F S S

vs.

Su Mo Tu We Th Fr Sa  /  Mo Tu We Th Fr Sa Su

to be completely incomprehensible, unless they don’t know what a calendar even is!

A lot of this has been previously discussed, in blogs like {recycled joke here} It could have been called LOCALE_SSINGLESERVINGDAYNAME*, but the focus was on how we were trying to “tame” the language experts and informants, all of whom we needed to provide data. And also how we lost a little bit of the mission and the scenario ourselves until we realized some of the requests we were getting just were not reasonable….

However, since that time in the days of Longhorn when we wrote the code or Vista when we shipped it, people have been using and enjoying the LOCALE_SSHORTESTDAYNAME* Constants, and of course the DateTimeFormatInfo.ShortestDayNames Property, and a new phenomenon has cropped up many times.

Someone will insist on the need to have these LOCALE_SSHORTESTDAYNAME*/ShortestDayNames values to never be more than two characters, or occasionally even one character (even though almost none of them are one character by now!).

We have to adopt a “talk to the hand” attitude here — and tell them that the LOCALE_SSHORTESTDAYNAME*/ShortestDayNames are as short as they can reasonably across every language.

And that they are just going to make sure that they design their feature with that reality in mind.

We don’t call them the AlmostButNotQuiteShortestDayNames for a very very good reason — because they are not!

Luckily, we point out just as we did with the informants/experts, though on occasion they may find themselves truncated, we know that if they were calendars that even the truncations would be okay in such cases, since no user would ever expect calendars to re-order their day names!

 

There are some [as of yet unconfirmed] reports of a few ShortestDayNames that are actually incorrect — if there are such then those would be definitely considered bugs. But that issue would be completely unrelated….

Book Review (Book 7) – Think Stats

This is a continuation of the books I challenged myself to read to help my career – one a month, for year. You can read my first book review here. The book I chose for December 2011 was: Think Stats, by Allen B. Downey

Why I chose this Book:

I originally chose another book for this month, but changed to this one after a difference in focus (sort of) in my technical career. That brings up a couple of interesting points right away. The first is that it’s OK to change a list – remember that the purpose of reading these books is to gain information that gets you closer to your professional goals. When you develop your list, you have a certain amount of knowledge, and as you read more, experience more, and are exposed to more, you get different information. When that happens, adapt.

The second point is that your goal itself may change. I am focusing on “Big Data” this year and with the changes we’ve made in Windows and SQL Azure at Microsoft, this fits neatly with my professional goals personally and the company I work for. Actually, my goals in technology haven’t changed in the 27+ years I’ve worked in IT, in roles from electronics, programming, consulting, management, architect and in my current technical role here at Microsoft. I think that it has always been about data – everything in IT is an interface to data. And I have always wanted to be at the center of that. Data Science involves not just the sourcing, administration and movement of data, but in applying scientific (with an emphasis on mathematical) disciplines to get at the meaning the situation needs.

So that brings me to this choice. My friend Jeremiah Peschka found this resource for a role I am VERY interested in – the “Data Scientist”. It’s a combination of high-end mathematics, Data Analysis and Big Data. The resource is a series of books from O’Reilly for that very title. You can find that here.

Personally, I find the grouping of books a little cobbled together. They are all fine books, but I’m not certain how they lead you through the series of knowledge required for the topic, but that’s a post for another day. Within that series of books is the one I’m reviewing today. I started (since there is no implied order in the books) with the “Data Analysis” book, but it seemed to start in the middle of some topics I needed to research, so I switched to reading this one, and chose it as my December book.

Another note here – December is a tough month. Since so many people take vacation time during this month, most of my clients try to get as much work in before the Holidays as possible. Since they are all doing that at once, it makes for a lot of overtime. Also, I travel to see family, which of course puts me out of pocket for a while myself. So staying on track with the books – especially one that makes heavy use of computing, math and focus is hard. So it’s tough to maintain your goals all of the time – but keeping in mind why you do this is the important thing. It will keep you on track.

What I learned:

This book focuses more on what the title says – it’s more about being mindful of the way you use statistics than the statistics themselves. It’s assumed you know not only the basics of statistics (I used these free lessons as a refresher, along with some of my old stats books) but how they are used.The author doesn’t stop to explain a lot of stats he uses, but periodically he does show why a given formula works the way it does. This is very useful, and helps with understanding the point of using one method over another. He also does a great job of using statistics to verify other statistics.

Although it should be obvious, the meaning of the data is essential. We think about this when we deal with the result of data processing, but not necessarily when we work with the sources. For instance – as the author explained some central tendency, smoothing and so on using statistical methods, he introduced some numbers and asks you to guess the central number from the set. Dutifully you work out the answer, but in time he reveals that it’s a series of numbers on a die – which of course can only be whole numbers. The point is that you’re so focused on getting the right answer, you don’t define what the real problem is first.

Another great tool  – and a fascinating study that I need to look into further – is the fact that you can often make at least educated inferences into data you might not imagine. For instance, he talks about the example of a series of train cars, numbered sequentially. You see a train car numbered “60” – can you guess with any certainty how many train cars the company has? Fascinating stuff.

He includes a glossary at the end of each chapter. I found this a great approach for summarizing the information in one place, and really helpful in making sure I understood everything before moving on. I didn’t always, so I had to re-read parts of the book and freshen up my stats knowledge along the way as well.

He uses Python as the language of choice – which I found a bit unusual. Most of the stats profession uses something more like the R language, which I’ve also started learning, and one of the other books in this series includes R as a primary subject. Because the author uses Python, he includes references to a series of libraries you add into it to work through the examples. Python certainly is a Data Scientist’s tool, just normally not for statistics. The author uses great examples and assignments, but doesn’t really follow up on those. I guess I’d rather see those introduced earlier in the chapter and explained better. He tends to jump around a bit, and his references are to Wikipedia, which isn’t always as reliable or thorough as it can be. But these are small quibbles. It’s a good book, and a I learned a lot reading it. In fact, I have lots of concepts to unpack based on what I read.