Archive

Archive for May, 2010

Of Business Plans and Net Neutrality

May 30, 2010 Leave a comment

Lately I’ve been pondering the odd situation of supply and demand that Internet Service Providers are in. ISP’s provide a great service which enables anyone to be able to access the world wide web. The system was designed where anyone (with only technical limitations getting in the way) could host content and anyone could access that content. So obviously ISP’s want there to be content on the web that people want to get to, making those people customers.

Hypothetical situation: there’s no longer is any content on the web that anyone wants to access. Everyone would stop paying the ISP’s. This isn’t good for them. But the business model of the internet is that people hosting websites (content) pay to have their content accessible on the internet. It’s worth it for many business websites because they end up making money from sales or by some other means, from people going to their websites. The end result is that ISP’s are getting paid at each end of this connection. I think it would be interesting if a business model evolved where ISP’s would start paying websites. That way the websites would be able to exist, and consumers would pay the ISP’s to access the website. For some reason though this isn’t the model that evolved.

I’ve been thinking about this because of the current “going on’s” with the FCC and Comcast and Congress, many commentators have mentioned that it could lead to a world were people would have basic internet service only to the ISP’s data, and a premium price for the rest of the internet. The world could reenter a phase that I’m going to call the AOL phase where for a period of time most people on the internet didn’t know there was a difference between AOL and the internet. I personally think it would be very sad if the internet fragmented like that again. But with the way the situation in the US is headed it looks like that might just happen (in the US anyway).

Building a close match exception

May 22, 2010 Leave a comment

One thing I’ve noticed when trying to do APM programming is that all of the online articles mention how to use the APM, but not how to implement the APM. I actually implemented it with a test tool at work (there is a bunch of overhead) and one of the issues that I came across was exception handling. I don’t mean exception handling in the normal case of catching exceptions, but the best way to generically pass them along. One aspect of .Net which I don’t like is how throwing an exception restarts the stack trace, thereby erasing what it previously might have had. There is the “throw;” syntax, but that doesn’t work for multi threaded code paths. What I wanted was a way to rethrow the original exception type, but with the original exception as an inner exception so that way the original stack trace wasn’t lost. To achieve this I just wrote up this quick method to assist with that.

 

using System;
using System.Reflection;

public class ExceptionReflector
{
    /// <summary>
    /// Builds an exception based off of the given exception so that the stacktrace
    /// of the inner exception is not lost. The returned exception should be close to 
    /// the type of exception passed in.
    /// </summary>
    /// <param name="innerException">The exception to be the inner exception</param>
    /// <returns>Best match exception</returns>
    /// <author>jader3rd</author>
    static Exception BuildException(Exception innerException)
    {
        Exception returnee = null;
        Type targetType = innerException.GetType();
        Type[] desiredTypes = new Type { typeof(String), typeof(Exception) };
        while (null != returnee)
        {
            ConstructorInfo ci = targetType.GetConstructor(BindingFlags.Public, null, desiredTypes, null);
            if (null != ci)
            {
                Object[] parameters = new Object { innerException.Message, innerException };
                returnee = ci.Invoke(parameters);
            }
            else
            {
                targetType = targetType.BaseType;
            }
        }

        return returnee;
    }
}

Cat Food Ball

May 16, 2010 Leave a comment

One of the toys that we have for our cat Isis is a food ball. It’s a hollow plastic ball about one inch in diameter. It has a hole in one end that lets kibble in and out. The idea is that the cat bats the ball around and kibble slowly drops out. It gives the cat something to do besides waltzing up to a bowl and eating.

When we first got this one for Isis she never used it. Then for two or three nights I didn’t put food in her food bowl, I only put food in the food ball. I make sure that her food bowl has kibble in it during the night (I don’t want her to starve) but during the day I make sure that the food ball has food in it. Isis now prefers the food ball. She hardly touches her food bowl anymore. When there’s kibble in the food ball she doesn’t knock it around wrecklessly, she wants to food. So she nudges it along with her nose, constantly sniffing waiting for another piece of kibble to drop out.

I think it’s fun to watch.

Categories: Pets