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

Saturday, 22 January 2011

Sat, 22 Jan 2011 - 06:22pm (GMT+0)
Comments

RegExEditor goes open source

I originally developed the RegExEditor tool as a personal project for my own use and simply published it here as a favour to the world. As it serves my purposes well I have not had the inclination to do much further development on it.

All the time however I get requests from people for this or that feature and most of these would make the product much better. Most of the things I get asked for would be a lot of work and I just don't have the time in my busy schedule. So I decided today, after some prompting by Prados Valiente Enrique, to open source the product.

The source repository can be found on CodePlex at http://regexeditor.codeplex.com/

I have never been involved in the open source world much, other than to use the fruits of other peoples labour, so it will be an interesting experience to see how this turns out. If you have any words of wisdom for someone just starting out on their first open source project please leave them below.

Wednesday, 05 August 2009

Wed, 05 Aug 2009 - 11:30am (GMT+1)
Comments

C# Function for converting an Int to Roman numerals

public static string ToRoman(int number)
{
    if (-9999 >= number || number >= 9999)
    {
        throw new ArgumentOutOfRangeException("number");
    }

    if (number == 0)
    {
        return "NUL";
    }

    StringBuilder sb = new StringBuilder(10);

    if (number < 0)
    {
        sb.Append('-');
        number *= -1;
    }

    string[,] table = new string[,] { 
        { "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX" }, 
        { "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC" }, 
        { "", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM" },
        { "", "M", "MM", "MMM", "M(V)", "(V)", "(V)M", 
                                          "(V)MM", "(V)MMM", "M(X)" } 
    };

    for (int i = 1000, j = 3; i > 0; i /= 10, j--)
    {
        int digit = number / i;
        sb.Append(table[j, digit]);
        number -= digit * i;
    }

    return sb.ToString();
}

Thursday, 09 April 2009

Thu, 09 Apr 2009 - 10:20am (GMT+1)
Comments

Cannot dump domain hosting settings when backing up Plesk

I have been working with Parallels Plesk 9.0 control panel software to enable one of my customers to administer their web server more effectively. As part of this I set up the Plesk backup to run every night. At the end of each backup Plesk sends an email giving the status of the backup. This status email was giving the status as "Task status is: warnings". This email also has a "migration.result" file attached which gives a bit more detail in XML format. Against each of the domains on the server there was this entry:

<message code="InformationalException" severity="error">Cannot dump domain hosting settings</message>

After Googleing and searching the Parallels web site and not finding anything much I decided to contact Parallels support. It turns out that this is caused by an issue with the way Plesk interfaces with SmarterStats. If you are experiencing the same issue there is a hot fix at http://kb.parallels.com/en/6144 and this will be included in a future Plesk patch.

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.

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

  Blogarama - The Blog Directory   GeoURL