July 14, 2006 fun

I’m on MySpace now

I’m on MySpace. Now what?
July 11, 2006 tools

Functional Language Summary

I’ve been hearing a lot about functional programming lately (and the circle of life continues); I found Functional Programming For The Rest of Us to be a nice summary. Here’s what I got from it:

Atoms of FP:

  • All variables” are immutable, often called symbols”
  • Program state is kept in functions (specifically, arguments passed on the stack to functions), not variables
  • Functions are first class citizens, i.e. functions can be passed as arguments
  • currying” is a convenience syntax for adapting a function to an alternate function signature
  • closures” are functions that are allowed mutable state and access to state outside their lexical scope to bridge functional and non-functional languages

Implications:

  • Functions cannot cause side effects (“variables” are immutable)
  • FP is great for unit testing (only have to test outputs against inputs — don’t have to test side effects)
  • FP is great for debugging (no need to worry about external state affecting function results — results are only based on the input)
  • No need for multi-threaded locks, as state is immutable
    • This makes functional programs automatically parallelizeable
  • Can hot swap new function definitions w/o effecting existing instances
  • Don’t need to evaluate a function til the results are needed

FP sounds great! Why do we mess around w/ anything else?!?

July 6, 2006

This blog entry cost me $113.70

So, I’m loving my t-mobile cell phone account (I get unlimited HotSpot access at Starbucks and lots of other places, too). However, I just learned that one service I don’t have is free text messaging. Normally, that’s not a problem because I’m a middle-aged white guy and texting” is for young kids cheating on tests and looking for sex partners (at least, that’s what I get from the news : ).

Anyway, I just got my t-mobile bill and my phone has been receiving text messages to the tune of 54/day for a total of 1137 in the first 21 days. At $0.10/message, that doubled my bill and confused the hell out of me, because I only ever see a text message on my phone when I miss a call from my wife or when my European friends text me, i.e. about 10/month. Where have all of these text messages come from?

Apparently, they come from Exchange using AUTD (Always Up To Date) to notify my phone that new messages are available. I didn’t know that’s how this worked; I was just happy to get it to work at all. Luckily, this is no longer a problem. AUTD was apparently a Windows Mobile 2003 Second Edition thing that my old Audiovox 5600 used (I must have had free text messaging on my AT&T Wireless account and not noticed how young and hip my phone was).

Luckily, my text message traffic has fallen back to near zero because of my Qtek 8500, which uses push email.” Apparently push email keeps an HTTP session open to Exchange using my unlimited data access instead of using my (very!) limited text message access.

I sure wish there’d been some way of knowing this before the first bill arrived, of course, but it’s nice to know my Qtek is actually saving me money (at least, that’s what I’ll tell the wife : ).

July 6, 2006 spout

Struggling with NUnit (2.2)

The one where I get System.IO.FileNotFoundException in NUnit in a bunch of different ways and suggest some possible solutions.
July 6, 2006 spout

Struggling with NUnit (2.2)

Struggling with NUnit (2.2)

I had a very unpleasant afternoon trying to get NUnit working, so I thought I’d share my troubles and my solutions (such as they are). A search revealed a lot of folks with the same troubles, but precious few explanations or solutions. The NUnit Quick Start documentation does a wonderful job telling you how to write a simple TestFixture class with one or more Test methods (and even an optional SetUp method). However, as far as I could tell, there wasn’t any part of that tutorial that said “Hey! Add a reference to nunit.core.dll’ as well as nunit.framework.dll’ to your project or neither nunit-gui nor nunit-console will work;” you’ll get a System.IO.FileNotFoundException when you don’t have nunit.core.dll (the Exceptions Details menu item doesn’t help):

Also, when you start up nunit-console, you better darn well be in the current working directory of the test assembly as well as nunit.core or you’re going to get the same message in the console. Likewise, if you start nunit-gui. Further, if you just run nunit-gui, create a new project and then add an assembly, you better have known to save the .nunit project file in the same directory as the assemblies you add, or you’ll be getting the same message again.

And, as if that weren’t enough, you’ll get this message again if you add nunit integration as an external tool to VS05 (via the Tools | External Tools menu item) using the instructions in the docs. The docs say to use $(TargetPath) and $(TargetDir), but those variables expand to the obj directory on my machine (although that seems wrong to me), not the bin directory, and the obj directory doesn’t contain the referenced assemblies. I never was able to get a VS05 external NUnit tool to work.

Luckily, it’s very cool that nunit-gui doesn’t keep test assemblies locked and notices when an assembly has changed from underneath it, so that once I do get it started with the appropriate working directory, it works nicely.

As it turned out, there were a lot of ways to get that FileNotFoundException message and I’m pretty sure I found them all before finding any ways to actually make nunit work. None of these things are NUnit’s fault it’s damn hard to do dynamic assembly loading in .NET but it’s still on you to make sure NUnit is configured properly.

Finally, the tutorial shows but doesn’t say that you better make your test methods public. Since NUnit uses Reflection, it doesn’t need the classes or the methods to be public, but I guess they decided that was an interesting knob to let the developer turn. I’d have preferred to let the default permissions work (internal) to save myself typing, but that’s just a nit.

July 5, 2006 fun

Superman Returns: Boring

Superman Returns has some cool scenes and Kevin Spacey does a great Lex Luthor, but overall there were far too many soulful looks between Superman and Lois Lane for my taste. It’s a matinee at best.
July 5, 2006 tools

A Shared Source Site: CodePlex

CodePlex functionality, built on Microsoft Visual Studio® 2005 Team Foundation Server, provides source control, issue tracking, discussion forums and RSS feeds in and out of each project so that members can stay up to date on the development issues most important to them. Microsoft Visual Studio Team Foundation Server enables developers to collaboratively develop, share, discuss and consume source code and build software.”

Enjoy.

June 27, 2006 spout writing

When to ship a book is hard to know these days…

Mr. Petzold beat me to the punch on the Windows Forms 2.0 book and he’s going to do it again on the RTM Avalon book. However, such a thing is dicey, as Mr. Petzold points out.

It was in researching the Windows Forms 1.0 book when I grew to be scared of finalizing a book before the technology was finalized; that’s when they added AllowPartiallyTrustedCallersAttribute and it screwed up the entire No-Touch Deployment story. Toward that end, we didn’t ship the WinForms 2.0 book til after the .NET 2.0 bits went gold and we won’t ship the paper copy of the Avalon 1.0 book til then, either (although I understand ORA is going to be shipping early electronic drafts of our work as we do it). I have to sacrifice 2-3 months on the shelves to my competitors, but I get to be less scared of big, last minute changes.

It’s a judgment call, though. In this era of books with 12-18 month shelf lives, I can’t say Mr. Petzold’s not right…


← Newer Entries Older Entries →