Jake Ginnivan's blog

Cannot Type Capital v on Sculpt Keyboard

At the MVP summit last year I picked up a Sculpt Ergonomic Desktop pack, mainly because I cannot stand the UK keyboard layout and wanted to stay on the US layout while working in London.

I just had a very strange issue, I could not type a capital V, lowercase worked fine. Plugging into another machine showed the same issue.

One of the problems with the Sculpt is that the function keys get stuck. Apparently if the F5 key gets stuck, then you can no longer type a capital V. If the F2 key is stuck then you won’t be able to type a capital C.

If you hit this random issue, hopefully you will read this post before returning your keyboard.

Disable thumbs.db

Thumbs.db is created by windows whenever a folder has images in it as a cache for the thumbnails for the images. But it gets locked and stops me switching branches in git and I have to restart my PC sometimes.

Save this as KillThumbsDb.reg and run it as administrator:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
"DisableThumbsDBOnNetworkFolders"=dword:00000001

I have no idea why thumbs.db is being created in local folders, but this fixes it for me.

Unknown Git Mergetool

Today my git mergetool stopped working. When I ran git mergetool I was greeted with:

git config option merge.tool set to unknown tool: --global
Resetting to default...

This message is displayed because 'merge.tool' is not configured.
See 'git mergetool --tool-help' or 'git help config' for more details.
'git mergetool' will now attempt to use one of the following tools:
tortoisemerge emerge vimdiff
No known merge tool is available.

Somehow (seriously, I have no idea how I did this) I had created a setting in one of my repositories set my mergetool to --global.

If you happen to get yourself into the same issue, run git config --list to see what your config settings are.

For me, I had a rogue merge.tool entry, so I just had to run git config --unset merge.tool which deleted the entry and I was off again.

BDDfy v4.0 Beta 1 Released

We are excited to announce v4 beta 1 of BDDfy! To give it a spin just change your NuGet settings to include pre-release and update. v4 has a bunch of new stuff included which takes BDDfy from not only the simplest BDD framework for .NET but also one of the most powerful!

Please give it a go and report any issues/feedback you have so can fix them before the final v4 release.

BDDfy v4.0 Examples Support

One of the major features in BDDfy v4 is the inclusion of examples

Scenario: Successful rail card purchases
Given: the buyer is a <buyer category>
And: the buyer selects a <fare>
When: the buyer pays
Then: a sale occurs with an amount of <price>

Examples:

| Buyer Category | Fare          | Price |
| Student        | Monthly Pass  | $76   |
| Senior         | Monthly Pass  | $98   |
| Standard       | Monthly Pass  | $146  |
| Student        | Weekly Pass   | $23   |
| Senior         | Weekly Pass   | $30   |
| Standard       | Weekly Pass   | $44   |
| Student        | Day Pass      | $4    |
| Senior         | Day Pass      | $5    |
| Standard       | Day Pass      | $7    |
| Student        | Single Ticket | $1.5  |
| Senior         | Single Ticket | $2    |
| Standard       | Single Ticket | $3    |

This is an example of a Cucumber test with examples, for each row in the examples table the test will run effectively giving us a data driven BDD style test.

nUnit 2.6.3, Async and .net 4.0 Broken

I am currently working on a .net 4.0 project which uses async/await quite heavily. We also are using the old AsyncTargeting pack rather than the RTM because we do not have stats on how many clients currently have the .net 4.0 KB 2468871 patch which enables PCL support. These issues affect the RTM version as well.

Recently I have upgraded to nCrunch 2.2 beta and ReSharper 8.1 both which ship with the upgraded nUnit 2.6.3 runner. After I upgraded these tools I noticed tests which should have been failing were passing and passing tests were being reported as failing but showing stack traces from a different test..

Also I was getting different results in nCrunch, R# and nUnits console runner. Something was broken.

NOTE: Async and TPL support is not supported in nUnit 2.x, but will be officially supported in v3.x and that it was a coincidence that it worked in 2.6.2. My discussions about the issues are at here on the nunit discussion board.
As far as I can tell, there is no reason that 4.0 cannot be supported because to offer framework support does not need any new features OR the classes in the Async Targeting Pack or .NET 4.5. At a minimum tests returning Task should be supported as TPL was introduced into the CLR for net40.
Recently I added async void and Task support to BDDfy which targets .NET 4.0, also xUnit 1.9.x supports Tasks in the current released version and has backported async void support to the 1.9.x codebase from the 2.0 and will be released if there is a need to release another patch release before 2.0 is released.

.NET 4.5 is fully supported and works as expected with nUnit, it is only .net 4.0 which is affected

On Async and Sync Contexts

This week has been a really heavy learning experience for me in terms of async/await, .ConfigureAwait() and how it interacts with Synchronisation Contexts. Quite a few of my assumptions were wrong, or the behaviour is different between the .NET 4.0 implementation (CTP3 and RTM) and what happens in .NET 4.5.

In this post I will cover:

  • What .ConfigureAwait(false) does in .net 4.0 and in .net 4.5, and why they act differently
  • Some guidance around using await in a rich client app (i.e await for offloading, not scalability) .net 4.0 in particular, .net 4.5 behaves better and the guidance is not as relevant
  • How you can use custom awaiters to switch contexts

Blog Migration

I have finally decided to move from FunnelWeb to Jekyll. My needs for a blog engine are changing, and at the moment I am liking the static site generators.

Those of you subscribed to my RSS feeds will likely get duplications, sorry about that.

LinqPad Migration script

Migrates posts, and images (putting them in the correct spot for Jekyll sites and rewriting links in your blog posts as it goes)

Available at http://share.linqpad.net/76oqrd.linq

Other Links

https://github.com/tokkonopapa/octopress-tagcloud

GitReleaseNotes Initial Release!

I have just used GitReleaseNotes to publish a release of GitReleaseNotes on GitHub https://github.com/JakeGinnivan/GitReleaseNotes/releases/tag/0.2.0!

I am excited about this project because it will save me a heap of time and effort with managing the open source projects I do releases for.

GitReleaseNotes was another project I kicked off about the same time that Simon Cropp and Andreas Öhlund were kicking off similar projects, see https://github.com/Particular/ReleaseNotesCompiler. We decided to start the projects off down different roads to start with, then maybe merge later once we both could experiment with ideas.

Git Flow Versioning

As a follow up to my last post http://jake.ginnivan.net/release-nuget-semver-packages-from-teamcity I have been investigating more into different ways to achieve semantic versioning and being able to release in an easy way.

Next stop on my trip was looking into Git-Flow and how it manages releases, initially it seemed very waterfally and too heavy to use on an open source project, but I thought it may fit at different clients. I was instantly drawn to the fact that releases have an explicit step to version at the start of the release process, this is great, I can manage my project, merge pull requests, add features then when I am ready, I can decide to release, put together release notes and figure out if this is a major, minor or patch release.

Much to my surpise, it is actually very light-weight and you can drop much of it if your process is simpler (say for open source).

https://github.com/TestStack/ConventionTests is my guinea pig!

To get started, I decided to try and implement git-flow manually to really understand what is going on. There are plenty of explainations out there, so I will just be running through what I did, and how it works from my point of view. I always have two remotes setup for my projects, ‘upstream’ is the main repository, ‘origin’ is my fork.