# Friday, April 17, 2009

I finally downloaded Simian today to give it a test drive, and already I think I'm going to love this tool. If you don't know what Simian is, its a tool to automatically locate duplicate lines of code and any good programmer should love to delete duplicated code, which where I work is pretty important. 

Simian being a console application is pretty useful, but being able to click a button from Visual Studio, see the output in the output window, and then being able to navigate to the duplicated lines by double clicking is what I really wanted.  So that's what I did, I created a Simian output formatter that transforms the output to MSBuild formatted output that is clickable!  Cool, how do we use it?

Download and copy the formatting tool somewhere, I put it in my Simian bin directory.  Create a batch file in this same directory, the batch file is used to pipe the Simian results to the formatter because Visual Studio doesn't let you from the external tools menu.  My batch file looks like this:

@ECHO OFF
REM Run simian redirecting output to the MSBuild formatter
C:\"Program Files (x86)"\Simian\bin\simian-2.2.24.exe %1 | C:\"Program Files (x86)"\Simian\bin\SimianMsBuildFormatter.exe

With that out of the way we need to setup Simian as an external tool within Visual Studio.  In this example I will setup Simian for the current file:

Now Simian - Current File will show up in the Visual Studio Tools menu.  With a file open in the editor we just need to click our new menu item to run Simian and get our output. Here's an example output run.

The interesting and useful part is that the source files listed in the output are now clickable, just like from the csc compiler.  Happy dupe finding!

Friday, April 17, 2009 10:24:13 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [3]  | 

First off let me say that I'm probably the last person to figure this out, but Google Reader allows you to share web pages via a simple toolbar shortcut. Just open Google Reader and drag the "Note In Reader" box to your browser toolbar.

It works exactly as I had wanted, without any browser plugins, the toolbar shortcut is just some Javascript that runs to share the current web page you are viewing, genius!

Friday, April 17, 2009 6:12:10 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  | 
# Monday, March 23, 2009

My employer Daptiv is currently looking for a couple of talented Software Engineers to join our scrum team. Daptiv is a software as a service (Saas) company committed to providing our customers with the best work management software on the market.

We need someone who is committed to producing quality software and is passionate about continuous improvement of themselves, the team, and the process. We want someone who's smart and isn't afraid to share their opinion.

Although we are primarily a C# and ASP.NET shop, we have a lot of rich client code written in JavaScript and JQuery.

Monday, March 23, 2009 4:42:46 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [2]  | 
# Friday, March 20, 2009

I was having trouble getting an ASP.NET 2.0 site up and running today on a (new to me) server.  I could browse static content from the site, but any ASPX pages would return a 404 error.   At first I thought I was mistyping the URL, then I thought that ASP.NET just wasn't registered so I ran the aspnet_regiis.exe utility, but still no dice. 

I played around with all kinds of settings until I find that ASP.NET was completely disabled on the server under Web Service Extensions.  For ASP.NET to work the WSE for ASP.NET must be set to allowed!  I have no idea why it was disabled, but it was.  Argh!

Friday, March 20, 2009 9:16:01 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  | 
# Tuesday, February 10, 2009
I think this should be pretty obvious to the next person to look at the code.
public class CrappyTextComparer : ITextCompareReportGenerator { ...

public class BeyondCompare : ITextCompareReportGenerator { ...


Tuesday, February 10, 2009 5:46:15 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, February 06, 2009

This is a follow up to a previous post where I declared my laptop free of Vista. So to finally answer your question Ryan, its going well.

I've been running Ubuntu Intrepid (8.10) for the past 6 weeks almost every day and haven't had any problems. On the contrary, my laptop is super speedy now, and for whatever reason I swear the wireless works better and faster than it ever did with Vista.

I haven't missed MS Office all that much. I primarily use Outlook in MS Office anyway, and that's not by choice, so like most everyone I use GMail when not at work. When I do need to write an actual document I've found OpenOffice and Google docs more than adequate for my meager needs. In fact Google docs has actually been preferable since some of the docs I've needed to share authorship. I will have to concede that the UI in OpenOffice leaves room for improvement. The icons are hard to see and distinguish from their standard MS Office counter parts.

I've been using Gimp for image editing because it comes preinstalled, but its a little too technical for my needs, and thus difficult to do simple things. Even Photoshop is easier to use IMO. I find Paint.Net superior for my needs so I plan on switching since it will run on Mono. In fact a lot of the winform compatibility testing for Mono has been done using Paint.NET.

I have missed Visual Studio a little, but really what I miss are my ReSharper keyboard shortcuts. I've been primarily using Eclipse since I have been primarily doing Java and Groovy programming in my laptop. Both of these dev environments were quite easy to setup, especially the Android plugin for Eclipse, it works really quite well for editing and debugging. The Grails integration into Eclipse is pretty rough, so I'm looking into buying IntelliJ IDEA since I hear it has really good Grails support.  That and I'm already familiar with the keyboard shortcuts from ReSharper. I use the IDEA shortcuts in Re# which always throws my co-workers off when they try to pair with me.

The command line has been a little tricky to get used to, but has been more consistent between commands than Windows. And the translucent terminal windows are sure purdy. Ray pointed me to a free Ubuntu pocket guide that has helped smooth things over. I now often find myself incorrectly trying to use *nix commands in my DOS prompts at work. Perhaps its time to install Cygwin to iron it the discrepancy?

Not everything has been booz and cigars though. I've had serious issues with Mono, specifically MonoDevelop. The problems of course are my own making. The version of Mono and MonoDevelop packaged with Intrepid isn't quite as new as I would like, so I decided to build my own from the SVN trunk.  That was about 4 weeks ago.  After installing and bulding another 20 prerequisite libraries I finally got MonoDevelop to not only compile and load without crashing, but I also got it to compile and run my first C# app MonoDevelop!

This one goal of getting the latest version of MonoDevelop and Mono running on my Ubuntu box has taught me more about Mono and Linux than anything else I've done.  Despite the hair pulling its been a rewarding journey. I feel like I've earned my first Linux merit badge.

See Dylan, I gots its werking without resorting to a VM and the package manager!
GRails | Java | Linux
Friday, February 06, 2009 7:49:04 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [2]  | 
# Saturday, January 24, 2009

Update: Resharper 4.5 beta is out, and it natively supports MsTest.

Update: I updated this plugin to work with ReSharper 4.5

Chances are, if you have ReSharper you're using the built in ReSharper test runner. The Resharper test runner is pretty frictionless assuming you're using one of the open source testing frameworks like NUnit.

If you're stuck using MSTest for some reason, like in my unfortunate case my company has standardized on it... then you're pretty much stuck using the MSTest runner, which really sucks for numerous reasons.

The MSTest runner likes to muck around with vsdmi and testconfig files (or something like that, I can't remember) and is pretty slow. Up until VS 2008 it was almost completely useless for TDD.

Its almost usable in VS 2008, but I still hate the test failure reports. I can't just scan a bunch of grouped tests to see which one's failed and why. To really see why, I have to open a new test report tab in VS. Even more annoyingly, MSTest refuses to find my resource satellite assemblies without additional hoop jumping. I like to call that friction.

After finally having enough of this I decided to create my own MSTest ReSharper 4 plugin (Apache 2.0 license). It was actually quite easy to hook into the ReSharper test infrastructure, especially since JetBrains gives you most of the code to do it in the form of a csUnit plugin. A few deletes and edits later, and I have a functional MSTest plugin.

image

Not only does it work, it works better. My satellite assemblies are found right out of the gate, reports are inline with the runner, and for a moment I almost lapse back into mistakingly typing NUnit attributes.

image

Now mind you, its not perfect, but it works really well for my needs. Some gotchas, or differences between the standard MSTest runner and my plugin:

  • TestContext is always null, the runner doesn't provide that. Unit tests shouldn't need it anyway.
  • AssemblyInitialize is not honored, much like like TestDriven.NET. I get around this using a static initializer in my base class test fixture (I need this for some slow integration tests if you're wondering).
  • MSTest seems to create a new test fixture instance between each test run, this plugin only creates a single instance of the fixture. Generally this shouldn't be a problem if your TestInitialize method is written correctly.

Binaries and source are available on my Google Code web site. To install, just drop the DLL into the ReSharper bin\plugins folder and restart VS 2008. Happy testing!

Saturday, January 24, 2009 2:29:37 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [5]  | 
# Tuesday, January 13, 2009
Because I keep forgetting, and writing is supposed to help you remember things...

./etc$ sudo gedit environment

Tuesday, January 13, 2009 2:16:19 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  | 
# Monday, December 22, 2008

I've been playing around with Grails on my Ubuntu box for the past week and really like the ability to do fast web development while still retaining all the power that the JVM provides.  Unfortunately, it also comes with the baggage of Java, which became pretty apparent once I needed to map a date time object.

Since I still have a day job, and I don't see us switching from .NET anytime soon, I thought I would spend a little time with ASP.NET MVC and IronPython to see where things are. I was able to find a sample MVC sample application on CodePlex which made use of IronPython in the views and the global.asax. The one feature I really wanted support for was writing controllers in python, apparently that's in the works but not currently supported.  Not much python in the sample, but pretty neat to know it works.

... Well actually at some point it probably did.  I'm using the first beta release of ASP.NET and some things have changed since the IronPython sample came out.  Needless to say, the sample no longer works, I get an HttpParseException with the message "HtmlHelper' object has no attribute 'ActionLink'"

Pretty strange message huh?  In C# I can find this method no problem. Long story short, IronPython can't use extension methods like C# can.

At some point the MVC team moved the HtmlHelper.ActionLink method from System.Web.Mvc to Microsoft.Web.Mvc.  The latter is the ASP.NET futures assembly, which provides a bunch of extension methods that they may add to the System DLL at a later date.

Monday, December 22, 2008 7:34:35 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  |