Category Archives: What I learned today

C# var keyword

I’m working my way through the C# 3.0 Language Enhancements videos on LearnVisualStudio.Net.  (Note:  LearnVisualStudio has many videos that are available for free from the MSDN website, but I think that you need a paid subscription to view this series.)  When I’m studying new programming concepts, I find that hearing someone talk about it helps me […]

C# “as” and “is” keywords

“Is” is exactly what I have been looking for.  You use it to check the type of an object.  For example: if(a is long) Gabe Wishnie points out that “is” is much more efficient than: if( a.GetType() == typeof(long)) “As” is a method of performing a typecast that gives you a null pointer rather than […]

.Net BackgroundWorker class

The BackgroundWorker class is an easy way to start up a thread from the GUI to run some lengthy action in the background.  Key points are: The DoWork event runs on the background thread.  You can’t interact with the GUI from there.  The ProgessChanged and RunWorkerCompleted events are raised by the background thread into the […]

NUnit and Visual Studio

Like all my “What I learned” experiences, this may not sound like much to you, but it was interesting to me. I attended a PhillyDotNet hands on lab session tonight  presented by Brian Donahue.  The lab was an avalance of Model View Presenter, Domain Driven Development, and unit testing techniques, with software tools such as Resharper, NUnit, and […]

Using regular expressions to find the text between two delimiters

I have a string like this:  “This is a [abcd] string”.  I want to find the text between the square brackets.  Looks like a job for regular expressions! This regular expression works:  “\[.*\]“.  Very straightforward (for a regular expression) – I like it! Then I saw this regular expression in some question and answer forum:  […]