I learned a little trick I reckon everyone else knows about. I am trying to grow my chops on Visual Studio and have been encouraged recently by some posts by JP Boodhoo and Kevin Atwood on things to increase productivity (speed, acccuracy, etc). One thing that has alluded me in the past was when I wanted to replace chunks of code that, having a pattern that I know I could write a Regular Expression for, would accept that regular expression and then turn around and ONLY replace the bits in the Reg Ex. Ok, that sentence sucked so here's an example.
In my Presenters I wanted to replace the code that had this:
public new ISomeView View
{
get { return ((ISomeView)base.View); }
}
I simply wanted to get rid of the 'new' declaration in there and return a class field instead. I knew I could apply reg ex's to Find stuff in my codebase, but I wasn't sure how to trap variables during a reg ex to preserve them during the replace...In other words, I'd want to keep the 'ISomeView' text above. So, I opened up the Replace In Files from the Edit menu and made my dialog box like this:
The curly brackets in the 'Find' are a Tag that gets captured and then preserved in the '\1' part of the Replace field. There is probably a better way to do this, but I at least learned a little trick. I wonder if ReSharper has some similar and more advanced methods for this kind of thing?
Hope this helps some one.
I have been getting tempted to install the RTM on my home machine just so I can start playing around with the new OS. Unfortunately, Vista seems to have 'snuck up' on E-MU and I have their 1820M card installed for my music studio setup .
I am not sure what else Microsoft needed to do to get vendors ready for Vista and it is ridiculous that EMU doesn't have much to say about their failure to release drivers that are compatible with the RTM.
All the forums are fuming about their lax response to this.
So...maybe I'll hold off a bit longer.
I work alone and don't have much of the complicity which arises in working with teams. Frankly, I'd rather have the complicity than the lack of peer reflection for ideas, inspiration, and even tension (butterflies have better wings with more tension out of the cocoon). But this is my station in professional life for now.
Along with this comes great freedom which allows me to investigate all kinds of ways of solving problems without anyone really to say 'no' to my ideas...I fall often or discover bad practices by engaging in them, but I get up and apply what I learned. Unfortunately, the freedom can cause liquidity in my design because I might fall into thinking "later I can change this". This kind of mindset in the past has caused me pain not only because I would apply Microsoft architectural guidances, resulting in brittle infrastructure, or I'd subtly fall into procedural programming that would be difficult to unravel when change came knocking.
Slowly learning and applying Test Driven Design principles seems to have also created a different mindset in my approach to domain problems, leading me to the Open-Closed Principle. Instead of designing with the assumption that I can change the code base when requirements shift, I now approach new problems with the mindset that my code, since tested and built as robustly as I know how, can NOT change. This is scary at first, but recently I enjoyed the value of this mindset when a potentially domain-shaking change came along in my current application. I didn't touch old code (except for perhaps some refactoring based on new insight...the tests still passed), but rather extended the way I accessed the module of my domain to incorportate the new functionality.
It only took about a week to get the new functionality built in to the domain and I DIDN'T SEND RIPPLES UP THE LAYERS like I used to.
Now I enjoy the challenge of digging around in my toolbox to accomodate this mindset and working alone is less risky.
So I needed to repair my Visual Studio because JetBrains' Resharper 2.5 build 301 screwed my menu up. I love Resharper but even the released versions (like 2.0.2) don't uninstall properly and leave tons of crap in my registry and all over my machine. I know 2.5 is EAP but still...
Anyways, I am at over an hour 'repairing' wondering why there isn't a way to NOT install all the garbage samples Microsoft feels everyone needs. A simple checkbox 'Install Our Lousy Architectural Samples' would be appropriate I think.
Oh well..it's late and I'm crabby.
Is it just me, or is any one else driven crazy by the constant resolution of Intellisense to 'ThreadStaticAttribute' when trying to create a generic parameter, as in
Monkey<T>
becomes,
Monkey<ThreadStaticAttribute>
Maybe I am the only one, but ThreadStaticAttribute isn't a common go-to in my development....
I needed to alternate the css on my table within a repeater, but didn't want to implement the alternatingItemTemplate since the controls would just be duplicated. I found this little snippet
here and modified my ItemTemplate tr tag to look like this:
<tr class="<%# Container.ItemIndex % 2 == 0?"altItem":"rowItem" %>">
The beta 2 is out...has the DetachedCriteria object ported from Hibernate 3 and used in Ayende's Rhino Commons.
Get the beta here.