Preserving Whitespace in DropDownList Items with C# MVC 3

Recently I noticed that the whitespace of the text on my pages wasn’t being preserved when the page loaded. Then I was reminded that, generally, multiple spaces get collapsed and text will wrap when it’s necessary. If you want to change this behavior then you’ll need to reach for the white-space CSS property.

No problem. I updated my text such that white-space:pre-wrap got applied and everything seemed great. Until I saw that my select lists completely ignored the change. Continue reading

Opening Netbeans PHP Projects from the Windows 7 Command Line

So here is a fabulously irritating bug in the NetBeans CLI.

The basic syntax for opening a NetBeans project from the CLI looks like this:

C:\Program Files\NetBeans 7.2.1\bin>netbeans --open <project path>

And for project paths that do not contain spaces this works as expected. However, if the path to your project has a space then NetBeans goes completely off the rails. Continue reading

Setting a Custom Regular Expression for Adding Books to Calibre

I use Calibre to manage my eBook, PDF, etc. libraries. When I’m importing catalogs of PDFs into my library things generally run smoothly… except when they don’t. I have a block of PDFs that I tried to import that had a file naming convention of author – title.pdf and author – seriesName seriesIndex – title.pdf. By default, Calibre will, when reading the metadata from the file name, assume that the file naming convention is title-author.pdf (or something similar). Continue reading

Programmatically Retrieving Team Project Collections and Team Projects from the Team Foundation Server 2010 API

There is an excellent blog post from Taylor Lafrinere on MSDN that deals specifically with retrieving a list of the team project collections from the Team Foundation Server (TFS) 2010 client API. The blog post references the RTC version of the TFS 2010 API and is dated from January of 2010. However, at the time I found it (April of 2012) the example code worked as expected. Continue reading