DOCS.COM

For the last 4 months, Matt Augustine and myself, along with Raman Narayanan, Richard Speyer, and Andrzej Turski, have been the main devs on http://docs.com.  What an amazing project! My role in all of this was to bring up some very custom roles inside of Windows Azure.  Stuff I can’t really talk about now, but,…

0

HRESULT=D0000033 When calling CloudDrive.Mount

I’ve been working with Azure’s new CloudDrive capability, and today I ran into a problem with caching that I thought I would share the workaround for. The first step in using caching with CloudDrive is to define a LocalResource for the role in the csdef file:     <LocalResources>       <LocalStorage name="AzureDriveCache" cleanOnRoleRecycle="false" sizeInMB="8000" />    …

0

Moving to Redmond!

Well, it’s official — I am moving to Redmond to work for Microsoft.  I’m very excited about the opportunity to be on the Mother Ship and work on cool stuff with my team here. Best! Brian

4

Entity Group Transactions and Development Storage

Have you gotten the error: InvalidInput One of the request inputs is not valid when performing an Entity Group Transaction against Development Storage?  If so, read on. Recently, I’ve been working on a Windows Azure project, and it’s wonderful that Azure Table Storage now includes support for “Entity Group Transactions”. Here’s the MSDN Documentation Page…

2

Extending the int type to have a For method

It’s been months since I had anything interesting to blog about.  Mostly because I was working away on some new stuff I couldn’t talk about.  Anyway, now I feel like blogging again. I’m working on an Azure Worker Role which processes messages from an Azure Queue.  In the main loop of my Worker Role, I…

2

Are you a Maker or a Manager?

Paul Graham writes very useful stuff.  I respect his mind. Read his Maker’s Schedule, Manager’s Schedule essay for what I think is one of the smartest descriptions of the classic problem all programmers face. Spread this meme in your organization. Are you a Maker or a Manager? Both are useful, but they are very different…

1

Stopwatch on Interlocked.Increment(ref x) vs. lock (y) { x++; }

Given 10 million iterations: object y = new object(); const int iterations = 10000000; Which is faster, InterlockedIncrement: stopWatch = Stopwatch.StartNew(); for (int i = 0; i < iterations; i++) { Interlocked.Increment(ref x); } stopWatch.Stop(); Console.WriteLine("Interlocked took " + stopWatch.ElapsedMilliseconds); Or lock: stopWatch = Stopwatch.StartNew(); for (int i = 0; i < iterations; i++) {…

5

A simple and totally thread-safe implementation of IDisposable

A simple and totally thread-safe implementation of IDisposable, with improved semantics over the Dispose() / Dispose(bool disposing) reference implementation.  Now updated, slightly, after a consult with someone much smarter than me, who suggested a slight improvement: use Thread.VolatileRead in the IsUndisposed method. Instructions: Override DisposeResources in derived classes.  When this method is called, always release…

1

An invariant version of the same…

An invariant version of the same… /// <summary> /// Extends StringBuilder so that it has an AppendFormatLineInvariant method. /// </summary> /// <param name="value">The StringBuilder being extended.</param> /// <param name="format">A composite format string.</param> /// <param name="args">An object array that contains zero or more objects to format.</param> /// <returns>The StringBuilder.</returns> public static StringBuilder AppendFormatLineInvariant(this StringBuilder value, string…

0

A missing method from StringBuilder…

StringBuilder is so useful.  Does it all.  But it’s missing a method.  Here it is: /// <summary> /// Extends StringBuilder so that it has an AppendFormatLine method. /// </summary> /// <param name="value">The StringBuilder being extended.</param> /// <param name="format">A composite format string.</param> /// <param name="args">An object array that contains zero or more objects to format.</param> ///…

0