Blogs

Using svn+ssh On Windows

Subversion supports repository access over an SSH tunnel. That is good news because the first "S" in SSH stands for secure. So the next question is how do we configure Subversion to use SSH?

Unix users are usually familiar with SSH; it has supplanted telnetd as the de facto shell daemon. For this reason we will not cover svn+ssh on Unix here - there are existing resources for that. This article will explain exactly how to svn+ssh on Windows.

On Documenting a System...

What is good practice for understanding a system? What is the point of understanding a system? How and when does that understanding become outdated? These questions are relevant to system documentation - our topic. This article seeks to directly answer each of these in turn.

"Understanding a system" differs from "learning a system" in one key aspect: ownership. When we share ownership of a system we may successfully contribute to its change, which leads us to a crux of the problem: understanding a system is directly dependent upon its vectors of change. But to come back to ownership for a moment, that is the main point of understanding a system. If you have no need to own a system - there is no point in understanding it. On the other hand, the act of enhancing or fixing a system is certainly a reason for understanding a system.

Testing Asynchronous Events

The timing seems right to demonstrate a pattern for testing asynchronous processing. This follows up on Steve's assertion: Don't make assumptions, write the test.

For purposes of demonstration our user story will be: As a program I want to output a message after an event is raised. So let us start by writing a test. Our story implies an event reader and a writer. So let us use the runtime execution provided by test runner and make that the reader. The writer will be some other simple class.

namespace Test.AsynchronousProcessing
{
    [TestFixture]
    public class EventReader
    {
        [Test]
        public void CreateInstance()
        {
            Assert.IsInstanceOfType(typeof (EventWriter), new EventWriter());
        }
    }
}
If you run the tests for EventReader, CreateInstance will fail of course. So let us do the minimal necessary to make the test pass: create EventWriter class. By the way...by convention the code listings show only relevant material.
    public class EventWriter
    {
    }

nunit + mono + private methods don't play

Came across a gnarly difference in behavior between .NET runtime and Mono runtime. Take a look at this snippet.

[SetUp]
private void Setup()
{
  this.layout = new FeedLayout();
  this.layout.ActivateOptions();
  this.writer = new StringWriter();
}

Test-driven development using JUnit left me with the arguably proper habit of defining setup/teardown methods private. This practice works in nunit under .NET runtime - but not under mono. You must change the modifier to public - as in...

[SetUp]
public void Setup()
{
  this.layout = new FeedLayout();
  this.layout.ActivateOptions();
  this.writer = new StringWriter();
}

Closures in Ruby, Part I

Closures are a powerful concept in some languages - a powerful tool in others. In my mind a tool is something I can ask for by name - as in, "I'd like a reciprocating saw, please." Languages where closures are truly a tool include Lisp, Python, Ruby, among others. For the time being I will use Ruby to discuss closures - although a switch over to Lisp may be necessary.

Template Method Pattern in Ruby

One of the most ubiquitous patterns in life is the template. It enables us to generalize behavior - thus ignoring or postponing complexity.

This ability to generalize behavior - deferring derivative details - turns out to be extremely useful in agile software development. It encourages mock-object practices. It encourages simplest possible solutions. It encourages test-driven development. And most importantly it embraces change.

What is the template-method pattern? A good example is found in JUnit. TestCase.run() defines a generic process: 1) setup before running test; 2) run test; 3) tear down after running test. The complexity is provided by derivative TestCase types - but the process is same for every run.

public class TestCase {
  // details elided
  public void run() {
    setup();
    runTest();
    tearDown();
  }
  protected void runTest() {
  }
  protected void setUp() {
  }
  protected void tearDown() {
  }
}

HOWTO: ActiveSync with Exchange 2003

There are several good resources on this topic - but if you are like me and just want the technicals without the pretty pictures then this post is for you.

  1. disable certificate-verification using certchk.exe
  2. configure server synchronization
  3. connect PPC to internet (usb, wifi, gprs...)
  4. start sync

Code your way out of primitive obsession!

Primitive Obsession is a result of poor practices. Primitive Obsession is a byproduct the impedance mismatch between OOD and ERD. Primitive Obsession is a code smell indicating procedural design - encouraged by some heavyweight framework.

Okay. But what does that look like? And, more importantly, how do I code my way out of it?

    PersonTypedDataSet GetPerson(Int64 personIdentifier);

This is your basic primitive obsession in action: use of primitive types as keys to a map (ERD, HashMap). This causes a flacid integration point. The parameter is an integral type - it has primitive rules regarding its domain and range. What means -1? Where do I get this magic number from? How do I remember what the number indicates? How do I get more information about this person number?

Fix Firefox h-scroll in Linux

I just added a topic on my wiki.

It is only useful for an infinitessimally small number of people...but important nonetheless.

irb beats calc any day

This may wind up the shortest entry to date - yet I hope as valuable as any other post.

Several months ago I switched the host OS on my laptop - from Windows XP to Gentoo Linux. One of my many reasons for doing so was the ease of maintaining a performant system under Linux (esp. Gentoo). All those Windows services we so very rarely use add up to wasted memory and processor.

My Gentoo installation is loaded with only those components I regularly use. Recently I needed to crunch some financial figures. A calculator was not installed on my system but Ruby was! And that leads me to maybe the best calculator of all...

Syndicate content