Debug Lambda Expression–Delivered!

Way back in July 19, 2011 I added on the, then relatively new, Visual Studio User Voice page Debug Lambda expression feature request. It quickly gain many votes and was sitting in the top few all this time. Microsoft stated that this was a hard thing to do requiring a complete rewrite of their Expression Evaluator. Instead of just saying it was too hard and not important enough, they did get to work. It is available now in Visual Studio 2015 Preview. Full details are given in the Support for Debugging Lambda Expressions with Visual Studio 2015 on the Visual Studio ALM blog.


Debug Lambda expressions [UserVoice]

It has been a long time coming. But I for one am very happy it has come. Well done Microsoft and all who were involved.

Windows Phone 8.1 Device Migration (Backup & Restore)

Wow. I am very impressed with the work Microsoft has done in this regard. If my phone goes through the wash, or in my case, through the air propelled by an excited child, all I lose is the phone, i.e. a few hundred bucks. All I need to do is get a new phone, plug in my credentials (a few times for some apps) and everything is back as it was. And I mean everything:

  • Current installed apps all automatically installed
  • Start screen fully restored
  • Settings galore, even custom ringtones that I’m not even using but had added at some time are available
  • Bluetooth pairings, WiFi networks
  • Text messages
  • Connected accounts, i.e. Facebook, LinkedIn, Twitter
  • Built-in Podcast subscriptions and which episodes were marked played
  • NextGen reader settings and feed data was all correct

Did I say everything? There were 2 things I noticed missing:

  • Nokia Mix Radio mixes. This isn’t strictly WP fault, but since it is first party I expect better.
  • Cortana Reminders. It is in Beta so I can excuse it for now. But I hope this is resolved and syncs with desktop in Windows 10 Cortana.

One weird bit of behavior I had was the Phone Name. It was coming up on as below:


What’s that? That’s my new Nokia Lumia 930 named Nokia Lumia 820. As was my previous now broken Lumia 820. To correct this name took a little searching. Plug your phone into a PC and rename it in file explorer like you would a USB Key.

This is the same sync behavior we see in Windows 8.1 between PCs. It will be interesting to see how this integrates with Windows 10 to make it all feel like multiple portals into my one cloud account. Make sure that you have backup enabled, otherwise you’ll have to do it all manually when changing phones.

Active Noise Cancelling Headphone–Sound off

Recently I was fortunate enough to receive, courtesy of DVLUP,  a pair of Nokia BH-940 Purity Pro Wireless Stereo Headset By Monster active noise cancelling headphones. Phew, that is Microsoft inspired naming. The thing is, I was blessed to receive a pair of Bose Quite Comfort 15 Limited Edition active noise cancelling headphones in a draw at a conference a couple of years ago. So I have hundreds of dollars worth of headphones I haven’t paid for. If you know me you’ll know I’m quite a scrooge and splurging on headphones this expensive I would never have done for myself. However, when the Bose failed I was very tempted to replace them. Fortunately their warranty and service was outstanding and in about 4 weeks, they had shipped me a new pair, albeit, not the limited edition. Paying for headphones like this when you use them all day everyday is worth it.

Nokia BH-940 Purity Pro Wireless Stereo Headset By MonsterSo now I have these two great headphones and I am seeing which I like best. I have always wanted to the Bose to be wireless. I catch the train, which tests the noise cancelling, but the cable management is tiresome. The Purity Pro is Bluetooth with NFC pairing. Sweet. The Purity Pro also has a microphone for calls, rechargeable battery for active noise cancelling, controls for music, calls and volume and amazingly pairs to two Bluetooth devices. For me, my phone and laptop on the train. Awesome. I love all those things about these headphones and it has been a massive step up from the Bose. When I open them up they turn on, and when I close them they turn off. It talks to me to tell me they are connected. If leave them open and not on my head, they turn off noise cancelling to save power. If the battery does run flat I can plug them in and still use them without noise cancelling. There has been times with the Bose that I have taken them off and forgot to turn them off. Do this overnight and bets are you have a flat battery and they are completely useless until you find a new battery.

Bose QuietComfort 15 Acoustic Noise Cancelling HeadphonesIt would seem for all of the above that the Purity Pro is much better than the Bose. However, the Quite Comfort, are worlds apart more comfortable. I can wear them all day, truly without knowing it. The cups fit fully over my ears and do not touch them. They create a good seal which makes the active noise cancelling very good. Much better than the Purity Pro. Although the Purity Pro is also over-ear, maybe I have big ears, because they are pushed by the edges and inner of the cups. My ears get a bit sore after a few hours. It would probably be fine if I didn’t know it could be way better. They come with iPhone compatible hands free microphone and controls on the wire. I’m one of the few with a Windows Phone though, so it didn’t work. I even got an inline convertor plug that didn’t work either. If the Bose had even just wireless, without all the controls like the Purity Pro, I think that would be enough to not give the Purity Pro a look in. At the Bose store they said most their customers use them for plane travel so wires are fine. Whether that is true or not, I don’t know, but I still don’t like wires.

Either way both these headphones are awesome and I would, and do, recommend both to anybody. Just pick which set of features is more important to you.

Windows 365 Anyone?

Just some unfounded speculation. All Windows is under Joe Belfiore. Windows Phone for OEMs is free. All Windows Phones 8+  are supported for updates. Windows 8+ for OEMs for all PCs, tablets, 2-in-1s or otherwise, under 9” screens is free. Office Online is free. For Office on your devices Office 365 starts at quite a low per person price. Windows 8 upgrade offer from Windows 7/Vista on release was very cheap.

With Windows Threshold, i.e. 9, I wonder if they are ready to remove the revenue from the Windows platform for consumers completely. Always up to date Windows. Will they go completely free, or package with an Office 365 account at no extra cost?

TFS Local Workspace Limit

One of my colleagues hit this last week:

TF401190: The local workspace XXXXXX;XXXXXX has 112202 items in it,
which exceeds the recommended limit of 100000 items. To improve
performance, either reduce the number of items in the workspace,
or convert the workspace to a server workspace.

Fortunately he had a few older release branches he could remove. I didn’t know there was a recommended limit. I found this overview of local workspaces:

Local workspaces have scalability limitations due to their use of the local workspace scanner which checks for edited items. Local workspaces are recommended for most of our customers, because most workspaces fit into the “small” or “medium” category in our view – that is, they have fewer than 50,000 files and folders. If your workspace has more than 50,000 items, you may experience performance problems or TF400030 errors as operations exceed 45 seconds in duration. In this case, splitting your workspace up into multiple smaller workspaces (perhaps one workspace per branch), or switching to server workspaces is recommended.

Server workspaces are optimized for performance at large scale and can support workspaces with up to 10,000,000 items (provided your SQL Server hardware is sufficient).

It seems performance for local workspaces has been improved, or maybe the limit has been adjusted due to average hardware upgrades. I can tell you though, our SQL Server hardware is not sufficient, greatly due to TFS using too much disk space.

Technorati Tags:

Increase TFS 2013 task board work item limit

Today one of our task boards hit this:

Board exceeded number of items allowed

No worries, we’ll just follow the link and increase the limit. That however takes you to Customize the Task Board Page for Visual Studio 2012. From what I have done previously I knew this would not apply to TFS 2013. The command is to export the agile process config and in 2013 this has all been combined to be the one process config. Looking through my process config though I could not find the IterationBacklog element, so I run the command anyway and get:

Warning: This command is obsolete. Use 'witadmin exportprocessconfig' instead.

In the 2013 process config, although there is not an IterationBacklog element, there is PortfolioBacklog, RequirementBacklog and TaskBacklog. The same attribute workItemCountLimit still applies and it goes on the TaskBacklog element. The details can be found in Configure and customize Agile planning tools for a team project.

The steps however are very simple:

  1. Export your process config
    witadmin exportprocessconfig /collection:http://tfs:8080/tfs/DefaultCollection /p:TeamProject /f:ProcessConfiguration.xml
  2. Add workItemCountLimit attribute to your TaskBacklog element

    <TaskBacklog category="Microsoft.TaskCategory" parent="Microsoft.RequirementCategory" pluralName="Tasks" singularName="Task" workItemCountLimit="800">
  3. Import your modified process config

    witadmin importprocessconfig /collection:http://tfs:8080/tfs/DefaultCollection /p:TeamProject /f:ProcessConfiguration.xml

Note that the default is 500 and the maximum allowed is 1500.

Technorati Tags:

No need to use DateTime UTC again!

We were always taught, whenever storing or comparing dates always store them as UTC. That’s how I remember it at least. But that is not actually the correct answer. According to the detailed Coding Best Practices Using DateTime in the .NET Framework the rules state “a developer is responsible for keeping track of time-zone information associated with a DateTime value via some external mechanism”. Which leads to the recommended Storage Strategies Best Practice #1:

When coding, store the time-zone information associated with a DateTime type in an adjunct variable.

I don’t think I have ever seen this actually done. But no worries, since .NET 3.5 and SQL Server 2008 there is new type to use. Today I was just introduced to DateTimeOffset. This solves the issues of storage and calculations ensuring that the time zone offset is always stored with the date.

Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC).

The code sample on the documentation page I think shows the difference and usefulness quite well.

using System;

public class DateArithmetic
   public static void Main()
      DateTime date1, date2;
      DateTimeOffset dateOffset1, dateOffset2;
      TimeSpan difference;

      // Find difference between Date.Now and Date.UtcNow
      date1 = DateTime.Now;
      date2 = DateTime.UtcNow;
      difference = date1 - date2;
      Console.WriteLine("{0} - {1} = {2}", date1, date2, difference);

      // Find difference between Now and UtcNow using DateTimeOffset
      dateOffset1 = DateTimeOffset.Now;
      dateOffset2 = DateTimeOffset.UtcNow;
      difference = dateOffset1 - dateOffset2;
      Console.WriteLine("{0} - {1} = {2}", 
                        dateOffset1, dateOffset2, difference);
      // If run in the Pacific Standard time zone on 4/2/2007, the example 
      // displays the following output to the console: 
      //    4/2/2007 7:23:57 PM - 4/3/2007 2:23:57 AM = -07:00:00 
      //    4/2/2007 7:23:57 PM -07:00 - 4/3/2007 2:23:57 AM +00:00 = 00:00:00                        

When would you prefer DateTime over DateTimeOffset? Introduced here by the BCL team and it is detailed when you may want to use the DateTime over the DateTimeOffset. Summarized I would say it is when you are doing interop with OLE or when you don’t care about time only date, like birthdays.

DateTimeOffset is the new preferred type to use for the most common date time scenarios.

Shortcomings due to the loss of time zone information and only using the offset is the main issue. If you are really serious about dates and time and are heavily using them, you may consider Noda Time started by Jon Skeet. My only issue with using DateTimeOffset virtually all the time in place of DateTime is that I have only found out about this years later.

Technorati Tags: ,