# Friday, June 26, 2009

I've been using IronPython as of late, not a whole lot, but more and more - and I want to do things the Pythonic way using the built in Python libraries whenever possible rather than .NET BCLs.  I've been using REPL mostly, but I'm starting to do more and more in Python, so I've started using SharpDevelop mainly because it supports IronPython out of the box and is a much smaller download than IronPython Studio.

The problem I had was getting access to the standard Python libraries from SharpDevelop, it appears that SharpDevelop only ships with the IP interpreter and not the Python libraries.  The regular IP install does ship with all the libraries, so how can we get SharpDevelop to use them?  Also, how do we get SharpDevelop to use the latest version of IP that I have installed on my system?

Start an IP project in SharpDevelop.  Remove all references to IronPython from the project (assembly ref).  Add a new reference browsing to your latest installed version, mine is in C:\Program Files\IronPython 2.0.1.  Add a reference to IronPython and IronPython.Modules. In SharpDevelop go to Tools | Options | Tools | Python, and browse to ipy.exe in your IP install directory.

Now that we have a working SharpDevelop IP environment running the latest version, lets go ahead and use some Python libs!  Notice how I explicitly set the Python libs path.

import sys
sys.path.append(r'C:\Program Files\IronPython 2.0.1\Lib')

import os.path

def walkDir(arg, dirname, names):
	print dirname

os.path.walk(r'C:\', walkDir, '')
Thursday, June 25, 2009 11:57:17 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  | 
# Friday, April 24, 2009

Without recessions we wouldn’t have prosperity. Everything in this world is relative, remember?  Everything!  There is no good without bad, no bad without good.  How would you compare and contrast without both?  You can’t!  Apples to apples are only just apples.  How ordinary!

Its recessions that allow me hire the most kick ass SDET ever born to walk this face of wanna be enterprise software ever to be born out of some half ass naked enterprisey architect fool!  Yes, recessions shake this world up, let the dead weight die, and make the good truly shine in all their glorious golden hue.  Code is no different.

I love bad, nay, horrible code.  Without the most clown-a-rific code ever (yes Kent, Clown-a-rific) my code would be so boring and ordinary.  It’s this clown code that makes my code standout and really shine like the terd that it is, er, gem that it is.  My code basks in the glow in the terdious cloud of awful code, so thank you for awful code for your wonderous glowing shine.

My point is we can’t just have good.  If we only have good, we would only have boring.  With boring we have nothing.  Thank you Jeebus that we have good and bad.  Thank you terdious code base for letting me shine! ASP.NET MVC wouldn’t look so good if we didn’t have Ruby.  So thank you Jeebus for some Ruby.  And circa 2005, go die ASP.NET webforms!  Ruby is the flashlight upon ASP.NET webforms.  We all knew around 2005 the problems, but Rails just put the spotlight upon ASP.NET webforms and made them naked for what they were.

Sure, webforms were glamorous, at least they were back in 2001 when I was evaluating ASP+ beta2 (yeah, ASP+, not ASP.NET).  Yes, yes they were quite remarkable.  Compared to classic ASP, ASP.NET webforms was the shiznit, as they say in my hometown.  I’m glad we have ASP.  I’m glad we have ASP.NET webforms.  I’m glad we have ASP.NET MVC.  One without the other is so ordinary and boring, so middle America.  Could we have rich without the poor?  Nay, we would all be so middle.  Again, I remind you dear reader that middle is boring!

So, let me be first to say that ASP.NET MVC sucks!  Sure, right now it’s pretty damn good. It copied MonoRail fairly well (which itself was a copy), but in a couple of years we’ll all be wishing for something else. They all say, too much static typing!  Give me controllers that are dynamic that don’t require a re-compile! It’s so slow! Views?  Views?! JavaScript XXX handles views and has its own templating engine!  I can’t believe we ever generated views on the server!  That’s what they’ll say, they will.

We just need some good old fashioned data services from our web server. Client server shall live again!  Trends always repeat themselves.  Don’t believe me?  Glam rock will rock again in 2012.  History is bound to repeat itself because of cycles.  OK, I’m getting a bit out there.  I agree, but damnit glam rock shall live again!  Guitar Hero Metallica is pretty damn fun!

Without cycles we would have only good which would yawn us all to death.  It’s the bad which makes the good, actually good.  It’s all relative, isn’t it Einstein?

Friday, April 24, 2009 4:03:45 AM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [3]  | 
# 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 [1]  | 

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.

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]  |