Bing Me – Redux

So it’s been a 2 weeks since I switched Chrome’s default search engine from Google to Bing, and this is what I’ve got to say.

430890004_98639b3bb7It’s not bad, but there’s nothing there that blows my socks off. The image search is way better than Google’s, but the regular search results are *slightly* less relevant sometimes than Google’s. I found myself at maybe once a day re-searching the same term on Google to find what I want. My searches typically have a very technical bent, so maybe that is relevant.

Oh and I don’t like the maps, but I think that may just be my fondness for Google Maps. The Bing maps aren’t bad either. I can’t quantify my distaste for the Bing Maps, but I don’t like them as much as Google’s. I think it may just be an aesthetic thing.

So the conclusion? I’m switching it back. It still feels foreign, and I think it’s a little less relevant to me than Google is for the things I search for.

Now I’m on the prowl for the next thing to jump into whole hog and test my preconceptions.

Accidental MVC

So this app I’m writing and maintaining at my day job. It accepts requests over this painful legacy protocol, performs some action based on that request, encodes the result in the same painful legacy protocol, and returns it to the client.

The way it’s designed, it has an array of IMessageHandlers that are each bound to a particular request type. So if a GETPRT request comes in, it loads up the GetPartMessageHandler which processes it and returns a result to send back to the client.

I had an epiphany a while back. This is MVC. If I didn’t have to deal with the legacy network protocol and weird encoding scheme, I could drop all this custom message handling code stuff in the dumpster and drop in one of 800 MVC web app frameworks and be done with it.

The command type, say GETPRT, could be mapped to http://server/GETPRT, and we could use our handy dandy routing engine to say route $GETPRT^ to the GetPart action on the PartController.

So in essence, I think I grew an MVC framework. It’s actually a little Django-ish, because I don’t really use controllers. But neat.

I wonder if I could have saved time if I had realized this would fit so well with MVC from the get go.

Bing Me

We are naturally biased towards the things we are most familiar with.  Learning something involves an investment in it, and often times there is an emotional investment as well. We become attached emotionally to the things we’re constantly exposed to.

sheyquote

This can be a good thing, but it can also lead to stagnation. We have to force ourselves to invest a little bit in alternatives so we can see what is new and what is out there, otherwise we just keep writing sprocs for our databases or writing assembly instead of using C “because it gets the job done”.

So in this vein, I set my default search engine in Chrome to bing.com last wednesday after listening in on the girldeveloper.com WAN. I’ll update soon with my experiences. I want to give myself enough time for my google-addicted self to unlearn and truly experience Bing to see if it’s worth its salt.

Simple BDD Reporting with NUnit

I do BDD with just plain NUnit. I haven’t yet invested the time to mess with any of the frameworks like MSpec or whatever.

I use a ContextSpecification class that I probably ripped off from someone long ago. Everyone in the BDD demos always have fancy reporting though, and I got jealous today so I wrote my own reporting tool.

   1: using System;
   2: using System.Reflection;
   3: using NUnit.Framework;
   4:  
   5: namespace Falcon.Server.Tests
   6: {
   7:     [TestFixture]
   8:     public class ReportGenerator
   9:     {
  10:         [Test]
  11:         [Ignore("Cuz I said so")]
  12:         public void GenerateBddReport()
  13:         {
  14:             var assembly = Assembly.GetExecutingAssembly();
  15:  
  16:             foreach (var type in assembly.GetExportedTypes())
  17:             {
  18:                 if (type.Name.StartsWith("when_"))
  19:                 {
  20:                     Console.WriteLine("{0}:", type.Name.Replace('_', ' '));
  21:                     foreach (var methodInfo in type.GetMethods())
  22:                     {
  23:                         if (methodInfo.Name.StartsWith("should_"))
  24:                         Console.WriteLine("\t{0}", methodInfo.Name.Replace('_', ' '));
  25:                     }
  26:                     Console.WriteLine();
  27:                 }
  28:             }
  29:         }
  30:     }
  31: }

Yup. That’s it.  Reflect over the current assembly, and grab everything that starts with “should_” and “when_” and spray it all over my screen.

Now you could take that and gussy it up with html like some 2-bit floozy, but I see no need. I made it a test that I can just run anytime I want from R# because I didn’t want the weight of some silly assembly/exe file laying around. This was easy.

And it was amazingly valuable.  Getting a report that looks like this:

   1: when daemons are started and stop is called:
   2:     should stop listening for client connections
   3:     should stop listening for bridge connections
   4:     should stop listening for gateway connections
   5:     should raise stopped event

makes it so much easier to find specs that don’t make sense or are bad or whatever.

All in all, I highly recommend running a report such as this now and then to give you a view of what you’re doing.

The Ugly Baby Project

I am announcing the Ugly Baby Project. It’s a simple thing I’ve decided to do to sort of compare and contrast Ruby on Rails, Django, and Ruby/Merb, and maybe ASP.NET MVC. I’m not sure about ASP.NET MVC. (I’m already familiar with Monorail, and I really don’t know how much more it brings to the table.)

I’m going to implement the same exact small website with the same functionality in all 3 (or 4) platforms.

My First Experience With Django

I decided to pop open a copy of Live Writer and chronicle my first Django first impressions. It’s going to be a bit stream of consciousness. I’m working off this tutorial from Instant Django.

The model creation seems relatively straightforward so far. I haven’t done anything even remotely complicated yet.

I like how the URL routing is so explicit. It does require me to know regular expressions though, which are one of those things I can’t remember for more than 30 seconds at a time. You just map a regular expression of the request to the view that handles it. It’s kind of exactly what I ranted about wanting in a previous post.

Neato. I just got my first “hello world” kind of thing going, but it goes to a database through the ORM and has a model and everything. Took about 40 minutes from first download of instant-django.

So far, I’m pleased. The more I think about how the routing works, the more I like it.  I’m excited about continuin with this.  I’ll keep posting, and include some code snippets once I get something useful going.

A New Beginning – Unit of Work, LLC

Unit-of-Work-Logo-80

I have come to the conclusion that, professionally for a variety of reasons, it is time for me to move on. My current employer has been nothing but good to me, and I have learned a tremendous amount working here, but it is time for me to spread my wings and fly.

So today, I am announcing my new software/services/consulting firm: Unit of Work, LLC. A big part of my decision to venture out on my own is a desire to return to the type of work I was trained to do: image analysis and pattern recognition.

There are a few projects I have been working feverishly on in my spare time. First, is PurpleOps, an IT infrastructure monitoring, measurement, and analysis package. It is an extensible hosted “Software as a Service” platform designed to give a user not only a view into their IT infrastructure, but advanced analysis capabilities of the data recorded.

Secondly, I would also like to announce Simon, a suite of tools designed for spectral image exploration, analysis, visualization, and manipulation. Due to the high dimensional nature of spectral images, direct visualization of the data is impossible. Simon allows users to navigate spectral image data in an exploratory fashion, yielding pseudo-color renderings of the data which help to directly emphasize the features of interest.

I am also offering consulting and development services. I have experience in Biomedical Image Analysis, Mobile Computing, Enterprise Systems, and Machine Learning. I understand how business problems must drive the technical solutions, and understand the value in high-quality maintainable systems.

I cannot begin to explain how excited I am to announce this new chapter of my life, and look forward to all the new opportunities and new relationships it will foster. This is my chance to fulfill my dream of doing what I want where I want: to write amazing software in beautiful Eastern Washington. Wish me luck, and feel free to contact me regarding this new venture.

James Thigpen
Owner, Unit of Work, LLC
james.thigpen@unitofwork.com
206-905-9974 (v)
unitofwork.com

Running Multiple Hudson Instances Simultaneously

I wanted to run multiple Hudson instances side-by-side. It was easy enough to get them running kicked off via batch files, but I wanted them to run as services, because I’m lazy and greedy.

Turns out it’s easy, though non-obvious.

  1. Install 1 Hudson instance as a Service.
  2. Stop the running Hudson service (net stop hudson)
  3. Copy the original hudson installation ($HUDSON_HOME) to another directory where you want the new service to reside
  4. Modify the copied hudson.xml in the new hudson install directory to give it a new service name.  Change service/id from “hudson” to “hudson2”. Not the service name, the service id.
  5. Now run the following from the command shell in your new hudson directory: hudson.exe install
  6. Start your new server: net start hudson2
  7. Start your old server: net start hudson
  8. Finished!

Now if you want to uninstall it you simply run “hudson.exe uninstall” from the service $HUDSON_HOME directory. The mailing lists are good.

Manifesto for Software Craftsmanship

A sort of sequel to the Manifesto for Agile Software Development, I am proud to be a signee of the Manifesto for Software Craftsmanship:

As aspiring Software Craftsmen we are raising the bar of professional software development by practicing it and helping others learn the craft. Through this work we have come to value:

Not only working software, but also well-crafted software

Not only responding to change, but also steadily adding value

Not only individuals and interactions, but also a community of professionals

Not only customer collaboration, but also productive partnerships

That is, in pursuit of the items on the left we have found the items on the right to be indispensable.

© 2009, the undersigned.
this statement may be freely copied in any form,
but only in its entirety through this notice.

Software quality is of huge importance to me. I have always believed that if you are going to do something, it is worth doing right. I believe that quality is an end unto itself, but I also believe that as a side-effect of quality, tremendous business value can be realized.

If you are a software developer that takes pride in the things you create, then I urge you to sign the manifesto.

Infinite List of Database Users with Yield Return

At the ALT.NET Seattle conference, I went to a session by Nate Kohari on the awesomeness of the yield return keyword in .NET and how you can use it for all kinds of fancy stuff.

In the true spirit of over-engineering a solution, I have created this little property in one of my spec base classes:

   1: protected IEnumerable<User> DatabaseUserList
   2: {
   3:     get
   4:     {
   5:         while (true) yield return CreateUserInDatabase();
   6:     }
   7: }
   8:  
   9: protected User CreateUserInDatabase()
  10: {
  11:     var user = new UserBuilder().Build();
  12:     Repository<User>.Save(user);
  13:  
  14:     Flush();
  15:  
  16:     return user;
  17: }

We create what would be an infinite loop which creates Users over and over until the system runs out of memory, but since we’re using yield return, each user will only be created as we iterate over the list. Sexy.

Infinite data structures are a pretty common thing in functionaly programming languages with lazy evaluation. It wasn’t until this past weekend that I realized you could do the same thing in C#.

And using the delayed execution magic of yield return and our good friend LINQ, we can do things like:

   1: // Give me an IEnumerable<User> with 5 users in it.
   2: var users = DatabaseUserList.Take(5);
   3:  
   4: // Give me 1 user
   5: var user = DatabaseUserList.First();
   6:  
   7: // Force list creation, populates DB w/ 10 Users
   8: DatabaseUserList.Take(10).ToList();

So this will create users, stick them in the database, flush the database, all lazily as I iterate over a list of users. Is this a good idea? Probably not! But it’s hella cool.