Tuesday, April 18, 2006

Here is the link to everything I used in the talk - PowerPoint, *.express files, and source code: MUNG_RegEx Talk.zip (34.5 KB)

The RegexOptions.Compiled flag

Something I forgot to mention in the talk is the "RegexOptions.Compiled" flag.  If you are going to execute the exact same regular expression repeatedly, you can use this flag in addition to any other flags you may have specified (e.g. RegexOptions.IgnorePatternWhitespace).  This will cause the framework to dynamically compile the expression to IL instead of using RegEx op codes, and therefore dramatically increase performance. 

If you are dynamically creating regular expressions, do NOT use the "Compiled" flag.  Each unique compiled RegEx is kept in memory until the application quits - even if the RegEx object goes out of scope. 

Resources:

 

[Update] Fixed error in .express file

Tuesday, April 18, 2006 11:44:59 PM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [3]  | 
 Monday, April 17, 2006

I was listening to HanselMinutes over the weekend, and picked up a few windows tips that I thought I'd share (and to remind myself later if I forget):

  1. Alt-Tab while dragging - In most cases, people usually "set up" a drag by making sure windows are side-by-side, etc.  This isn't necessary.  Just start dragging and then Alt-Tab to the window you want to drag to.
     
  2. Right-click-drag - When dragging using the right mouse button, you get a context menu with several options at the end of the drag.

     
  3. Dragging to the taskbar - In addition to Alt-tabbing while dragging, you can bring a window to the front by dragging an item to its taskbar icon.  Then drop the item on the focused window, not the taskbar

     
Monday, April 17, 2006 4:36:12 PM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, April 07, 2006

Kinda funny that the day after I sign up with FeedBurner, Mike Gunderloy posts a rant against FeedBurner saying

Nine times out of ten when I try to subscribe to a new feed using FeedBurner these days, I get: "Error when subscribing to feed for http://feeds.feedburner.com/XXXXX/: Timeout when downloading feed". I've reached the point where I largely don't even bother trying to subscribe if you go through FeedBurner.

Interesting... let me know if you have problems, and I'll ditch 'em.

Friday, April 07, 2006 4:06:01 PM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [4]  | 
 Thursday, April 06, 2006

I finally signed up at feed burner.  If you're subscribed to this blog, please take a few seconds to un-subscribe from the old URL and use the new one on the right-hand side of my blog (http://feeds.feedburner.com/ColinNeller)

Thanks!

Friday, April 07, 2006 6:39:55 AM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, April 03, 2006

I like studying other people’s code… when they know what they’re doing!  I’ve noticed that this is particularly helpful when I’m new to a technology.  The problem is that the code you’re studying may not be as good as you think it is.

Case in point: I was recently reading over anther programmer’s stored procedure.  At the end, I saw the line “select SCOPE_IDENTITY()”  Eh?  SCOPE_IDENTITY?  What is this?  Every example I’ve seen would have said “select @@identity”… come to find out, 99% of the time, this is the wrong way to do it.

Jeff Attwood recently posted on studying other people’s code:

You won't become a better programmer by passively studying other people's code. Similarly, you don't magically become a better writer by reading a lot of books. You become a better writer by.. wait for it.. writing.

I agree: unless you go through the motions of leveraging a technology yourself, you won’t completely understand it.  Until you actually do it, you don’t yet know what you don’t understand.  I also agree with Jeff’s next statement: “Studying code is reasonable advice. It's helpful.”

Absolutely!  After having done it yourself, it’s much easier to pick out the things that the other author did differently.  Finding these differences makes you find out ask which way is better.  This process enhances your ability to make choices in a given scenario.  It also makes you aware of in future code you write or review.

A quick search on Google ("http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=deskbar&q=@@identity+vs+SCOPE_IDENTITY")  revealed that this issue is not a new topic – but I wouldn’t known anything about it if I hadn’t taken some time to read through someone else’s code.

Monday, April 03, 2006 7:09:13 AM (Central Daylight Time, UTC-05:00)  #    Disclaimer  |  Comments [0]  |