<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title></title>
	<atom:link href="http://cognize2k.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cognize2k.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 06 May 2008 11:30:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cognize2k.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title></title>
		<link>http://cognize2k.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cognize2k.wordpress.com/osd.xml" title="" />
	<atom:link rel='hub' href='http://cognize2k.wordpress.com/?pushpress=hub'/>
		<item>
		<title>ASP.NET / C# Image Optimization</title>
		<link>http://cognize2k.wordpress.com/2008/05/06/aspnet-c-image-optimization/</link>
		<comments>http://cognize2k.wordpress.com/2008/05/06/aspnet-c-image-optimization/#comments</comments>
		<pubDate>Tue, 06 May 2008 11:30:41 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://cognize2k.wordpress.com/?p=16</guid>
		<description><![CDATA[ASP.NET Image Optimization Code Original Source: private void btnSubmitImage_Click(object sender,EventArgs e) { // get the stream of data for the image from a server-side Form with an control with an ID of inputUserSubmission int length = (int)inputUserSubmission.PostedFile.InputStream.Length; byte[] imageBits = new byte[length]; // read the digital bits of the image into the byte array inputUserSubmission.PostedFile.InputStream.Read(imageBits,0,length); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=16&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ASP.NET Image Optimization Code</p>
<p>Original Source: <a href="http://weblogs.asp.net/jasonsalas/archive/2004/07/31/202705.aspx"></p>
<pre>
private void btnSubmitImage_Click(object sender,EventArgs e)

{

    // get the stream of data for the image from a server-side Form with an  control with an ID of inputUserSubmission

    int length = (int)inputUserSubmission.PostedFile.InputStream.Length;

    byte[] imageBits = new byte[length];

    // read the digital bits of the image into the byte array

    inputUserSubmission.PostedFile.InputStream.Read(imageBits,0,length);

    // save the byte array as a Bitmap object

    MemoryStream ms = new MemoryStream();

    ms.Write(imageBits,0,imageBits.Length);

    Bitmap unrenderedImage = new Bitmap(ms);

    ms.Close();

    // manipulate the image according to the specification and save it to the database

    WarpImageDimensions(unrenderedImage);

}

private void WarpImageDimensions(Bitmap imageToSave)

{

    /* RE-SIZE THE IMAGE ACCORDING TO A FIXED WIDTH OF 350 PIXELS */

    Bitmap resizedImage = ResizeSubmittedImage(imageToSave);

    /* SET THE RESOLUTION OF THE IMAGE TO 72dpi */

    const float res = 72;

    resizedImage.SetResolution(res,res);

    /* SET THE INTERPOLATION MODE */

    Graphics g = Graphics.FromImage(resizedImage);

    g.InterpolationMode = InterpolationMode.HighQualityBicubic;

    /* RE-SET THE IMAGE'S COMPRESSION QUALITY TO "30" */

    EncoderParameters encoderParams = new EncoderParameters();

    long[] quality = new long[1];

    quality[0] = 30;

    EncoderParameter ep = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality,quality);

    encoderParams.Param[0] = ep;

    ImageCodecInfo[] arrayICI = ImageCodecInfo.GetImageEncoders();

    ImageCodecInfo jpegICI = null;

    for(int x=0;x&lt;arrayICI.Length;x++)

    {

        if(arrayICI[x].FormatDescription.Equals("JPEG"))

        {

            jpegICI = arrayICI[x];

            break;

        }

    }

    MemoryStream mem = new MemoryStream();

    resizedImage.Save(mem,jpegICI,encoderParams);

    /* SAVE THE IMAGE TO THE DATABASE AS A BINARY BYTE ARRAY */

    byte[] bits = mem.ToArray();

    // do database INSERT operations into DB field of type IMAGE here

    mem.Close();

    g.Dispose();

}

private Bitmap ResizeSubmittedImage(Bitmap bmpIn)

{

    // re-size a submitted image while maintaining its aspect ratio

    Bitmap bmpOut = null;

    int newHeight = 0;

    int newWidth = 0;

    const int fixedWidth = 350;

    const int fixedHeight = 200;

    decimal ratio;

    // if the image is too small, then just use it as is

    if(bmpIn.Width &lt; fixedWidth)

    {

        ratio = (decimal)fixedHeight/bmpIn.Height;

        newWidth = Convert.ToInt32(ratio*bmpIn.Width);

        newHeight = fixedHeight;

    }

    else

    {

        ratio = (decimal)fixedWidth/bmpIn.Width;

        newHeight = Convert.ToInt32(ratio*bmpIn.Height);

        newWidth = fixedWidth;

    }

    bmpOut = new Bitmap(newWidth,newHeight);

    Graphics g = Graphics.FromImage(bmpOut);

    g.FillRectangle(Brushes.White,0,0,newWidth,newHeight);

    g.DrawImage(bmpIn,0,0,newWidth,newHeight);

    bmpIn.Dispose();

    return bmpOut;

}
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=16&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/05/06/aspnet-c-image-optimization/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple C# Delegate Example</title>
		<link>http://cognize2k.wordpress.com/2008/05/05/simple-c-delegate-example/</link>
		<comments>http://cognize2k.wordpress.com/2008/05/05/simple-c-delegate-example/#comments</comments>
		<pubDate>Mon, 05 May 2008 16:23:00 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://cognize2k.wordpress.com/?p=15</guid>
		<description><![CDATA[Simple example of passing a delegate to a method to extend the functionality of the recieving method. This allows us to reuse the code in the recieving method since it can be combined with the method passed with the delegate to produce new functionality. using System; using System.Collections.Generic; using System.Text; // Delegates are used here [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=15&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Simple example of passing a delegate to a method to extend the functionality of the recieving method. This allows us to reuse the code in the recieving method since it can be combined with the method passed with the delegate to produce new functionality.</p>
<pre>
using System;
using System.Collections.Generic;
using System.Text;

// Delegates are used here to provide a method containing common functionality
// a way of using a method passed in (via a delegate) to extend functionality.
// This is a way of re using code since common functionality is extended via
// the use of delegates that pass in specialist functionality

    public class UserClass
    {
        // Method that takes a delegate as a parameter and uses it to complete its work
        public void ReturnText(ProcessDelegate newDelegate)
        {
            string stubString = "Stub ";

            string getDelegateResponse = newDelegate();

            stubString += getDelegateResponse;

            Console.WriteLine( stubString );
        }
    }

    public delegate string ProcessDelegate();

    public class MainClass
    {
        // Instance method to be passed to delegate
        string AppendText()
        {
            Random random = new Random();

            string txt = "";

            txt += random.Next(0, 100000).ToString();

            return txt;
        }

        // Static method to be passed to delegate
        static string StaticAppendText()
        {
            Random random = new Random();

            string txt = "";

            txt += random.Next(0, 100000).ToString();

            txt += (" (Static)");

            return txt;
        }

        static void Main(string[] args)
        {
            // Create an instance of the class which contains a method that uses a delegate
            UserClass newUserClass = new UserClass();

            // Call the user class's method passing a methed of an instance object
            MainClass newMainClass = new MainClass();
            newUserClass.ReturnText(new ProcessDelegate(newMainClass.AppendText));

            // Call the user class's method passing a static method
            newUserClass.ReturnText(new ProcessDelegate(StaticAppendText));

            Console.ReadLine();
        }
    }
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=15&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/05/05/simple-c-delegate-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple JavaScript Image Preloader</title>
		<link>http://cognize2k.wordpress.com/2008/05/05/simple-javascript-image-preloader/</link>
		<comments>http://cognize2k.wordpress.com/2008/05/05/simple-javascript-image-preloader/#comments</comments>
		<pubDate>Mon, 05 May 2008 16:18:21 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript Image Preloader]]></category>

		<guid isPermaLink="false">http://cognize2k.wordpress.com/?p=14</guid>
		<description><![CDATA[Add this code at the bottom of the page, creating a new variable for each image you wish to be preloaded. function ImagePreloader( imgSrc ) { var preloadedImage = new Image; preloadedImage.src = imgSrc; } Cognize Web Design Services<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=14&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Add this code at the bottom of the page, creating a new variable for each image you wish to be preloaded.</p>
<pre>
function ImagePreloader( imgSrc )
{
    var preloadedImage = new Image;

    preloadedImage.src = imgSrc;

}
</pre>
<p><a href="http://www.cognize.co.uk">Cognize Web Design Services</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=14&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/05/05/simple-javascript-image-preloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Search Engine Optimization Easy Guide</title>
		<link>http://cognize2k.wordpress.com/2008/03/26/search-engine-optimization-easy-guide/</link>
		<comments>http://cognize2k.wordpress.com/2008/03/26/search-engine-optimization-easy-guide/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 13:00:54 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[Search Engine Optimisation]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Site Promotion]]></category>

		<guid isPermaLink="false">http://www.cognize.co.uk/cog_blog/?p=18</guid>
		<description><![CDATA[This guide will see you through the search engine optimization (SEO) process from code to upload, with a no-nonsense explanation of each technique, and direct links to the resources you need. First off, here are two myths that need to be dispelled: 1st Myth: There are &#8216;tricks&#8217; that can get you to the top of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=12&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1></h1>
<h3>This guide will see you through the search engine optimization (SEO) process from code to upload, with a no-nonsense explanation of each technique, and direct links to the resources you need.</h3>
<p style="margin-top:20px;font-weight:bold;">First off, here are two myths that need to be dispelled:</p>
<p style="font-weight:bold;">1st Myth: There are &#8216;tricks&#8217; that can get you to the top of major search engine rankings.</p>
<p>Whilst I&#8217;m going to show you how to optimise your site to give you the best possible chance off appearing high up in the search rankings, you need to be aware that Google, and Yahoo have been successful by making an art form out of suppressing spam techniques, and thereby producing the most relevant results for their users.</p>
<p>In short, they are very practiced at spotting deliberate attempts to deceive the web crawlers, and may even penalise your site if it severely breaks the rules.</p>
<p style="font-weight:bold;">2nd Myth: You need to pay &#8216;expert&#8217; to help you achieve the highest possible placement in the Search Engine rankings.</p>
<p>Of course there&#8217;s plenty of best practices to follow, and a good understanding of how the search engines work will be an asset to you, but this is no harder than getting a decent grasp on best usability practices, or how to design an accessible site. Follow this guide, and you&#8217;ll be covering pretty much everything an SEO expert would suggest.</p>
<p><a name="rule_1" title="rule_1"></a></p>
<h2>Rule Numero Uno</h2>
<p><span style="font-weight:bold;">After all is said and done, the most important thing you can do to boost your sites rankings is to get other search engine indexed web pages to link your site.</span></p>
<p>Do not however use special services that offer to link your site on loads of other web sites. They&#8217;re scams at the end of the day, and the search engines are wise to it. You might even hurt your rankings by using these services.</p>
<p>Now that&#8217;s out of the way let&#8217;s fine tune your site, because every little helps&#8230;..</p>
<p><a name="in_your_web_pages" title="in_your_web_pages"></a></p>
<h2>Code to Include In Your Web Pages</h2>
<p>Before we run off scouring the web for bit part search engines to suggest our lovely new site to, let&#8217;s get our web pages sorted first. We&#8217;re going to make them search engine friendly.</p>
<p><span style="font-weight:bold;">1. Start with the file name, and make it meaningful.</span> Rather than call your page &#8216;cogSEO2.html&#8217;, use some proper words, hyphens and underscores and try something like &#8216;cognize_seo_optimization_guide.html&#8217;.</p>
<p><span style="font-weight:bold;">2. Give every page a meaningful &lt;title&gt; tag.</span> Put your site name in by all means, but add a little information after, up to about 70 characters.</p>
<p><span style="font-weight:bold;">3. Add in relevant &lt;meta&gt; information.</span> Two very common meta tags are the ones that provide the description of the page and keywords.</p>
<p>Whilst you may think that these two tags might be just the thing to get you shooting to the top of google, the historic abuse of keywords has limited the attention that the search engine bots will pay to them. If you do use the keyword meta tag, be careful not to spam. This may be considered bad practice by the search bots and harm your ranking.</p>
<p>The description meta tag also has limited use for ranking purposes. What it will do however is dictate the way that you want your page to be described in the search engine results. If this suits, then you may want to use this meta tag.</p>
<pre>&lt;meta name="Description" content="Cognize -  a web developers resource."&gt;</pre>
<pre>&lt;meta name="Keywords" content="html, css, javascript,  web design, web design,</pre>
<pre>article, tutorials, resource, programs,  internet, web, cognize, coding,</pre>
<pre>code, script, form, validate,  w3c, w3, mozilla, mdc, lint, debugger, search"&gt;</pre>
<p>Other meta tags you can use are shown below. Meta tags are not essential however, the search engines will still make sense of your site. Use them at your own discretion.</p>
<pre>&lt;meta name="author" content="me"&gt;</pre>
<pre>&lt;meta name="subject" content="Web Development, Design, Consulting"&gt;</pre>
<pre>&lt;meta name="Classification" content="Cognize - a web  developers resource." &gt;</pre>
<pre>&lt;meta name="Geography" content="Your Full Address"&gt; &lt;meta name="Language"</pre>
<pre>content="English"&gt;</pre>
<pre>&lt;meta http-equiv="Expires" content="never"&gt; &lt;meta name="Copyright"</pre>
<pre>content="Cognize.co.uk"&gt;</pre>
<pre>&lt;meta name="Designer" content="me"&gt; &lt;meta name="Publisher"</pre>
<pre>content="http://Cognize.co.uk"&gt;</pre>
<pre>&lt;meta name="Revisit-After" content="1"&gt; &lt;meta name="distribution"</pre>
<pre>content="Global"&gt;</pre>
<pre>&lt;meta name="city" content ="My City"&gt;</pre>
<pre>&lt;meta name="country" content ="England, UK, United Kingdom,</pre>
<pre>Britain, Great Britain"&gt;</pre>
<p>A good automatic meta tag generator can be found at <a href="http://www.seochat.com/seo-tools/advanced-meta-tag-generator">SEO Tools</a>.</p>
<p style="font-weight:bold;">4. Create a site-map.html page and link to it from every page.</p>
<p>You should create and maintain a file named site-map.html, place it in the root directory, and link to it from every page on your site. Make the links to the page and on the page basic &lt;a&gt; link tags to ensure that the bots to not have any problems in accessing the file. This is a good way of ensuring that the whole of your site is crawlable.</p>
<p style="font-weight:bold;">5. Follow Usability and Accessibility best practices, they also help search engines.</p>
<p>Basic rules really, all the little things that make your web site more accessible to special browsers such as using the alt attribute for images or using html links rather than dynamically created ones.</p>
<p>Providing html alternatives where other technologies are used all help the search bots crawl your site more easily. If you are able to check your web site in Lynx, that may give you a good vision of how a search bot sees your site. If you use images, make the alt tags descriptive, using around 7 words if you can.</p>
<p style="font-weight:bold;">6. Add multiple basic html links to the main areas of your site on all pages.</p>
<p><span style="font-weight:bold;">7. Make your page content rich.</span> Some search engines test the ratio of code to text on your page. The more text, the more content rich the page will be considered, thus improving your ranking. Write pages that clearly and accurately describe your content.</p>
<p><span style="font-weight:bold;">8. When adding text and content to your page, think about keywords.</span> Some of the SEO tools suggested later will help you to work out which are the best keywords. The keywords in the meta data are often ignored, but those in your content will not be.</p>
<p><span style="font-weight:bold;">9. Check the page for broken links.</span> If the links to a page are broken, a search bot might not be able to reach them. The <a target="_blank" href="http://validator.w3.org/checklink">W3C link checker</a> can check online sites automatically.</p>
<p><a name="in_your_web_space" title="in_your_web_space"></a></p>
<h2>In your web space</h2>
<p>There are two main types of file you can include in your web space that can help to guide search bots through your site.</p>
<p><span style="font-weight:bold;">1. Add a &#8216;sitemap.xml&#8217; file.</span></p>
<p>This is a site map in a special recognised format (XML) especially for search engines. It should be placed at the highest level in your website (i.e. in your root directory).</p>
<p>Here is an example:</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</pre>
<pre>&lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt;</pre>
<pre>&lt;url&gt;</pre>
<pre>&lt;loc&gt;http://www.cognize.co.uk/&lt;/loc&gt;</pre>
<pre>&lt;changefreq&gt;daily&lt;/changefreq&gt;</pre>
<pre>&lt;priority&gt;0.7&lt;/priority&gt;</pre>
<pre>&lt;/url&gt;</pre>
<pre>&lt;url&gt;</pre>
<pre>&lt;loc&gt;http://www.cognize.co.uk/resources.html&lt;/loc&gt;</pre>
<pre>&lt;changefreq&gt;daily&lt;/changefreq&gt;</pre>
<pre>&lt;priority&gt;0.5&lt;/priority&gt;</pre>
<pre>&lt;/url&gt;</pre>
<pre>&lt;/urlset&gt;</pre>
<p>You can copy this code exactly, change the urls in the &lt;loc&gt;, &lt;changefreq&gt; and &lt;priority&gt; tags, and this will be enough to help the search bot check all of the pages you specify in your site, even if it struggles with the links for some reason.</p>
<p>As a quick guide, &lt;loc&gt;, refers to the URL of the page.</p>
<p>&lt;changefreq&gt; tells the search bot how often the page changes. Example options are &#8216;daily&#8217; &#8216;weekly&#8217; or &#8216;monthly&#8217;.</p>
<p>&lt;priority&gt; Tells the search bot how important this page is in the context of your site. Values range from 0 to 1. Putting 1 for every page will not increase the ranking of your site, it is only relevant to the page your on.</p>
<p>There are other tags and options you can use, although they are beyond the scope of this guide. For complete information on site maps, visit <a target="_blank" href="https://www.google.com/webmasters/tools/docs/en/protocol.html">Google Site Maps Protocol</a>.</p>
<p>If you want a short cut, a nice little xml sitemap generator can be found here <a target="_blank" href="http://www.xml-sitemaps.com/">xml-sitemaps.com</a>.</p>
<p style="font-weight:bold;">2. Add in a file named robots.txt</p>
<p>A robots.txt file placed in your root directory will give a search bot a little more info. If you would like the bot not to crawl certain pages, maybe because they aren&#8217;t particularly relevant to incoming searches, then this the way to do it.</p>
<p>Again, a full blown explanation of exactly how these files work is beyond the scope of this guide, but full documentation can be found on <a target="_blank" href="http://www.google.com/support/webmasters/bin/answer.py?answer=40360">Google&#8217;s robots.txt guide</a></p>
<p>For now, here is an example of a robots.txt file that you can place in your web space. It&#8217;s very simple, this is the contents of a (very short) complete file asking the bot not to check the directory named &#8216;boring&#8217;, because, well it&#8217;s boring!</p>
<pre>User-Agent: *  Disallow: /boring/</pre>
<p><a name="putting_it_out" title="putting_it_out"></a></p>
<h2>Putting it Out There</h2>
<p>To make things easy for you, here is a list of the main search engines that you will want to submit your site to. You may have to satisfy certain conditions before they will index your pages. For example, you will need to sign up for a Google account if you want to use their stats system to check how your site is doing.</p>
<p>Please note that even with submission, it can take the search engines a little while to get around to your site, we&#8217;re talking weeks. If however you&#8217;ve followed the rules so far, you should find it&#8217;s probably quicker than that, especially if you can get links to your site into web pages that are already indexed.</p>
<p>Google <a href="https://www.google.com/webmasters/tools/siteoverview">https://www.google.com/webmasters/tools/siteoverview</a></p>
<p>Yahoo <a href="https://siteexplorer.search.yahoo.com/submit">https://siteexplorer.search.yahoo.com/submit</a></p>
<p>MSN <a href="http://search.msn.com.sg/docs/submit.aspx">http://search.msn.com.sg/docs/submit.aspx</a></p>
<p>LIVE <a href="http://search.live.com/docs/submit.aspx">http://search.live.com/docs/submit.aspx</a></p>
<p>Open Director Project <a href="http://www.dmoz.org/">http://www.dmoz.org/</a></p>
<p>AltaVista Included uses the Yahoo engine, so no need to submit to this one.</p>
<p>Ask Jeeves included in Teoma, which you can not manually submit to.</p>
<h2>Checking Your Position and More Fine Tuning</h2>
<p>Once you&#8217;ve completed the above, you can start using more tools to check how your sites doing.</p>
<p>Some great SEO resources for webmasters can be found here:</p>
<p><a href="http://www.seochat.com/">SEO Chat</a></p>
<p><a href="http://www.selfseo.com/">Self SEO</a></p>
<p><a href="http://www.google.co.uk/webmasters/">Google Web Masters</a></p>
<h2>The Final Word</h2>
<p>We started with it and so we&#8217;ll finish with it, because it can&#8217;t be emphasised enough:</p>
<p style="font-weight:bold;">Get as many incoming links to your site as you can. If you maintain other sites, have them link to one another.</p>
<p>It all helps!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=12&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/03/26/search-engine-optimization-easy-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Lotto Number Generator Form Class (C# .NET)</title>
		<link>http://cognize2k.wordpress.com/2008/03/26/lotto-number-generator-form-class-c-net/</link>
		<comments>http://cognize2k.wordpress.com/2008/03/26/lotto-number-generator-form-class-c-net/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 10:17:15 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Lotto]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Random number generator]]></category>
		<category><![CDATA[unique random]]></category>

		<guid isPermaLink="false">http://www.cognize.co.uk/cog_blog/?p=15</guid>
		<description><![CDATA[This code demonstrates another way to generate unique random numbers, using an if statement in nested for loops to check and reassign numbers where it is found they have already been selected. Not to the most graceful way of going about this, but works none the less. There is another random number generator class in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=11&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This code demonstrates another way to generate unique random numbers, using an if statement in nested for loops to check and reassign numbers where it is found they have already been selected.</p>
<p>Not to the most graceful way of going about this, but works none the less. There is another random number generator class in this blog which is a bit neater.</p>
<p>Download Code File: <a href="http://www.cognize.co.uk/cog_blog/wp-content/uploads/2008/03/lottoform.cs" title="LottoForm.cs">LottoForm.cs</a></p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Windows.Forms;</p>
<p>namespace Lotto<br />
{<br />
public partial class LottoForm : Form<br />
{<br />
public LottoForm()<br />
{<br />
InitializeComponent();<br />
}</p>
<p>Random m_random = new Random();</p>
<p>int[] selectedNumbers = new int[7];</p>
<p>private void goButton_Click(object sender, EventArgs e)<br />
{<br />
// For each array member, assign a random number<br />
for (int numberCount = 0; numberCount &lt; selectedNumbers.Length; numberCount++)<br />
{</p>
<p>int newNumber = m_random.Next(1, 50);</p>
<p>for (int i = 0; i &lt; numberCount; i++)<br />
{<br />
if (newNumber == selectedNumbers[i])<br />
{<br />
// MessageBox.Show(&#8220;A duplicate (&#8221; + newNumber + &#8220;) has occured&#8221;);<br />
newNumber = m_random.Next(1, 50); // Assign a new number<br />
// MessageBox.Show(&#8220;Replacing with &#8221; + newNumber);<br />
continue; // Test again<br />
}<br />
}</p>
<p>selectedNumbers[numberCount] = newNumber;</p>
<p>}</p>
<p>// Place the bonus number in the 7th space before sorting</p>
<p>textBox7.Text = selectedNumbers[6].ToString();</p>
<p>// Create and populate intemediary array which we can exclude the bonus number from<br />
int[] nonBonusNumbersArray = new int[6];</p>
<p>for (int x = 0; x &lt; nonBonusNumbersArray.Length; x++)<br />
{<br />
nonBonusNumbersArray[x] = selectedNumbers[x];<br />
}</p>
<p>// Sort the intemediary array<br />
Array.Sort(nonBonusNumbersArray);</p>
<p>// Place sorted numbers in non bonus text boxes<br />
textBox1.Text = nonBonusNumbersArray[0].ToString();<br />
textBox2.Text = nonBonusNumbersArray[1].ToString();<br />
textBox3.Text = nonBonusNumbersArray[2].ToString();<br />
textBox4.Text = nonBonusNumbersArray[3].ToString();<br />
textBox5.Text = nonBonusNumbersArray[4].ToString();<br />
textBox6.Text = nonBonusNumbersArray[5].ToString();</p>
<p>label9.Text = &#8220;&#8221;;<br />
label9.Text += &#8220;Your new numbers are: \n\n&#8221;;<br />
label9.Text += nonBonusNumbersArray[0].ToString();<br />
label9.Text += &#8220;, &#8220;;<br />
label9.Text += nonBonusNumbersArray[1].ToString();<br />
label9.Text += &#8220;, &#8220;;<br />
label9.Text += nonBonusNumbersArray[2].ToString();<br />
label9.Text += &#8220;, &#8220;;<br />
label9.Text += nonBonusNumbersArray[3].ToString();<br />
label9.Text += &#8220;, &#8220;;<br />
label9.Text += nonBonusNumbersArray[4].ToString();<br />
label9.Text += &#8220;, &#8220;;<br />
label9.Text += nonBonusNumbersArray[5].ToString();<br />
label9.Text += &#8221; (Bonus: &#8220;;<br />
label9.Text += selectedNumbers[6].ToString();<br />
label9.Text += &#8220;)&#8221;;</p>
<p>}</p>
<p>}<br />
}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=11&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/03/26/lotto-number-generator-form-class-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Unique Random Number Generator Class (C# .NET)</title>
		<link>http://cognize2k.wordpress.com/2008/03/26/unique-random-number-generator-class-c-net/</link>
		<comments>http://cognize2k.wordpress.com/2008/03/26/unique-random-number-generator-class-c-net/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 10:00:49 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Generator]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Unique random numbers]]></category>

		<guid isPermaLink="false">http://www.cognize.co.uk/cog_blog/?p=13</guid>
		<description><![CDATA[This is a class for generating an absolute unique random number. The class works by removing selected numbers from a list once they&#8217;ve been selected, so it&#8217;s impossible for them to be selected again, thus making it possible to simulate real life random number selection in lottery type scenarios. Pass the maximum and minimum numbers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=10&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a class for generating an absolute unique random number. The class works by removing selected numbers from a list once they&#8217;ve been selected, so it&#8217;s impossible for them to be selected again, thus making it possible to simulate real life random number selection in lottery type scenarios.</p>
<p>Pass the maximum and minimum numbers that you would like returned from the class to the constructor when creating the object.</p>
<p>Download Code File: <a href="http://www.cognize.co.uk/cog_blog/wp-content/uploads/2008/03/generateuniquerandomnumber.cs" title="GenerateUniqueRandomNumbers.cs">GenerateUniqueRandomNumbers.cs</a></p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Text;</p>
<p>/// &lt;summary&gt;<br />
/// Class for generating unique random numbers within a given range. Removes numbers from list<br />
/// once chosen from an instance of an object so that it is impossible for them to be selected again.<br />
/// &lt;/summary&gt;<br />
public class GenerateUniqueRandomNumber<br />
{<br />
Random m_random = new Random();</p>
<p>int m_newRandomNumber = 0;</p>
<p>List&lt;int&gt; RemainingNumbers;</p>
<p>// Constructor<br />
public GenerateUniqueRandomNumber( int requiredRangeLow, int requiredRangeHi )<br />
{<br />
// Get the range<br />
int range = (requiredRangeHi &#8211; requiredRangeLow);</p>
<p>// Initialise array that will hold the numbers within the range<br />
int[] rangeNumbersArr = new int[range + 1];</p>
<p>// Assign array element values within range<br />
for (int count = 0; count &lt; rangeNumbersArr.Length; count++)<br />
{<br />
rangeNumbersArr[count] = requiredRangeLow + count;<br />
}</p>
<p>// Initialize the List and populate with values from rangeNumbersArr<br />
RemainingNumbers = new List&lt;int&gt;();<br />
RemainingNumbers.AddRange(rangeNumbersArr);<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// This method returns a random integer within the given range. Each call produces a new random number<br />
/// &lt;/summary&gt;<br />
/// &lt;returns&gt;&lt;/returns&gt;<br />
public int NewRandomNumber()<br />
{<br />
if (RemainingNumbers.Count != 0)<br />
{<br />
// Select random number from list<br />
int index = m_random.Next(0, RemainingNumbers.Count);<br />
m_newRandomNumber = RemainingNumbers[index];</p>
<p>// Remove selected number from Remaining Numbers List<br />
RemainingNumbers.RemoveAt(index);</p>
<p>return m_newRandomNumber;<br />
}<br />
else<br />
{<br />
throw new System.InvalidOperationException(&#8220;All numbers in the range have now been used. Cannot continue selecting random numbers from a list with no members.&#8221;);<br />
}<br />
}<br />
}</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=10&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/03/26/unique-random-number-generator-class-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>A Couple of Quick Tips on Setting Up IIS 5 (XP)</title>
		<link>http://cognize2k.wordpress.com/2008/03/25/a-couple-of-quick-tips-on-setting-up-iis-5-xp/</link>
		<comments>http://cognize2k.wordpress.com/2008/03/25/a-couple-of-quick-tips-on-setting-up-iis-5-xp/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 00:32:11 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.cognize.co.uk/cog_blog/?p=11</guid>
		<description><![CDATA[It&#8217;s not always obvious whats up with IIS if all not going according to plan. The error messages are not always as clear as they could be. None of it&#8217;s that tricky once you&#8217;ve set up a couple of sites, however, there are some things to watch out for:  1. IIS 5 must be installed before [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=9&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not always obvious whats up with IIS if all not going according to plan. The error messages are not always as clear as they could be. None of it&#8217;s that tricky once you&#8217;ve set up a couple of sites, however, there are some things to watch out for:</p>
<p> 1. IIS 5 must be installed before you  install the .NET framework. Lots of problems arise if the two components are not installed in that order. It&#8217;s probably advisable to reinstall any instances of SQL Server that you&#8217;ll be using too.</p>
<p> 2. Make sure that anonymous access is enabled. Default Website &gt; Properties &gt; Directory security.</p>
<p> 3. If you want to put your application at a level higher than wwwroot (e.g. wwwroot/mysite/default.aspx), then you need to set up a virtual directory, even if it&#8217;s just going to be the same name. This is because it is an error to place a web.config file at a level higher than the application root.</p>
<p> This page explains how to set up a virtual directory in IIS 4 or 5:</p>
<p> <a href="http://www.microsoft.com/technet/security/prodtech/IIS.mspx" id="bx">http://www.microsoft.com/technet/security/prodtech/IIS.mspx</a></p>
<p> With these simple rules adhered to, you should be able to start testing your C# or VB web pages.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=9&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/03/25/a-couple-of-quick-tips-on-setting-up-iis-5-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Porting Visual Studio .mdf Database File to SQL Server &#8211; ASP.NET</title>
		<link>http://cognize2k.wordpress.com/2008/03/25/10/</link>
		<comments>http://cognize2k.wordpress.com/2008/03/25/10/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 00:16:08 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.cognize.co.uk/cog_blog/?p=10</guid>
		<description><![CDATA[There is some confusing information out there on how to get your development database from visual studio into SQL Server so that you can run an ASP.NET website through IIS. I&#8217;ve spent a whole evening getting this sorted and now am writing down explicit instructions on how I did it so that I (and hopefully [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=8&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is some confusing information out there on how to get your development database from visual studio into SQL Server so that you can run an ASP.NET website through IIS.</p>
<p>I&#8217;ve spent a whole evening getting this sorted and now am writing down explicit instructions on how I did it so that I (and hopefully you don&#8217;t have to spend time doing this again).</p>
<p>Prerequisites:</p>
<p>A database file in .mdf format.</p>
<p>IIS (Tested on IIS 5)</p>
<p>SQL Sever</p>
<p>SQL Server Management Studio Express (Free)</p>
<p>Download Link:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&amp;displaylang=en</a></p>
<p>1. In your web.config file, change the connection string to the following, replacing the database name and connection string name:</p>
<p>2. Attach the mdf file to SQL server by right clicking the databases node, selecting attach, and pointing to the .mdf file from Visual Studio. This will be deleted later, bear with me.</p>
<p>3. Create a back up of that attached database by right clicking the database name, going to tasks, then back up.</p>
<p>4. Back up as prompted and make a note of the back up location. The back up will create a back up file in format .bak.</p>
<p>5. Delete the attached data base.</p>
<p>6. Create a NEW (as opposed to attached) database in SQL Server management studio express by right clicking databases node and selecting new database.</p>
<p>7. Give the new database the same name as your .mdf file, excluding the extension.</p>
<p>8. You are given the opportunity to assign owners. Play around a bit here. I selected all available options here, which through an error, but some owners stuck anyway, so don&#8217;t worry too much here ( a security expert may say other wise! ). Roles are added via queries in a minute so this might not even be necessary.</p>
<p>9. Back in the tree view, click the new database name node, go to tasks again, and select restore.</p>
<p>10. Point to the recently created back up file and restore.</p>
<p>11. Now for some trickery pokery. We need to configure security for SQL server. In SQL Server management studio express, you can execute queries against your database. Type in the following queries one at a time only replacing machineName and databaseName. This will be the name of the windows pc you are installing the application on.</p>
<p>EXEC sp_grantlogin &#8216;machineName\ASPNET&#8217;</p>
<p>USE databaseName</p>
<p>EXEC sp_addrolemember &#8216;dbowner&#8217;, &#8216;machineName\ASPNET&#8217;</p>
<p>USE databaseName</p>
<p>EXEC sp_grantlogin &#8216;machineName\ASPNET&#8217;</p>
<p>That&#8217;s it. With some luck you should be good to go here!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=8&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/03/25/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending E-mail From C# Class Using G-mail</title>
		<link>http://cognize2k.wordpress.com/2008/03/24/sending-e-mail-from-c-class-using-g-mail/</link>
		<comments>http://cognize2k.wordpress.com/2008/03/24/sending-e-mail-from-c-class-using-g-mail/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 18:28:04 +0000</pubDate>
		<dc:creator>cognize2k</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[G-Mail]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Send]]></category>

		<guid isPermaLink="false">http://www.cognize.co.uk/cog_blog/?p=8</guid>
		<description><![CDATA[Here is a complete C# class that can be used to send mail using a g-mail (Google mail) account. This has been tested as working today. I&#8217;ve used the web.config file to get authentication parameters and smtp server, but these can be replaced directly with strings if you like. Those strings will be: SmtpUser: Your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=7&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a complete C# class that can be used to send mail using a g-mail (Google mail) account. This has been tested as working today.</span></em></p>
<p>I&#8217;ve used the web.config file to get authentication parameters and smtp server, but these can be replaced directly with strings if you like. Those strings will be:</span></p>
<p>SmtpUser: Your gmail user name. SmtpPassword: Your gmail password. SmtpClient: smtp.gmail.com</p>
<p>Also worth noting is that the port used is 587 instead of 465. If 587 doesn&#8217;t work, try 465.</p>
<p>The Code:</p>
<pre style="font-size:0.7em;">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Net.Mail;
using System.Net;

///
/// Summary description for MailSender
///
public class MailSender
{

    // Constructor #1 for general text only messages
    ///
    /// Constructor for basic email sending, does not required that IsHtml bool is specified.
    ///
    ///
    ///
    ///
    ///
    public MailSender(string from, string to, string subject, string body)
    {
        m_from = from;
        m_to = to;
        m_subject = subject;
        m_body = body;

        SendMailGmail(m_from, m_to, m_subject, m_body, false);
    }

    // Constructor #2 with ability to specify isHtml as true for sending HTML email
    ///
    /// Constructor with optional IsHtml parameter for sending of HTML email.
    ///
    ///
    ///
    ///
    ///
    ///
    public MailSender(string from, string to, string subject, string body, bool isHtml )
    {
        m_from = from;
        m_to = to;
        m_subject = subject;
        m_body = body;

        SendMailGmail(m_from, m_to, m_subject, m_body, isHtml);
    }

    ///
    /// Send email method configured for use with gmail.
    ///
    /// From
    /// To
    /// Subject
    /// Body text
    /// IsHtml
    private void SendMailGmail(string from, string to, string subject, string body, bool isHtml)
    {
        // Code from: http://www.andreas-kraus.net/blog/aspnet-20-aka-systemnetmail-with-gmail/

        System.Net.Mail.MailMessage message = new MailMessage(from, to, subject, body);
        message.Priority = MailPriority.High;
        message.IsBodyHtml = isHtml;

        SmtpClient smtp = new SmtpClient();
        smtp.Host = m_smtpClient;

        smtp.Credentials = new System.Net.NetworkCredential(m_smtpUserName, m_smtpPassWord);
        smtp.EnableSsl = true;
        // Not the usual port but works
        smtp.Port = 587;
        smtp.Timeout = 10;

        try
        {
            smtp.Send(message);
        }
        catch (Exception ex)
        {
            // Send error but pass false to prevent looping error emails
            ErrorLogger errorLogger = new ErrorLogger(ex, false);
        }
    }

    private string m_from = "";
    private string m_to = "";
    private string m_subject = "";
    private string m_body = "";

    private string m_smtpClient = ConfigurationManager.AppSettings["SmtpClient"];
    private string m_smtpUserName = ConfigurationManager.AppSettings["SmtpUser"];
    private string m_smtpPassWord = ConfigurationManager.AppSettings["SmtpPassword"];
}</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cognize2k.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cognize2k.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cognize2k.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cognize2k.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cognize2k.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cognize2k.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cognize2k.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cognize2k.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cognize2k.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cognize2k.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cognize2k.wordpress.com&amp;blog=3262958&amp;post=7&amp;subd=cognize2k&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cognize2k.wordpress.com/2008/03/24/sending-e-mail-from-c-class-using-g-mail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b03c1bbe1b34d6bd81940c552acc22d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cognize2k</media:title>
		</media:content>
	</item>
	</channel>
</rss>
