Tools & Utilities

The Book of F#

The Book Of F#Earlier this year (late February to be exact) my life took an interesting turn: a publisher approached me about writing an F# book. Writing a book had been something that I’d thought of doing for some time but it was never something I gave any serious consideration. After some discussion with my wife, mostly about the time commitment, I decided to go ahead with the project. Since then, a mix of writing, reviewing, revising, and the variety of other activities that go along with getting a book on the shelves have consumed most of my nights and weekends.

After months of work, I’m very excited to announce that The Book of F#: Breaking Free with Managed Functional Programming will be published by No Starch Press! The book is scheduled for release on March 22, 2014 but No Starch is accepting pre-orders now! By pre-ordering from No Starch with the coupon code PREORDER, you can save 30% off the cover price of $44.95.

If you’re an experienced .NET developer that would like to break free from the chains of C# and Visual Basic or someone that’s just curious about the language, this book is for you. The Book of F# will introduce you to the basics of the language and walk you through features such as currying, partial application, pattern matching, discriminated unions, record types, units of measure, type providers, and a plethora of other concepts. Throughout the book you’ll see examples of how F#’s terse syntax and functional-first nature will help you be more productive and produce code that’s more predictable than that of many modern languages.

F# has been getting a lot of attention lately. If you’re even remotely curious as to why, I hope you’ll consider adding this book to your collection.

Custom Dark Colors for F# Depth Colorizer for VS2012

Custom F# Depth ColoringA few days ago I installed the F# Depth Colorizer extension for Visual Studio 2012. I really liked the idea but didn’t care much for the default colors used with the dark theme. Rather than alternating light and dark colors I thought it would look better with the background getting progressively lighter giving the illusion of each block being stacked on its container.

After a little tweaking I created the necessary registry entry and was pretty pleased with the result.  The image to the right shows the colors against the same code snippet used in the extension’s description.  If you’d like to use these colors just copy the registry information below into a .reg file and apply it. You’ll need to restart Visual Studio for the changes to take effect.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Text Editor\FSharpDepthColorizer\Dark]
"Depth0"="0,0,0,0,0,0"
"Depth1"="15,15,15,15,15,15"
"Depth2"="30,30,30,30,30,30"
"Depth3"="45,45,45,45,45,45"
"Depth4"="55,55,55,55,55,55"
"Depth5"="65,65,65,65,65,65"
"Depth6"="75,75,75,75,75,75"
"Depth7"="80,80,80,80,80,80"
"Depth8"="85,85,85,85,85,85"
"Depth9"="90,90,90,90,90,90"

More information about the extension including how to customize the colors is available on Brian McNamara’s blog.

.NET Rocks! Visual Studio 2012 Launch Road Trip in Indianapolis!

.NET Rocks Visual Studio 2012 Launch Road Trip

The details are still a bit sparse on this one but here’s a note to mark your calendar.  On October 8 (Yes, the day after GiveCamp) IndyTechFest presents The .NET Rocks! Visual Studio 2012 Launch Road Trip in Indianapolis!

If you’re wondering what this is all about here you go:

Well, we’ve done it again! We went and rented a big 37′ RV and booked another United States (mostly) Road Trip for the launch of Visual Studio 2012. No charge for admission.

At each stop we will record a live .NET Rocks! show with a guest star, whom we will fly in for the occasion.

Following that, we (Richard Campbell and Carl Franklin) will each do a presentation around building modern applications on the Windows platform. Carl leans toward development and client-side technology and Richard leans toward DevOps and server-side technology.

There will be food, drink, geeking out, and hopefully some alert locals will know of a pub where we can adjourn after the event to continue the conversation.

If you’d like to attend be sure to register.  I’ll update this space with more details as they’re made available.  I hope to see you there!

10/8/2012 Update

I’m a little behind with this update since I was tied up with GiveCamp all weekend but the venue details are as follows:

IndyCoz
7960 Castleway Dr
Indianapolis, Indiana 46250
[Map]

Moles vs Fakes: The Differences

If you’re a fan of the Microsoft Moles framework you’ve probably heard that it’s being included in Visual Studio 2012 as Microsoft Fakes.  As I was preparing my talk covering this isolation framework I noted some of the key differences between the two.  Rather than going back and updating my original post regarding Moles (much of which is still applicable even with terminology changes) I thought I’d list those differences here.  So without further ado:

  • Assembly generation is driven by a .fakes file rather than a .moles file
  • Isolation types are placed in a .Fakes assembly and .Fakes namespace
  • Shim types replace Mole types
  • Stub types are prefixed with “Stub”
  • Shim types are prefixed with “Shim”
  • ShimsContext replaces HostTypeAttribute for enabling profiling
  • Profiling occurs in the IntelliTrace profiler rather than the Moles profiler
  • Fakes allows shims for static constructors whereas Moles allowed erasing static constructors through an assembly attribute
  • Fakes does not provide any support for finalizers whereas Moles allowed erasing finalizers through an assembly attribute
  • Moles allowed controlling whether the profiler would run as a 32-bit or 64-bit process but this is now handled entirely by the IntelliTrace profiler
  • The “classes” filter attribute was removed.
  • Fakes supports isolating auto-implemented properties
  • Fakes play much nicer with testing frameworks other than MSTest when run through Visual Studio

VS2010: Web Standards Update and the CSS Editor

I’ve been doing a bit of Web UI work recently and everything was going fairly smooth until yesterday when I tried opening one of my CSS files in Visual Studio and was promptly greeted with a dialog reading “The operation could not be completed. Unspecified error” and the editor never opened.  A little hunting for the error message and “CSS editor” revealed that the Web Standards Update for Microsoft Visual Studio 2010 SP1 was likely to be the culprit and uninstalling should resolve the issue.

I closed Visual Studio, uninstalled the update, and sure enough, when I reopened my project the CSS file opened just fine. I haven’t reinstalled the update yet. Maybe I’ll try again soon but it seems from the comments on the component’s page that this is a common issue.

More information:

Nesting Files in Visual Studio

A neat trick that I’ve used a few times to help organize files in a project is nest some under a related “master” file just like an aspx file and its code-behind.  I’ve mostly done this to group some page-specific JavaScript files with the page but also to group some partial classes for a WCF service together under a single “master” file.  This is hardly new (I think I did it for the first time with a project file from VS2008 and I know it has been around even longer than that) but every once in a while it comes up in a conversation so I thought it was worth sharing.
(more…)

JustDecompile – One More Time

I’ve looked at JustDecompile a few times over the past year, following its progress from its early beta stages.  When I saw that it was officially released yesterday (14 Feb 2012) I remembered telling Vladimir Dragoev from the JustDecompile team that I’d give it another look.  I’ve been very critical of this product in the past but given that everything I’ve looked at so far has been pre-release software it’s only fair that I give it one more chance to redeem itself.  Can this version finally handle my tests?

(more…)

Archiving with Mercurial

Recently I’ve been working with a third party component vendor to resolve a defect. They requested that I create a sample project illustrating the issue and send it to them as a zip archive. Building the project was easy but I didn’t want to send all of the extra stuff that goes along with it. In other words, I wanted a snapshot of the current revision but without the source control bindings.  I knew how to do this with Subversion but how did Mercurial handle it?

(more…)

More Fiddler Troubles

Last week I posted about a coworker having some trouble with Fiddler. Whenever he’d visit a page the only thing that Fiddler would show was oscex-en.url.trendmicro.com. At the time I thought it was a problem our virus scanner setting itself as a proxy and interfering with the process filters.  He actually wasn’t using filters so that wasn’t the problem.

Earlier this week another coworker stopped by my cube and said he’d heard rumor about me troubleshooting some fiddler issues…  And he had his laptop…  Uh oh…

(more…)

Fiddler Troubles

This morning I was included on an email asking a few of us if we’ve been able to use Fiddler.  He said when he tried to use it he saw it do its update check then make a request to oscex-en.url.trendmicro.com but it wouldn’t capture anything else regardless of which sites he visited.

I’ve been using Fiddler a lot lately to help test a new RESTful WCF service I’m prototyping and hadn’t been having any trouble with it but then I remembered that I didn’t have filters enabled.  I clicked over to the Filters tab and checked the “Show only Internet Explorer” traffic, refreshed a page, then nothing…  Fiddler wasn’t capturing anything.  What gives?  This worked the last time I used it.

(more…)