Buba XPath Builder

This is the tool I reach for anytime I need to pull data out of XML’s cold bird-like claws.

It let’s you interactively write XPath queries against an XML document. It’s simple. It works well. It’s got syntax highlighting.

Basically, it’s the cat’s meow.

Posted in Development | Tagged | Leave a comment

ALT.NET Seattle 2009 – Why So Mean?

I am currently attending the ALT.NET Seattle Conference. The energy and passion is really invigorating. It makes me want to be productive.

Scott Hanselman hosted a session named, “Why so mean?” that was really good. It asked the question “Are we the barrier to entry for new people being introduced to the ALT.NET movement?”. There are some abrasive personalities in ALT.NET which some people feel (including myself) can be a deterrent towards introducing new people to the ideas and practices that we evangelize. Scott did a great job facilitating the session and sort of guiding the conversation.

A great number of good points were made. For one, we talk a lot about teaching new people how to do these things, but we don’t spend a lot of time discussing pedagogy (the science/study of teaching). There is a session tomorrow inspired by that realization that I’m really excited to attend.

Discussing the session over dinner, someone made an observation that I thought was a little sad. One of the last statements on the “mean people” in our community (technically the word “Asshole” was bandied about quite readily) made during the session was along the lines of “There will always be mean people so you just have to accept that,” which I think is a bit a cop-out. If we’re going to claim to be a community, we should take responsibility for those in our community, not just give them a get out of jail free card.

It wasn’t all doom and gloom though. There was a lot of good discussion about how we can make ALT.NET more approachable to new people. It’s hard to do that though. I personally am still a bit intimidated talking to some of these people. Everyone is super nice though. It’s a great group of people and I can’t wait for tomorrow to get some more hot nerd on nerd dialog.

Posted in Development | 2 Comments

Windows Task Manager Keyboard Shortcut

Maybe everyone else already knows this, but I just found out and I’m so happy.

CTRL-SHIFT-ESC brings up the Windows Task Manager.  No more CTRL-ALT-DELETE click the button dance.  Woo hoo!

Posted in Development | 2 Comments

Automatically Increment WiX Installer Product Version

Most build servers set an environment variable BUILD_NUMBER on every build that is auto-incremented. We can do this using WiX proprocessor. (Note, the link is for WiX 2.0 Manual, I couldn’t find a reference for WiX 3.0 Preprocessor.  Maybe it’s the same? Probably not.)

I wanted to increment my WiX installers Product Version field automatically based off this number.

Here’s the top of my Product.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <!-- Set version based on build_number env. variable. -->
  <?ifdef env.BUILD_NUMBER ?>
    <?define PRODUCTVERSION="1.0.$(env.BUILD_NUMBER).0"?>
  <?else?>
    <?define PRODUCTVERSION="1.0.0.0"?>
  <?endif?>

  <Product Id="THE_GUID_YOU_GENERATED"
           Name="My Application Name"
           Language="1033"
           Version="$(var.PRODUCTVERSION)"
           Manufacturer="My Manufacturer Name"
           UpgradeCode="THE_GUID_YOU_GENERATED">

...

The ifdef part is very picky. At first I tried <?ifdef $(env.BUILD_NUMBER) ?>, which totally doesn’t work. Then I tried <?ifdef BUILD_NUMBER ?>, which also totally doesn’t work. The above is the only thing I could get to work, which goes against what this guy says. The WiX documentation for the preprocessor is pretty shoddy.

Also notice that I am incrementing the 3rd of the 4 version numbers. Why? No idea. Maybe you can tell me.

So YMMV, Caveat Emptor, and all the crap.

WiX Arcanum!

Posted in Development | 3 Comments

Stateless Network Service (A Rant)

Ok so I’ve got an idea for a stateless network/application service.  Check it out.

It’s a simple concept. The service will accept requests that are wrapped in a protocol specific envelope, perform an action, and then return results in a similar protocol specific envelope. Simple! Clients will perform a series of actions, get a series of results, and generally navigate the world.

Now, the totally awesome part: My Custom Implementation. Every request that comes in will logically specify what type of request type it is. Maybe it’s “List Employees” or “Process this Order”. Each request type will have some sort of textual key associated with it like “ListEmployees”. I’m going to take that textual key associated with a request, look for a file in the software project’s directory with the same name as the key, run it, and that file will be responsible for displaying the results.

In case you’re wondering, I just re-invented Http, and hopefully illuminated one of the more insane aspects of it: Why do requests map to files in our software applications in almost all http servers?? Am I the only one that thinks that is absolutely insane?

The only originally conceived usage of HTTP. I understand that it sort of started out that way with static html files and stuff, which is fine, I can still see that use case being valuable. But we don’t even call Http Servers “Web Servers” anymore, they are marketed as “Application Servers”, ostensibly designed to serve applications.  Too bad they almost all focus on the use case of serving html or jpegs of kittens with guns.

This rant was all brought on by a post from Phil Haack entitled Handling Formats Based On Url Extension. In it he describes jumping through hoops to essentially perform an action that can be simplified as “I want to perform one action based on one request type, and a different action based on a second request type”?

How is it that this can still be so difficult? Why can’t we enable a mode in our Application Servers that simply says, “Ok, you know what? I’m not serving static Html. Give me the damn requests and let me decide what I want to do with it.”

How much time have you personally spent trying to get craft some ASP.NET Routing Rule (or MonoRail Routing rule, or mod_rewrite rule) because application server X is just completely hell bent on matching http://foo.com/employee/add to to a file named add.html or add.aspx in a directory named employee?

Imagine if NServiceBus or MassTransit routed messages to components based on their filenames? Epic Fail!

If you’re going to call yourself an Application Server, at least pretend like you’re actually in the business of serving applications.

Posted in Development | Tagged | Leave a comment

Netflix is a Pusher

This entire post is off-topic, but I couldn't resist. 

Netflix is trying to make me a drug addict.

I love how Meth only gets 4 stars.

Posted in Personal | Tagged | Leave a comment

SVN Externals, Post 1.5

In a pre SVN 1.5 world (or if you host your repo on Dreamhost, Grr.) your externals looked thusly

And that was ok, but if you switched SVN repo hosts (like we did, moved to Assembla), it all went to hell. But now you can now use relative paths!

^/Externals/Castle castle

They swapped the order around, apparently for fun, and the ^ is the new “Root of this repo” character. It seems like ~ would have been more logical, but whatever. It’s a small change, but it makes things much easier when swapping hosts for your repo.

Posted in Development | Leave a comment

C# Enum Type Automatic-Figure-It-Out-er

I want this:

public enum MeowSound
{
  Angry = 1,
  Happy = 2
}

public class Cat
{
  public void Meow(MeowSound meowSound)
  {
    // Do stuff
  }

  public void AngryMeow()
  {
    // Meow(MeowSound.Angry) // I don't want this.
    Meow(Angry);  // I want this.
  }
}

That is all.

Posted in Development | Tagged | Leave a comment

Coding on ADD

Pennies by Beige Alert. A shiny penny can distract me and totally derail my productivity for tens of minutes. Shiny pennies come most commonly in the form of a tweet.

I take a lot of steps to reduce the shiny pennies I’m exposed to.

  • I set my IM clients to not beep and flash and explode on every new message.
  • Email clients are forbidden from actively notifying me of new messages (I use Gmail anyway, so really it’s a factor of not installing those popup email notification things)
  • Twhirl, my current twitter client of choice, only notifies me on direct messages or replies, not Every. Single. Tweet.
  • I tend to put my phone on vibrate when coding.

After making that list I already forgot why I was writing this blog post, I had to go and look at FireFox to remember.

Even with all those measures, I am still going to get distracted by things, especially since I work from home. It’s important that I am able to get back on topic just as easily as I get distracted. When I get distracted, I tend to forget everything I was working on. After I clear the distraction, I switch back to visual studio and it’s like looking at a blank wall. I generally have no idea what I was working on.

There are a few things I do to combat this.  Firstly, I keep a sheet of paper next to my mouse that I use to write down what I’m currently doing at quasi-regular intervals. Nothing high level, just enough to jog my memory as to what I’m working on. “Add Submit Button to UI”, “Create IFoo Interface”, no details, just something I can glance over, find out where I am, and I can check off as I work. It’s not a list of what I need to do, it’s a list of what I’m doing.

Second, I installed TabMixPlus. It allows you to mark a tab as “Protected” so that you can’t close it, you can also lock a tab so that it can’t navigate away from a URL. I just installed it, but I intend to protect and lock the tab of the current ticket/story/bug/whatever I’m working on, so I can always have that point of reference in addition to my little page.

I’m going to get distracted, that’s a given, but having a set of techniques to let me get back to work as quickly as possible helps alleviate some of the productivity drain.

Posted in Personal | Tagged , , , | Leave a comment

Windows LiveID an OpenID Provider

Microsoft is going to support the open standard OpenID by making LiveID an OpenID provider. Say Whaaat?!

Who are you and what have you done with our Microsoft?!

Posted in Development | 2 Comments