<?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>SourceFirst</title>
	<atom:link href="http://sourcefirst.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sourcefirst.wordpress.com</link>
	<description>Code Snippets and Samples</description>
	<lastBuildDate>Thu, 17 Feb 2011 09:19:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sourcefirst.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SourceFirst</title>
		<link>http://sourcefirst.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sourcefirst.wordpress.com/osd.xml" title="SourceFirst" />
	<atom:link rel='hub' href='http://sourcefirst.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SQL Crib Sheet</title>
		<link>http://sourcefirst.wordpress.com/2008/02/18/sql-crib-sheet/</link>
		<comments>http://sourcefirst.wordpress.com/2008/02/18/sql-crib-sheet/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 11:25:54 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[SQL 2000]]></category>
		<category><![CDATA[SQL 2005]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/?p=37</guid>
		<description><![CDATA[These notes are intended to provide a simplified crib sheet (or reminder) on SQL. It is not a tutorial. A number of examples for common types of tasks are provided &#8211; but little or no explanation. SQL &#8211; Structured Query Language &#8211; is a language understood by most database systems. Except where noted it is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=37&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These notes are intended to provide a simplified crib sheet (or reminder)  		on SQL. It is not a tutorial. A number of examples for common types of tasks  		are provided &#8211; but little or no explanation.</p>
<p>SQL &#8211; Structured Query Language &#8211; is a language understood by most database  		systems. Except where noted it is believed these SQL statements will work  		with Microsoft SQL Server, Oracle and MySQL.</p>
<h2><a title="Select" name="Select"></a>Select</h2>
<p>Return all records all columns in a table:</p>
<blockquote>
<pre>select * from <i>TableName</i></pre>
</blockquote>
<p>Return all records but only field1 and field2 in a table:</p>
<blockquote>
<pre>select <i>field1</i>, <i>field2</i> from <i>TableName</i></pre>
</blockquote>
<p>Return field1 for all records in a table with a specific value for field2:</p>
<blockquote>
<pre>select <i>field1</i> from <i>TableName</i> where field2=123</pre>
</blockquote>
<p>Return all records in a table where field1 is one of three possible values:</p>
<blockquote>
<pre>select * from <i>TableName</i> where <i>field1</i> in (<i>value1</i>,<i>value2</i>,<i>value3</i>)</pre>
</blockquote>
<p>Return the number of records in a table:</p>
<blockquote>
<pre>select count(*) from <i>TheTable</i></pre>
</blockquote>
<p>Return the number of records in a table with a specific value for field2:</p>
<blockquote>
<pre>select count(*) from <i>TableName</i> where <i>field2</i>=123</pre>
</blockquote>
<p>Simple join:</p>
<blockquote>
<pre>select * from <i>table1</i>, <i>table2</i>where <i>table1</i>.<i>field1</i>=<i>table2</i>.<i>fieldA</i></pre>
</blockquote>
<p>or</p>
<blockquote><p><code>select <i>table1</i>.<i>field1</i>, <i>table2</i>.<i>fieldA</i>  			from <i>table1</i>, <i>table2</i><br />
where <i>table1</i>.<i>field2</i>=<i>table2</i>.<i>fieldB</i></code></p></blockquote>
<p>or</p>
<blockquote><p><i><code>select table1.field1, table2.fieldA<br />
from table1 inner join table2 on table1.field2 = table2.fieldB</code></i></p></blockquote>
<p>Select all unique values in field1 from a table (not supported in  		MSAccess):</p>
<blockquote>
<pre>select distinct(<i>field1</i>) from <i>TableName</i></pre>
</blockquote>
<p>or</p>
<blockquote>
<pre>select distinct <i>field1</i> from <i>TableName</i></pre>
</blockquote>
<p>For MSAccess use:</p>
<blockquote>
<pre>SELECT count(*) from (select distinct <i>field1</i> from <i>TableName</i>)</pre>
</blockquote>
<p>Select all unique values for field1 from a table together with the number  		of records with that unique value:</p>
<blockquote>
<pre>select <i>field1</i>, count(*) from <i>TableName</i>group by <i>field1</i></pre>
</blockquote>
<p>Select all unique values for combinations of field1 and field2 from a  		table together with the number of records with that combination:</p>
<blockquote>
<pre>select <i>field1</i>, <i>field2</i>, count(*) from <i>TableName</i>group by <i>field1</i>, <i>field2</i></pre>
</blockquote>
<p>Select the number of unique values:</p>
<blockquote>
<pre>select count(distinct <i>field1</i>) from <i>TableName</i></pre>
</blockquote>
<p>Select all duplicate records in a table, where two (or more) records  		are considered duplicates if they share a common value for a single field:</p>
<blockquote>
<pre>select <i>field</i>, count(<i>field</i>) from <i>TableName</i>group by <i>field</i>

having count(*) &gt; 1</pre>
</blockquote>
<p>Select all duplicate records in a table, where two (or more) records  		are considered duplicates if they share common values for a pair of fields:</p>
<blockquote>
<pre>select <i>field1</i>, <i>field2</i>, count(*) from <i>TableName</i>group by <i>field1</i>, <i>field2</i>

having count(*) &gt; 1</pre>
</blockquote>
<p>Select similar records, i.e. all records which have duplicate field1  		and field2 in a table but with different field3 (i.e. specifying which fields  		must be the same and which different):</p>
<blockquote>
<pre>select * from <i>table</i> as A, <i>table</i> as Bwhere A.<i>field1</i>=B.<i>field1</i>

and A.<i>field2</i>=B.<i>field2</i>

and A.<i>field3</i>&lt;&gt;B.<i>field3</i>;</pre>
</blockquote>
<p>Note:</p>
<ul>
<li>It is important to specify at least one field which is different  			between the two records otherwise this query will list a record as being  			the same as itself.</li>
<li>This query will not find duplicate records, i.e. records with every  			field the same.</li>
</ul>
<p>Select all records from a table which do not share a common ID with records  		from a second table:</p>
<blockquote>
<pre>select * from <i>table1</i>where <i>field1</i> not in (select <i>field2</i> from <i>table2</i>)</pre>
</blockquote>
<p>Note:</p>
<ul>
<li>Sub-queries are quite slow.</li>
<li>Sub-queries are not supported in versions of MySQL prior to MySQL  			5, so the above will not work on older versions of MySQL. My thanks  			to Kevin Bowman for pointing out that MySQL 5 supports sub-queries.</li>
</ul>
<p>An alternative using a join (which can be much faster):</p>
<blockquote><p><code>select <i>table1</i>.* from <i>table1</i><br />
left join <i>table2</i> on (<i>table1</i>.<i>field1</i> = <i>table2</i>.<i>field2</i>)<br />
where <i>table2</i>.<i>field2</i> is null;</code></p></blockquote>
<p>The following method (which has been suggested by Michael Miller) is  		to use EXISTS. It is much faster on SQL Server than the above (but Michael  		says it is comparable with the left join technique on Oracle):</p>
<blockquote><p><code>select * from <i>table1</i><br />
where not exists (select <i>field2</i> from <i>table2</i> where <i>table2.field2</i>  			= <i>table1.field1</i>)</code></p></blockquote>
<p>To perform a two way join:</p>
<blockquote><p><code>select * from<br />
<i>table1</i> left join <i>table2</i> on (<i>table1</i>.<i>field1</i>  			= <i>table2</i>.<i>field1</i>),<br />
<i>table1</i> left join <i>table3</i> on (<i>table1</i>.<i>field2</i>  			= <i>table3</i>.<i>field3</i>)</code></p></blockquote>
<p>this has been tested on SQL Server, but not on Oracle or MySql. It does  		not work with MS-Access.</p>
<p>To combine the results of two queries (be aware that the number and types  		of fields in both queries must agree):</p>
<blockquote>
<pre>select * from table1union select * from table2</pre>
</blockquote>
<p>To return a value based on the contents of a field. This can be done  		using either <code>Iif</code>, <code>Decode</code> or <code>Case</code>,  		depending on the database.</p>
<p>The following works with MSAccess:</p>
<blockquote>
<pre>select Iif(<i>field1</i> = 1, 'one', 'not one')from <i>TableName</i></pre>
</blockquote>
<p>This is equivalent to the following on SqlServer:</p>
<blockquote>
<pre>select Case when <i>field1</i> = 1 then 'One' else 'Two' Endfrom <i>TableName</i></pre>
</blockquote>
<p>For Oracle use the <code>DECODE</code> function.</p>
<p>To create a new table to hold the results of the select query:</p>
<blockquote>
<pre>select * into <i>table2</i> from <i>table1</i></pre>
</blockquote>
<p>Be aware that this will fail if table2 exists, and that the new table  		will be created without any indexes.</p>
<hr />
<h2><a title="Insert" name="Insert"></a>Insert</h2>
<p>Insert new record into a table:</p>
<blockquote>
<pre>insert into <i>TableName</i> values (1,2,3)</pre>
</blockquote>
<p>Insert new record into a table explicitly naming fields:</p>
<blockquote><p><code>insert into <i>TableName</i> (field1,field2,field3) values  			(1,2,3)</code></p></blockquote>
<p>Insert new record into a table using values from another table:</p>
<blockquote>
<pre>insert into <i>TableName</i> (field1,field2,field3)select fieldA,2,fieldC from SomeTable</pre>
</blockquote>
<hr />
<h2><a title="Update" name="Update"></a>Update</h2>
<p>Update all records in a table:</p>
<blockquote>
<pre>update <i>TableName</i> set <i>field1</i>=2</pre>
</blockquote>
<p>Update specific records in a table:</p>
<blockquote>
<pre>update <i>TableName</i> set <i>field1</i>=2 where <i>field1</i>=1</pre>
</blockquote>
<p>To update more than one field at a time:</p>
<blockquote>
<pre>update <i>TableName</i> set <i>field1</i>=2, <i>field2</i>=3</pre>
</blockquote>
<p>Update a field in a table using a value from another table where both  		records are referenced by a common key &#8211; warning, different databases support  		different syntax!</p>
<blockquote><p>This works in MS-Access and MySQL (5) but not in SQL Server:</p>
<p><code>update <i>TableOne<br />
</i>    inner join <i>TableTwo</i> on <i>TableOne</i>.<i>commonID</i>  			= <i>TableTwo</i>.<i>commonID</i><br />
set <i>TableOne</i>.<i>field1</i> = <i>TableTwo</i>.<i>fieldX</i></code></p></blockquote>
<p>or</p>
<blockquote><p>This works in MS-Access but not in SQL Server:</p>
<pre>update <i>TableOne</i>, <i>TableTwo</i>    set <i>TableOne</i>.<i>field1</i> = <i>TableTwo</i>.<i>fieldX</i>

where <i>TableOne</i>.<i>commonID</i> = <i>TableTwo</i>.<i>commonID</i></pre>
</blockquote>
<p>or</p>
<blockquote><p>This works in SQL Server but not in MS-Access (my thanks to John  			Lee for this):</p>
<pre>update <i>tableOne</i>set <i>tableOne</i>.<i>field1</i>=<i>tableTwo</i>.<i>fieldX</i>

from <i>tableOne</i>, <i>tableTwo</i>

where <i>tableOne</i>.<i>commonID</i>=<i>tableTwo</i>.<i>commonID</i></pre>
</blockquote>
<p>Note:</p>
<ul>
<li>MS-Access gives the error &#8220;Operation must use an updateable query&#8221;  			if you attempt to use any of the above with a view/query rather than  			a table. The work around is to copy the data from the query into a temporary  			table and use the temporary table instead.</li>
</ul>
<hr />
<h2><a title="Delete" name="Delete"></a>Delete</h2>
<p>Delete all records in a table (dangerous):</p>
<blockquote>
<pre>delete from <i>TableName</i></pre>
</blockquote>
<p>Delete specific records in a table:</p>
<blockquote>
<pre>delete from <i>TableName</i> where <i>field1</i>=<i>value</i></pre>
</blockquote>
<p>Delete records from one table which do not have a matching field in another  		table:</p>
<blockquote>
<pre>delete from <i>TableName</i> where <i>field1</i> not in(select <i>field2</i> from <i>TableTwo</i>)</pre>
</blockquote>
<hr />
<h2><a title="Keys" name="Keys"></a>Keys</h2>
<p>Be aware that there are often subtle syntax variations between different  		database systems. Also other key properties (for example &#8216;clustered&#8217;) will  		vary between database systems. Therefore please treat this part of the SQL  		crib sheet as a guide only.</p>
<p>Create a primary key on a table:</p>
<blockquote><p><code>Alter Table <i>TheTable</i> Add Primary Key (field1, field2)</code></p></blockquote>
<p>To add an index on a field:</p>
<blockquote>
<pre>alter table TableName Add Index (<i>field1</i>)</pre>
</blockquote>
<p>To remove a primary key:</p>
<blockquote>
<pre>alter table drop primary key</pre>
</blockquote>
<p><a href="http://www.cryer.co.uk/brian/sql/sql_crib_sheet.htm" target="_blank">via</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=37&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2008/02/18/sql-crib-sheet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>Mobile Development</title>
		<link>http://sourcefirst.wordpress.com/2007/12/11/mobile-development/</link>
		<comments>http://sourcefirst.wordpress.com/2007/12/11/mobile-development/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 14:41:33 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/12/11/mobile-development/</guid>
		<description><![CDATA[Ready.mobi provides an excellent tool for testing and scoring your mobile website, as well as an emulator for viewing your site on several mobile devices. The ready.mobi testing tool evaluates mobile-readiness using industry best practices &#38; standards. This report provides a score (from 1 to 5) and in-depth analysis to determine how well your site [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=35&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://ready.mobi" target="_blank"><a href="http://ready.mobi" target="_blank"><img style="border-width:0;" height="132" alt="ReadyMobi" src="http://sourcefirst.files.wordpress.com/2007/12/readymobi1.jpg?w=204&#038;h=132" width="204" border="0"></a></a></p>
<p><a href="http://ready.mobi" target="_blank">Ready.mobi</a> provides an excellent tool for testing and scoring your mobile website, as well as an emulator for viewing your site on several mobile devices. </p>
<blockquote><p>The ready.mobi testing tool evaluates mobile-readiness using industry best practices &amp; standards. This report provides a score (from 1 to 5) and in-depth analysis to determine how well your site displays on a mobile device</p>
</blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=35&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/12/11/mobile-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>

		<media:content url="http://sourcefirst.files.wordpress.com/2007/12/readymobi1.jpg" medium="image">
			<media:title type="html">ReadyMobi</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript Text Only Input</title>
		<link>http://sourcefirst.wordpress.com/2007/12/10/javascript-text-only-input/</link>
		<comments>http://sourcefirst.wordpress.com/2007/12/10/javascript-text-only-input/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 15:13:09 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/12/10/javascript-text-only-input/</guid>
		<description><![CDATA[This function can be used on the onkeypress event of a HTML input box to only allow entry of text charactes: A-Z, a-z, dash, space, and backspace. Usage: &#60;input type="text" id="name" onkeypress="return textonly(event);" /&#62; Javascript: function textonly(e){var code;if (!e) var e = window.event;if (e.keyCode) code = e.keyCode;else if (e.which) code = e.which;var character = String.fromCharCode(code);//alert('Character [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=32&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This function can be used on the <strong>onkeypress </strong>event of a HTML input box to only allow entry of text charactes: A-Z, a-z, dash, space, and backspace.</p>
<p><strong>Usage:</strong> </p>
<pre>&lt;<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">id</span>=<span class="attribute-value">"name" </span><span class="attribute-name">onkeypress</span>=<span class="attribute-value">"return textonly(event);" </span><span class="error"><span class="attribute-name">/</span></span>&gt; </pre>
<p><strong>Javascript:</strong></p>
<p><code>function textonly(e){<br />var code;<br />if (!e) var e = window.event;<br />if (e.keyCode) code = e.keyCode;<br />else if (e.which) code = e.which;<br />var character = String.fromCharCode(code);<br />//alert('Character was ' + character);<br />&nbsp;&nbsp;&nbsp; //alert(code);<br />&nbsp;&nbsp;&nbsp; //if (code == 8) return true;<br />&nbsp;&nbsp;&nbsp; var AllowRegex&nbsp; = /^[\ba-zA-Z\s-]$/;<br />&nbsp;&nbsp;&nbsp; if (AllowRegex.test(character)) return true;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; return false; <br />}</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=32&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/12/10/javascript-text-only-input/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript Validate South African Identity Number</title>
		<link>http://sourcefirst.wordpress.com/2007/12/10/validate-south-african-identity-number/</link>
		<comments>http://sourcefirst.wordpress.com/2007/12/10/validate-south-african-identity-number/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 15:07:29 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/12/10/validate-south-african-identity-number/</guid>
		<description><![CDATA[function validateSAID(elementID) {var SAIDRegEx = /^(((\d{2}((0[13578]&#124;1[02])(0[1-9]&#124;[12]\d&#124;3[01])&#124;(0[13456789]&#124;1[012])(0[1-9]&#124;[12]\d&#124;30)&#124;02(0[1-9]&#124;1\d&#124;2[0-8])))&#124;([02468][048]&#124;[13579][26])0229))(( &#124;-)(\d{4})( &#124;-)(\d{3})&#124;(\d{7}))/;if (SAIDRegEx.test(document.getElementById(elementID).value)) return true; return false; } Take a look at this blog post for more information about SA ID number structure and validation.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=31&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>function validateSAID(elementID)<br />
{<br />var SAIDRegEx = /^(((\d{2}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229))(( |-)(\d{4})( |-)(\d{3})|(\d{7}))/;<br />if (SAIDRegEx.test(document.getElementById(elementID).value)) return true; return false; <br />}</code></p>
<p>Take a look at this <a href="http://geekswithblogs.net/willemf/archive/2005/10/30/58561.aspx" target="_blank">blog post</a> for more information about SA ID number structure and validation. </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=31&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/12/10/validate-south-african-identity-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript key codes</title>
		<link>http://sourcefirst.wordpress.com/2007/11/20/javascript-key-codes/</link>
		<comments>http://sourcefirst.wordpress.com/2007/11/20/javascript-key-codes/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 13:45:50 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[key codes]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/11/20/javascript-key-codes/</guid>
		<description><![CDATA[http://webonweboff.com/tips/js/event_key_codes.aspx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=29&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://webonweboff.com/tips/js/event_key_codes.aspx">http://webonweboff.com/tips/js/event_key_codes.aspx</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=29&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/11/20/javascript-key-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Force file download</title>
		<link>http://sourcefirst.wordpress.com/2007/11/20/c-force-file-download/</link>
		<comments>http://sourcefirst.wordpress.com/2007/11/20/c-force-file-download/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 10:47:52 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[force download]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/11/20/c-force-file-download/</guid>
		<description><![CDATA[To force a file to download, instead of being opened by the browser create a page called (something like) force.aspx and populate it with the C# code below. Then in the page containing the link that you want to force as a download use: &#60;a href=&#8221;force.aspx?f=filename.ext&#8221;&#62;Download&#60;/a&#62; as the link, replacing filename.ext with the relevant filename. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=28&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To force a file to download, instead of being opened by the browser create a page called (something like) <strong>force.aspx</strong> and populate it with the C# code below. Then in the page containing the link that you want to force as a download use: &lt;a href=&#8221;force.aspx?f=filename.ext&#8221;&gt;Download&lt;/a&gt; as the link, replacing filename.ext with the relevant filename.</p>
<p><strong> The Code:</strong><br />
<code><br />
&lt;%@ Page Language="C#" %&gt;&lt;%<br />
String File = "";<br />
if (Request.Params.Get("f") != null) File = Convert.ToString(Request.Params.Get("f"));<br />
if (File != "")<br />
{<br />
Response.ContentType = "application/octet-stream";<br />
Response.AddHeader("content-disposition", "attachment;filename=" + File);<br />
string FilePath = MapPath(File);<br />
Response.WriteFile(FilePath);<br />
Response.End();<br />
}<br />
else<br />
{<br />
Response.Write("Error: Invalid parameters.");<br />
}<br />
%&gt;</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=28&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/11/20/c-force-file-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Paging</title>
		<link>http://sourcefirst.wordpress.com/2007/10/31/sql-paging/</link>
		<comments>http://sourcefirst.wordpress.com/2007/10/31/sql-paging/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 12:57:55 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[SQL 2000]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/10/31/sql-paging/</guid>
		<description><![CDATA[This stored procedure provides a simple method of SQL paging &#160; CREATE PROCEDURE [dbo].[Up_Guestbook_List]@PageNumber int,@PageSize intasbeginset nocount ondeclare @TotalRows intdeclare @FirstRow intdeclare @FirstRowId intdeclare @PageTotal floatselect @TotalRows = count(id) from Guestbook where status = 1set @PageTotal = ceiling(cast(@TotalRows as float) / cast(@PageSize as float))if (@PageNumber &#60; 1) set @PageNumber = 1if (@PageNumber &#62; @PageTotal) set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=27&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This stored procedure provides a simple method of SQL paging</p>
<p>&nbsp;</p>
<p> <code> CREATE PROCEDURE [dbo].[Up_Guestbook_List]<br />@PageNumber int,<br />@PageSize int<br />as<br />begin<br />set nocount on<br />declare @TotalRows int<br />declare @FirstRow int<br />declare @FirstRowId int<br />declare @PageTotal float<br />select @TotalRows = count(id) from Guestbook where status = 1<br />set @PageTotal = ceiling(cast(@TotalRows as float) / cast(@PageSize as float))<br />if (@PageNumber &lt; 1) set @PageNumber = 1<br />if (@PageNumber &gt; @PageTotal) set @PageNumber = @PageTotal<br />select @FirstRow = (@PageNumber - 1) * @PageSize + 1<br />if (@FirstRow &lt;= @TotalRows)<br />begin<br />set rowcount @FirstRow<br />select @FirstRowId = id<br />from Guestbook where status = 1<br />order by 1c<br />set rowcount @PageSize<br />select<br />@PageNumber as PageNumber,<br />@PageSize as PageSize,<br />@PageTotal as PageTotal,<br />*<br />from Guestbook<br />where id &gt;= @FirstRowId and status = 1<br />order by 1<br />end<br />set nocount off<br />end</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=27&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/10/31/sql-paging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight 1.0 Drag and Drop</title>
		<link>http://sourcefirst.wordpress.com/2007/10/25/silverlight-10-drag-and-drop/</link>
		<comments>http://sourcefirst.wordpress.com/2007/10/25/silverlight-10-drag-and-drop/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 19:37:33 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/10/25/silverlight-10-drag-and-drop/</guid>
		<description><![CDATA[See the toucan sample: http://www.hoffmancentral.org/sample/silverlight.htm<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=25&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>See the toucan sample: <a href="http://www.hoffmancentral.org/sample/silverlight.htm">http://www.hoffmancentral.org/sample/silverlight.htm</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=25&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/10/25/silverlight-10-drag-and-drop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaScript Numeric Only Input</title>
		<link>http://sourcefirst.wordpress.com/2007/07/16/javascript-numbers-only-input/</link>
		<comments>http://sourcefirst.wordpress.com/2007/07/16/javascript-numbers-only-input/#comments</comments>
		<pubDate>Mon, 16 Jul 2007 11:50:11 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/07/16/javascript-numbers-only-input/</guid>
		<description><![CDATA[Use the following JavaScript function to only allow numeric (0-9) input and backspace input in a web form text field. JavaScript: function numbersonly(e) {var unicode=e.charCode? e.charCode : e.keyCode;if (unicode!=8){ //if the key isn't the backspace key (which we should allow) if (unicode&#60;48&#124;&#124;unicode&#62;57) //if not a number return false //disable key press }} Usage: &#60;input onkeypress=&#8221;return [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=24&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Use the following JavaScript function to only allow numeric (0-9) input and backspace input in a web form text field.</p>
<p><strong>JavaScript:</strong></p>
<p><code>function numbersonly(e) {<br />var unicode=e.charCode? e.charCode : e.keyCode;<br />if (unicode!=8){ //if the key isn't the backspace key (which we should allow) <br />if (unicode&lt;48||unicode&gt;57) //if not a number return false //disable key press <br />}} </p>
<p></code><strong>Usage:</strong></p>
<p>&lt;input onkeypress=&#8221;return numbersonly(event);&#8221; name=&#8221;VAT_Number&#8221;&gt;</p>
<p>To allow for tabbing change (unicode!=8) to (unicode!=8 &amp;&amp; unicode!=9)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=24&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/07/16/javascript-numbers-only-input/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
		<item>
		<title>Removing embedded HTML tags with SQL</title>
		<link>http://sourcefirst.wordpress.com/2007/06/13/removing-embedded-html-tags-with-sql/</link>
		<comments>http://sourcefirst.wordpress.com/2007/06/13/removing-embedded-html-tags-with-sql/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 08:43:12 +0000</pubDate>
		<dc:creator>Neil</dc:creator>
				<category><![CDATA[SQL 2000]]></category>

		<guid isPermaLink="false">http://sourcefirst.wordpress.com/2007/06/13/removing-embedded-html-tags-with-sql/</guid>
		<description><![CDATA[This is an interesting piece of sql, the function accepts a string and removes HTML elements that is inside the string. This is genereally useful when you have data that has embedded HTML content on it. via Create Function dbo.UTILfn_StripTags (@Dirty varchar(4000)) Returns varchar(4000) As Begin Declare @Start int, @End int, @Length int While CharIndex('&#60;', [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=23&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is an interesting piece of sql, the function accepts a string and removes HTML elements that is inside the string. This is genereally useful when you have data that has embedded HTML content on it. <a href="http://devpinoy.org/blogs/keithrull/archive/2005/06/23/a-custom-t-sql-function-for-removing-embedded-html-tags.aspx">via</a></p>
<p><code>Create Function dbo.UTILfn_StripTags<br />
(@Dirty varchar(4000))<br />
Returns varchar(4000)<br />
As<br />
Begin<br />
Declare @Start int,<br />
@End int,<br />
@Length int<br />
While CharIndex('&lt;', @Dirty) &gt; 0 And CharIndex('&gt;', @Dirty, CharIndex('&lt;', @Dirty)) &gt; 0<br />
Begin<br />
Select @Start = CharIndex('&lt;', @Dirty),<br />
@End = CharIndex('&gt;', @Dirty, CharIndex('&lt;', @Dirty))<br />
Select @Length = (@End - @Start) + 1<br />
If @Length &gt; 0<br />
Begin<br />
Select @Dirty = Stuff(@Dirty, @Start, @Length, '')<br />
End<br />
End<br />
return @Dirty<br />
End</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sourcefirst.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sourcefirst.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sourcefirst.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sourcefirst.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sourcefirst.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sourcefirst.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sourcefirst.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sourcefirst.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sourcefirst.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sourcefirst.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sourcefirst.wordpress.com&amp;blog=733881&amp;post=23&amp;subd=sourcefirst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sourcefirst.wordpress.com/2007/06/13/removing-embedded-html-tags-with-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40378024f57119fc13bf51d86d01c1d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Neil</media:title>
		</media:content>
	</item>
	</channel>
</rss>
