Archive for 'Code'

Mercurial (hg) Pull Does Not Show New Changes

Just a quick note. After doing an hg pull, make sure you do an hg update to begin working on the most recent changeset. That’s five minutes I’m never getting back. I am a little terrified that I have been working on Mercurial for over a month now and haven’t run into [...]

Fixing Blog Post Titles in WordPress

One of my many low priority annoyances with this blog is that the theme that I am using places the blog name in front of the post or page title. Not a huge deal, but when these pages get indexed by Google or Bing, the search results show JamesWampler.com and then the actual title [...]

Configure Mercurial (hg) to Use a Proxy Server

My laptop is behind our corporate firewall for most of the day, so being able to do an hg push/pull against bitbucket.org fails because it isn’t hitting or proxy server. To setup Mercurial to use a proxy server, edit your hrgc file in the .hg folder of your repository and add this section:

[http_proxy]
host = [...]

Why is my .hgignore not ignoring?

After almost an hour of tweaking my .hgignore file trying to figure out why it was not, in fact, ignoring ANY of the file types and folders I told it to, I discovered that .hgignore should be in the root of the repository, not in the .hg folder. I suppose this makes sense if [...]

My First Week with Mercurial (hg)

I haven’t completely disrupted my programming life in a couple of days now, so I have decided to make the switch from Subversion to Mercurial for my personal source control needs. Don’t worry TFS, you are still my number one choice for partially solving my professional source control needs.

There is nothing really driving my [...]

Adding the NHibernate Schema Files to Visual Studio 2010

Since I can never remember the steps on how to do do this, if you need to add the Schema Definition files (.xsd) from NHibernate to Visual Studio 2010, here are the steps you need to follow:

Download the latest version of NHibernate
Copy nhibernate-configuration.xsd and nhibernate-mappng.xsd to C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas\
Restart Visual Studio if it [...]

TFS Merging Infinite Loop Madness

I made a bug fix to the trunk of one of my projects, which included a change to the project file. When I tried to merge the trunk into my development branch in TFS, I double clicked on the solution file before I commited my changes.

Now, Visual Studio is reporting this error message in [...]

Fixing Broken Paging Links in WordPress Running on Windows

I periodically review Google Analytics and Google Webmaster Tools for a couple of different sites I that manage, and I noticed that there were several pages on my blog with broken links. It turns out that on any page with a link to “Recent Posts” or “Older Posts” the links were broken because an [...]

Merging a .NET .DLL into an .EXE with ILMerge

I am currently working a C# console application that I want to be able to easily deploy onto multiple machines. Currently, it is referencing about a half a dozen other DLL’s that I don’t want to have to deploy along with it. I really, really wanted to be able to deploy a single [...]

Production Surprise

I found this while I was debugging a minor production problem this afternoon.

if (userName.Contains(""))
userName = GetUserName(userName);
 
if (String.IsNullOrEmpty(userName))
throw new ArgumentNullException("userName can not be null. Verify identity.Name is not empty.");

This code was written last month during a refactor of this method, and I can not for the life of me understand what userName.Contains(“”) is there for. [...]