Thursday, May 28, 2009

Neighbours' shock as cows invade housing estate - Rugby Today - Back to Home Page
No comments:
Its ol news but only just came across it - wish Id have moved here sooner!
Neighbours' shock as cows invade housing estate - Rugby Today - Back to Home Page: "Neighbours' shock as cows invade housing estate"
Read More

Friday, May 15, 2009

How to use SQL Server T-SQL cursors | Microsoft SQL Server Advisor
No comments:
This is a brilliant little example script what absoluted HAVE TO use a cursor - my take generally on this is "If you have to use a cursor youre doing it wrong", however during some work for a client I needed to "duplicate" a hierarchy of items from different nested tables with foreign key references for a questionnaire something along the lines of
Questionnaire table links to Questions table, Questions table links to QuestionLinking table (Where a dependancy between one question and another is held) and so forth. I spent a while looking for a "clean" solution but the only option I found was to iterate through each Questionnaire, Question and Question link at a time as I needed to update the QuestionnaireId, QuestionId and QuestionLinkId from the Source Questionnaire to the Destination Questionnnaire row equivalents... if you have any patterns or approaches tot his type of thing not involving cursors I would love to hear from you!

How to use SQL Server T-SQL cursors Microsoft SQL Server Advisor
Read More

Wednesday, May 06, 2009

Internet Explorer 8: Videos
No comments:
Internet Explorer 8: Videos: "Internet Explorer 8: Videos" these, whilst very"microsoft", "vision of the future", "overly gloosy with an irritatingly up-beat narrator", if you know what I mean; much like the Windows Tour video (which i always make a bee line for when a new O/S is released), is actually very informative, concise and easy to understand. It shows key new features and how they work giving a very good insight into the lovely new "community" features. Well worth 5 minutes of your time!! Note: Especially useful is the Compatibility feature which, a developer, I might just find ver handy if it does indeed invoke the previous versions' of IE' rendering engines!
Read More

Tuesday, December 11, 2007

HITMAN THE MOVIE

No comments:
Well, Im not one for blogging about general everyday stuff but after reading some of the reviews of Hitman I felt I had to my two penneth in. Firstly thes think about those other not-so-great films of computer games, Street Fighter, Tomb Raider, Mario Bros, Mortal Kombat (to a
lesser extent) were all, well, not to be unkind but quite poor. So by that benchmark given the genre anything better than quite poor is a big plus. OK, so nmow we have a general benchmark lets consider some other mitigating factors - whilst Hitman has some superb stunts, special
effects and action sequences you should not go to this film with "This is another Borne Identity/James Bond type of film", it not, firstly the main character is more reminiscent of Leon than either of the two previously mentioned, think World Cinema, Darkened Eastern
European/Russian location, think World Cinema with a bigger budget. There are also some nice "in jokes" - at one point Agent 47 crashes thru a window into a hotel room with two kids playing Hitman the game on the telly - quite amusing if you catch the reference. Now the leading lady
isn't your typical "Bond Girl" shes dark, damaged, sassy and gothic AND she appears partially naked now and again - in my book all these things make her much more intriguing and interesting and indeed more sexy than anything the Bond franchise has produced. The main character IS NOT A "GOODIE" as with Borne and Bond, this guy has been trained from birth to be an assassin and it is his sole purpose, no sleeping with anything that moves, no witty repartee just a case full of weaponry and some bad-ass hand to hand combat get this guy thru life. The gadgets whilst fanciful in places have at least the potential to exist and are generally believable and used judiciously. Personally I thought that this film was one of the best Ive seen so far this year and, even if you don't go and see it at the cinema its certainly worth a rental - especially if you have surround sound and a hi-def telly to enjoy all the gun fights and explosions! Its efinitely a lads movie but not so much your "I like guns and stuff blowing up me" type of lad film more a "Im interested in see some alternative characters play out an intercontinental game of cat and mouse with high violence and some reasonable character development". The leading man, though Ive forgotten his name, must have been able to memorise his lines in an afternoon - he remains mostly silent throughout the film, punctuated occaisionally by some direct instruction which generally either ends or saves someones life, this guy however is not devoid of character, you are left with the distinct impression that theres a world of torment and angst behind those eyes and that whilst he never expresses it in words his facial reactions say it all whilst giving away nothing!

All in all a FIVE STAR film - SEE IT NOW!
Read More

Wednesday, November 28, 2007

Javascript Goodies

No comments:


I’ve recently had to deal with some very run of the mill client side validation, namely validation a comma separated list of email addresses – I was so pleased with my cobble together of bits of code I found on the net that I thought Id post it here for the next time! Also a handy bit of script to “trim” a string in javascript and adding the trim method to the String object… NICE!

String.prototype.trim = function() { return this.replace(/^\s+\s+$/g, ''); }

function CheckEmailAddresses()
{
var recipients = document.getElementById('recipients').getAttribute('innerText').split(',');
var emailRegEx = /^(("[\w-\s]+")([\w-]+(?:\.[\w-]+)*)("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)(@\[?((25[0-5]\.2[0-4][0-9]\.1[0-9]{2}\.[0-9]{1,2}\.))((25[0-5]2[0-4][0-9]1[0-9]{2}[0-9]{1,2})\.){2}(25[0-5]2[0-4][0-9]1[0-9]{2}[0-9]{1,2})\]?$)/i
for (var email in recipients)
{
if(emailRegEx.test(recipients[email].trim()))
{
alert('good');
} else {
alert('bad');
}
}
}

Thanx go to the following locations:
Trim function: http://www.nicknettleton.com/zine/javascript/trim-a-string-in-javascript
Email Regex: http://xyfer.blogspot.com/2005/01/javascript-regexp-email-validator.html

Read More

Monday, April 30, 2007

The Brooba Revolution!

No comments:
I just thought Id drop in a quick note about my new project, Brooba.com , the concept behind this site is quite simple - Why shoudl you have to pay extra fees when buying/selling/exchanging/searching for a house - this site puts users together giving them the tools necessary to end their Housing woes - do check it out and pre-register - more info to follow!

http://www,brooba.com
Read More

Monday, March 05, 2007

New Website

No comments:
Please please please checkout my new creation for a friend of mine who's set up a landscape gardening business - the website I created for him can be found at www.newmanlandscapesltd.co.uk

Cheers!
Read More

Tuesday, August 01, 2006

Javascript - Strpping CrLf

2 comments:
I've just been hunting round the internet for this so I thought Id share! This is a simple function to remove the CrLf characters from a string (Handy if you're receiving HTML in a Javascript variable and you want a HTML <BR/> instead) .
Simply add the following to the end of your variable and all will be well!

.replace(/(\r\n)/g, "<br/>");

Read More

Tuesday, July 11, 2006

ASP.NET Web.Config from IIS

No comments:
Just a little tip for those that dont like hacking the XML in web.config on ASP.NET 2.0 projects manually theres a handy little tool built into IIS:
If you right click on the website in IIS then click properties then go to the ASP.NET tab theres a button at the bottom called Edit Configuration, if you go in there theres a nice little interface for the web.config file which saves you hacking the XML directly!
Read More

Tuesday, July 04, 2006

RSS XML Stylesheet Example

No comments:

Some time ago I was working for a client who required their CMS system to output particular items as RSS feeds. The CMS output XML and used XSLT to tranform to HTML. This provided a very handy mechanism indeed for conversion to RSS.

 

My final solution used a stylesheet to simply take the XML from the CMS and convert it to an RSS 2.0 format feed rather than HTML! Below I have rewritten the stylesheet (adding a few flourishes) which should be easily adaptable and fairly generic for this type of conversion as long as the XML provides the following attributes in a fairly sensible format!

 

XML Needs to contain the following items for the feed:

    TITLE OF FEED

    LINK TO FEED HOMEPAGE

    DESCRIPTION OF FEED

    COPYRIGHT NOTICE

 

XML Needs to contain the following items for EACH ARTICLE:

    TITLE OF ARTICLE

    LINK TO ARTICLE

    DESCRIPTION OF ARTICLE

    CREATOR OF ARTICLE

    DATE OF ARTICLE

 

An eaxmple of how the XML might look is (it might not look at all like this in which case I might advise a pre-RSS xml conversion with XSL to bring it into line with the below and separate the XML conversion code form the XML-RSS code):

 

<data>

  <feed title="" link="description="" copyright="">

    <item>

     <title></title>

     <link></link>

     <description></description>

     <creator></creator>

     <date></date>

    </item>

    <item>

     <title></title>

     <link></link>

     <description></description>

     <creator></creator>

     <date></date>

    </item>

    <item>

     <title></title>

     <link></link>

     <description></description>

     <creator></creator>

     <date></date>

    </item>

  </feed>

</data>

 

And finally the actual stylesheet - obviously this could easily be extended to manage multiple feed xml but if I did it all here it'd take the fun out of it!

 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="no" encoding="unicode" omit-xml-declaration="yes" media-type="text/xml"/>

 

<xsl:template match="data">

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">

<channel>

  <title>TITLE OF FEED</title>

  <link>LINK TO FEED HOMEPAGE</link>

  <description>DESCRIPTION OF FEED</description>

  <language>en-gb</language>

  <dc:rights>COPYRIGHT NOTICE</dc:rights>

  <xsl:for-each select="ITEMNODESET">

  <item>

      <title>TITLE OF ARTICLE</title>

      <link>LINK TO ARTICLE</link>

      <description>DESCRIPTION OF ARTICLE</description>

      <dc:creator>CREATOR OF ARTICLE</dc:creator>

      <dc:date>DATE OF ARTICLE</dc:date>   

  </item>

  </xsl:for-each>

</channel>

</rss>           

</xsl:template>

</xsl:stylesheet>

 

 

Read More

XSLT Replace Template

No comments:
I was working on a site today that required me to split a string in the form of a=1;b=2;c=3 in xsl. Now xsl does provide a translate() function but it doesn't traverse the whole string doing a normal replacement as you might expect. Instead a trawled the internet and found the following little template which nicely recurses through and does the replacement. I thought I'd post it here so I can find it again - and share it with the world of course!
 

  <xsl:template name="replace">

    <xsl:param name="string" select="." />

    <xsl:choose>

      <xsl:when test="not($string)" />

      <xsl:when test="contains($string, ';')">

        <xsl:value-of select="substring-before($string, ';')" />

        <br />

        <xsl:call-template name="replace">

          <xsl:with-param name="string" select="substring-after($string, ';')" />

        </xsl:call-template>

      </xsl:when>

      <xsl:otherwise>

        <xsl:value-of select="$string" />

        <br />

      </xsl:otherwise>

    </xsl:choose>

  </xsl:template>

 

All you need do is call the template and pass your input into with $string param, in my case this was the ";". Then replace the <br/> tags with whatever you need to replace your input string with - easy!

Read More

Monday, July 03, 2006

Email Blog Entry

1 comment:
Again Im new to all this blogging lark and now Ive had it for a while I thought I'd checkout some of the extended capabilities - like emailing in this entry! See you all again soon!
Oh I've also allowed comments from everyone (not just registered users) so lets see if we can get some kinda flame ware on the go eh? ;oP

Read More

Enmus, Enum Sets, parsing n' stuff

No comments:
Recently I have started keeping track of some industry leading developers and what they're up to via their weblogs. One very active blogger is Rick Strahl who really knows his stuff - anyway todya I noticed he'd posted a very good guide to using Enum's - far far superior to my one liner about recursing through them so I thought Id post a link here and share!

http://west-wind.com/weblog/posts/6222.aspx
Read More

Tuesday, June 27, 2006

Real Japanese Name!

No comments:

Ok so I was bored and thought this was erm...cool?


My japanese name is 黒田 Kuroda (black field) 海斗 Kaito (big dipper of the ocean).
Take your real japanese name generator! today!
Created with Rum and Monkey's Name Generator Generator.

Read More

Thursday, June 22, 2006

foreach Item in Enumerator?!

No comments:
This is just a quick snippet but the other day I was trying to do a foreach thru an Enumerator, after a llittle tinkering and enquiry with our resident guru I was provided with this nasty looking bit of code that works like a charm - basically all it does is push the contents of the Enum into an Array, Array supporting the IEnumerable interface of course makes it easy to foreach thru!

Array Attributes = Enum.GetValues(typeof(Enumerator));
Read More