<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkMDQ3s4fCp7ImA9WhVUEkQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205</id><updated>2012-05-17T23:41:12.534+01:00</updated><category term="standards" /><category term="regular expressions" /><category term="bank card reader chip and pin" /><category term="web" /><category term="ASP.net validation control custom user" /><category term="browser" /><title>Matt's Software Blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.matthewedmondson.info/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/matthewedmondson/Erzm" /><feedburner:info uri="matthewedmondson/erzm" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkcNSX8_eyp7ImA9WhRQEUQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-7227464631230607444</id><published>2011-12-06T17:54:00.000Z</published><updated>2011-12-06T17:54:58.143Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-06T17:54:58.143Z</app:edited><title>Not the usual 'breakpoint will not be hit' solution</title><content type="html">I know the woes of &amp;nbsp;the 'The breakpoint will not be hit' problem as I've struggled with it personally for years. &amp;nbsp;After days of searching through the usual answers of check/delete your .pdb files I've found that it's often much simpler than that:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
If you've got more than one instance of Internet Explorer running when trying to debug &lt;b&gt;&lt;u&gt;close them all&lt;/u&gt;&lt;/b&gt; and try to debug again.&lt;/blockquote&gt;
&lt;br /&gt;
The amount of times Visual Studio has attached itself to the wrong instance is both amazing and&amp;nbsp;inconsistent. &amp;nbsp;This simple trick has saved hours of both mine, and&amp;nbsp;colleagues&amp;nbsp;time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-7227464631230607444?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BYJFbwN0AXHA4OUXTe6NbKzo_Dc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BYJFbwN0AXHA4OUXTe6NbKzo_Dc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BYJFbwN0AXHA4OUXTe6NbKzo_Dc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BYJFbwN0AXHA4OUXTe6NbKzo_Dc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/azC1qTlyS5Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/7227464631230607444/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/12/not-usual-breakpoint-will-not-be-hit.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/7227464631230607444?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/7227464631230607444?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/azC1qTlyS5Y/not-usual-breakpoint-will-not-be-hit.html" title="Not the usual 'breakpoint will not be hit' solution" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/12/not-usual-breakpoint-will-not-be-hit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIHSXw_eCp7ImA9WhdbEEQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-30739826133521780</id><published>2011-10-08T18:05:00.000+01:00</published><updated>2011-10-08T18:05:38.240+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-08T18:05:38.240+01:00</app:edited><title>Who tests the unit tests?</title><content type="html">With unit tests having fast become an accepted method of automating and reducing test time the question has to be asked - &lt;b&gt;how are unit tests themselves tested&lt;/b&gt;?&lt;br /&gt;
&lt;br /&gt;
A good developer can always be &lt;a href="http://www.codinghorror.com/blog/2005/08/how-to-be-lazy-dumb-and-successful.html"&gt;described as lazy&lt;/a&gt; because it's good developers who understand a little effort &amp;nbsp;invested up front will pay off plenty in the future. It's this philosophy that has spread the wide adoption of unit-testing and&amp;nbsp;specifically&amp;nbsp;test driven development (TDD).&lt;br /&gt;
&lt;br /&gt;
The problem is - like all code - unit tests &lt;i&gt;can themselves&lt;/i&gt; contain bugs. &amp;nbsp;A prime example in the .net framework:&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;[TestMethod]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; TestMethod1()
        {
            &lt;span class="rem"&gt;//&lt;/span&gt;
            &lt;span class="rem"&gt;// TODO: I'm not doing anything!&lt;/span&gt;
            &lt;span class="rem"&gt;//&lt;/span&gt;
        }&lt;/pre&gt;
&lt;br /&gt;
Even though this test &lt;i&gt;clearly&lt;/i&gt; doesn't test anything, when executed it is a &lt;b&gt;pass&lt;/b&gt;!&lt;br /&gt;
&lt;br /&gt;
There are methods out there of &lt;a href="http://blog.stevensanderson.com/2009/08/24/writing-great-unit-tests-best-and-worst-practises/"&gt;how to craft a good unit test&lt;/a&gt; which focuses on the properties and structure of a quality test, and of-course standard&amp;nbsp;re-factoring&amp;nbsp;and quality control factors still apply, and here is the problem..&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How can a unit test be completely trusted - when they are code themselves?&lt;/b&gt; &amp;nbsp;Are unit tests simply "passing the buck" of&amp;nbsp;responsibility?&lt;br /&gt;
&lt;br /&gt;
Since unit tests are produced by developers. How can a developer&amp;nbsp;absolutely&amp;nbsp;know that a unit test&amp;nbsp;accurately&amp;nbsp;represents a requirement? Do we test it? How? If so &lt;b&gt;who tests the unit tests&lt;/b&gt;?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-30739826133521780?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4R6kn5I1m73QyXYmZph1z0ughCI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4R6kn5I1m73QyXYmZph1z0ughCI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4R6kn5I1m73QyXYmZph1z0ughCI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4R6kn5I1m73QyXYmZph1z0ughCI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/L34k2l5ftGw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/30739826133521780/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/10/who-tests-unit-tests.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/30739826133521780?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/30739826133521780?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/L34k2l5ftGw/who-tests-unit-tests.html" title="Who tests the unit tests?" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/10/who-tests-unit-tests.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIFRX84eyp7ImA9WhdTFk4.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-6554980639852246579</id><published>2011-07-14T11:15:00.000+01:00</published><updated>2011-07-14T11:15:14.133+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-14T11:15:14.133+01:00</app:edited><title>Leaving router on at all times, good idea?</title><content type="html">Having recently subscribed to a new broadband service and sent the token 'free' wireless router. I was posed with the following question; should I leave the router powered on the whole time?&lt;br /&gt;
&lt;br /&gt;
This particular broadband provider was nice enough to include the answer within their FAQ, and it is not at all what I expected &amp;nbsp;[copied directly from their FAQ]:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;u&gt;FAQ: Should I leave my router switched on all the time?&lt;/u&gt;&lt;br /&gt;
Yes. Leaving your router on will make sure you get the best speed and performance from your service.&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;b&gt;Don't switch it off at night!&lt;/b&gt; Regularly switching off your router can make it look like your service is disconnecting. If this happens, your broadband speed will be reduced&amp;nbsp;because&amp;nbsp;the exchange thinks your line is unstable and can't cope with higher speeds.&lt;/blockquote&gt;
&lt;br /&gt;
Aside from any technical reasons, I can think of a&amp;nbsp;plethora&amp;nbsp;of reasons why this might in fact be a &lt;b&gt;bad idea&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
- Security&lt;br /&gt;
&lt;div&gt;
Physical security is the &lt;u&gt;best kind&lt;/u&gt; of security, preventing attackers getting their grubby mits anywhere near the bottom rung of the &lt;a href="http://www.webopedia.com/quick_ref/OSI_Layers.asp"&gt;7 layer OSI model&lt;/a&gt;. Physical security for a wireless, omnidirectional service &lt;i&gt;can only&lt;/i&gt; be achieved through removing the power, stopping any would-be intruders in their tracks.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Leaving it on constantly however massively increases the attack area, which can be used to attempt to gain access. &amp;nbsp;Once access is gained any kind of activities can take place, which could land the fee-paying subscriber in plenty of trouble such as; sending spam, stealing passwords, masquerading and cookie sniffing among others.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
- Wasting power&lt;/div&gt;
&lt;div&gt;
Of course anything that has&amp;nbsp;electricity&amp;nbsp;running through it whilst not being used can be deemed a waste, hence minimising any such time is preferable.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
- Fire risk&lt;/div&gt;
&lt;div&gt;
By leaving the router on all the time you are increasing the&amp;nbsp;likelihood&amp;nbsp;of leaving your service&amp;nbsp;accessible&amp;nbsp;to intruders.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There is also an active discussion:&amp;nbsp;&lt;a href="http://community.plus.net/forum/index.php/topic,80567.0.html/"&gt;http://community.plus.net/forum/index.php/topic,80567.0.html/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Which, in addition to the other two points means I will be isolating my router for the foreseeable future&amp;nbsp;and to be honest, who would want to risk those points for the sake of a possible yet temporary drop in speed?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-6554980639852246579?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RTPTqefllTiSDGmNeTzNBomTzAA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RTPTqefllTiSDGmNeTzNBomTzAA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RTPTqefllTiSDGmNeTzNBomTzAA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RTPTqefllTiSDGmNeTzNBomTzAA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/x2ng3xXpmvo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/6554980639852246579/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/07/leaving-router-on-at-all-times-good.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/6554980639852246579?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/6554980639852246579?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/x2ng3xXpmvo/leaving-router-on-at-all-times-good.html" title="Leaving router on at all times, good idea?" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/07/leaving-router-on-at-all-times-good.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMAQnk7fCp7ImA9Wx9aFkQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-506042271583398735</id><published>2011-03-07T19:09:00.011Z</published><updated>2011-03-09T18:14:03.704Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-09T18:14:03.704Z</app:edited><title>The key to another world</title><content type="html">Having recently stumbled upon the World of Warcraft authenticator device I became intrigued at exactly how these work. &amp;nbsp;For those of you who haven't seen one:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://lh5.googleusercontent.com/-C_iHoFBQtvo/TXNc5INpgiI/AAAAAAAAAC8/k1yLuENJsBg/s1600/authenticator-blizzard.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="https://lh5.googleusercontent.com/-C_iHoFBQtvo/TXNc5INpgiI/AAAAAAAAAC8/k1yLuENJsBg/s320/authenticator-blizzard.jpeg" width="237" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The authenticator provides a special code upon a pressing a button which the user needs when logging into their &lt;i&gt;WoW&lt;/i&gt; account. &amp;nbsp;The device itself is completely standalone, the code changes every few seconds and you cannot log-in without one. Surely this has got to be kind of &lt;i&gt;magic&lt;/i&gt;? &amp;nbsp;Well, no - its pretty simple really...&lt;br /&gt;
&lt;br /&gt;
The devices are manufactured with a serial number known to the device that is hard coded. In addition to this it also contains a real time clock which is set during manufacture. &amp;nbsp;Hence the device has two pieces of information at its disposal; the &lt;b&gt;hard coded serial no&lt;/b&gt;, and the &lt;b&gt;current time&lt;/b&gt;. &amp;nbsp;Note how there's no connection whatsoever to anything else.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-AZBFoTvnWKU/TXUiBJNGOCI/AAAAAAAAADA/NjIUmDR-OnY/s1600/authenticator_small.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://lh4.googleusercontent.com/-AZBFoTvnWKU/TXUiBJNGOCI/AAAAAAAAADA/NjIUmDR-OnY/s1600/authenticator_small.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;The serial number printed on the back of the Authenticator&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
When you first receive your device you must "synchronise" your online account with the serial no (which is reproduced on a sticker on the back). &amp;nbsp;Since time is universal and the serial no never changes, the WoW server and the device both have access to the same two variables.&lt;br /&gt;
&lt;br /&gt;
The server and authenticator both generate a code based on the &lt;b&gt;current time&lt;/b&gt; and &lt;b&gt;serial number&lt;/b&gt;. These are then&amp;nbsp;concatenated&amp;nbsp;together to come up with one long sequence of numbers, like so:&lt;br /&gt;
&lt;blockquote&gt;
Sum of know values = [Current Time] + [Authenticator Serial No]&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote&gt;
which could be:&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote&gt;
Sum of known values = 12:37 + 1412668222&lt;/blockquote&gt;
so you would end up with a number like&amp;nbsp;12371412668222&amp;nbsp;which&lt;b&gt; both the authenticator and the server could generate given a specific time&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
The problem with this is that this number can be captured by anyone through a variety of methods: looking at your screen, installing a keylogger, phishing, or any number of other attack.&lt;br /&gt;
&lt;br /&gt;
To mitigate this the &lt;b&gt;number is encrypted&lt;/b&gt;&amp;nbsp;&amp;nbsp;using either &lt;a href="http://en.wikipedia.org/wiki/Data_Encryption_Standard"&gt;DES&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Triple_DES"&gt;3DES&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard"&gt;AES&lt;/a&gt; &lt;a href="http://www.wowwiki.com/Blizzard_Authenticator"&gt;as supported by the device&lt;/a&gt; which will turn it into something&amp;nbsp;meaningless, such as:&amp;nbsp;63634545.&lt;br /&gt;
&lt;br /&gt;
Because both devices (the server and authenticator) generate these numbers separately, at the same time, and encrypt using the same algorithm, both will calculate the same result. This makes full&amp;nbsp;use of the powerful combination of something you&amp;nbsp;&lt;i&gt;know&lt;/i&gt;&amp;nbsp;- your username and password, which something you&amp;nbsp;&lt;i&gt;have&lt;/i&gt;&amp;nbsp;- your authenticator. &amp;nbsp;A step&amp;nbsp;similarly&amp;nbsp;introduced into&amp;nbsp;&lt;a href="http://gmailblog.blogspot.com/2011/02/advanced-sign-in-security-for-your.html"&gt;google accounts 2-step&amp;nbsp;verification&lt;/a&gt;.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
To mitigate the user taking a while to submit their code it's likely the &lt;i&gt;WoW&lt;/i&gt; server will accept a range of numbers, from a couple of minutes prior to the actual time.&lt;br /&gt;
&lt;br /&gt;
This provides the following advantages:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The serial number is never sent over the wire in plain text so cannot be captured&lt;/li&gt;
&lt;li&gt;The key changes with the time and&amp;nbsp;whether it has been used, so being captured over the wire is useless as it must be used straight away and cannot be used again&lt;/li&gt;
&lt;li&gt;Unless the attacker can collect a lot of keys - the serial no cannot be reverse engineered&lt;/li&gt;
&lt;/ul&gt;
I hope I've explained how these devices work, and shown how it's possible to manufacture these devices for pennies while thwarting a range of attack vectors.&lt;br /&gt;
&lt;br /&gt;
Some sources used for this article:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://wow.joystiq.com/2009/06/10/the-truth-about-authenticators/"&gt;The truth about authenticators&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://us.blizzard.com/support/article.xml?locale=en_US&amp;amp;articleId=26017"&gt;Removing a Battle.net Authenticator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-506042271583398735?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NhGXkKqod2HqCURGGGwczJSC9J8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NhGXkKqod2HqCURGGGwczJSC9J8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NhGXkKqod2HqCURGGGwczJSC9J8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NhGXkKqod2HqCURGGGwczJSC9J8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/mD9A6UE_3Ro" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/506042271583398735/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/02/key-to-another-world.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/506042271583398735?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/506042271583398735?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/mD9A6UE_3Ro/key-to-another-world.html" title="The key to another world" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh5.googleusercontent.com/-C_iHoFBQtvo/TXNc5INpgiI/AAAAAAAAAC8/k1yLuENJsBg/s72-c/authenticator-blizzard.jpeg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/02/key-to-another-world.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIERXozeip7ImA9Wx9bEUg.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-4293098674165846165</id><published>2011-02-19T21:55:00.000Z</published><updated>2011-02-19T21:55:04.482Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-19T21:55:04.482Z</app:edited><title>Keeping it simple - stupid</title><content type="html">Einstein once said "Everything should be made as simple as possible, but not simpler" which couldn't apply any more to physics as it does&amp;nbsp;modern software development.&lt;br /&gt;
&lt;br /&gt;
You see - modern software development is brimming full of abstractions - which exist solely to provide simplification through hiding complexity.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
These abstractions tend to come along with 'buzz word' names, here's just a handful:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
- Web Services&lt;/div&gt;
&lt;div&gt;
- ASP.NET Web Forms&lt;/div&gt;
&lt;div&gt;
- User Controls&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
These are all 'cool' words to find on anyones CV, and asking a software developer about each would result in volumes spoken. &amp;nbsp;However at the end of the day all of these boil down to &lt;b&gt;abstracting the underlying messages being passed across a network&lt;/b&gt;. &amp;nbsp;Imagine having to&amp;nbsp;piece&amp;nbsp;together each HTTP packet, adding the headers, and populating its payload - it would take an age to build anything,&amp;nbsp;never mind&amp;nbsp;a decent website, user control or web service - which is the problem abstraction solves.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
However abstractions are very limited in their scope, and it's too easy for the non-experienced to try and &lt;a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html"&gt;abstract too much&lt;/a&gt;. &amp;nbsp;Abstractions keep things simple, but applied too wide they make things &lt;i&gt;simpler.&lt;/i&gt;&amp;nbsp;&amp;nbsp;And we know good old Einstein wouldn't be impressed with that.&lt;br /&gt;
&lt;br /&gt;
To illustrate this point I'd like to describe something I recently experienced. &amp;nbsp;A requirement of ours was to provide nightly backups across the internet, between two&amp;nbsp;separate&amp;nbsp;systems. To&amp;nbsp;achieve&amp;nbsp;this the following would take place:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;The backup would be uploaded over FTP&lt;/li&gt;
&lt;li&gt;&lt;b&gt;A message&lt;/b&gt; would be sent to the recipient of the backup when complete (to allow it to process the backup)&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
The developer in charge decided the message after the upload was complete should be sent via a method call to a web service, which would also pass the hash of the uploaded file so it &lt;a href="http://www.matthewedmondson.info/2010/08/difference-between-validation-and.html"&gt;could be verified&lt;/a&gt;. &amp;nbsp;There was a number of problems getting this set up, and while the FTP side of things worked perfectly, the web service didn't.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The point I'm making is that a &lt;b&gt;web service is an abstraction over HTTP&lt;/b&gt;, and is&amp;nbsp;complete&amp;nbsp;overkill&amp;nbsp;for a simple method call. &amp;nbsp;A much better (and simpler) way would be to create a page who's URL allowed the hash to be passed in as a variable. &amp;nbsp;Which would in turn carry out the same actions as the web service.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Doing it this way allows a number of benefits over the web service option:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Any machine connected to the internet could send the 'completed' message as there is no reliance on the .net framework&lt;/li&gt;
&lt;li&gt;A lot of overhead has been removed&lt;/li&gt;
&lt;li&gt;There no need to install, debug, and mess around with web service way of doing things&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
The developer involved had the notion that using a web service is some how more secure, which just sounds downright dangerous to me. &amp;nbsp;If you've got an open web service, anyone can play around with it, but that's because I understand that its just abstracting a bunch of HTTP calls.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I therefore urge all software developers out there to &lt;i&gt;think&lt;/i&gt; before you type anything, remember this is what a specification is for! &amp;nbsp;Are you trying to abstract something which is already &lt;b&gt;simple&lt;/b&gt;? &amp;nbsp;You wouldn't nail a picture to the wall with a sledgehammer, would you?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-4293098674165846165?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FrLZ1gj8xkU7c6WmlvG_f9pjxNA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FrLZ1gj8xkU7c6WmlvG_f9pjxNA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FrLZ1gj8xkU7c6WmlvG_f9pjxNA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FrLZ1gj8xkU7c6WmlvG_f9pjxNA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/o3VIsnCxwj8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/4293098674165846165/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/02/keeping-it-simple-stupid.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/4293098674165846165?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/4293098674165846165?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/o3VIsnCxwj8/keeping-it-simple-stupid.html" title="Keeping it simple - stupid" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/02/keeping-it-simple-stupid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcCQHgyeSp7ImA9Wx9UEUQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-2239564099741175832</id><published>2011-02-08T19:24:00.000Z</published><updated>2011-02-08T19:24:21.691Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-08T19:24:21.691Z</app:edited><title>ASP.NET ComboBox</title><content type="html">Want a ComboBox for your ASP.NET application? &amp;nbsp;One that works? Cross browser? Well you're in luck.&lt;br /&gt;
&lt;br /&gt;
A ComboBox is a control that displays a TextBox combined with a ListBox - which enables the user to either select an item from the list or type&amp;nbsp;their&amp;nbsp;own. &amp;nbsp;They have many uses - as I'm sure most of you are aware.&lt;br /&gt;
&lt;br /&gt;
I've always had a hard time trying to understand why Microsoft haven't provided a decent implementation of a ComboBox for ASP.NET applications. &amp;nbsp;They have tried - and its included in the &lt;a href="http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ComboBox/ComboBox.aspx"&gt;AJAX Control Toolkit&lt;/a&gt; - but its pretty darn useless if you ask me.&lt;br /&gt;
&lt;br /&gt;
Don't get me wrong, there are &lt;a href="http://demos.telerik.com/aspnet-ajax/combobox/examples/overview/defaultcs.aspx"&gt;plenty of permutations of ComboBox&lt;/a&gt; out there and as the adage goes "&lt;a href="http://www.codinghorror.com/blog/2004/12/never-design-what-you-can-steal.html"&gt;great programmers don't write what can be stolen&lt;/a&gt;", but the best ones aren't free and I just couldn't justify paying for something that should be. &amp;nbsp;&lt;b&gt;So I got to work and made my own:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img border="0" src="http://3.bp.blogspot.com/_WhyXe0-z1CA/TUsGwWnbT2I/AAAAAAAAAC4/ND_9MxKFVg0/s1600/comboBox.jpg" style="padding: 0px;" /&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
Pretty nice isn't it?&lt;br /&gt;
&lt;br /&gt;
Features of the control:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Nice and smooth sliding action&lt;/li&gt;
&lt;li&gt;Its lightweight and simple&lt;/li&gt;
&lt;li&gt;Renders in all browsers&lt;/li&gt;
&lt;/ul&gt;
It uses jQuery - so you'll have to include a script tag wherever you use it, I'm using this one kindly hosted at google:&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Overall it took me around 2 simple hours to create, so why after &lt;a href="http://en.wikipedia.org/wiki/ASP.NET"&gt;9 years since the ASP.NET framework has been released&lt;/a&gt; can Microsoft not provide a decent clone of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.aspx"&gt;Windows ComboBox&lt;/a&gt;?&lt;br /&gt;
&lt;br /&gt;
By all means my version is no way finished - it was created it to make a point. &amp;nbsp;However by providing the source on here I've hopefully filled a gap in the ASP.NET control selection. &amp;nbsp;I know that by storing it on here I should hopefully never lose it, and also allow others to use as they wish.&lt;br /&gt;
&lt;br /&gt;
A couple of things you may want to implement into this control:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Remove the&amp;nbsp;unnecessary&amp;nbsp;postback when selecting an element using Javascript&lt;/li&gt;
&lt;li&gt;Allow the height of the listbox to change&amp;nbsp;dynamically&amp;nbsp;depending on its contents&lt;/li&gt;
&lt;li&gt;Add a load more methods (perhaps to bring it in line with the AJAX Control Toolkit)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wiktionary.org/wiki/Ajaxify"&gt;Ajaxify&lt;/a&gt; it - what isn't these days?&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
I'm providing it as a Visual Studio 2008 solution so you can fire it up straight away, however it's trivial to open in any version. &amp;nbsp;You can &lt;a href="http://dl.dropbox.com/u/20546109/comboBoxSite.zip"&gt;grab it here&lt;/a&gt;. &amp;nbsp;I must say I'm quite proud of it.&lt;br /&gt;
&lt;br /&gt;
All in all its a simple control - but it works perfectly for what I need. &amp;nbsp;Please download the source and modify as you wish, however I'd be grateful if you cited &lt;a href="http://www.matthewedmondson.info/"&gt;me&lt;/a&gt; as the source. Perhaps even Microsoft will pick up on it (I can wish).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-2239564099741175832?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/coa7vxa-GBaNvcQ13_5rzsX49HI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/coa7vxa-GBaNvcQ13_5rzsX49HI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/coa7vxa-GBaNvcQ13_5rzsX49HI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/coa7vxa-GBaNvcQ13_5rzsX49HI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/0loZsLeo9BA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/2239564099741175832/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/02/aspnet-combobox.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/2239564099741175832?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/2239564099741175832?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/0loZsLeo9BA/aspnet-combobox.html" title="ASP.NET ComboBox" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_WhyXe0-z1CA/TUsGwWnbT2I/AAAAAAAAAC4/ND_9MxKFVg0/s72-c/comboBox.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/02/aspnet-combobox.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ADQXk8fSp7ImA9Wx9VEkw.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-6942515597341780868</id><published>2011-01-22T22:15:00.001Z</published><updated>2011-01-28T10:49:30.775Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-28T10:49:30.775Z</app:edited><title>The often underrated value of Googling skills</title><content type="html">I recently &lt;a href="http://stackoverflow.com/questions/4723447/find-out-url-from-given-paragraph-using-regex-c/4723461#4723461"&gt;stumbled upon this question&lt;/a&gt; over at Stack Overflow:&lt;br /&gt;
&lt;blockquote style="background-color: #595959; padding: 10px;"&gt;
can anyone help me find out url from given paragraph using regex c#&lt;/blockquote&gt;
From reading this you can learn a few of things about the asker:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;They have *some* software knowledge as they know they want to use &lt;a href="http://www.regular-expressions.info/"&gt;regular expressions&lt;/a&gt; (regex)&lt;/li&gt;
&lt;li&gt;They didn't use punctuation&lt;/li&gt;
&lt;li&gt;They don't know how to use Google&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Programming is is such a large area that is constantly&amp;nbsp;undergoing&amp;nbsp;change that it simply isn't possible to know it all, and anyone who tells you that is likely already&amp;nbsp;light-years&amp;nbsp;behind.&lt;br /&gt;
&lt;br /&gt;
The internet however &lt;i&gt;does&lt;/i&gt; know all of the answers, and any programmer at any level should know about and exploit this excellent resource. Of course you know this - &lt;b&gt;because you're doing it right now&lt;/b&gt;. &amp;nbsp;In fact it has been said that &lt;a href="http://www.matthewedmondson.info/2011/01/are-programmers-any-good-without-google.html"&gt;software developers are simply Googling machines&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Whats at the centre of the internet? &amp;nbsp;&lt;a href="http://www.codinghorror.com/blog/2009/02/the-elephant-in-the-room-google-monoculture.html"&gt;Its Google of course!&lt;/a&gt;&amp;nbsp;Google is a tool - period, and any one whos been tasked with writing even a single line of code should know how to use it and use it to its full potential. And since you're reading this that likely means you.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So why arn't educational establishments teaching Googling skills to computer science students? &amp;nbsp;I graduated in 2008 and certainly didn't get any formal guidance.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Which brings me back to the question above. &amp;nbsp;The asker would have got an answer instantly if they simply knew (and had the motivation) to do a search. &amp;nbsp;Perhaps if all software related education taught the use Google that above question would have never been asked. &amp;nbsp;Of course the asker could have simply been lazy - in which case shouldn't be developing software at all...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-6942515597341780868?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BGJ2qtI2m8sXV9aSeYkL_MAxI3Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BGJ2qtI2m8sXV9aSeYkL_MAxI3Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BGJ2qtI2m8sXV9aSeYkL_MAxI3Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BGJ2qtI2m8sXV9aSeYkL_MAxI3Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/lopx47-Tjxw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/6942515597341780868/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/01/often-underrated-value-of-googling.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/6942515597341780868?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/6942515597341780868?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/lopx47-Tjxw/often-underrated-value-of-googling.html" title="The often underrated value of Googling skills" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/01/often-underrated-value-of-googling.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEANRno9eSp7ImA9Wx9WE0k.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-7456919897242337632</id><published>2011-01-17T22:22:00.003Z</published><updated>2011-01-18T10:33:17.461Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-18T10:33:17.461Z</app:edited><title>Assumptions in software</title><content type="html">Its no secret that I &lt;b&gt;&lt;a href="http://www.matthewedmondson.info/2010/09/preventing-arrow-code.html"&gt;prefer beautiful code&lt;/a&gt;&lt;/b&gt;. &amp;nbsp;I prefer code that reads like a set of comments - which provide a running commentary of the execution path with zero ambiguity&amp;nbsp;and certain clarity that makes its intent crystal clear.&lt;br /&gt;
&lt;br /&gt;
This makes good sense when you realise&lt;b&gt;&amp;nbsp;code is the only medium which allows us to communicate with machines&amp;nbsp;&lt;/b&gt;- it allows us to speak the same language. &amp;nbsp;And just as in&amp;nbsp;English, if you do not directly specify each and every possible fact - &lt;i&gt;assumptions&lt;/i&gt; get made.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Now if an assumption is not was as intended strange results may occur - some may even say &lt;i&gt;exceptional&lt;/i&gt;&amp;nbsp;results. Bill Gates famously assumed in 1981 "640K ought to be enough for anybody" and we all know how wrong that was.&lt;br /&gt;
&lt;br /&gt;
Exceptional circumstances are dealt with by most modern programming languages (in particular .NET) with - you guessed it - Exceptions. These set of classes are the equivalent of the software going crazy and refusing to carry on doing anything until the assumption is resolved - &lt;u&gt;this is good&lt;/u&gt;, as we know that assumptions at best cause ambiguity and at worst are a&amp;nbsp;show-stopper.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My beef is with a certain construct &amp;nbsp;that goes by the name "Else". &amp;nbsp;The problem is it &lt;i&gt;encourages&lt;/i&gt; assumptions to be made but the main problem with this is &lt;b&gt;computers don't have intuition.&lt;/b&gt; &amp;nbsp;Imagine the following scenario:&lt;br /&gt;
&lt;br /&gt;
A school want to carry out a survey of the average age of students and would like to use some software to take input and perform the calculation. &amp;nbsp;I know if this was paper-based and an age came back as 135 my intuition would tell me this cannot be true - so I would write the software to also discard such a condition.&lt;br /&gt;
&lt;br /&gt;
Once done the code looks like this:
&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; addAge(&lt;span class="kwrd"&gt;int&lt;/span&gt; userInputtedAge)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (userInputtedAge &amp;lt; 100)
            {
                &lt;span class="rem"&gt;//They've entered a valid range of ages&lt;/span&gt;
                calculateMean();
            }
            &lt;span class="kwrd"&gt;else&lt;/span&gt;
            {
                &lt;span class="rem"&gt;//The age wasn't less than 100&lt;/span&gt;
                MessageBox.Show(&lt;span class="str"&gt;"Please enter a valid age"&lt;/span&gt;);
            }
        }&lt;/pre&gt;
&lt;br /&gt;
As you can see here using the else construct you have potentially introduced a bug if the user entered a &lt;a href="http://msdn.microsoft.com/library/5kzh1b5w(v=vs.80).aspx"&gt;perfectly valid int value of -10&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
If I had re-written this software without using the else construct I would be forced to manually check for each expected condition:
&lt;br /&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, "Courier New", Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; addAge(&lt;span class="kwrd"&gt;int&lt;/span&gt; userInputtedAge)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (userInputtedAge &amp;gt; 100)
            {
                &lt;span class="rem"&gt;//Bigger than 100&lt;/span&gt;
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentOutOfRangeException();
            }
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (userInputtedAge &amp;lt; 0)
            {
                &lt;span class="rem"&gt;//Less than zero&lt;/span&gt;
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentOutOfRangeException();
            }

            calculateMean();
        }&lt;/pre&gt;
&lt;br /&gt;
Writing without the else has forced me to &lt;b&gt;stop being lazy&lt;/b&gt; - and in the process &lt;b&gt;I removed a potentially serious bug&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
"So what?" you might be thinking. &amp;nbsp;The fact of the matter is any assumptions included in your code have the scope of being manipulated and abused. &amp;nbsp;&lt;a href="http://www.matthewedmondson.info/2010/05/overlooking-security-aspect-of-query.html"&gt;Here is a real life example I found&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My conclusion is simple - if I'm expecting a particular range of inputs I should &lt;u&gt;specifically test for each one&lt;/u&gt;. &amp;nbsp;If an input is not what is expected it is therefore &lt;i&gt;exceptional&lt;/i&gt; and hence the software should throw a tantrum rather than carry on regardless. &amp;nbsp;&lt;b&gt;Software should be designed in a way that causes bugs to show themselves - not hide away quietly.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
So please - next time you think of writing Else stop and think "Do I really mean &lt;i&gt;anything&lt;/i&gt; else?"&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-7456919897242337632?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qh0hS53CzC4Ge-h3hlLR-R7FTGo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qh0hS53CzC4Ge-h3hlLR-R7FTGo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qh0hS53CzC4Ge-h3hlLR-R7FTGo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qh0hS53CzC4Ge-h3hlLR-R7FTGo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/NgiOTFaXv1M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/7456919897242337632/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/01/assumptions-in-software.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/7456919897242337632?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/7456919897242337632?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/NgiOTFaXv1M/assumptions-in-software.html" title="Assumptions in software" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/01/assumptions-in-software.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08DSHs8eCp7ImA9Wx9WEkQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-5371965298382036782</id><published>2011-01-03T15:20:00.002Z</published><updated>2011-01-17T19:17:59.570Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-17T19:17:59.570Z</app:edited><title>Are programmers any good without Google?</title><content type="html">Having recently read that apparently&amp;nbsp;&lt;a href="http://weblog.raganwald.com/2007/01/dont-overthink-fizzbuzz.html"&gt;199 out of 200&lt;/a&gt; of applicants for programming jobs can't write code at all&amp;nbsp;I thought I'd put myself to the test.&lt;br /&gt;
&lt;br /&gt;
The crux of the post being the &lt;a href="http://weblog.raganwald.com/2007/01/dont-overthink-fizzbuzz.html"&gt;FizzBuzz problem&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
My results were rather&amp;nbsp;surprising, although&amp;nbsp;I managed to code a solution within 10 minutes - I had to perform the following google searches:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;c# if whole number&lt;/li&gt;
&lt;li&gt;c# multiples&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
and finally ending up with asking &lt;a href="http://stackoverflow.com/questions/4585166/simple-division"&gt;a rather dumb question over at stackoverflow&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This strikes fear through me, as it has become apparent that I am one of those who have a degree but can &lt;a href="http://www.kegel.com/academy/getting-hired.html"&gt;fail when asked to carry out a basic programming task&lt;/a&gt;&amp;nbsp;during interview.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I've often wondered about this very fundamental understanding of programming - are programmers reduced to being simple googling machines? &amp;nbsp;Are our jobs simply comprised of looking up others&amp;nbsp;code - and making it work for you?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I'm not so sure about the value of coding during interviews, as they tend to want you to code solo - without help. &lt;b&gt;&amp;nbsp;But when in the real world are you working on a computer without internet access?&lt;/b&gt; Now obviously I disagree with someone using the internet for hours whilst trying to solve a trivial problem, but looking up syntax or framework quirks - surely thats excusable?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There are thousands of aspects to the .NET Framework and I challenge anyone who says they "know" it all. A programmer not needing the internet I&amp;nbsp;believe&amp;nbsp;is the equivalent of saying a&amp;nbsp;Christian&amp;nbsp;doesn't need a Bible because they "know" it all.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So what are the general thoughts on this?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-5371965298382036782?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8UAl0oTEebawgDoqZjfgFnM4w0U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8UAl0oTEebawgDoqZjfgFnM4w0U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8UAl0oTEebawgDoqZjfgFnM4w0U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8UAl0oTEebawgDoqZjfgFnM4w0U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/jyqNof08DMY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/5371965298382036782/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2011/01/are-programmers-any-good-without-google.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/5371965298382036782?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/5371965298382036782?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/jyqNof08DMY/are-programmers-any-good-without-google.html" title="Are programmers any good without Google?" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2011/01/are-programmers-any-good-without-google.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUNSXY5cSp7ImA9Wx9RGEg.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-2810272426073212216</id><published>2010-12-20T15:01:00.000Z</published><updated>2010-12-20T15:01:38.829Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-20T15:01:38.829Z</app:edited><title>Is Gmail dangerous?</title><content type="html">&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span"&gt;To date&amp;nbsp;&lt;a href="http://mail.google.com/"&gt;Gmail&lt;/a&gt;&amp;nbsp;is offering&amp;nbsp;&lt;/span&gt;&lt;/span&gt;7530+ MB of free storage space. &amp;nbsp;Of course thats nothing new and is a welcome relief to those who have used e-mail services in the past which restrict your storage.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif;"&gt;However those restrictive e-mail services have one advantage that&amp;nbsp;&lt;a href="http://mail.google.com/"&gt;Gmail&lt;/a&gt;&amp;nbsp;cannot possibly hope to offer;&amp;nbsp;&lt;b&gt;security by forced removal of data&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;Don't get me wrong, I'm an avid &lt;a href="http://mail.google.com/"&gt;Gmail&lt;/a&gt; fan and love being able to search back through the months to find past communications. My gripe is that information is needlessly kept not for a set time but essentially&amp;nbsp;&lt;i&gt;forever&lt;/i&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;"Great" some people might think, now I'll never lose anything and it will always be there for me again if I need it, but take a moment to think of it this way:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;div style="font-family: 'Times New Roman';"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;i&gt;Almost every single part of your online identity - for the whole of the time you've been online - is usually contained within e-mails&lt;/i&gt;&lt;/b&gt;. &amp;nbsp;Thats right, those websites that e-mail you your password after registration, receipts from purchases and even notifications from social networking sites you're subscribed to (to name a few).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Not only that, but because &lt;a href="http://www.codinghorror.com/blog/2007/09/youre-probably-storing-passwords-incorrectly.html"&gt;users collect Usernames and Passwords like Pokemon&lt;/a&gt;, and all those are collected under your e-mail providers password, you're essentially keeping &lt;b&gt;all your eggs in one big&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;persistent&lt;/b&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;b&gt;&amp;nbsp;security basket&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: 'Times New Roman'; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span"&gt;This opens a whole world of security problems such as detailed in&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;a href="http://www.codinghorror.com/blog/2010/12/the-dirty-truth-about-web-passwords.html"&gt;Jeff Atwood's&lt;/a&gt;&amp;nbsp;recent post. The best way to ensure information is secure, is to remove it. &amp;nbsp;Simple! &amp;nbsp;But without enforcing this, how many users will actually do it?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-2810272426073212216?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nenDBUXrb-cEMXOTcO-fEz3YPlw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nenDBUXrb-cEMXOTcO-fEz3YPlw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nenDBUXrb-cEMXOTcO-fEz3YPlw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nenDBUXrb-cEMXOTcO-fEz3YPlw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/BF6mmFbnmcU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/2810272426073212216/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/12/is-gmail-dangerous.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/2810272426073212216?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/2810272426073212216?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/BF6mmFbnmcU/is-gmail-dangerous.html" title="Is Gmail dangerous?" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/12/is-gmail-dangerous.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIHQH04eyp7ImA9Wx5VEko.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-6426091330201889383</id><published>2010-10-05T11:10:00.001+01:00</published><updated>2010-10-05T11:12:11.333+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-05T11:12:11.333+01:00</app:edited><title>C# Conditional Operator ( ?: ) and Null-Coalescing Operator ( ?? )</title><content type="html">After spending a couple of years in the software industry its becoming more and more apparent &amp;nbsp;to me just how little I actually know. &amp;nbsp;It seems that&amp;nbsp;every time&amp;nbsp;I learn something new, something &lt;i&gt;groundbreaking&lt;/i&gt;, a new world of possibilities opens up. &amp;nbsp;One such event&amp;nbsp;occurred&amp;nbsp;today.&lt;br /&gt;
&lt;br /&gt;
A little known operator (??) can do away with bulky if...else statements and tidy up the source code. &amp;nbsp;Suppose you want to assign something to a variable, but only want to do so if that value isn't null? &amp;nbsp;Its something I know I do pretty much every day, usually with code such as:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (x != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;     {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;       y = x;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;     }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;     &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;     {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;       y = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;     }&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
This can be completely replaced with:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;y = x ?? &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
How cool is that?&lt;br /&gt;
&lt;br /&gt;
In addition a single (?) can be used as a boolean conditional operator, so instead of testing for null it can test for any boolean to be true. &amp;nbsp;For example:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;y = x != &lt;span class="kwrd"&gt;null&lt;/span&gt; ? x : &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
This article was written because of inspiration from &lt;a href="http://stackoverflow.com/questions/3862347/what-is-use-of/3862355"&gt;both here&lt;/a&gt; and &lt;a href="http://davidhayden.com/blog/dave/archive/2006/07/05/NullCoalescingOperator.aspx"&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I'm going to be using these quite a bit I think.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-6426091330201889383?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ak_Btj0wujp5WgKn-5faZfr5EQU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ak_Btj0wujp5WgKn-5faZfr5EQU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ak_Btj0wujp5WgKn-5faZfr5EQU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ak_Btj0wujp5WgKn-5faZfr5EQU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/L-r41Nc-E-0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/6426091330201889383/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/10/c-conditional-operator-and-null.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/6426091330201889383?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/6426091330201889383?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/L-r41Nc-E-0/c-conditional-operator-and-null.html" title="C# Conditional Operator ( ?: ) and Null-Coalescing Operator ( ?? )" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/10/c-conditional-operator-and-null.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcMRHw7eCp7ImA9Wx5XFEw.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-1009561781795063724</id><published>2010-09-13T22:41:00.000+01:00</published><updated>2010-09-13T22:41:25.200+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-13T22:41:25.200+01:00</app:edited><title>Preventing Arrow Code</title><content type="html">One of my pet hates in software is arrow code, that is code that contains excessive nesting of conditional statements and loops.&lt;br /&gt;
&lt;br /&gt;
Take a look at this&amp;nbsp;unwieldy&amp;nbsp;mess:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; returnCodes()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        code.Items.Clear()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;If&lt;/span&gt; IsNothing(mycls.Dates) = &lt;span class="kwrd"&gt;False&lt;/span&gt; &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            &lt;span class="kwrd"&gt;If&lt;/span&gt; mycls.Dates.Rows.Count &amp;lt;&amp;gt; 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;                &lt;span class="kwrd"&gt;Dim&lt;/span&gt; myrow &lt;span class="kwrd"&gt;As&lt;/span&gt; DataRow&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;                &lt;span class="kwrd"&gt;Dim&lt;/span&gt; myindex &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;                &lt;span class="kwrd"&gt;For&lt;/span&gt; &lt;span class="kwrd"&gt;Each&lt;/span&gt; myrow &lt;span class="kwrd"&gt;In&lt;/span&gt; mycls.Dates.Rows&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;If&lt;/span&gt; getId(Input.Text) = Trim(myrow(&lt;span class="str"&gt;"id"&lt;/span&gt;)) &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;For&lt;/span&gt; myindex = 0 &lt;span class="kwrd"&gt;To&lt;/span&gt; code.Items.Count - 1&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;If&lt;/span&gt; Trim(code.Items(myindex)) = Trim(myrow(&lt;span class="str"&gt;"year"&lt;/span&gt;)) &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                                &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;For&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;Next&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;If&lt;/span&gt; code.Items.Count - 1 &amp;lt; myindex &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                            code.Items.Add(myrow(&lt;span class="str"&gt;"year"&lt;/span&gt;))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;Else&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;.Compare(Trim(code.Items(myindex)), Trim(myrow(&lt;span class="str"&gt;"year"&lt;/span&gt;)), &lt;span class="kwrd"&gt;True&lt;/span&gt;) &amp;lt;&amp;gt; 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                                code.Items.Add(myrow(&lt;span class="str"&gt;"year"&lt;/span&gt;))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                &lt;span class="kwrd"&gt;Next&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                code.Sorted = &lt;span class="kwrd"&gt;True&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;                &lt;span class="kwrd"&gt;If&lt;/span&gt; code.Items.Count &amp;gt; 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt; setCode(code.Items(0))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    &lt;span class="kwrd"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Pretty ugly huh?&amp;nbsp;A couple of problems with this:&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;There are a high number of distinct paths through the code&lt;/u&gt;&lt;br /&gt;
&lt;div&gt;
The amount paths through a section of code is directly correlated to the chance of it containing a bug. &amp;nbsp;You can't&amp;nbsp;realistically&amp;nbsp;test every single possible scenario on your code - its simply not possible, therefore the only answer is to reduce the possible paths your code can take.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Excessive looping&lt;/u&gt;&lt;br /&gt;
Loops use up resources - fact. &amp;nbsp;A piece of code that loops 5 times is quicker than a piece that loops 500. &amp;nbsp;It is therefore important to use looping carefully to efficiently use resources.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Its hard to debug&lt;/u&gt;&lt;br /&gt;
Chances are you won't be the only person who will have to read and understand your code. You might understand it fully when you write it, but what about a year down the line? What about your&amp;nbsp;colleagues&amp;nbsp;when you&amp;nbsp;aren't&amp;nbsp;about?&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Coding like this will only contribute to a slower, harder to debug, error prone software.&lt;/div&gt;
&lt;br /&gt;
So that I could&amp;nbsp;ultimately&amp;nbsp;understand and&amp;nbsp;subsequently&amp;nbsp;modify, I had to&amp;nbsp;simplify&amp;nbsp;it whilst also keeping in mind the above points.&lt;br /&gt;
&lt;br /&gt;
Now:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; returnCodes()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        code.Items.Clear()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;If&lt;/span&gt; IsNothing(mycls.Dates) &lt;span class="kwrd"&gt;Then&lt;/span&gt; &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; myrow &lt;span class="kwrd"&gt;As&lt;/span&gt; DataRow&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;For&lt;/span&gt; &lt;span class="kwrd"&gt;Each&lt;/span&gt; myrow &lt;span class="kwrd"&gt;In&lt;/span&gt; mycls.Dates.Rows&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            &lt;span class="kwrd"&gt;If&lt;/span&gt; getId(Input.Text) = Trim(myrow(&lt;span class="str"&gt;"id"&lt;/span&gt;)) &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;                &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Not&lt;/span&gt; code.Items.Contains(myrow(&lt;span class="str"&gt;"year"&lt;/span&gt;)) &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;                    code.Items.Add(myrow(&lt;span class="str"&gt;"year"&lt;/span&gt;))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Next&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        code.Sorted = &lt;span class="kwrd"&gt;True&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="kwrd"&gt;If&lt;/span&gt; code.Items.Count &amp;gt; 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt; setCode(code.Items(0))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    &lt;span class="kwrd"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Not only is the code easy to understand, I actually increased performance dramatically. &amp;nbsp;This process &lt;b&gt;reduced loops from 2480 to 509&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The most important lesson I've learnt is that there is simply &lt;b&gt;no excuse&lt;/b&gt; for any good developer to submit code without &amp;nbsp;removing the&amp;nbsp;unnecessary&amp;nbsp;crap. &amp;nbsp;&lt;a href="http://www.codinghorror.com/blog/2006/01/flattening-arrow-code.html"&gt;See this article&lt;/a&gt; for some of the hints on cleaning up your own code.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-1009561781795063724?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UK3cYA_t_91Zh5onvzq1cMJGzMw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UK3cYA_t_91Zh5onvzq1cMJGzMw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UK3cYA_t_91Zh5onvzq1cMJGzMw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UK3cYA_t_91Zh5onvzq1cMJGzMw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/WlEd80vN-a0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/1009561781795063724/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/09/preventing-arrow-code.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1009561781795063724?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1009561781795063724?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/WlEd80vN-a0/preventing-arrow-code.html" title="Preventing Arrow Code" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/09/preventing-arrow-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EMRHY4cSp7ImA9Wx5QEkU.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-8322333009356705132</id><published>2010-08-31T22:21:00.000+01:00</published><updated>2010-08-31T22:21:25.839+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-31T22:21:25.839+01:00</app:edited><title>The difference between validation and verification</title><content type="html">&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;This one is kind of a rant. &amp;nbsp;There is a subtle difference between the two key words &lt;b&gt;validation&lt;/b&gt; and&amp;nbsp;&lt;b&gt;verification&lt;/b&gt;.&amp;nbsp;They are not the same thing, and the&amp;nbsp;difference&amp;nbsp;is taught as low as GCSE IT level.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;I just felt like I needed to say that as there is a lot of &lt;i&gt;"validate this"&lt;/i&gt; and &lt;i&gt;"validate that"&lt;/i&gt;&amp;nbsp;knocking around when in fact verification is what is required. &amp;nbsp;Don't know the difference?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Lets clear this up:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: sans-serif; line-height: 19px;"&gt;&lt;ul style="line-height: 1.5em; list-style-image: url(http://bits.wikimedia.org/skins-1.5/vector/images/bullet-icon.png?1); list-style-type: square; margin-bottom: 0.5em; margin-left: 1.5em; margin-right: 0px; margin-top: 0.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;li&gt;Valid&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;ation: The process of&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 16px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;checking of data to ensure that it is acceptable for it or not&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li style="margin-bottom: 0.1em;"&gt;Verification: The process of checking of data to ensure that it is the correct value&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So when you go down to the ATM and enter your PIN to get cash out its important to understand that any four digit number you type on the keyboard is in fact valid, whereas after checking it is actually yours means it has been verified.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Just so that no one gets this mixed up here are some more examples:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table border="1" cellpadding="5px" cellspacing="0" style="border-width: 0px;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Validation&lt;/td&gt;
&lt;td&gt;Verification&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password
&lt;/td&gt;
&lt;td&gt;Any text at least 7 characters
&lt;/td&gt;
&lt;td&gt;Comparison with actual password
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phone number
&lt;/td&gt;
&lt;td&gt;Correct amount of numbers between 0 - 9
&lt;/td&gt;
&lt;td&gt;Dialling gets through to the right person
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Television channel
&lt;/td&gt;
&lt;td&gt;Any number of correct length
&lt;/td&gt;
&lt;td&gt;Selecting the channel you wanted
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For those who should know better &lt;a href="http://www.regular-expressions.info/"&gt;Regular Expressions&lt;/a&gt; are for validation (thats all they do) and not verification!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I finally have somewhere to point those people who mean one thing, but say another...&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-8322333009356705132?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mPAAWO_vWZo0Byb_4qLmESWqrQg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mPAAWO_vWZo0Byb_4qLmESWqrQg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mPAAWO_vWZo0Byb_4qLmESWqrQg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mPAAWO_vWZo0Byb_4qLmESWqrQg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/T2nbicuEuvY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/8322333009356705132/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/08/difference-between-validation-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/8322333009356705132?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/8322333009356705132?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/T2nbicuEuvY/difference-between-validation-and.html" title="The difference between validation and verification" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/08/difference-between-validation-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIERXozeip7ImA9Wx5QE0g.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-1414466346598291563</id><published>2010-05-25T10:29:00.000+01:00</published><updated>2010-09-01T16:21:44.482+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-01T16:21:44.482+01:00</app:edited><title>Internet Explorer window.close(); does not work after print preview</title><content type="html">It appears that a call to window.close(); or self.close(); doesn't do a single thing after opening print preview in Internet Explorer. &amp;nbsp;Apparently this bug goes from versions 6 - 8 (9 has yet to be released). &amp;nbsp;If anyone has any work&amp;nbsp;arounds for this bug I would be very greatful. &amp;nbsp;It astounds me that such a simple bug can span multiple releases.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-1414466346598291563?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qawQz1wA6WPyYKO3WrNMqGEgQDs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qawQz1wA6WPyYKO3WrNMqGEgQDs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qawQz1wA6WPyYKO3WrNMqGEgQDs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qawQz1wA6WPyYKO3WrNMqGEgQDs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/7bku1NMtkpw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/1414466346598291563/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/05/internet-explorer-windowclose-does-not.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1414466346598291563?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1414466346598291563?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/7bku1NMtkpw/internet-explorer-windowclose-does-not.html" title="Internet Explorer window.close(); does not work after print preview" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/05/internet-explorer-windowclose-does-not.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcDSX0zfyp7ImA9WxFXFkQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-1086706367501385230</id><published>2010-05-24T11:14:00.000+01:00</published><updated>2010-05-24T11:14:38.387+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-24T11:14:38.387+01:00</app:edited><title>Overlooking the security aspect of the query string</title><content type="html">Recently whilst debugging a mission&amp;nbsp;critical, public facing, financial web application I&amp;nbsp;uncovered&amp;nbsp;a very serious security hole.&lt;br /&gt;
&lt;br /&gt;
As one of its features the application contained a content management system so that&amp;nbsp;relevant&amp;nbsp;departments&amp;nbsp;can upload and change content which appears on carefully selected parts of the site. &amp;nbsp;This meant that certain folders must be open to the&amp;nbsp;departments which are available&amp;nbsp;to be edited through the system. &amp;nbsp;The folder currently being worked on was contained in the query string.&lt;br /&gt;
&lt;br /&gt;
For those that do not know what the query string is here is an example. &amp;nbsp;When you google something, for example 'blog' the page you are sent to is&amp;nbsp;&lt;a href="http://www.google.co.uk/search?q=blog"&gt;http://www.google.co.uk/search?q=blog&lt;/a&gt;. That bit after the ? is called the query string (in this case&amp;nbsp;q=blog) which contains my search. &amp;nbsp;I can do what I want with this string and resubmit it. &amp;nbsp;So if I change the query string to q=blogspot and submit it, I am returned the google results for 'blogspot'. &amp;nbsp;Anyone can manipulate the query string.&lt;br /&gt;
&lt;br /&gt;
In the web application this meant that anyone could simply change the query string, and that would change the folder currently being worked on. &amp;nbsp;Only a few guesses are needed to view the contents of restricted folders. &amp;nbsp;Doing this I managed to download the full source code for the application, something which would be very valuable to an attacker...&lt;br /&gt;
&lt;br /&gt;
So if in doubt use server side variables instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-1086706367501385230?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/f-RiCh35hvGdxsUrwN_GIaLA1VY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f-RiCh35hvGdxsUrwN_GIaLA1VY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/f-RiCh35hvGdxsUrwN_GIaLA1VY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/f-RiCh35hvGdxsUrwN_GIaLA1VY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/RYYDfROXzcw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/1086706367501385230/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/05/overlooking-security-aspect-of-query.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1086706367501385230?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1086706367501385230?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/RYYDfROXzcw/overlooking-security-aspect-of-query.html" title="Overlooking the security aspect of the query string" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/05/overlooking-security-aspect-of-query.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8DRng6cCp7ImA9Wx5QEkU.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-8912124959095987226</id><published>2010-01-19T11:02:00.000Z</published><updated>2010-08-31T21:01:17.618+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-31T21:01:17.618+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.net validation control custom user" /><title>Validatation for Custom User Controls</title><content type="html">Recently I stumbled across the problem of needing to validate user input supplied to a Custom User Control. &amp;nbsp;Usually validation is simply the case of dragging one of the excellent&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/aa479013.aspx"&gt;validation controls&lt;/a&gt;&amp;nbsp;onto the page and pointing it towards the control you wish to validate.&lt;br /&gt;
&lt;br /&gt;
Custom User Control's however are a different story. &amp;nbsp;These are controls written by a developer to carry out a function which no other existing controls can. &amp;nbsp;As they have been written from the ground up, they cannot be simply associated to a validation control without further work.&lt;br /&gt;
&lt;br /&gt;
To allow a Custom User Control to be validated the first thing which is required is the addition of&amp;nbsp;&amp;lt;ValidationPropertyAttribute("value")&amp;gt;. &amp;nbsp;This specifies the property which supplies the string to be validated, where "value" is the name of the property.&lt;br /&gt;
&lt;br /&gt;
Secondly the ControlToValidate="" property of validation control on the page should be the ID of the user control, colon(:), then the ID of the control to which 'value' is associated.&lt;br /&gt;
&lt;br /&gt;
For example I had a control named cboTask which had&amp;nbsp;&amp;lt;ValidationPropertyAttribute("value")&amp;gt; defined within it where value was a property which returned the current value of a DropDownList (DropDownList1) which was contained within cboTask. &amp;nbsp;In order to validate that the user selected an option I used the &lt;a href="http://msdn.microsoft.com/en-us/library/5hbw267h(VS.80).aspx"&gt;RequiredFieldValidator&lt;/a&gt; with the ControlToValidate="cboTask:DropDownList1".&lt;br /&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&amp;lt;ValidationPropertyAttribute(&lt;span class="str"&gt;"value"&lt;/span&gt;)&amp;gt; _&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;Partial &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; ctlDropDownList&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;Inherits&lt;/span&gt; System.Web.UI.UserControl&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt; value() &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Get&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            &lt;span class="kwrd"&gt;Return&lt;/span&gt; DropDownList1.SelectedValue.Trim()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Get&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Set&lt;/span&gt;(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; value &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            &lt;span class="kwrd"&gt;Dim&lt;/span&gt; llistitem &lt;span class="kwrd"&gt;As&lt;/span&gt; ListItem&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;            DropDownList1.ClearSelection()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;For&lt;/span&gt; &lt;span class="kwrd"&gt;Each&lt;/span&gt; llistitem &lt;span class="kwrd"&gt;In&lt;/span&gt; DropDownList1.Items&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                &lt;span class="kwrd"&gt;If&lt;/span&gt; RTrim(llistitem.Value) = RTrim(value) &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                    llistitem.Selected = &lt;span class="kwrd"&gt;True&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;For&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            &lt;span class="kwrd"&gt;Next&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Set&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Property&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; Class&lt;/pre&gt;

&lt;/div&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:RequiredFieldValidator&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="rfvTask"&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;       &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;       &lt;span class="attr"&gt;ErrorMessage&lt;/span&gt;&lt;span class="kwrd"&gt;="Task cannot be blank"&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;       &lt;span class="attr"&gt;InitialValue&lt;/span&gt;&lt;span class="kwrd"&gt;=""&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;       &lt;span class="attr"&gt;ControlToValidate&lt;/span&gt;&lt;span class="kwrd"&gt;="cboTask:DropDownList1"&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="attr"&gt;ValidationGroup&lt;/span&gt;&lt;span class="kwrd"&gt;="page"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;*&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:RequiredFieldValidator&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Doing this allows both client and server validation, and allows you to use the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/aa479013.aspx"&gt;validation controls&lt;/a&gt;&amp;nbsp;as you would with any of the existing .NET controls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-8912124959095987226?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1To4rgvfOs-OCFKaoIFOfzOA_1I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1To4rgvfOs-OCFKaoIFOfzOA_1I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1To4rgvfOs-OCFKaoIFOfzOA_1I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1To4rgvfOs-OCFKaoIFOfzOA_1I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/98uaGocQn7E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/8912124959095987226/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2010/01/validatation-for-custom-user-controls.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/8912124959095987226?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/8912124959095987226?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/98uaGocQn7E/validatation-for-custom-user-controls.html" title="Validatation for Custom User Controls" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2010/01/validatation-for-custom-user-controls.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMNQH4yeyp7ImA9Wx5QEkU.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-5536189728023099572</id><published>2009-12-14T10:49:00.000Z</published><updated>2010-08-31T20:38:11.093+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-31T20:38:11.093+01:00</app:edited><title>Preventing an error 403 ever reaching the client</title><content type="html">&lt;div class="MsoNormal"&gt;
I was put in the strange position of preventing an ASP.net web application sending an error HTTP 403 to the client. &amp;nbsp;This was following 'security recommendations from the experts' that an error 403 confirms to an attacker that they have identified a part of the file structure.&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
Anyway this is how I managed to do it.&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
Add an Application_Error method to Global.asax which directs the user to a known page:&lt;/div&gt;
&lt;br /&gt;
&lt;div class="csharpcode"&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Application_Error(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;            {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;                Response.Redirect(&lt;span class="str"&gt;"Default.aspx"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
and configure IIS custom error page to direct to a non-existing page,&amp;nbsp; this will show in the logs so choose something like /AttemptToAccess403.aspx.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
When the server encounters a 403 it will look up the non-existing page which will cause an error in the application.&amp;nbsp; This is caught via the Application_Error method and will direct the user to a valid page (Default.aspx).&amp;nbsp; To the user this is invisible, however the server has logged the attempt to access a directory structure (403) as an attempt to access page /AttemptToAccess403.aspx and an error 403 is never propogated to the client and hence satisfies the security requirement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;u style="text-decoration: none;"&gt;Headers returned to the client:&lt;/u&gt;&lt;br /&gt;
&lt;u style="text-decoration: none;"&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
(before)&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;b&gt;HTTP/1.x 301 Moved Permanently&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;b&gt;&lt;span style="font-weight: 800;"&gt;HTTP/1.x 302 Found&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-weight: 800;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div class="MsoNormal" style="display: inline !important;"&gt;
&lt;b&gt;&lt;div class="MsoNormal" style="display: inline !important;"&gt;
&lt;div style="display: inline !important;"&gt;
&lt;span style="font-weight: normal;"&gt;(after)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div class="MsoNormal" style="display: inline !important;"&gt;
&lt;/div&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;div class="MsoNormal"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-family: Arial; font-size: 10pt;"&gt;HTTP/1.x 200 OK&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-family: Arial; font-size: 10pt;"&gt;&lt;span style="font-weight: 800;"&gt;HTTP/1.x 200 OK&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: normal;"&gt;&lt;b style="mso-bidi-font-weight: normal;"&gt;&lt;span style="font-family: Arial; font-size: 10pt;"&gt;&lt;span style="font-weight: 800;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;div class="MsoNormal" style="display: inline !important;"&gt;
&lt;div style="display: inline !important;"&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;b&gt;&lt;div class="MsoNormal" style="display: inline !important;"&gt;
&lt;div style="display: inline !important;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;As for the initial 'security' concern....&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-5536189728023099572?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NFLFiLfIBlO-ge8Ff8MECsMGRaI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NFLFiLfIBlO-ge8Ff8MECsMGRaI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NFLFiLfIBlO-ge8Ff8MECsMGRaI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NFLFiLfIBlO-ge8Ff8MECsMGRaI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/J5D3ycEvQfI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/5536189728023099572/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/12/preventing-error-403-ever-reaching.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/5536189728023099572?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/5536189728023099572?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/J5D3ycEvQfI/preventing-error-403-ever-reaching.html" title="Preventing an error 403 ever reaching the client" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/12/preventing-error-403-ever-reaching.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4NQHw-eip7ImA9WxNaGEk.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-3515764901037695072</id><published>2009-12-03T12:56:00.000Z</published><updated>2009-12-03T12:56:31.252Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-03T12:56:31.252Z</app:edited><title>ASP Menu bug in IE8 and Chrome</title><content type="html">Well it turns out there is a bug in the ASP Menu control that stops the dynamic part of the menu rendering when the user rolls their mouse over a static part of the menu.&lt;br /&gt;
&lt;br /&gt;
It appears the problem is to do with the way the control checks if the browser has javascript enabled, and it decides both IE 8 and Chrome don't, hence nothing is shown to the user.&lt;br /&gt;
&lt;br /&gt;
The only work arounds I've come&amp;nbsp;across&amp;nbsp;are:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Don't use the thing&lt;/li&gt;
&lt;li&gt;Put IE8 into compatibility mode (or download &lt;a href="http://support.microsoft.com/kb/962351"&gt;this hotfix&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Use this &lt;a href="http://blog.the-dargans.co.uk/2008/09/getting-aspnet-menus-to-work-with.html"&gt;nasty hack around&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Obviously we cannot expect our users to have to follow special procedures to view our site, and with the only other solution being a hack, we'd rather go with something else completely...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-3515764901037695072?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Tyj_v2IfIOSUfoWVNHvRLH96f3Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tyj_v2IfIOSUfoWVNHvRLH96f3Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Tyj_v2IfIOSUfoWVNHvRLH96f3Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tyj_v2IfIOSUfoWVNHvRLH96f3Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/0YSh42DU2rE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/3515764901037695072/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/12/asp-menu-bug-in-ie8-and-chrome.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/3515764901037695072?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/3515764901037695072?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/0YSh42DU2rE/asp-menu-bug-in-ie8-and-chrome.html" title="ASP Menu bug in IE8 and Chrome" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/12/asp-menu-bug-in-ie8-and-chrome.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8ERng4eSp7ImA9Wx9XGE4.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-155039130844201713</id><published>2009-11-23T16:29:00.001Z</published><updated>2011-01-12T12:20:07.631Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-12T12:20:07.631Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="regular expressions" /><title>Regular Expressions are fun</title><content type="html">I've finally made the effort to fully understand how to write my own regular expressions. &amp;nbsp;In the past I just had no idea what something as cryptic as&amp;nbsp;&lt;b&gt;^.+[a-zA-Z][a-zA-Z]\d\d\d\d\d\d.+?.pdf|^.+\w+\.xml&lt;/b&gt;&amp;nbsp;(I just wrote that) meant.&lt;br /&gt;
&lt;br /&gt;
Plugging that into my application now means that it fully validates my input, and does it perfectly. &amp;nbsp;How did we manage before these things were invented?&lt;br /&gt;
&lt;br /&gt;
If you want to learn more about regular expressions then take a look &lt;a href="http://www.regular-expressions.info/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-155039130844201713?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x8AzLCjTeEImUUsTmG3f3rd2cqI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x8AzLCjTeEImUUsTmG3f3rd2cqI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x8AzLCjTeEImUUsTmG3f3rd2cqI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x8AzLCjTeEImUUsTmG3f3rd2cqI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/Qc1Uq0a1v0M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/155039130844201713/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/11/regular-expressions-are-fun.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/155039130844201713?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/155039130844201713?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/Qc1Uq0a1v0M/regular-expressions-are-fun.html" title="Regular Expressions are fun" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/11/regular-expressions-are-fun.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYASHc5cSp7ImA9Wx5QEkU.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-9110220415588191109</id><published>2009-11-04T10:14:00.000Z</published><updated>2010-08-31T20:49:09.929+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-31T20:49:09.929+01:00</app:edited><title>Using the @MasterType directive instead of the @Page directive with MasterPageFile=""</title><content type="html">Just a quick snippet for future use. &amp;nbsp;When referencing a master page within your aspx file its best to use the @MasterType directive rather than the MasterPageFile="" attribute of the @Page directive. &amp;nbsp;Doing so will allow strongly typed access to any methods you've put in the master page rather than having to do something ugly.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="csharpcode"&gt;((DefaultLayout)&lt;span class="kwrd"&gt;this&lt;/span&gt;.Master).SetPageHeading(&lt;span class="str"&gt;"This heading is set from inside Default.aspx"&lt;/span&gt;);&lt;/pre&gt;
&lt;div&gt;
&lt;span style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;becomes:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="csharpcode"&gt;Master.SetPageHeading(&lt;span class="str"&gt;"This heading is set from inside Default.aspx"&lt;/span&gt;);&lt;/pre&gt;
&lt;div&gt;
&lt;span style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px;"&gt;Much better dont you think?&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-9110220415588191109?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ce2Q032OC8QEkUMAR0IvJ1usZxk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ce2Q032OC8QEkUMAR0IvJ1usZxk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ce2Q032OC8QEkUMAR0IvJ1usZxk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ce2Q032OC8QEkUMAR0IvJ1usZxk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/PMSjlIbBmYw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/9110220415588191109/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/11/using-mastertype-directive-instead-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/9110220415588191109?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/9110220415588191109?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/PMSjlIbBmYw/using-mastertype-directive-instead-of.html" title="Using the @MasterType directive instead of the @Page directive with MasterPageFile=&quot;&quot;" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/11/using-mastertype-directive-instead-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4CQnw8eSp7ImA9WxNUEko.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-7997585240482288165</id><published>2009-11-03T18:55:00.000Z</published><updated>2009-11-03T19:36:03.271Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-03T19:36:03.271Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="standards" /><category scheme="http://www.blogger.com/atom/ns#" term="web" /><category scheme="http://www.blogger.com/atom/ns#" term="browser" /><title>Browser discrepancies, arghh!</title><content type="html">Why oh why do browsers from different vendors (Internet &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Exlorer&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Firefox&lt;/span&gt;, Chrome etc) STILL have problems agreeing on the correct way to display a web page and correctly interpret javascript?&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.w3.org/"&gt;World Wide Web Consortium&lt;/a&gt; has been around for &lt;a href="http://en.wikipedia.org/wiki/W3c"&gt;15 years now&lt;/a&gt; and defines the standards required for web developers to follow (which I must say I attempt to do very carefully) only to find that most browsers out there don't (or even worse have their &lt;span style="font-style: italic;"&gt;own&lt;/span&gt; interpretation of them).&lt;br /&gt;&lt;br /&gt;The problem here is the W3C leaves it up to the software manufacturers in order to become 'compliant', which doesn't mean much, as there are different standards of compliance, huh?&lt;br /&gt;&lt;br /&gt;Microsoft's latest version of Internet Explorer claims it is "standards &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;compliant&lt;/span&gt;" and has been riled all over the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;internet&lt;/span&gt; forums for breaking existing websites. Which I think is a very positive move as now these websites must also begin to follow standards or start losing traffic.&lt;br /&gt;&lt;br /&gt;I think the only way this can be tackled would a scheme which checks new web browser software prior to market for &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;compliance&lt;/span&gt;, and only if it passes 100% of tests can it legally be called a browser.  Such a scheme could work in the same way that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SSL&lt;/span&gt; certificates are issued, and would work something like this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Software is submitted to an &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;independent&lt;/span&gt; authority which &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_7"&gt;performs&lt;/span&gt; tests on the browser for &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;compliance&lt;/span&gt; with current standards&lt;/li&gt;&lt;li&gt;Following a successful result a certificate is issued based on a signature of the software, and is unique to that software&lt;/li&gt;&lt;li&gt;In order resolve domain names this certificate must be included in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;DNS&lt;/span&gt; requests, failure of which would mean the request is ignored&lt;/li&gt;&lt;/ul&gt;Assuming this is possible would mean that non-&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;compliant&lt;/span&gt; browsers would be less &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;convenient&lt;/span&gt; to use for end users (who wants to type in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;IPs&lt;/span&gt; each time they want to visit a page?) and would result in loss of custom, forcing them elsewhere.&lt;br /&gt;&lt;br /&gt;On a side note the latest version of outlook express actually uses the Word (yes &lt;span style="font-style: italic;"&gt;Word&lt;/span&gt;) to render embedded HTML, surely this is a joke Microsoft?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-7997585240482288165?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sY082Ml7p8Qa9ogXS9DSZ5VccVo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sY082Ml7p8Qa9ogXS9DSZ5VccVo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sY082Ml7p8Qa9ogXS9DSZ5VccVo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sY082Ml7p8Qa9ogXS9DSZ5VccVo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/DoIwW6KJuFI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/7997585240482288165/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/11/browser-discrepancies-arghh.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/7997585240482288165?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/7997585240482288165?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/DoIwW6KJuFI/browser-discrepancies-arghh.html" title="Browser discrepancies, arghh!" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/11/browser-discrepancies-arghh.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MEQ3Y4eyp7ImA9WxNUEUU.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-5898284916857506209</id><published>2009-11-02T16:46:00.000Z</published><updated>2009-11-02T17:03:22.833Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-02T17:03:22.833Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="bank card reader chip and pin" /><title>Why I hate the bank card readers</title><content type="html">All the major banks are now supplying the darned card readers to be used for online transactions.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you don't know what I mean they're the little "calculator like" devices which you insert your debit card (and pin) to allow yourself to be authenticated via online banking.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However (like all security) there are downsides:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;You have to carry one &lt;i&gt;everywhere&lt;/i&gt; you do your online banking&lt;/li&gt;&lt;li&gt;For some reason most institutions &lt;i&gt;lock&lt;/i&gt; them to only work with their cards (so you cannot simply borrow one from someone)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Most people mis-understand how these devices work, the clue is in the name, they are a &lt;i&gt;reader&lt;/i&gt;, they don't have any logic on-board regarding anything financial.  The processing all happens within the chip itself on the card, the readers are simply a means of communicating with your card.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Regarding having to use one for each institution would be very understandable if each used their own algorithms for card transactions, but this would be both a massive overhead and simply isn't the way its done (do they have different card readers for each bank in the shops?).  Instead a marker is set on the card detailing the banks 5 digit number.  The readers must simply compare this to a pre-set value and if not identical "Wrong Card", god dam!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Forcing most people to have to carry this stupid things around with them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Regarding security they can actually make it worse.  Picture this.  Dark alley late at night. Thieves mug you, get your card, and demand your pin.  It can be checked on the spot, without the thieves having to risk marching you to the nearest cash machine.  This is &lt;i&gt;stupid &lt;/i&gt;that these things actually issue "wrong pin, try again".  A better way would to be simply issue the authentication codes anyway, which would of course be wrong had the pin being incorrect.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Nevermind, maybe the banks will catch up with technology one day...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Shame on you banks for locking down on internet banking when the whole ethos is around making it more convenient for their customers.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-5898284916857506209?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vXzciT7TaSk270CGqidm2-AaGmc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vXzciT7TaSk270CGqidm2-AaGmc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vXzciT7TaSk270CGqidm2-AaGmc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vXzciT7TaSk270CGqidm2-AaGmc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/i1J-YmrK9Mo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/5898284916857506209/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/11/why-i-hate-bank-card-readers.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/5898284916857506209?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/5898284916857506209?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/i1J-YmrK9Mo/why-i-hate-bank-card-readers.html" title="Why I hate the bank card readers" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/11/why-i-hate-bank-card-readers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYBQ3w6cCp7ImA9WxNVGE8.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-726764029693374777</id><published>2009-10-29T14:11:00.000Z</published><updated>2009-10-29T14:22:32.218Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-29T14:22:32.218Z</app:edited><title>.NET Framework gets more powerful by the day</title><content type="html">Almost daily now I discover another aspect of the .NET framework which replaces manual repetitive tasks us developers are used to.&lt;br /&gt;&lt;br /&gt;On going about setting up a membership system for a recent project I was about to go ahead and create session variables so the user can be tracked across pages, a pretty usual task in web development, when a colleague passed me a training folder entitled "Developing ASP.NET Web Applications: Hands-On".&lt;br /&gt;&lt;br /&gt;Well blow me, everything you need (I mean EVERYTHING) is already pre-written and accessible through the System.Web.Security namespace using the Membership Provider, and anything that you need to customise is simply a case of deriving a class full of your own code.&lt;br /&gt;&lt;br /&gt;In about 5 mins flat I put all the "members only" pages into a respective folder and changed the config file, now it'll only be shown when I &lt;u&gt;drag&lt;/u&gt; the asp:Login control and authenticate myself. So much easier, and .NET is definitely becoming my first choice for personal and future projects&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-726764029693374777?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Cen-G41yadNzpJZObR3465-mIlQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cen-G41yadNzpJZObR3465-mIlQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Cen-G41yadNzpJZObR3465-mIlQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cen-G41yadNzpJZObR3465-mIlQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/feNhA9Xuahg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/726764029693374777/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/10/net-framework-gets-more-powerful-by-day.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/726764029693374777?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/726764029693374777?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/feNhA9Xuahg/net-framework-gets-more-powerful-by-day.html" title=".NET Framework gets more powerful by the day" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/10/net-framework-gets-more-powerful-by-day.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcAQX0-fip7ImA9WxNbFkk.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-1072208972097617289</id><published>2009-06-08T15:28:00.000+01:00</published><updated>2009-11-19T14:47:20.356Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-19T14:47:20.356Z</app:edited><title>WHHAAT? HttpUtility.Urlencode() doesn't encode apostrophes?</title><content type="html">For some obscure reason &lt;a href="http://msdn.microsoft.com/en-us/library/4fkewx0t.aspx"&gt;HttpUtility.Urlencode()&lt;/a&gt; supplied with the .NET framework doesn't encode the apostrophe!  The only way around this appears to be encode it, then manually replace this "special character" with %27.&lt;br /&gt;
&lt;br /&gt;
This is rather worrying actually.  I've used this method plenty of times, in past projects, only to have found out they can be broken with a simple '.  This is a major oversight on MS's behalf (yes have you noticed the amount of apostrophe's that appear in this post?).&lt;br /&gt;
&lt;br /&gt;
Anyways, looks like a quick Ctrl+F to find all instances of this I can and to replace with:&lt;br /&gt;
&lt;br /&gt;
HttpUtility.UrlEncode(URL.Replace("'", "%27");&lt;br /&gt;
&lt;br /&gt;
Funny how this isn't documented anywhere in the official docs isn't it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-1072208972097617289?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mJtWPzFIiVZOfs3t58VRkZUDwaU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mJtWPzFIiVZOfs3t58VRkZUDwaU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mJtWPzFIiVZOfs3t58VRkZUDwaU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mJtWPzFIiVZOfs3t58VRkZUDwaU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/HD4TecI-ncY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/1072208972097617289/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/06/whhaat-httputilityurlencode-doesnt.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1072208972097617289?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/1072208972097617289?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/HD4TecI-ncY/whhaat-httputilityurlencode-doesnt.html" title="WHHAAT? HttpUtility.Urlencode() doesn't encode apostrophes?" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/06/whhaat-httputilityurlencode-doesnt.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8CRn0zfip7ImA9WxJQFUQ.&quot;"><id>tag:blogger.com,1999:blog-5869170458511702205.post-2173515086017154260</id><published>2009-05-29T11:39:00.000+01:00</published><updated>2009-05-29T11:44:27.386+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-29T11:44:27.386+01:00</app:edited><title>I was caught Google's StreetView!</title><content type="html">On the way to work this morning whilst sending a text message I realised the easily &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;distinguishable&lt;/span&gt; &lt;a href="http://maps.google.co.uk/help/maps/streetview/"&gt;Google StreetView&lt;/a&gt; cam flying past on the top of a foreign registered corsa, and I've a good bet it was filming at the time. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No images are online yet...but I'll be checking on a daily basis.  I wonder how long it takes them to process and upload the images?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5869170458511702205-2173515086017154260?l=www.matthewedmondson.info' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YEAmpN8Kfdjc4wMMc0-cNltWwi0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YEAmpN8Kfdjc4wMMc0-cNltWwi0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YEAmpN8Kfdjc4wMMc0-cNltWwi0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YEAmpN8Kfdjc4wMMc0-cNltWwi0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/matthewedmondson/Erzm/~4/8J3iXliBD7Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.matthewedmondson.info/feeds/2173515086017154260/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.matthewedmondson.info/2009/05/i-was-caught-googles-streetview.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/2173515086017154260?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5869170458511702205/posts/default/2173515086017154260?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/matthewedmondson/Erzm/~3/8J3iXliBD7Q/i-was-caught-googles-streetview.html" title="I was caught Google's StreetView!" /><author><name>eddy556</name><uri>http://www.blogger.com/profile/01617617680494514764</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.matthewedmondson.info/2009/05/i-was-caught-googles-streetview.html</feedburner:origLink></entry></feed>

