Tag Archives: microoft

Microsoft moves towards UDP in place of TCP for Azure Virtual Desktop, claims lower latency and higher reliability

Microsoft has announced the public preview of Azure Virtual Desktop RDP Shortpath for public networks – a bit of a mouthful, but what this really means is a switch towards UDP as the first choice transport for remote desktop sessions on the Azure cloud.

“Long running TCP sessions are problematic” said Senior Program Manager Denis Gundarev. “UDP is more tolerant to the temporary network interruptions caused by wireless interference or by changes in dynamic routing.”

UDP in itself is not enough; for example, UDP “does not care about each individual packet’s packet order or delivery. It does not have built-in congestion or rate control,” explains Gundarev. The implementation for RDP (Remote Desktop Protocol) uses a thing called URCP (Universal Rate Control Protocol) which Microsoft developed back in 2013, for real-time communications.

AVD already supported UDP for private networks, but many users do not have a private connection to Azure like ExpressRoute, hence the introduction of the public network version. Microsoft says that the benefits include lower latency, better network utilization, and high tolerance to packet loss.

Implementing the preview is done by setting a registry key on the AVD session host, so this can be done experimentally for just a few hosts in order to try out the feature. That said, it will not always be possible. “RDP Shortpath may fail if you use double NAT setups,” said Gundarev. Users should not notice as the old TCP-based connection will be used automatically instead.

Amazon Mobile SDK adds login, data sync, analytics for iOS and Android apps

Amazon Web Services has announced an updated AWS Mobile SDK, which provides libraries for mobile apps using Amazon’s cloud services as a back end. Version 2.0 of the SDK supporting iOS, and Android including Amazon Fire, is now in preview, adding several new features:

Amazon Cognito lets users log in with Amazon, Facebook or Google and then synchronize data across devices. The data is limited to a 20MB, stored as up to 20 datasets of key/value pairs. All data is stored as strings, though binary data can be encoded as a base64 string up to 1MB. The intent seems to be geared to things like configuration or game state data, rather than documents.

Amazon Mobile Analytics collects data on how users are engaging with your app. You can get data on metrics including daily and monthly active users, session count and average daily sessions per active user, revenue per active user, retention statistics, and custom events defined in your app.

Other services in the SDK, but which were already supported in version 1.7, include push messaging for Apple, Google, Fire OS and Windows devices; Amazon S3 storage (suitable for any amount of data, unlike the Cognito sync service), SimpleDB and Dynamo DB NoSQL database service, email service, and SQS (Simple Queue Service) messaging.

Windows Phone developers or those using cross-platform tools to build mobile apps cannot use Amazon’s mobile SDK, though all the services are published as a REST API so you could use it from languages other than Objective-C or Java by writing your own wrapper.

The list of supported identity providers for Cognito is short though, with notable exclusions being Microsoft accounts and Azure Active Directory. Getting round this is harder since the federated identity services are baked into the server-side API.


Steven Sinofsky leaves Microsoft – but why?

Microsoft has announced that Windows chief Steven Sinofsky is leaving the company:

Microsoft Corp. today announced that Windows and Windows Live President Steven Sinofsky will be leaving the company and that Julie Larson-Green will be promoted to lead all Windows software and hardware engineering. Tami Reller retains her roles as chief financial officer and chief marketing officer and will assume responsibility for the business of Windows. Both executives will report directly to Microsoft CEO Steve Ballmer.


Here are some quick thoughts.

One line of thought is that Windows 8 and Surface RT are failing because users do not like the dramatic changes, with the new tiled personality and disappeared Start menu, and therefore its architect is departing.

I do not believe this for several reasons. One is that the promoted Julie Larson-Green is a key creator and proponent of the new design (call it Metro if you like). She worked with Sinofsky on the Office Ribbon way back, a project that has some parallels with Windows 8: take a critically important product and revamp its user interface in ways that customers are not requesting or expecting.

My further guess is that Microsoft was braced for some level of storm on the release of Windows 8. There was plenty of warning that the new tablet-friendly platform would be a hard sell to longstanding Windows users.

The time to judge the success of Windows 8 is not today, but in two or three years time, when we can observe how the platform is faring in the new world of mobile and cloud.

It is my opinion that the remaking of Windows is more brilliant than blunder. Without “reimagining” it was doomed to slow decline. Microsoft now has a tablet operating system, and one that is in the hands of millions thanks to its integration with desktop Windows. The storm will die down and there is at least some chance that the outcome will be an app platform that will keep the company in the tablet game.

That said, it seems to me that Microsoft has had problems in execution. Windows 8 is fairly solid, but there are signs of haste in the building blocks of Metro, as you discover if you write an application, while Surface RT is not the fast, easy to use appliance that it should be. Key apps like Mail and Xbox Music are short of features and too hard to use, while Windows-isms such as update errors have not been expunged as they should. Such issues can be fixed, but the moment to get this right is at launch, not six months or a year later.

You might also ask: why is Microsoft allowing its brand new store to fill with rubbish apps, seemingly with the knowledge and encouragement of employees at the company?

Were these execution problems Sinofsky’s fault then? Again I doubt that. My perception is that Microsoft is a dysfunctional company to some degree, but one in which there are islands of immense talent and teams which deliver. It is huge and bureaucratic though, and getting everyone motivated and energised to deliver top quality is likely impossible without radical reform. Bureaucracy tends to result in employees who work by the letter not from the heart, which results in mediocrity, and there is evidence of that everywhere.

In this context, the fact that Sinofsky delivered twice, once with Office 2007 and again with Windows 7, with judgment on Windows 8 not yet possible, shows his ability.

If failure is not the reason then, why?

Well, another reason for staff to leave suddenly is that there was some sort of internal conflict. Sinofsky achieved by taking a firm line and sticking to it, which made him enemies. I do not have any inside information; but two moves to reflect on would be the move of ASP.NET and Silverlight guy Scott Guthrie to Windows Azure, and deep Windows internals guy Mark Russinovich also to Azure.

Sinofsky was no friend to .NET, which led to some perplexing decisions. A little sign of this I witnessed at Build was why XNA, a .NET wrapper for Direct X hardware acceleration, is not supported in Windows Phone 8. Except it is, as a member of the phone team explained to me, it is just that you have to target Windows Phone 7 in your project, but it will run fine on Phone 8. Why the workaround? Because .NET is now discouraged for games development, for no technical reason.

Still, this war has been going on for a while and Sinofsky has won every battle. Why has he now left?

I have no inside knowledge, but would conjecture that the effort of forcing through Windows 8 and native code versus .NET built up pressure against him, such that there was instability at the top. In this context, even relatively small failures or falling behind projections can be significant, as resources for opponents to use against you.

CEO Steve Ballmer of course is still in place. Did have a change of heart about Sinofsky, or a row with him over what comes next for Windows? That is the kind of thing which is plausible; and the uncertain market reaction to Windows 8, while not unexpected, would make it possible to push him out.

If I were a shareholder though, the departure of this key executive at this moment would worry me. This is the company which has transformed Windows Azure for the better and delivered the fantastic Windows Server 2012; it is also the company which is guilty of the Kin mobile phone debacle, and forgetting its agreement with the EU to offer a browser ballot to Windows 7 users at perhaps substantial financial cost. Evidence, one would judge, that deep change is needed, but not the kind of change that will be achieved by the departure of one of the most capable executives.

Postscript: Mary Jo Foley notes that Sinofsky did not present at the Build keynote right after the Windows 8 launch, raising the possibility that Sinofsky’s departure was already planned, before the Windows 8 launch. That is further evidence that this is not a reaction to poor initial sales (if indeed they are poor).

Windows 8 usability: still a struggle for new users

Today I met with a professional software developer and at the end of the meeting brought out a laptop with Windows 8 installed. Had he ever used it? No.

This particular laptop has the RTM (Release to Manufacturing) build of Windows 8 and Office 2010 installed. I logged on with a new profile and put it in front of him. This was good, because Windows 8 ran its start-up sequence exhorting the user to “move your mouse into any corner” and showing the Charms menu.


This intro was not a success. My contact thought he was being instructed to move the mouse, but at this point in the start-up sequence, the mouse is disabled; it is a kind of pre-roll slideshow.

Microsoft would have done better to show a video of a user performing common actions.

Next, the Start screen came up.


The user soon found the Desktop tile and clicked it. I then asked him to run Word.

“Ah, no Start menu” he said. Then, being resourceful, he right-clicked the desktop and clicked “New Microsoft Word Document.” Next he double-clicked the new document.

Very good, I said, but now run Word without making a new document.

This was a struggle. Although the new Start screen is called Start, it was not obvious to him that this was in fact the Start menu and he looked for some other launcher on the desktop. He probably could have done something else clever like Ctrl-Alt-Del, Task Manager, File – New Task, but knew that was not what I was looking for.

It did not help that some quirk or bug in Office or Windows 8 meant that there were no shortcuts for Office showing by default in the Start screen. In other words, the Office apps were not “pinned to Start.” I had not intended this.

After some clicking around he stabbed the keyboard a few times which had the effect of performing random searches in the Start screen. This changes the view from big tiles to small tiles, quite disconcerting when you see it for the first time.

At this point I gave him some more help; once he got the idea of typing a few letters to find an application he was fine with it.

“What is the point of removing the Start menu?” he asked me.

I know the answer to that one. The purpose is not to trip up users like him; but nor is it to help him – though personally I do now find the Start screen a better launcher than the old Start menu.

Microsoft designed Windows 8 so that users cannot avoid the Start screen, which is the gateway to the new world of Windows Store apps.

Despite his uncertain start, my victim thought he would be fine with Windows 8 after a few days. I agree.

Nevertheless, most Windows users will have a few painful moments as they get used to the new user interface.

Users less steeped in the old familiar ways of Windows may actually find it easier. I have seen children using Windows 8 and having no problem with it.

Expect fireworks when Windows 8 goes fully public, and more users like David Gerwirtz declare:

… despite the operating itself being a marvel of engineering, ease of use, speed, and underlying functionality — I’m forced to say that it’s unusable for desktops out of the box. Un-frakin’-usable.

He is wrong. Even as a desktop operating system, with mouse and keyboard, Windows 8 works fine. Take the trouble to learn how to use it, and you will soon be just as productive as before.

Those first moments are hard though; and no doubt some will adjust quicker than others, and some will never adjust.

It is also true that while Windows 8 is just as productive as Windows 7, and probably a bit more productive, it is less coherent in its design, thanks to its split personality.

I understand why Microsoft removed the Start menu, but it seems to me the company could have done better in showing new users how to get going. Of course this is an opportunity for OEM vendors to show how they can add value, though history is not encouraging in this respect.

Windows 8 is a brave move for Microsoft; but remember this. Without the new tablet personality, Windows would be doomed to irrelevance in a few years. As it is, Windows is getting a new Start.

Microsoft Surface has changed the Windows 8 conversation

The Register ran two online discussions on Windows 8, in which I participated along with Mary Jo Foley and Gavin Clarke.

The first was on 25th April and is here. A typical comment:

I personally think Windows 8 can’t bag Microsoft the kind of runaway success they had with Windows 95 or XP. It’s going to turn off many PC users and the success of Windows tablets is uncertain.

The second was on 20th June, following the announcement of Surface, a Windows 8 tablet to be sold by Microsoft itself. Typical comment:

I definitely want one. iPad for kids, Surface for grown ups. First bit of kit I’ve wanted in years.




A simple example of async and await in C# 5

I have been playing with the Visual Studio 11 developer preview and exploring its asynchronous features, specifically the async and await keywords which are new to C# 5.0. These features have actually been available as a CTP (Community Tech Preview) since October 2010, but I had not found time to try it.

I like to keep examples as simple as possible. I have a Windows Forms application which has a long-running task to perform, and I do not want to lock the UI while it runs. Here is my long-running function:

 private int slowFunc(int a,int b)       
 return a + b;

Yes, it takes 10 seconds! I am going to click a button on a form, call the function, and show the result on a label control.

Now, here is how I might try to achieve the goal of not locking the UI using Visual Studio 2010 and C# 4.0:

 private void button1_Click(object sender, EventArgs e)
 this.button1.Enabled = false; //prevent re-entry 
 var someTask = Task<int>.Factory.StartNew(() => slowFunc(1, 2));
 this.label1.Text = "Result: " + someTask.Result.ToString(); //oops, blocks calling thread 
 this.button1.Enabled = true;       

Oops, this did not work at all! The reason is that although I have gone to the trouble of creating a Task in order to run the slow function on a background thread, my work is undone when I call the Result property of the Task object – since this blocks the thread until the Task completes.

Here is how you can fix it in Visual Studio 2010 – remember, there is an easier way in C# 5.0 coming up soon:

 private void button1_Click(object sender, EventArgs e)        
 this.button1.Enabled = false;          
 var uiScheduler = TaskScheduler.FromCurrentSynchronizationContext(); //get UI thread context 
 var someTask = Task<int>.Factory.StartNew(() => slowFunc(1, 2)); //create and start the Task 
 someTask.ContinueWith(x =>     
   this.label1.Text = "Result: " + someTask.Result.ToString();   
   this.button1.Enabled = true;   
   }, uiScheduler  

This one works. I click the button and the UI does not lock up at all; I can minimize the form, move it around the screen, and so on.

However, I have had to do some extra work. The ContinueWith method tells the Task to run some other code after the background thread has completed. By default this code will not run on the UI thread, which means it will raise an exception when it updates the UI, but you can pass in a TaskScheduler object so that it continues on the UI thread.

Now here is a look at the same problem using C# 5.0. The slowFunc is the same, so I will not retype it. Here is the code for the button click:

 private async void button1_Click(object sender, EventArgs e)
 this.button1.Enabled = false; 
 var someTask = Task<int>.Factory.StartNew(() => slowFunc(1, 2)); 
 await someTask;  
 this.label1.Text = "Result: " + someTask.Result.ToString(); 
 this.button1.Enabled = true;

Less code, same result, which is usually a good thing.

What is going on here though? First, the async modifier is added to the click event handler. This does not mean that the method runs asynchronously. It means that it contains code that will run asynchronously using await. As Eric Lippert explains, it tells the compiler to rewrite the method for you.

Second, there is the await keyword. I cannot improve on Lippert’s explanation so here it is:

The “await” operator … does not mean “this method now blocks the current thread until the asynchronous operation returns”. That would be making the asynchronous operation back into a synchronous operation, which is precisely what we are attempting to avoid. Rather, it means the opposite of that; it means “if the task we are awaiting has not yet completed then sign up the rest of this method as the continuation of that task, and then return to your caller immediately; the task will invoke the continuation when it completes.

If you refer back to the Visual Studio 2010 examples, you will see that the code is very close to my first, non-working example. In other words,using await makes the code work in the way that intuitively I hoped that it might, without specifically called the ContinueWith method and messing around with the thread context as in the second example.

This is still concurrent programming though. One thing that C# 5.0 cannot prevent is an impatient user clicking several times on the button when the result does not appear immediately, so in all the examples I have disabled the button while the background thread runs.

This is why people ignore security warnings: IE9 blocks official Microsoft update

Microsoft has released a Web Standards Update for Visual Studio 2010, with new HTML5, CSS3 and JavaScript support.

I look forward to trying it; but Internet Explorer 9’s Smart Filter was not keen.


What you cannot see from the screenshot is that the option to “Run anyway” is hidden by default. You have to click More Options; otherwise you just get the first two options, Don’t run, or Delete.

Note that this download is from an official Microsoft site, and has been downloaded, according to the stats on the page, nearly 6,500 times.

Developers can cope; but I think this sort of warning is extreme for a download from an official Microsoft site, whose main crime is being unknown, for some reason, to the SmartScreen database of approved executables.

Though maybe the Visual Studio team should have signed the installer.

The long term effect is that we learn to ignore the warnings. Which is a shame, because the next one might be real.

Update: How do other browsers handle this scenario? Here’s Google Chrome:


Mozilla Firefox – a prompt, not a warning:


same in Apple Safari:


Which is best? Well, IE9 wins kudos for being the only browser to point out that the package is unsigned; but loses it for its over-the-top reaction. Chrome has pitched the leverl of warning about right; Firefox and Safari are perhaps too soft, though let’s also allow for the fact that their filters may already have worked out that thousands had already downloaded this file without known incident so far.

The IE9 issue is mainly because the installer package is unsigned, which is probably an oversight that will be fixed soon.