How bandwidth affects productivity

Thursday, 30 August 2007 11:18 GMT | 13 comments

HERE is proof that the bandwidth available to you has an impact on your productivity.

At about 40 KB/sec — the average broadband speed in Mauritius — it takes approximately 23.5 hours to download the latest beta of Visual Studio Orcas.

20070731-001

At about 400 KB/sec, it takes only two hours for the same download to complete. This means I can start taking advantage of the new features of the improved IDE without having to wait for almost a whole day.

20070731-002

Eddy.

How we became homeowners

Friday, 24 August 2007 12:04 GMT | 7 comments

P1010308

ACCORDING TO a survey done by ING Direct, house-buyers in the UK take an average of just 17 minutes to decide on whether to buy a property they have viewed or not. This is an interesting finding to keep in mind when it comes time for us to sell.

I don’t remember exactly how long it took us to decide on the house we are now living in, but then again it was such a hectic period when all we seemed to be doing was visiting other people’s houses and finding faults with them. We discarded houses that did not appeal to us within seconds of walking through the front door and, in some cases, just by driving around the neighbourhood.

When we started, we picked properties that were in the region where we were living in London, but after viewing countless properties and managing an offer on only one one-bedroom flat that still required a lot of renovation work, we realised we were not getting good value for money. We retracted our offer and started looking elsewhere.

Elsewhere was literally a random location picked from a map. By pure coincidence, “elsewhere” turned out to be Farnborough, a place that I had driven to only once before at night! We called local estate agents and booked about fifteen houses for viewing in a single day. We set off early in the morning, forgetting that we did not know the area. Of course, we got lost and were late for the first viewing. We stopped at a petrol station and bought an over-priced local map and, wisely enough, the only food we would eat on that day — two cold sandwiches and a bottle of water.

We received a call from the estate agents informing us that the first house we were to view had just been sold. We had missed it by about 30 minutes — a testament to how fast good houses were going. Fortunately, the rest of the day went better. We not only visited the houses for which viewings had already been arranged, but were also being directed to other ones that were coming on the market while we were on the road. There was a good feeling of genuine co-operation between the estate agents and us.

By the end of that single Saturday, we had found two houses that we liked, something we had not managed in MONTHS of viewing in the London area. It took us until the following Monday to decide on which of the two houses we preferred and have our offer accepted by the vendors. Then, we were ready to start the paperwork. But, little did we know that it would take us another four months until we would move in, during which time we had moments of doubt and nearly pulled out.

Typing Dvorak for RSI relief

Tuesday, 14 August 2007 22:52 GMT | 3 comments

I AM training on the Dvorak keyboard layout to see if it can relieve my budding RSI. The pain in my fingers seems to be subsiding, but it is too early to say whether it is from typing slowly or having less finger-travel (which is the stated benefit of using the Dvorak layout).

RSI in pinky finger

Monday, 13 August 2007 23:12 GMT | 9 comments

14082007

Trouble ahead, I’m afraid.

The pinky finger on my left hand has been aching for the past few days. It started during the intensive debugging sessions I had at the office lately, and now it shoots pain every single time it reaches for the left Shift key. In the picture above, you can see that the marking of the “A” key is almost gone. Also notice how far the finger has to travel to reach the Shift key.

I will see if it improves over the next few days with more frequent breaks and control over my typing speed — fingers on home keys; one finger off the home keys at a time; active finger returns to home key before next finger move; and so on — and if the pain gets worse, I will have to consider a specialist.

Abstract factory design pattern

Sunday, 5 August 2007 13:57 GMT | Add a comment

IN my previous post, I described how to use the Factory Design Pattern and interfaces to create a generic class that instantiate storage objects at run-time as specified in the configuration file of an application.

One of the remarks I received was that the storage object produced by the storage factory class required casting to the correct type.

For example:


        ...
        IAccountStorage storage = (IAccountStorage) StorageFactory.GetStorage(typeof(IAccountStorage));
        ...


In order to eliminate the cast operation, we need to apply the Abstract Factory Design Pattern which allows factories and their products to be specified without their implementation details. Using an analogy similar to the one in the previous post, this pattern means that we have specifications for factories and specifications for the manufactured products without the actual factories and products themselves.

In programming, this means that factories and classes that they instantiate are specified as interfaces.

For example:


public interface IAccountStorage
{
        void Save(Account account);
}

public interface IAccountStorageFactory
{
        IAccountStorage GetStorage();
}


The actual implementations are based on these interfaces. For example, if we want to build memory-based storage classes, we will have the following code.


public class MemoryAccountStorage
{
        public void Save(Account account)
        {
                // Saves account to memory
        }
}

public class MemoryAccountStorageFactory
{
        public IAccountStorage GetStorage()
        {
                return new MemoryAccountStorage();
        }
}


In the client code, the need for cast is thus eliminated.


        ...
        IAccountStorageFactory factory = new MemoryAccountStorageFactory();
        IAccountStorage storage = factory.GetStorage();
        storage.Save(...); // saves an account
        ...


Typically, the choice of implementation of IAccountStorageFactory will be done at run-time by a specialised class, based on a configuration setting.

For example:


public static class StorageFactoryHelper
{
        public static IAccountStorageFactory GetAccountStorageFactory()
        {
                Type type = ...; // finds the correct implementation
                IAccountStorageFactory factory = (IAccountStorageFactory) Activator.CreateInstance(type);

                return factory;
        }
}


Note that in this case, since we are using the Activator.CreateInstance method to instantiate an object at run-time, we cannot do without the cast.



Powered by WordPress and Eddy Young.

DISCLAIMER: This site is supported by advertising. As a result, cookies may be installed by advertisers in order to track usage and trends. If you do not want this, please disable cookies for this site.


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser