25 Jul 2013

The ungrateful behaviour award

452511_crybabyThis week’s award for more ungrateful behaviour goes to Greg Young, who seems to think that being a speaker at an event makes him special. The story is that Greg went to TechEd North America as a speaker, with multiple talks to present. His wife joined him on the day of his first talk, but the organisers wouldn't let her into his talk (to take photos of him) for free. He then cancelled all his talks at TechED NA and also cancelled his talk at TechEd Europe, in response to the on the ground staff not accommodating him.

All that is right

I FULLY agree with him that the TechEd NA people on the ground could've & should've been handled it way better (I would've just let his wife in) and his suggestions on how they could've done it better (find his wife and take to the speakers room/Starbucks for example) are totally correct.

As he said in his post, this was the last in a bad experience for him as a speaker:

  • Problems with flights (costs & times)
  • Booking for other events that didn't take into account flights etc...

And so on, and you know what? HE IS RIGHT, that was a bad experience, which no one (speaker, delegate or staff) should have to deal with. It seems that TechED NA was badly organised and I believe he is correct in his view that it is caused by it having many parts working independently and those parts not having authority to make things happen without 900 billion meters of red tape. His first three points of issues are spot on and ALL conferences should learn from him.

All that is wrong

If I agree so much with him, why do I have an issue with his behaviour? It is four points:

  1. Greg says "Speakers are not commodities, they are people who are giving much to help the conference" - I am sorry Greg, but speakers are commodities. We are there to help the conference succeed & serve the audience. Nothing is more important than serving the audience & cancelling your talk shows that you think your situation is more important than that. And if you not willing to do that, tough - you will be replaced... just like a commodity.
  2. Speaking at an event like TechED NA, plus talking on Channel 9 is an honour & should be approached as such. There are hundreds if not thousands that would put up with a lot more bad experiences to have that opportunity. Wasting it is a slap in the face to the many people that could've & would've done the talk.
  3. Being a speaker is about planning - talks that fail are mostly due to lack of planning. Greg has a responsibility to ensure his planning, which includes where his family will be during his talk, is done ahead of time with the right people & not with the people on the ground at the last minute. Planning is a corner stone to professional speaking. I am sure someone involved knew his wife was coming (they booked her flights) but that doesn’t mean everyone involved knew (a conference like this is massive, with hundreds of moving parts). I can also see the staff making the assumption that his wife joined him in the city but wouldn’t attend the conference. At the end of the day it is his responsibility to plan with the right people ahead of time to make sure everything works out.
  4. Now, the most important point of this entire post: Let's assume his only choice was to cancel that talk, as he had to do what is right for his wife and go and tell her (leaving her alone for 2 hours would be rough). I would not see that cancelled talk as an issue, and I would not have written this. The single biggest reason I believe his behaviour is award winningly bad is he cancelled the rest of his talks too! There is no reason other to do that, than to stamp his authority and view of being special. He has even cancelled his talk at a different Microsoft conference?! Who is that hurting? The people that are measured for the success & the staff of TechEd NA & Europe are different! That behaviour is unprofessional and deserving of an award. Cancel the one talk, sort things out with the wife & then go and serve the audience - that is what he should’ve done.

Final Thoughts

I speak at Microsoft events all the time but I have never spoken at TechEd NA. I have never met Greg and only know him from a few tweets, his amazing CodeBetter posts and this story and I think he must be amazingly bright if he gets the chance to speak at TechEd. I am not suggesting otherwise, I am talking about his behaviour in this situation. I am not even suggesting this is his normal behaviour, it may just be him grumpy & irrational from the jetlag & lack of sleep he mentions at the start of the blog post, but in that case rather admit you were wrong & don’t post a blog post like that.

11 Jul 2013

Amazing Lock Screen + Windows 8.1

When the Windows 8.1 Preview came out a few weeks ago I was in no place to test it, because I needed my machine stable for a bunch of conferences I was speaking at. However that didn’t stop a lot of amazing users of the Amazing Lock Screen app, trying it out & finding it did not work!

Since then I have gotten VS 2013 & Windows 8.1 and started to dig into the issue which has confused me for DAYS on end – but yesterday I found out that Microsoft have acknowledged there is a bug in lock screens with Windows 8.1. It is this bug directly breaks Amazing Lock Screen’s ability to changed the lock screen.

Unfortunately until Microsoft issues a patch or the RTM comes out there is very little I can do to correct the issue. This bug is NOT stopping development on the Amazing Lock Screen though & the next release will be the biggest release in a long time with a couple of brand new features in it!

In summary: There is a bug in the OS, Microsoft will fix the bug, the app is still being worked on, is not forgotten & will work on Windows 8.1 in the near future!

07 Apr 2013

XAML (Windows Store apps) editing in Visual Studio broken with NVIDIA Optimus

I have a fancy laptop that seems to delight in giving me headaches, and the latest is to do with Windows Store app development. The problem is simple, you edit the XAML and nothing happens! You need to trigger a full redraw of the screen to get it to render the changes, the below video may explain it better:

The issue here is that my fancy laptop has two graphics cards, a low powered Intel one (great for battery – average for performance) & a high powered NVIDIA one (bad for battery – great for performance). Add to this, that it uses a new technology from NVIDIA called Optimus which allows individual parts of the screen to be rendered by each card – the best explanation of this can be found on SuperUser.

So what is the solution to this problem? Disable one of the graphics card – yeah, that is the work around at this point. I am doing this by using device manager to disable the NVIDIA one.

image

That fixes the rendering issue and allows Visual Studio to work properly. Not great by any stretch of the imagination.

28 Mar 2013

Visual Studio: Auto-load changes, if saved

Visual Studio is great, but if you are using external tools like Git or Blend at the same time, the constant prompting to update/reload files can be annoying. In this short video I show a great option, that you can enable in Visual Studio that will make the experience a lot more pleasurable.

If you want this option to work with project & solution files in future, please vote on it at User Voice.

05 Mar 2013

Cannot connect to LocalDB from .NET

imageYou are trying something simple – just open a connection to a LocalDB instance from .NET but it is failing with a SqlException which has the following message:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

You know LocalDB is working, since you copied the connection string from within Visual Studio, but it just doesn’t work!

The cause of this issue is the connection string, however it may not be obvious at first glance:

var sqlConnection = new SqlConnection("Data Source=(localdb)\v11.0;Initial Catalog=Astronauts;Integrated Security=True;Connect Timeout=5");

image

The root cause is the Data Source and the \v in it – normally when you have a \ it complains unless it is a valid escape sequence like \r or \t and since it is not complaining here, it must be a valid escape sequence, just maybe one you are not familiar with, as \v is for a vertical tab.

The solution is easy when you realise that the escape sequence is messing with you, just add another slash:

var sqlConnection = new SqlConnection("Data Source=(localdb)\\v11.0;Initial Catalog=Astronauts;Integrated Security=True;Connect Timeout=5");

05 Mar 2013

Visual Studio 2012 - LightSwitch: The selected project was created by a newer version of this application and cannot be opened.

imageYou may have run into this annoying dialog when creating an HTML application with Visual Studio 2012 LightSwitch after installing Update 2 CTP 4. The issue does not appear when creating a “normal” application.

The cause of this is a conflict between the old bits that came with the Office Dev tools update and the new bits that came in the Visual Studio update.

Prevent it in future!

You can prevent this by following these steps [source]:

Before installing CTP 4 you must uninstall HTML Client Preview 2 and clear the Application Manifest cache:

  1. Open Add\Remove Programs.
  2. Select the entry for Microsoft LightSwitch HTML Client Preview 2 for Visual Studio 2012.
  3. Right-click the entry and select Uninstall.
  4. Select the entry for Windows Azure Tools for LightSwitch HTML Client Preview 2 for Visual Studio 2012 – June 2012 SP1.
  5. Right-click the entry and select Uninstall.
  6. Clear your application manifest cache by deleting the following folders:
    • %localappdata%\Microsoft\MSBuild\VSLS\11.3
    • %localappdata%\Microsoft\VisualStudio\11.3

How do I fix it?

While the above is useful information ahead of time, it is is not helpful after the fact. So how do you fix your Visual Studio to be able to get into the fantastic new LightSwitch bits?

works-on-my-machine-starburstYour mileage may vary with this since this is been found with a bit of trial and error as I fixed on my machine.

First shutdown Visual Studio and then follow the steps above. Once done, run the CTP 4 installer again and chose the uninstall option. Once it is completely uninstalled you then reinstall the CTP.

Finally make sure you may want to make double sure you have cleaned the manifest cache (step 6 above) – it won’t hurt to do it again either. Just make sure Visual Studio is close when you do it.

Do not try a repair

You may think a repair is as good as an uninstall/reinstall of the CTP. It isn’t, since it gives you this lovely fun:

image

20 Jan 2013

Dealing with off by x issues when using the TextBox

image

Introduction

One of the toughest problems I faced when I built Notepad Classic was an issue where many functions like Go To & Find were always off a few characters. After a bit of experimenting I noticed a pattern, it was off by the number of characters equal to the line number (0 based).

i.e.: no issues on the first line (line index 0); Off by one on the second line (line index 1); Off by two on the third line (line index 2); Off by three on the forth line etc…

Problem

It turned out that the way the string functions count a line break (i.e. \r\n) as two characters, and rightly so – it is two characters a \r & a \n. However the TextBox functions like Select treat \r\n as a single character because that is what is displayed visually – a line break is one character visually. So there is a difference between the two scenarios and thus the “off by one x line count” error I found.

Solution

The solution I used is to compensate for it by working out the number of lines to the point (i.e. count all the line breaks before the point) and adjusting the results (adding +1 for each \r\n) as needed.

Sample application to show this problem and the solution can be found at: https://bitbucket.org/rmaclean/off-by-one-x-sample-code

10 Oct 2012

Windows 8 and how it breaks applications in South Africa!

Before I start thank you to Mike Geyser for for bringing this up on Twitter.

Recently I wrote about what is the correct way to display currency in South Africa, which was meant as an interest post rather than anything related to Windows 8 or development – but it seems to be serendipitous in it’s timing. The post referred to the currency format and how you should use a comma to separate Rands & Cents. Windows has always (at least as far back as Windows 98) respected this as the correct currency format in South Africa.

Here you can see Windows 7 (left) and Windows 8 (right) have the same settings.

windows7currencywindows8currency

However with Windows 8, Microsoft have decided to be correct everywhere so if you compare the number format settings in Windows 7 (left) it uses a full stop where Windows 8 (right) uses a comma for number formatting.

windows7numberwindows8number

The problem is that the number format setting is used in .NET for parsing which means that all numeric code parsing code will break in Windows 8 if you have the South African formatting set!

var testOne = Decimal.Parse("10.2"); // works in Windows 7 and before - exception in Windows 8
var testTwo = Decimal.Parse("10,2"); // works in Windows 8 but fails in Windows 7 and before

The exception that will be raised is: System.FormatException: Input string was not in a correct format.

To be fair, Microsoft has said you should never write code like that, you should always provide the culture settings when parsing (this code always works):

var rightWay = Decimal.Parse("10.2", CultureInfo.InvariantCulture);

There are also two other ways to handle this:

CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
var anotherWay = Decimal.Parse("10.2");

In summary when going to Windows 8, make sure you properly test your applications and you test them on the culture that the users will use.

Pages