Professional Programmer Notes

or just call this my soapbox

Archive for the ‘Uncategorized’ Category


leave a comment »

Overview of ZeroMQ from pieterh
This slideshare makes me wonder about the different ways ZeroMQ could allow me to scale .NET applications?

Written by curtismitchell

April 16, 2013 at 12:32 pm

Posted in Uncategorized

Tagged with , ,

To whom it may concern

leave a comment »

For the last four years, this country has been governed by an African-American president. A little more than four years ago, (soon-to-be) President Barack Obama excited a large variety of citizens of this country – particularly, the citizens that do not share the same racial or gender demographics as the previous forty-three presidents. We were excited by his charm. We were excited by his cool. We were excited by his race. More importantly, we were excited by his priorities, his promises, his resolve, and his confidence that he could lead this country into a much brighter, more just, and more united future.

That was then.

Today, I reflect back on the presidency of this man and I am amazed. I’m not particularly amazed by his policies or compromises. But, I am amazed at the cool way he has conducted himself in the face of a country that has shown a very hateful side of itself.

When the ink dries on the pages written about President Barack Obama, the record will reflect the uprisings of Americans that simply had enough. The books will reflect photos of citizens that united against this president, with signs scarred by hate-speech and caricatures of our president with exaggerated lips and ears. And, sadly, somewhere (not just here), a story will be written about the gas station in NC where a staged lynching of our president and other African-American men was put on display for all to see.

I don’t live too far from that gas station.

Today, I feel like me and my family were just threatened. In my head, I hear the voice of some of my more conservative associates reminding me that no law was broken by the person(s) responsible for this display. However, when I consider the intent of the messenger(s) and the history of Black Americans and lynchings in this country, I see this as an act of terror.

I see this as yet another very serious offense that will go unpunished, unexplored, and unquestioned. Why? Because it is not uncommon.

In turn, I’ll look to the current leader of these United States for something I can’t get from a Mitt Romney or Paul Ryan. I’ll look to him for an example of how a man could conduct himself in the face of hate. I’ll be cool. I’ll keep my charms. And, I’ll do the terrorists a favor by not being fearful or terrified.


Written by curtismitchell

September 5, 2012 at 10:22 pm

Posted in Uncategorized

On a nodejs kick today

leave a comment »

I’ve recently increased my interest in nodejs. Today, I revisited a framework called Mojito by Yahoo. I first learned about Mojito on, an awesome site for the IT-minded.

Mojito uses nodejs. It is a framework for developing applications in javascript. Interestingly, Yahoo also developed a project called Manhattan that serves as a platform-as-a-service for your Mojito applications – similar to Nodester.

As great as that all sounds, there is more! Check out this 5 minute demo by the lead engineer. It’s interesting stuff.

Cocktails in Action

Written by curtismitchell

May 16, 2012 at 12:41 pm

SEWDI (Someone Else Will Do It) Disease

leave a comment »

What is it?

A productivity block that often affects the work of developers that habitually search and find solutions to technical problems.

History (feel free to skip to “How it affects us” below)

In the past, research was very time consuming.  It often involved 
  • traveling to a library that may not have computers
  • learning and utilizing the Dewey Decimal system to increase efficiency
  • identifying possible books and/or periodicals on the topic
  • reviewing many sources to adequately research the topic and add depth to the research
  • compiling the research into a format to be reused
  • consuming and/or sharing the research
Then, the Internet was invented and things started getting better!
Today, we can simply
  • open a web browser on one of the many computers available to us (even at libraries now)
  • type a term or phrase into one of many search engines
  • click on a few of the links that were instantly presented 
  • use what you learned and move on (no need to compile it or save it because we can always just search and find it again later)

In other words, research is relatively cheap and easy.

How it affects us

The ease of research has impacted how developers respond to problem-solving.  As professional problem-solvers, our natural response pertains to how the problem can be solved.  This helps us identify an approach to solving the problem that we think might work.  That’s the easy part. 
Next, we have to actually do the work to prove the approach solves the problem.  That’s the hard part — especially when there is often an easier way.  Instead of doing the implementation work, we research solutions to the problem.  Often, we find solutions that can be implemented with little or no effort.  We call that efficient.
Meanwhile, we are conditioning ourselves to be dependent on this readily available resource known as the Internet.  In addition, we are subconsciously depending on the hard work of strangers.  Given enough successful Internet searches, we start to believe that failing to find a response means one of two things:
  1. Our search terms need to be refined
  2. The solution is not available … yet.
This means either we need to approach our search differently, or wait until someone comes along and solves our problem.  Either way, actually solving the problem becomes the last option!
That’s the magic of the Internet and the illusion of productivity that hides procrastination.  We will “work on solving the problem”.  We are professionals after all.  It’s just that “working on it” takes on a new meaning like 
  • refining our search terms
  • asking colleagues how they solved similar problems
  • or, distracting ourselves with a new problem until someone else solves the first problem – thus, this blog entry 🙂

Written by curtismitchell

December 7, 2011 at 8:11 pm

Posted in Uncategorized

Tagged with ,

Don’t let my face stop you from giving to a good cause

leave a comment »

Hey You,

As you may or may not know, I’m participating in a very exciting event called Movember. It is when people everywhere set their own pride and vanity aside, and grow mustaches throughout November to raise money to help combat common Men’s health issues like Prostate Cancer.

One requirement was to start the month cleanly shaven. Here is me on November 2nd:

Clean shaven

Look Ma! No mustache!

Here is what I looked like on November 11th:

Barely a mustache as of 11-11-11

Stache still missing

If the whole purpose of Movember is to grow a mustache in order to raise awareness, I am failing badly. I can’t help it. My face just isn’t cooperating.

However, I still owe it to you, LexisNexis (my company and Movember team), to provide something that will raise awareness and money for the cause.

Without further ado, here are some pics of me with potential mustaches.

Michael Jordan Stache

My Michael Jordan Stache

Michael Jordan Mustache

Michael Jordan's Hanes Mustache

My Juan Valdez Stache

My Juan Valdez Stache

Juan Valdez

Juan Valdez

Obviously, I need help. I’m borderline desperate. Since my mustache refuses to work with me on this, please work with me on this. Checkout my Movember page and donate dollars to the cause.

UPDATE (11.18.2011)

Hulkamania Stache

Written by curtismitchell

November 11, 2011 at 11:32 am

.NET Devs: Make |DataDirectory| resolve to a path of your choosing

leave a comment »

I’m working on a desktop application that uses and embedded database. In my case, I’m using Sql Server Compact Edition 4.0 with Entity Framework 4.1. This tip could also apply to usage of Sqlite. In my app.config file, I have a connection string that tells my application to put the database in the “Data Directory” by using a syntax similar to this:

    <add name="DbConnection"
         connectionString="data source=|DataDirectory|\MyDb.sdf"
         providerName="System.Data.SqlServerCe.4.0" />

In ASP.NET, the |DataDirectory| token would expand to an App_Data folder under the root of my web application. For desktop applications, it is the bin directory. But, what if I wanted to point to a different location?

It turns out that DataDirectory is a macro. It is resolved using the AppDomain. The following line of code allows me to set the DataDirectory path prior to using the connection string:

AppDomain.CurrentDomain.SetData("DataDirectory", @"C:\temp\data");

That would expand my connection string to: data source=C:\temp\data\MyDb.sdf

Written by curtismitchell

June 21, 2011 at 2:14 pm

Posted in Uncategorized

Code Camp Report

with 2 comments

Name: Chicago Code Camp 2010
Where: Illinois Institute of Technology, Chicago, IL
When: May 1, 2010

My Talk


I had an opportunity to present at the Chicago Code Camp. My talk was titled, “Seven Habits of Highly Effective ASP.NET MVC Developers.” It is a long title derived from Stephen Covey’s best selling business book, “Seven Habits of Highly Effective People.”

Similarly, the content of my presentation was derived from the habits and principles that Stephen Covey introduces in his book. The difference is the technical spin that I apply to make these principles relate to the job of developing web applications using Microsoft’s ASP.NET MVC framework. I presented habits that we as developers should adopt in order to effectively begin and maintain our web applications over their respective lifecycle.

Surprisingly, this topic was very popular at the Chicago Code Camp. Initially, I was expected to present in a room that seated about thirty people. However, the room quickly exceeded capacity and I was asked to present in a larger room. The seats in the larger room were quickly taken, and some attendees sat along a window sill in the back of the room.

At the conclusion of the talk, I had some great discussions with a few people with questions ranging from organizational concerns to technical implementation. I was able to answer many of the questions or offer relevant suggestions.

Overall, I felt like the presentation was well received. The initial feedback available on Twitter gave me the feeling that the experience was a pleasant one. Here are some example tweets that I read shortly after the talk:

“Learned a lot from your MVC talk. Hopefully you can go to CVNUG code camp some day”@cksanjose

“Highly Effective Habits of MVC Developers by Curtis Mitchell. This guy is crazy awesome”@jonathanbaltz

“Liking the MVC presentation. The speaker is really up beat. Keeps you interested.”@itsff

Talks I attended


Ioke ( by Ola Bini )

Ioke is an experimental language written by the presenter of this talk. It runs atop the Java Virtual Machine and it is inspired by many of the features in languages like Ruby and Lisp. It is a very impressive programming language. However, it is not intended for use in production applications. Ola Bini did mention he is working on a newer programming language. I am hoping the new language implements many of the features in Ioke, and become a viable language to use in production scenarios.

Limelight ( by Micah Martin )

Limelight is a framework written and actively maintained by Micah Martin’s company, 8th Light Incorporated. The framework allows developers to create desktop applications in the popular Ruby scripting language. In addition, the development experience is simple yet powerful. Limelight employs a web development-like paradigm. And, it makes deployment of these applications over the web very easy.

Micah also explained that Limelight applications should be considered rich internet applications (RIA) as well. He demonstrated Limelight links – a hyperlink that can be used to download and launch Limelight applications from a server. This eases versioning and maintenance of desktop applications because the deployed software is hosted on a server like a web application. And, users automatically get the most recent version when they launch the application from a web-enabled computer.

Making the web “F#”unctional w/BistroMVC ( by Scott Parker )

This talk focused on two things of interest to me: Microsoft’s newest .NET language, F#, and an alternative Model-View-Controller web framework, BistroMVC. The presenter was entertaining and very comfortable throughout the talk. He did a good job at targeting the “F# newbies” like myself and many others in attendance. The talk included a good introduction to F#. Unfortunately, due to time constraints, we weren’t able to get a good introduction to BistroMVC.

However, I learned enough to pique my interest in both technologies. I am going to definitely learn more about F# and do some more investigation into BistroMVC.

Web Testing with Visual Studio 2010 ( by Richard Campbell )

Microsoft released Visual Studio 2010 on April 12th of this year. They have put a lot of work into improving the features related to testing. Richard Campbell gave a very entertaining and educated talk on how to leverage a small portion of these new features to stress test our web applications.

Personally, I have been looking into some of the web testing capabilities of VS2010 from an automated integration test perspective. It was great to learn about and see the stress-testing features.

Richard is the founder of and Product Evangelist of StrangeLoop Networks. His company specializes in optimizing web applications. He demonstrated his expertise in the subject matter and delivered a great presentation on how to use VS2010 to make sure your web application can perform.



I am very happy I attended this event. There were approximately 550 registrants and slightly more than 300 attendees. The attendees, presenters, and organizers included notable leaders from the .NET community such as:

  • Scott Seely, co-author of "Effective REST Services via .NET: For .NET Framework 3.5", founder of Friseton, LLC
  • Micah Martin, founder of 8th Light Inc. and co-author of "Agile Principles, Patterns, and Practices in C#"
  • Robert “Uncle Bob” Martin, author of "Clean Code: A handbook of Agile Software Craftsmanship", co-aurthor of "Agile Principles, Patterns, and Practices in C#", and founder of Object Mentor
  • Rocky Lhotka, creator of the widely-used CSLA.NET framework
  • Carl Franklin, co-host of the popular .NET Rocks podcast
  • Richard Campbell, co-host of the popular .NET Rocks podcast

To name a few.

This code camp met my criteria of successful code camps. It was well-organized, supported by a great development community, consisted of diverse technological topics, and concluded with downright awesome giveaways. I hope I have an opportunity to attend future Chicago Code Camps.

Written by curtismitchell

May 3, 2010 at 2:40 pm

Posted in Uncategorized

Two ways to handle unauthorized requests to Ajax actions in ASP.NET MVC 2

leave a comment »

Problem:  I have created a view that posts to an action via Ajax with the expectation that the action will return the requested data or an empty string.  Even better, I would like it to be configurable to return whatever value I see fit.

The problem arises when I decorate the called action with the [Authorize] attribute.  If the request is not authorized and I have a loginUrl configured in my web.config, my ajax request will return the html output of my loginUrl view.  That is undesirable.

Solution #1:  I need to implement a custom ActionFilterAttribute that I can use on the ajax action to handle the request appropriately.  Here is the code for my ActionFilterAttribute:

    public class AjaxAuthorizeAttribute : ActionFilterAttribute
        public string View { get; set; }
        private bool renderView;

        public override void OnActionExecuting(ActionExecutingContext filterContext)
            if (!filterContext.HttpContext.Request.IsAuthenticated && filterContext.HttpContext.Request.IsAjaxRequest())
                renderView = true;


        public override void OnResultExecuting(ResultExecutingContext filterContext)
            if (renderView)
                filterContext.Result = new ViewResult { ViewName = View };


And, here is how I would decorate my ajax action in my controller class:

public ActionResult AjaxRequest()
        return View();

That would handle the issue by checking whether the request is authenticated.  If it isn’t authenticated and the request is being submitted via ajax, a specified view will get called.  The content of that view determines what my ajax call will receive back when the request is not authenticated.

Note:  There is no default view page being rendered if one is not passed to the ActionFilterAttribute.  That’s room for improvement.

Solution #2:  I can extend the existing Authorize attribute by inheriting from the AuthorizeAttribute class.  Here is the code that extends the Authorize attribute:

    public class AjaxAuthorizeOverrideAttribute : AuthorizeAttribute
        public string View { get; set; }

        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
            if (!filterContext.HttpContext.Request.IsAjaxRequest())

            filterContext.Result = new ViewResult { ViewName = View };

Here is the decorator for the ajax action in the controller class:

public ActionResult AjaxRequest()
     return View();

Note:  Again, there is no default view page being rendered.

Written by curtismitchell

March 22, 2010 at 4:10 pm

Posted in Uncategorized

Changing the default Virtual Directory/[TARGETVDIR] name in a Visual Studio Setup Project

with 2 comments

While working on a Visual Studio Setup Project for an ASP.NET MVC application, I ran into an interesting dilemma. The installer automatically uses the Title of your setup project as the default virtual directory value. From a user experience standpoint, it can serve as a visual indicator that this "virtual directory" is specifically for the application that you (the user) are installing.

However, it isn’t ideal. See, usually the title of an installer is human readable e.g. "My Application". However, I don’t think user would want their virtual directory to contain spaces since spaces typically get escaped to a hex value, making your site’s address http://someserver/My%20Application. Visual Studio Setup Projects do not offer a straight-forward way of editing this default value, except to edit your title to read "MyApplication".

There are a handful of solutions that have been conceived by various people that include passing command line arguments or using custom dialog windows that set the TARGETVDIR parameter explicitly – to name a couple.

For different reasons, none of the proposed solutions satisfied my dilemma.

So, here is what I did:

I opened the deployment project in notepad++ (a very handy text editor), found the line that says, "VirtualDirectory" = "My Application" and changed it to "VirtualDirectory" = "MyApplication". After saving the file, reloading it in Visual Studio, and building my installers, my dilemma was solved. I hope this is helpful to you as well.

Written by curtismitchell

February 19, 2010 at 12:14 pm

Posted in Uncategorized

Slides from Raleigh Code Camp 2009

leave a comment »

This weekend, I had the pleasure of presenting a talk on Spark View Engine at Raleigh Code Camp (#rducc).  It was a well organized event with a schedule full of great topics and presenters.  The Triangle .NET User Group (TriNUG) did a wonderful job at organizing and running the event.  Thanks, TriNUG!

As promised, I am posting the slides that I used in the Spark talk.  Although the true context of the talk is not present on the slides, I hope these are helpful to someone using the Spark View Engine or considering it.

Stay tuned, or subscribe to the rss. I am planning to post a series of short to-the-point screencasts that demonstrate how to practically use Spark in your ASP.NET MVC application.

In the meantime, checkout for some great videos on Spark.

Written by curtismitchell

September 21, 2009 at 10:01 am