April 2006

Monthly Archive

Three rules for not looking like an idiot when you outsource

Posted by wenzi on 25 Apr 2006 | Tagged as:

You all know I use different outsourcess now, after that whole oDesk episode. To make a long story short, stay away from oDesk.

I was reading a review site about a person who had an email program written by a coder thru an outsourcing website. ( I have used this same outsourcing site for a while, and I have not had any problems at all. As with all these types of sites and outsourcing, you get out of them what you put in. The site was contracted out thru one of the sites with coders overseas. ) The buyer made the deposit, sent the spec and everyone was happy. The coder finished the project, and submitted it back to the buyer. This is where it gets interesting. The buyer that the coder wrote it did not include a reply button. The buyer felt cheated. Of course it should have a ‘reply’ button. In his mind, every email program should have a reply mind. Well, guess what? There was not a reply button in the spec. The coder wrote to the spec, and wanted to be paid as per the spec he was given. The buyer went to arbitration and lost. As well he should.

So what is the moral of this story?

Don’t be a twit. If you ask for something, don’t complain when you get it.

If you write a spec for a programmer to calculator the phase of the moon on alternating Thursdays, and you agree to pay him a sum of money for that spec, then that is that. If the programmer returns a program that calculator the phase of the moon on alternating Thursdays. Pay the man ! The spec is you part of the contract, the finished application is the other part. This buyer was making up spec and contract terms , after the fact , using the same method used by insane people for hundreds of years. Pulling it out of his ass.

Making up imaginary parts of contracts and forcing that on someone else is lunacy.

If you however discover that the program doesn’t calculate the moon phases also ( which was not in the spec ) and ask the programmer to add it back in at no cost that is plain wrong. Feature creep will kill people with fix price bids. There livelihood is based on estimating the cost based on the spec. Changing the spec after the fact is ok only if you change the price that is to be paid. I am sure this buyer would not like the programmer coming back halfway thru the project and ask for more money? If you want to change or add something, they have something called a change order. Which is a great example of something being exactly what it is. An additional to change an order.

Change orders are there for a purpose, use them.

When you outsource a job it is your responsibility to write down what you want back. Docs, acceptance test, whatever. But that is the deal , like it or not. I have written a spec, and forgot about one item I wanted done. When the class came back it passed the acceptance test. I paid the coder, said thanks and asked him how much to add the needed functionality. If it passes the acceptance test, that is it. It should be accepted.

The story of the disgruntled buyer has a interesting ending. He kept complaining that the coder would not do something that was in the spec for free. To the arbitrator, to the account manager, just making a nuisance of himself. Eventually, this complaint worked its way up to the president of the company. After much argument, the buyer was actually banned from the site. Getting banned from one of these sites without doing something illegal or fraudulent is pretty hard. I can only imagine what he said to the owner of the company.

Now these things not only apply to overseas coders, they can apply to the guy in the next cubicle, or the consultant on the other side of town. Treating coders with respect works both ways.

Singleton Pattern in Quantlib

Posted by wenzi on 20 Apr 2006 | Tagged as:

Singleton Pattern in Quantlib

Ok, the Singleton pattern is one of the easiest patters in QuantLib, so I will start with that one first. A Singleton pattern guarantees that only one instance of an object will be needed in a system or framework like Quantlib. The Singleton pattern is usually implemented as a class that returns an instance of the object if one exists, or creates one if it does not exist. To make sure that the object cannot be instantiated any other way, the constructor is made protected .

So here is the simple version of the Singleton class in QuantLib


template
class Singleton : private boost::noncopyable {
public:
static T& instance();
protected:
Singleton() {}
};

In QuantLib, it is implemented as a template, which makes life easier. We don’t want to have to write the same thing for each singleton class. The Singleton class is the base class for four other classes

ExchangeRateManager - exchange-rate repository
IndexManager - global repository for past index fixings
SeedGenerator - Random seed generator.
Settings - global repository for run-time library settings

You may have noticed the boost::noncopyable. This is from the Boost libs, and it makes the copy constructor and copy assignment private to ensure classes derived from class noncopyable cannot be copied. So we cannot copy a Singleton.

So when we want to get an instance of the object, we call the method instance


mt19937uniformrng.cpp: unsigned long s = (seed != 0 ? seed : SeedGenerator::instance().get());

So lets look at an example usage in Quantlib. mt19937uniformrng.cpp is a Seed generator. The call to the method unsigned long get () returns the Random seed. SeedGenerator::instance() returns the instance , and the get() method returns the Random seed.

We all know what a Singleton is. A lot of people do not like the Singleton pattern as they feel it is a warm fuzzy throwback to Non OOP programming. Like a global variable. But that is life, and the Singleton pattern is useful.

There are some things I did not cover for sake of incompleteness like QL_ENABLE_SESSIONS, but I leave that for later.

Beacon Light SDA Church Annapolis MD Allegheny East

Posted by wenzi on 08 Apr 2006 | Tagged as:

beaconlightsda.org

I really need a new computer bag.

Posted by wenzi on 05 Apr 2006 | Tagged as:

I really need a new computer bag. I have my shiny new MacBook Pro in a computer bag from a G3 Wallstreet.

I saw the SI Vertical Computer Bag http://www.zappos.com/n/p/dp/3291268/c/4188.html , and I am really thinking about it. I am always jumping on and off planes and I think I could use it as my ‘personal’ item.

I am about to take another long flight. I am so used to these things now, it seems second nature.