LINQ, collections and null reference exceptions

This short post describes an idiosyncrasy of LINQ that, for someone with several years of C# experience I should probably have known about, but didn’t. During development of an app the test team reported that a null reference exception was intermittently occurring. For a seasoned developer like myself I didn’t think it would be too…


Video Streaming with a custom IRandomAccessStream on Windows and Windows Phone (Universal App)

  Overview   We encountered a challenge on our project where we wanted to play videos in MediaElement but the MP4 file was stored in Sharepoint which required user credentials for authentication. If you pass a URL to the MediaElement on Windows Phone 8.1 then it just tried to access the file without passing any…


Azure: Calling the Azure Management Rest API

The Azure Management REST API exposes a series of endpoints that allow you to perform various operations against your Azure subscription. This is documented at http://msdn.microsoft.com/en-us/library/windowsazure/ee460799.aspx. You can do many things with the REST API – the majority of Azure management operations can be initiated via this (Note: the Azure PowerShell commandlets wrap calls to…


Execution Time Based Heuristic Custom Task Scheduler

If you follow the samples for Parallel Programming with the .Net Framework, you may have come across the ParallelExtensionsExtras and the Additional TaskSchedulers. Although these samples cover a broad set of requirements I recently came across another that could be satisfied with the creation of a new custom task scheduler. In the current samples there…


Dealing with an XSD Choice when XSD.exe doesn’t add XmlChoiceIdentifierAttribute

On my current project we are dealing with some quite complex xsd schemas. Whilst working with one of these I was confused by what I was seeing in the generated code produced by xsd.exe; specifically where an xs:choice was involved. I was expecting to see: An XmlChoiceIdentifier attribute appear on the object in question An…


Co-occurrence Approach to an Item Based Recommender

For a while I thought I would tackle the problem of creating an item-based recommender. Firstly I will start with a local variant before moving onto a MapReduce version. The current version of the code can be found at: http://code.msdn.microsoft.com/Co-occurrence-Approach-to-57027db7 The approach taken for the item-based recommender will be to define a co-occurrence matrix based…


.Net Implementation of a Priority Queue (aka Heap)

I thought I would take a break for a while from Hadoop and put together an F# .Net implementation of a Priority Queue; implemented using a heap data structure. Conceptually we can think of a heap as a balanced binary tree. The tree will have a root, and each node can have up to two…


Generic based Framework for .Net Hadoop MapReduce Job Submission

Over the past month I have been working on a framework to allow composition and submission of MapReduce jobs using .Net. I have put together two previous blog posts on this, so rather than put together a third on the latest change I thought I would create a final composite post. To understand why lets…


Framework for Composing and Submitting .Net Hadoop MapReduce Jobs

An updated version of this post can be found at: http://blogs.msdn.com/b/carlnol/archive/2012/04/29/generic-based-framework-for-net-hadoop-mapreduce-job-submission.aspx If you have been following my blog you will see that I have been putting together samples for writing .Net Hadoop MapReduce jobs; using Hadoop Streaming. However one thing that became apparent is that the samples could be reconstructed in a composable framework to…