Recently I was trying to use a Regular Expression in .NET. I was working with small blobs of text. I was trying to extract some code snippets out of some wiki markup.

The code snippets looked like:

{code:csharp|title=C#}
//C# Code
{code}
{code:vbnet|title=vb.net}
//VB.NET Code
{code}

For testing purposes I was using the simplest Regex I could think of {code:(.+?){code}. After playing around it became obvious that it was not matching over multiple lines. This makes sense because the ‘ .’ character  matches every character except /n/r

Well it turns out you want to enable SingleLineMode not MultiMode.  I know I know makes a ton of sense.

Lesson learned. Read the documentation.

Extra Bonus: If you want to quickly test .NET regular expressions with all these options. I found I like http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx

So today update data cross table in a MYSQL database. It took me way longer than it should have.  I spent way too much time trying to get my join to work only to continue getting syntax errors.  So long story short. If you are doing a cross table update in MYSQL you cannot use a join. Rather you must use WHERE a simple example looks like:

UPDATE TableToUpdate, TableToPullInfoFrom

SET

TableToUpdate.col1 = TableToPullInfoFrom.col1,

TableToUpdate.col2 = TableToPullInfoFrom.col2,

TableToUpdate.col3 = TableToPullInfoFrom.col3,

TableToUpdate.col4 = TableToPullInfoFrom.col4

WHERE TableToUpdate.id = TableToPullInfoFrom.id

And I will just leave this here so I don’t make that mistake again.

So my girlfriend and I have been talking about how we both neglect our websites and blogs and that we really want to work on them.  I was curious and pulled up my site stats and checked out how much traffic I have been getting. On average I receive about 5,500 views in a month. I am quite proud of that, but there is clearly much room for growth.

So I made a bet with my girlfriend to keep us both motivated and working on our site. We both looked at our site statistics and found the busiest month that we had and are going to see who can double their traffic the fastest.

Now we both target very different audiences so we didn’t bet anything huge but the loser of the challenge has to buy the winner dinner (hopefully a very nice one! Since it is dinner with my girlfriend I guess we both win either way).

My busiest month was May 2011 with 6,161 views.

So my goal is to get 12,322 views in a month.

I am quite excited about this, as my blog tends to be very technical articles or tutorials this will hopefully force me to start researching and writing about some new technologies.  At the same time I am going document various strategies I use to raise the traffic of my site by focusing not only on new content, but also SEO and marketing tactics.

Let the challenge begin!

If you want to help the competition you can check out my girlfriend’s site at http://www.jennifervitti.com

Recently I was working on ClickOnce Application and I was trying to distribute XULRunner with my application. Unfortunately when deploying the application I realized that not all the files where included in the ClickOnce applications file, particularly text files such as files that ended in .ini or .manifest.

The solution was to go into the solution explorer in Visual Studio, select the files that there not being copied, and set the build action to content for those files.