MGBrown.com Hunk

MGBlog

A log of issues faced by a .Net contractor, and the resolutions used. There is a mixture of C# and VB.Net. Also included are items seen by the author as interesting to .Net developers.

View last  items

Friday, 16 November 2007

Fri, 16 Nov 2007 - 02:00pm (GMT+0)
Comments

New .Net Developers London group on Facebook

After reading an article on ContractorUk.com titled 'Facebook better than ads for finding IT staff' I decided it would be good to start a new group on Facebook for .Net Contractors in London. It is a relatively new group and needs a hole lot more members so if you are interested in joining the group simply follow the link and hit the 'Join this Group' link.

http://www.facebook.com/group.php?gid=6702996788

Saturday, 10 November 2007

Sat, 10 Nov 2007 - 07:14pm (GMT+0)
Comments

Trying to learn PHP error code is 2878.

I thought for a change it was about time I learnt something that was not Microsoft related. I seem to be getting endless calls by people wanting me to help them with their PHP sites, so I thought it would be a good idea to learn it. After about ten minutes I remembered why I don't normally venture away from the Microsoft world. It is not that the rest of the software world is bad, but I definitely seem to be jinxed when I go there.

The first thing that does my head is the first line on the PHP Manual. You see, apparently PHP stands for "Hypertext PreProcessor", but in my world that should make it HPP. Anyway, I won't hold that against them so I head off and download the installer for version 5.2.5. It downloads fine and the number of bytes downloaded match what the site says they should be only when I run the thing I get this error message just after the step where you specify the install directory:

"The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2878."
It turns out, I'm not the only one to have this issue. There are six more on the bug report. I'm not sure what causes this, but you would have thought that some testing would have occurred on the worlds most used operating system wouldn't you. As there is no sign of the msi for the previous version, I'm left to do the multi-step manual install. Maybe I might get to writing my "Hello PHP World" application sometime before Christmas. I'll let you know how it goes when I do.

Monday, 11 September 2006

Mon, 11 Sep 2006 - 05:28pm (GMT+1)
Comments

Technorati

I am a bit late getting onto the whole Technorati thing. But I thought it was about time I gave it a go.

Here is a link to my profile: Technorati Profile

Monday, 14 August 2006

Mon, 14 Aug 2006 - 09:00am (GMT+1)
Comments

C# equivalent of VB’s Left function

It really bugs me that C# does not have an equivalent of VB’s Left function. I know I could be using text.Substring(0,length) but this has the rather annoying feature of throwing an exception if the string is shorter than the length parameter. In 99.999999% of cases what I actually want it to do is return as much as it can instead.

Anyway here is my equivalent:

public static string Left(string text, int length)
{
    if (length < 0)
        throw new ArgumentOutOfRangeException("length", length, "length must be > 0");
    else if (length == 0 || text.Length == 0)
        return "";
    else if (text.Length <= length)
        return text;
    else
        return text.Substring(0, length);
}

Saturday, 12 August 2006

Sat, 12 Aug 2006 - 04:19pm (GMT+1)
Comments

Yahoo Search API Wrapper now under BSD Licence

I have decided to re-release my C# and VB.Net wrappers for the Yahoo API under the BSD licence. This was prompted by Yahoo’s decision to include the code with their other language examples. By changing the licence it is now inline with Yahoo’s own licence.

Subscribe to my RSS 2.0 feed which I've  Validated.

  Blogarama - The Blog Directory   GeoURL