IronPython error messaging for instance methods

November 3rd, 2009

Recently I’ve been using IronPython as a dynamic testing framework for .Net assemblies more and more. Particularly in the current development iteration for our company’s website, where a contractor is working on the data access layer classes for a database schema of my design. In order to test his data access methods I need to new up an instance of the various classes and check the output of the methods. We’re simultaneously starting to do some coded integration tests using NUnit for the same purpose, but when I just want to quickly smoke-check his work before sending him on to the next task, opening an IronPython console and instantiating his class and running through the methods can’t be beat for quickness. I’ve been meaning to write a little bit more about this, but suffice it to say it’s been working really well for me.

My typical usage pattern is to import the clr and add a reference to the dll in question by path and filename, and then to import just the class I want to test. So far, so good. But when testing a little refactoring I was doing this morning I encountered an error message that took me a few minutes to isolate and resolve.

The call I was using was
c=Category.LoadSimpleCategoriesByRegion("2")

And the error message I saw was:

TypeError: LoadSimpleCategoriesByRegion() takes exactly 2 arguments (1 given)

I stared at the code for a while, swearing up and down that the method I was calling *did* have a 1 argument overload available. Finally I realized that I was calling an instance method in a static fashion – the other argument that IronPython was expecting was an instance of the class to execute the method on.

Not exactly rocket science, but a confusing (to me, at least) error message that took me longer than it should have to figure out.

NUnit and app.config in VS2005

November 2nd, 2009

I ran into a little problem yesterday in setting up unit tests for some new data access classes for my employer’s website.  I’m using NUnit 2.4.8 and integrating it with Visual Studio as outlined here, so when I’m ready to run the tests I select the external tool and NUnit spins up and loads the project I’m working on I also use a plugin that starts NUnit and attaches the Visual Studio debugger to the NUnit process, but I often don’t want to debug the tests, and the external tool is faster to start).  NUnit is configured with Visual Studio integration on and whenever I would run my tests they would fail because NUnit wouldn’t use the appropriate configuration settings.

There are plenty of people who have encountered this problem, and plenty of examples of versions of the “right” way to add the config file.  None of these were suitable to my exact situation – I have a “correctly” named config file in the directory with the DLL my tests are testing, and I also have a “correctly” named config file in the directory where my .nunit file resides.

I finally discovered the correct solution for my use case.  The difference lies in the fact that I’m running NUnit in Visual Studio integration mode, and loading NUnit with the project file of the Visual Studio project I’m testing.  Because NUnit is loading the tests directly from %projectroot%/MyProject.csproj my config file had to be named MyProject.csproj.config.  Once I made that change my tests started working fine.  They didn’t pass, but at least they were working J

Seems like a pretty simple answer, but I figured I’d post it here to add to the pool of possible solutions for someone in the future to run across (and like as not, that someone could be me).

links for 2008-04-03

April 3rd, 2008
  • Many of the buildings these architects produced were absolutely extraordinary – and, frankly, it seems impossible not to look at these images and judge 20th century Germany in light of the catastrophic stupidities that led to its murderous exile of the

links for 2008-03-30

March 30th, 2008

links for 2008-02-06

February 6th, 2008

links for 2008-02-05

February 5th, 2008

links for 2008-01-30

January 30th, 2008

links for 2008-01-20

January 20th, 2008

links for 2008-01-05

January 5th, 2008

links for 2008-01-04

January 4th, 2008

links for 2008-01-03

January 3rd, 2008

links for 2007-12-28

December 28th, 2007

links for 2007-12-19

December 19th, 2007

links for 2007-12-17

December 17th, 2007

links for 2007-12-04

December 4th, 2007

links for 2007-11-30

November 30th, 2007

links for 2007-11-28

November 28th, 2007

links for 2007-11-21

November 21st, 2007

links for 2007-11-20

November 20th, 2007

Non-ambient findability

October 18th, 2007

This:

GoogleMySlippers

Reminded my of Bruce Sterling’s 2006 ETech talk, which you can read here (I tried to find it on one of Bruce’s properties but couldn’t), and hear here.

“I no longer hunt anxiously for my missing shoes in the morning. I just Google them.”

Peter Kim, I just don’t get it, either

October 18th, 2007

 Peter Kim of Forrester reports on Twitter usage amongst US adults

Our data shows that 6% of US online adults use Twitter regularly. (from Being Peter Kim: “I just don’t get it.” [i.e. Twitter])

That is patently insane.  I suppose it depends on how you define “online adults,” but even with a very restrictive definition (like, say “adults between 20 and 30 who own a web-capable cell phone, pay for unlimited SMS messages, and have a broadband connection at home”) there is utterly no way you can convince me that 6% of online US adults use Twitter regularly.

To top it off, Kim refers us to statistics in a client-access only report to support his claims.  So essentially most of us are supposed to take that statement at face value.  I mean, what kind of stunt is that?  It makes Kim’s assertions basically completely unsubstantiated.  At least link to a pared-down version of the data and analysis so we can do a basic sanity check.

Useless.

Update:

Peter Kim, and Cynthia Pflaum pull back the curtains on the data Peter based his commentary on, and things make a lot more sense now.

As I see it, Peter got carried away and misinterptreted the data. It seem clear from what Cynthia says that 6% of a highly self-selecting population that’s interested in the technology sphere have “used” Twitter (which, given the openness of the question asked, per Peter, could be interpreted as “having viewed a blog with a Twitter widget on it”) in the last month. That’s a completely believable statistic. And one that can validly be used to support Peter’s real thesis: “If you want to reach an affluent, well educated, and early adopter audience, there might not be a better communication channel out there.” But as pointed out in the comments, Twitter is intended to be used frequently and as such in my view, “monthly” doesn’t mean “regularly.” Perhaps I was a bit strong in my language in my initial post, but I stand by my view that it was an outlandish claim made with no supporting data.

Interestingly, the corresponding post on Forrester’s Marketing Blog has not been updated.

links for 2007-10-18

October 18th, 2007

"Big" news today in the Microsoft SharePoint space – updated

October 17th, 2007

Today Microsoft is announcing two strategic partnerships, with enterprise software company Atlassian and RSS solutions vendor NewsGator. (from Read/Write Web)

I suppose this is pretty big news for Atlassian wiki customers, especially those that are using Microsoft SharePoint – single sign-on and cross-platform search can be pretty important in the enterprise world.  Plus the ability to embed Confluence (Atlassian’s wiki product) content into SharePoint pages and allowing Confluence users to edit SharePoint content directly are pretty big wins.  It could also be pretty innovative for large existing SharePoint customers who are interested in using wikis for collaboration.   I think it’s pretty well accepted that the built-in SharePoint wiki is horrible – I feel safe in saying it’s the least wiki-like wiki product I’ve ever had the displeasure of using.

From my standpoint, though, I’m not sure I see enough value in the additions to warrant moving to Confluence as a wiki, at least not for a small- to medium-sized business.  With pricing starting at $4000 for 500 users (about the size of ETC) it seems steep - even if you work in a solid Microsoft shop (as I do) and have to consider the additional support costs of running multiple platforms within a company (as we did when we started looking at other wikis), the ongoing ROI of a Confluence purchase seems out of balance for the wins.  Perhaps at a larger company, where there would be significantly more maintenance overhead, it might be worth it.

I don’t really get the NewsGator stuff, I’ll have to admit: SharePoint already supports RSS in lists (which is how almost all SharePoint content is organized), and at first glance the NewsGator stuff looks like it’s mostly social network-style gizmos and connections between users.  A lot of what they offer could be done (albeit not as slickly) without too much difficulty with built-in SharePoint objects.  The addition of tags is nice, but the $20,000 large enterprise price tag seems way out of whack with the value delivered.

via Scoble’s tweet

Update:

An email from Jon Silvers reminded me that I should point out that ETC doesn’t use SharePoint Server, but instead uses Windows SharePoint Services, the free-with-Windows-Server-2003 subset of the SharePoint Server features. Given that, we’re probably not the target market for Confluence or the Confluence connector.

links for 2007-10-16

October 16th, 2007

links for 2007-10-10

October 10th, 2007

links for 2007-10-09

October 9th, 2007

links for 2007-10-08

October 8th, 2007

links for 2007-10-05

October 5th, 2007

links for 2007-10-04

October 4th, 2007

links for 2007-10-03

October 3rd, 2007