development
The only thing worse than my XPath skills are my RegEx skills. I don’t use XPath all that much these days, but today I needed to. It took me a while to find a code sample that does this. After a playing a bit with SnippetCompiler, I found the solution: StringBuilder builder = new StringBuilder();
builder.AppendLine("<foo>");
builder.AppendLine("<bar baz=\"a\">1</bar>");
builder.AppendLine("<bar>2</bar>");
builder.AppendLine("<bar baz=\"b\">3</bar>");
builder.AppendLine("<bar>4</bar>");
builder.AppendLine("<bar baz=\"c\">5</bar>");
builder.AppendLine("</foo>");
XmlDocument doc = new XmlDocument();
doc.LoadXml(builder.ToString());
XmlNodeList nodes = doc.SelectNodes("//foo/bar[not(@baz)]");
if ( nodes == null )
{
WL("nodes was null");
}
else
{
foreach ( XmlNode node in nodes )
{
...
I’ve been getting into some pretty advanced scenarios with WCF where we need to precisely shape the XML on the wire and the schema’s that are produced by svcutil.exe. Trust me, the moment you start using WCF for exposing services to Java clients, those Java clients are really going to care how the XML looks. WCF makes .NET-to-.NET very easy, and .NET-to-Java doable, but I wouldn’t call it easy. For vanilla scenarios (simple contracts with simple types and basic complex types), it’s pretty easy. The hooks exposed by WCF for shaping the XML are pretty poor in my opinion....
I’m finally getting a chance to sink my teeth into Windows Communication Foundation (WCF). I’m finding quite a few gaps on the interoperability side of things, and I think it’s overly complex in it’s configuration schemes and extensibility points, but it’s light years beyond what we had previously in ASMX. From what I can tell, the WCF adoption was just much slower than everyone anticipated. I’m not sure why that is – perhaps it’s the vastness of it that’s intimidated people. Perhaps it was the quality of the the .NET version 2.0 release that resulted in a slow adoption of...
Some time ago I wrote a post called Base Personal Image. I wanted to write an update to that, but decided it would be nice to have it in it’s original date for historical purposes. So, I’m writing a new post and stamping it with the year. Here’s the topology of my setup The staple of my setup are Windows Live Mesh (this replaced Folder Share for me – now called Windows Live Synch). This is what ties everything together for me. Core Windows Vista SP1...
From time to time I have to break out skills from my past. I needed to solve a few problems today that required a VBS script and a couple of batch scripts. It took me longer than I care to admit to remember how to do this.
So, this post is a reminder for my future self.
Here's how to set a local variable in DOS and use them, as well as how to use a system environment variable (WinDir):
1: SET INTERNAL_ROOT_PATH=D:\foo\trunk
2:
3: svn.exe update %INTERNAL_ROOT_PATH%
4: %WinDir%\Microsoft.NET\Framework\v2.0.50727\msbuild.exe %INTERNAL_ROOT_PATH%\Internal.sln /Property:Config=Release
Here is...
Two product efforts at Microsoft have spun up this year and both are new implementations of very old ideas:
ASP.NET MVC Framework - Microsoft's upcoming implementation of a Model View Controller architecture for their web application platform. MVC has been around for a long time on other development platforms, but only recently has there been a push in the .NET community demanding for this.
ADO.NET Entity Framework - Microsoft's next rev of data access technology (ADO.NET) contains a lot of new ways to...
Its refreshing when you solve what appears to be a nasty problem with a simple and clean solution. It's an even better feeling when you solve it with Computer Science fundamentals. I solved something this morning by releaning how acces modifiers work (access modifiers in C# in my case).
We have a basic data transfer object that has some private state that handles change tracking. Something such as:
1: public class ProductDTO
2: {
3: private bool _isDirty = false;
4: private string _name;
...
Microsoft's developer division has been making a lot interesting moves lately. They're starting to finally listen to the strong thoughts and opinions coming out of the Java converts in the .NET community and realizing they know what they're talking about. As usual, they're not really innovating, but they're taking existing ideas and building some great tooling around those ideas and delivering them to the masses.
In the March release of MSDN Magazine they published Loosen Up which is a general overview of the benefits of IoC and DI. Just last week Microsoft Pattern's and Practices group released Unity...
I haven't blogged in a long, long time. I'm not sure what got me off the horse exactly, but it's time to get back on.
Recently a past coworker from my Avanade days joined our team at CSG. It's great to have him aboard, but it was a blast from the past for me being around him in a workplace setting. I brought back a lot of memories of the consulting days. Comparing and constrasting current myself with my 18-months-ago self was a little shocking. I'm definitely much less of a Microsoft koolaide drinker and I'm certainly much less interested in...
Long ago I married myself to the Microsoft technology stack. For a long long, that meant you were a Visual Source Safe user. VSS's suckiness is well known and well documented. I've been happily using the free license for SourceGear Vault at home for the last 3 years and professionally I've been using whatever my clients had in place (VSS, Vault, or Team Foundation usually). When I came to CSG in late 2006, I was introduced to Subversion (SVN). I'd certainly read about SVN and knew it was a very popular open source source control system. While the adjustment period was a little...
Full development Archive