Rants, rambles, news and notes from another geek

Home From Sayulita

SayulitaWe flew home from lovely Sayulita Mexico on Tuesday. Man, that is a beautiful place. Located about 30 miles north of Puerto Vallarta, it is&nbsp_place_holder;a small town that you can tell is destined to grow into a bigger tourist destination. There were signs of growth everywhere. Lots of construction, new restaurants and hotels, etc.

But despite the growth, the place is still charming. The people were nothing but friendly and helpful.

Although I didn’t bring a laptop, I probably could have blogged all I wanted. Believe it or not, in this little village that barely takes credit cards, and doesn’t have an&nbsp_place_holder;ATM, there are at least three internet cafes. I couldn’t believe it. One of them was right on the beach and was free as long as you bought something to eat or drink.

The wedding was wonderful. Brandon and Claire Moynahan (nee Murret) were married in the local town Catholic church… right off the main town square. A couple of local gentlemen played guitar and two sisters sang the choruses. The reception was up in a villa on top of the highest hill in town. On one side you could see all the way down the beach. The party was great, more food and drink than anyone could ask for and a killer Mariachi band to boot. After sunset there was ever a fireworks display shot from the beach below. Amazing.

The only thing I’m disappointed in was that I didn’t get a chance to surf. I dabbled with surfing once when I was younger and really missed an opportunity to try it again in Sayulita. The waves were perfect and there were plenty of available teachers, both for pay and for free (friends).

All in all it was a wonderful, much needed vacation for Emily and me. While we were glad to get home to our kids, we also were sad about leaving the tropics and returning to&nbsp_place_holder;Seattle in the winter.

I got back to the office Wednesday morning to&nbsp_place_holder;find 100+ unread work emails, a few dozen personal emails, 1000s of unread mailing list emails, dozens of blog comments and contacts and more than a thousand unread blog posts in my aggregator. Scott Densmore told me the answer is to press the delete button, but I just can’t do that with everything. It just feels wrong. So I’m working my way through it all. A lot of lower priority stuff just had to go into /dev/nul in order to get through it all, but I tried to read most of it. I think I’m almost caught up now, so hopefully I’ll be able to return to some interesting technical blogs soon.

One additional note… Enterprise Library (which many people have apparently shortened to EL) has had more than 25,000 downloads. Congrats to the whole PAG team for a job well done. And thanks to all of you out there for taking the time to download it, explore it, and (we hope) use it in your development efforts.

Off to Mexico...

Today is my birthday. Tomorrow Emily and I are heading off to a small town outside of Puerto Villarta for a wedding and some much needed R&R.

I’ll be back sometime around Feb 15. I’m not bringing a computer, so no blog posts or any of that while I’m away.

Adios!

Now playing: A Perfect Circle - Orestes

Enterprise Library and Developing Non-Admin

I just noticed that my friend Robert Hurlbut posted the following comments about running non-admin and using Enterprise Library:

Security Note: If you are running and developing as a non-administrator (as you should be), you should install this to another folder other than the default location under Program Files. Otherwise, when you try to fire up any of the projects with your non-administrator account, you will get an error saying files couldn’t be written to that location (C:\Program Files\ is a restricted area for regular users). My solution was to use MakeMeAdmin and put the files under its own separate location. This gave me owner right to the folder as well as making sure I am not writing to a protected area.

Robert is absolutely right. If you intend to build the solution where it is installed, and if you are a non-admin developers, then you need to deal with the fact the Program Files is not a place that you will be allowed to compile. My recommendation is right in line with Robert: install it to another location (I use C:\Development) and set more appropriate permissions on that folder.

But one thing that Robert didn’t catch yet is that you will find that a few of the unit tests will fail if you are running non-admin. There really isn’t anything we could do about this, since we have tests that do things like creating event sources and other restricted activities. So if you decide you want to run all your unit tests, then make sure you are running as an admin when you run NUnit. (If, like me, you use TestDriven.NET, then you need to launch VS as an admin. As Robert points out, MakeMeAdmin is great for this.)

Personally, I wish we had isolated those unit tests into either their own assemblies or wrapped them in #if ADMIN..#endif blocks. But we didn’t think of it, and so it didn’t happen.

Enterprise Library 1.0 Has Shipped!

OK folks. People have been all over Scott Densmore, emailing him, pinging him on IM. We’ve seen posts on mailing lists both internal and external asking where it is. Scott even got contacted by a guy in Holland who was gonna stay up all night if that’s what it took.

At least we didn’t have people camping out for weeks waiting for it, eh?

I promised I would let Scott post first (and I did–his post is here), but now that that is all out of the wayΓǪ

Enterprise Library 1.0 Is Now Available!!

You can download it from MSDN now. There have been discussions of setting up an EntLib team blog for us to share tips and tricks, but that hasn’t happened yet. I’ll let you know if it does.

Now playing: AC/DC - Problem Child

Enterprise Library 1.0 Release to Web (RTW)

All right folks, it is coming. Be patient, it takes a little bit of time to actually get it from our (the developers’) hands and up to the MSDN download page, but it is on its way.

The best way to keep track if this, and to get educated at the same time is to read Scott Densmore’s blog. Scott, who&nbsp_place_holder;is the dev-lead on EntLib, posted the official announcement a few days ago, and this morning started what promised to be a series of posts about the inner workings of EntLib.

I’ll keep this page updates with links to his posts&nbsp_place_holder; as he makes them and of course I will provide a link straight to the MSDN page when it comes online.

Scott’s Posts:

NUnit Assert.AreEquals Parameter Ordering

I regularly take jabs at my boss Jim Newkirk&nbsp_place_holder;(original author of NUnit 2.x), telling him, “I think you put the parameters to AreEqual in the wrong order. It should be&nbsp_place_holder;actual, expected and not the other way ‘round.”

To which he consistently replies, “Well, you would be wrong.”

But all kidding aside, I still find myself writing code that assumes the AreEqual method has the opposite ordering.

It comes from the way I write if() statements. I write them like this:

if( myVariable == 4 )
{
  // Do something
}

&nbsp_place_holder;I have seen C/C++ programmers do this…

if( 4 == MyVariable )
{
  // Do something
}

ΓǪas a way to protect themselved from forgetting the second = symbol (in fact I used to do it too).&nbsp_place_holder;But as the C# compiler won’t let me make that mistake, I don’t do it anymore.

Which is why I want to write…

Assert.AreEqual( myVariable, 4 );

…instead of…

Assert.AreEqual( 4, myVariable );

But apparently, I’m wrong. But I still type it the other way more often than not.

Now playing: Bob Marley & The Wailers - Misty Morning

World Juggling Federeation on ESPN2 This Week

I love juggling. I’m not very good but I want to be. I’ve got JuggleSaver as my screensaver. I’ve been playing with MAGNUS to try to learn more about site-swaps. I’ve spent too much time reading all the information on juggling.org. I’ve got a set of clubs and balls at homeΓǪ and another one at work.

So&nbsp_place_holder;yesterday when I read on Boing Boing that the World Juggling Federation Championships is being shown as five separate half hour shows on ESPN2 starting tomorrow, I got a little excited. They are showing:

  • Advanced Ball Competition
  • Advanced Ring Competition
  • Advanced Club Competition
  • Team 6 Competition
  • Team 7+ Competition

The TiVo is set!!

If you like juggling, visit theWJF site and watch the ESPN commercial. Very cool.

Now playing: Rush - 2112- I: Overture/II: The Temples of Syrinx/III: Discovery/IV: Presenta

Remote Pair-Programming With Microsoft Virtual Server

Today I found another excellent reason to use Virtual Server 2005&nbsp_place_holder;for your development activites. I’ve been a convert of virtual development environments since I met Harry Pierson at PDC 2003 and he showed me his setup. Since then I have never had a single development tool installed on my laptop. It has made for much more stable systems with the added bonus of being able to keep separate machines for separate projects (a must when you are in consulting, but also a plus when you aren’t).

Since coming to Microsoft I’ve been using Virtual Server instead of VirtualPC. Why? Simple, I have a laptop AND a desktop machine. I leave the fat ol’ desktop machine at work running Virtual Server instances and I use remote desktop to access themΓǪ from my desk or from home. Same environment. Same performance (as compared to my laptop which is good, but not that good).

But today I&nbsp_place_holder;needed to do some more remote pairing with Brian Button. We had done this before using Skype and RealVNC, but VNC wasn’t behaving well. So we decided to try the VMRC client.

I didn’t know about this tool until a couple of weeks ago when I was lucky enough to be on a cruise in Lake Washington on Keith Pleas’ boat with a number of .NET luminary types. At one point, after describing my setup someone asked my why I wasn’t using the Virtual Server client program.

“The one in the browser?” I asked.

“No. The standalone client program.”

Hmmm. I didn’t know what he was talking about so I wandered off and contemplated my navel somewhere. You learn something new every day, eh?

I later found it on the Virtual Server installation and copied it over to my laptop. I tried it that night from home over RAS and it worked ok. It had some usability issues that made it a second place compared to RDP for me, but it was adequate. But until today, I stuck with RDP…

Today, Brian and I wanted something that I knew RDP couldn’t offer, but VNC could: two simultaneous users connected to the same login session. (Before anyone leaves a comment asking why I didn’t use MSN Messenger Remote Application Sharing, I’ll say this: You try it through firewalls, routers and the like. No go.)

I didn’t know if VMRC would support what I wanted, so we tried it. VNC wasn’t working worth a crap.

You know what? It was perfect. MUCH better than VNC was. Almost as good as RDP. Add in Skype (which was also giving us problems but we got it to work eventually) and we had a wonderful remote pairing solution.

So the old old way was NetMeeting. The less old way was Real VNC. The new way is VMRC.

Geek Notes 2005-01-24

Not many posts lately. Emily has been out of town recuperating. Grammy and Bompie (my folks) are in town helping me. So&nbsp_place_holder;I haven’t been reading many blogs. And my Geek Notes output is directly proportional to how many blogs I read. But I see light at the end of the tunnel, soΓǪ

  • How Do Managed Breakpoints Work - And older post from Mike Stall, but one all .NET developers should read.
  • Apple iPodShuffle - Check this out. The new iPod has no local UI and is basically on “Full Library Shuffle” all the time. The size of a pack of gum, it comes in either 512MB or 1GB mode. Also, while you’re looking at Apple’s newest stuff, check out the Mac Mini. An entire Mac in a box 6.5” square. Cool. [via AaronX&nbsp_place_holder;and The .NET Guy]
  • Frustration-Driven Language Development - I found this older Michael Feathers post after thinking about the question, “What does it really mean to say that a language supports testing?”
  • Portable $50 Wi-Fi Detector - “The Canary Wireless Hotspotter is a $50 WiFi detector with an LCD readout that shows the name, WEP status and signal strength of the 802.11g and 802.11b networks it finds.” [via BoingBoing]
  • Profiling .NET Applications with nprof - Darrell Norton gives us a nice little tutorial showing nprof. Remember this people: Don’t optimize until you have measured. Unless you use a profiler to tell you where to optimize, you are wasting your time.
  • MSW Logo - Ahh the good ol’ Logo Programming Language. The programming language for the kid in all of us. Pen-up, pen-down. [via The Daily Grind 524]

Also, I’ll just throw this at the bottom. Google doesn’t know who Gerry Provost or Sarah Jean Provost are or where they are on the ‘net. This should help.

Now playing: The Shins - New Slang

Extreme Refactoring With Brian Button

For the past few weeks and months, my good friend Brian Button has been posting a six part series called “TDD Deep Dive” which is one of the better TDD-by-example explanations you can read in less than an hour. If you haven’t read it yet, go read it now. (Links: Part 1, 2, 3, 4, 5, 6.)&nbsp_place_holder;Then come back here and continueΓǪ

Done? Good.

&nbsp_place_holder;Well, Brian has done it again. This time with a very cool post titled “Extreme” Refactoring - The Video Store Revisited. In this essay–almost 1,800 words of text, plus just under 1,000 lines of code–he takes the example used in Martin Fowler’s Refactoring book and takes it through a truly extreme refactoring process.

He begins with three goals in mind:

  • Methods should be 1 line long. Anything longer than that needs to be looked at closely.
  • Aggressively eliminate all duplication, specifically duplication involved with iterating over containers several different times in similar ways.
  • Use no private methods.

And then works to make it happen. Using the baby-step approach he used with me, he works through one little piece at a time. Extract Method here, Extract Superclass there. A little of this… a little of that.

And when he is done, the code certainly doesn’t look like Martin’s anymore. Is it better? Even Brian isn’t sureΓǪ

Now for the questions. Is this code more clear than the original Customer class? I’m not sure. In some senses it is. If I want to go see how the statement is generated, I can now go look at a RentalStatement class and see it. Looking ahead a bit, knowing that one of the changes Martin talks about in his book is that we need to support an HTML statement as well as a text statement, so by creating the RentalStatement class, we’re well prepared to make that change. I’m never sure if the ReplaceExternalIterationWithInternalIteration ever makes code more clear, but it does eliminate duplication.

I’m not sure that I would ever go this far in real life, but it is nice to know that I could.

But the process is very cool, very educational and something we all should strive for.

This has got me to thinking about another idea that Brian and I have been talking about. Refactoring parties. Yeah, yeah. Geeky as all hell, but here is the idea… Get a good A/V room. We have a bunch of these on campus so we should be able to make that work. Elect someone to be the facilitator. Bring up some code on the screen. Now go around the room, round-robin-style, ad each person gets to make **_one_** refactoring to the code. Not two. One. (Hopefully you have something like [JetBrains Resharper](http://www.jetbrains.com/resharper/) installed.) If you don't like the Extract Method that the person before you did, then you can use your turn to remove it. But you can't argue when they make their selection. You can only discuss what you're thinking when it is your turn. When you "have the conch". Personally, I think it would be a blast. What do you think? (Having guys like Brian there would certainly help.)