East Ayrshire’s Day in the Millenium Dome

Just digitised this video from East Ayrshire Choir’s trip to the Millennium Dome in 2000. If you see yourself, just leave a comment and I’ll list you!

Join the excitement as 80 members of East Ayrshire Schools’ Brass Band and East Ayrshire Schools’ Choir perform to a capacity audience in the ‘Our Own Story Theatre’ in the Millenium Dome in Greenwich.

// <![CDATA[
jwplayer('mediaplayer').setup({ 'flashplayer': '/content/jwplayer/player.swf', 'id': 'playerID', 'width': '730', 'height': '590', 'file': 'http://kewneystorage.blob.core.windows.net/kewney/millenium-dome-2000.m4v&#039; });
// ]]

OpenSRS Lookup Code

string Server = "https://rr-n1-tor.opensrs.net";

string Port = "55443";

string PostData = " <?xml version='1.0' encoding='UTF-8' standalone='no' ?> " + "<!DOCTYPE OPS_envelope SYSTEM 'ops.dtd'> " + " <OPS_envelope> " + " <header>" + " <version>0.9</version> " + " </header> " + " <body>" + " <data_block>" + " <dt_assoc> " + " <item key="protocol">XCP</item>" + " <item key="action">LOOKUP</item>" + " <item key="object">DOMAIN</item>" + " <item key="registrant_ip">" + Request.ServerVariables("LOCAL_ADDR").ToString() + "</item>" + " <item key="attributes">" + "<dt_assoc>" + " <item key="domain">" + Domain.Text + "</item>" + " <item key="no_cache">0</item>" + "</dt_assoc> " + "</item>" + "</dt_assoc>" + "</data_block>" + "</body>" + "</OPS_envelope>";

WebRequest aRequest = WebRequest.Create(Server + ":" + Port);

aRequest.Method = "POST";
aRequest.ContentType = "text/xml";

aRequest.Headers.Add("X-Username", "validuser");

MD5 aMD5 = MD5.Create();

string privateKey = "validkey";

// Dim pkByte() As Byte = aMD5.ComputeHash(PostData & privateKey)
aRequest.Headers.Add("X-Signature", cMD5(cMD5(PostData.ToString() + privateKey) + privateKey));

System.Text.ASCIIEncoding bodyEnc = new System.Text.ASCIIEncoding();

byte[] bodyData = bodyEnc.GetBytes(PostData.ToString());
aRequest.ContentLength = bodyData.Length;

System.IO.Stream aStream = aRequest.GetRequestStream();

aStream.Write(bodyData, 0, bodyData.Length);

//Error Here
WebResponse aResponse = aRequest.GetResponse();

Manifesto: The Mad Farmer Liberation Front

I really like this poem by Wendell Berry and wanted to share it.

Love the quick profit, the annual raise,
vacation with pay. Want more
of everything ready-made. Be afraid
to know your neighbors and to die.
And you will have a window in your head.
Not even your future will be a mystery
any more. Your mind will be punched in a card
and shut away in a little drawer.
When they want you to buy something
they will call you. When they want you
to die for profit they will let you know.
So, friends, every day do something
that won’t compute. Love the Lord.
Love the world. Work for nothing.
Take all that you have and be poor.
Love someone who does not deserve it.
Denounce the government and embrace
the flag. Hope to live in that free
republic for which it stands.
Give your approval to all you cannot
understand. Praise ignorance, for what man
has not encountered he has not destroyed.
Ask the questions that have no answers.
Invest in the millennium. Plant sequoias.
Say that your main crop is the forest
that you did not plant,
that you will not live to harvest.
Say that the leaves are harvested
when they have rotted into the mold.
Call that profit. Prophesy such returns.
Put your faith in the two inches of humus
that will build under the trees
every thousand years.
Listen to carrion – put your ear
close, and hear the faint chattering
of the songs that are to come.
Expect the end of the world. Laugh.
Laughter is immeasurable. Be joyful
though you have considered all the facts.
So long as women do not go cheap
for power, please women more than men.
Ask yourself: Will this satisfy
a woman satisfied to bear a child?
Will this disturb the sleep
of a woman near to giving birth?
Go with your love to the fields.
Lie down in the shade. Rest your head
in her lap. Swear allegiance
to what is nighest your thoughts.
As soon as the generals and the politicos
can predict the motions of your mind,
lose it. Leave it as a sign
to mark the false trail, the way
you didn’t go. Be like the fox
who makes more tracks than necessary,
some in the wrong direction.

String Extension Collection for C#

This article brings a small collection of my more commonly used string extensions. For those who don’t know about extension methods, I suggest reading this short article.

Get the initials from a string

public static string ToInitials(this string str)
      return Regex.Replace(str, @"^(?'b'w)w*,s*(?'a'w)w*$|^(?'a'w)w*s*(?'b'w)w*$", "${a}${b}", RegexOptions.Singleline)

Remove line breaks from string

public static string RemoveLineBreaks(this string lines)
  return lines.Replace("r", "").Replace("n", "");

Replace line breaks in a string

public static string ReplaceLineBreaks(this string lines, string replacement)
    return lines.Replace("rn", replacement)
                    .Replace("r", replacement)
                    .Replace("n", replacement);

Strip HTML syntax from a string

public static string StripHtml(this string html)
   if (string.IsNullOrEmpty(html))
            return string.Empty;
   return Regex.Replace(html, @"<[^>]*>", string.Empty);

Pluralise a word

public static string Pluralise(this string value, int count) 
    if (count <= 1) 
        return value; 
    return PluralizationService 
        .CreateService(new CultureInfo("en-US")) 

and then

    "You have {0} {1} left", player.Lives, "life".Pluralise(player.Lives) 

Get Suffix From Date

    public static string GetDateSuffix(this DateTime date)
        string day = date.Day.ToString();
        if (day.EndsWith("1"))
            return day.StartsWith("1") && date.Day != 1 ? "th" : "st";
        else if (day.EndsWith("2"))
            return day.StartsWith("1") ? "th" : "nd";
        else if (day.EndsWith("3"))
            return day.StartsWith("1") ? "th" : "rd";
        return "th";

Add Working Days to Date

 public static DateTime AddWeekdays(DateTime start, int days)
            int remainder = days % 5;
            int weekendDays = (days / 5) * 2;
            DateTime end = start.AddDays(remainder);

            if (start.DayOfWeek == DayOfWeek.Saturday && days > 0)
                // fix for saturday.          
                end = end.AddDays(-1);
            } if (end.DayOfWeek == DayOfWeek.Saturday && days > 0)
                // add two days for landing on saturday        
                end = end.AddDays(2);
            else if (end.DayOfWeek < start.DayOfWeek)
                // add two days for rounding the weekend      
                end = end.AddDays(2);
            // add the remaining days   
            return end.AddDays(days + weekendDays - remainder);

East Ayrshire Schools Brass Band and Choir Concert 2000

This is a 90 minute recording of the East Ayrshire Schools Brass Band and Choir Concert back in 2000. It was filmed at the Grand Hall in Kilmarnock.

Welcome to the third annual concert to be given by the East Ayrshire Schools’ Brass Band and East Ayrshire Schools’ choir. The varied programme spans 300 years from the 18th to the 21st century.

Following a successful application in 1999 by East Ayrshire Council’s Department of Education to the Scottish Arts Council National Lottery Fund, the internationally renowned composer Goff Richards was commissioned to write a work for the band and choir which would in some way reflect East Ayrshire.

Robert Burns’ First Edition was published in Kilmarnock in 1976 by John Wilson and it seemed wholly appropriate to use extracts from Burns poetry as the text for the piece, ‘A String O’ Blethers’ by Goff Richards, who passed away on 25 June 2011 in Cheshire, following an illness, at the age of 66.