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…


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…


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…


Stream join aggregates using SQL Server Stream Insight

Lately I have been working with StreamInsight and thought it was about time to share some of my observations and key points. This is loosely based upon a requirement to aggregate Financial risk vectors and deliver changes to clients in an event based manner. When working through this I was primarily interested in the following…


String extension methods rather than using RegEx

In a recent project I was using regular expressions a lot for validating string expressions such that statements like the following were true: Must be all characters Must be all alphanumeric’s and be of length 6 Must be all numeric digits (e.g. “3648”) Must be all upper case characters However in reflection the char data…


Refactor boilerplate code with Actions and Funcs

I have seen quite a few projects where the code starts with the best of intentions in terms of readability, but soon setup and boilerplate code creep in and it becomes hard to focus on where the setup and clean up ends and the functionality begins.  The other downside being repetition of this boilerplate code…


Parallel process execution with partial completion of processes

  On a recent project I came across an interesting parallel processing problem that I could not find a well defined pattern for. The problem was I needed to execute some long running processes synchronously and in parallel, but stop processing when a certain condition was met. Each individual process would normally take seconds but…