<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Radcliffe &#187; Work</title>
	<atom:link href="http://www.dwradcliffe.com/blog/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dwradcliffe.com</link>
	<description>Web Developer</description>
	<lastBuildDate>Thu, 29 Jul 2010 14:56:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>UpdateModel requires properties</title>
		<link>http://www.dwradcliffe.com/blog/2010/02/updatemodel-requires-properties/</link>
		<comments>http://www.dwradcliffe.com/blog/2010/02/updatemodel-requires-properties/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 01:32:40 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/?p=225</guid>
		<description><![CDATA[I was working on a feature at work this week on a ASP MVC project. I was attempting to use UpdateModel to update an object retrieved from the database with values from the POST. If you aren&#8217;t familiar with it, ASP MVC has a &#8220;magic method&#8221; to map these POST values to an object. One [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a feature at work this week on a ASP MVC project. I was attempting to use UpdateModel to update an object retrieved from the database with values from the POST. If you aren&#8217;t familiar with it, ASP MVC has a &#8220;magic method&#8221; to map these POST values to an object. One simply needs to call</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">UpdateModel<span style="color: #000000;">&#40;</span>myObjectFromDatabase<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p> and the new values will be changed on the object.</p>
<p>That is all fine and dandy unless it doesn&#8217;t work. I had checked everything. I could verify that the values were in the Request header. I could verify that UpdateModel was called and did not fail. The values simply were not updated.</p>
<p>I finally found the key (thanks to my supervisor). The object I was updating had a mix of auto-properties and fields. Apparently, UpdateModel will only update properties. A quick change from a field to an auto-property and everything worked as it should. Thanks Aaron!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2010/02/updatemodel-requires-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Phone Numbers</title>
		<link>http://www.dwradcliffe.com/blog/2010/02/clean-phone-numbers/</link>
		<comments>http://www.dwradcliffe.com/blog/2010/02/clean-phone-numbers/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 20:34:56 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/?p=184</guid>
		<description><![CDATA[I&#8217;ve been working with a lot of person type data recently at work and I&#8217;m using data from multiple sources. Not just two databases but two separate systems with similar and yet incompatible data. One of the biggest messes was the phone numbers. I need to convert a phone number from a completely un-normalized format [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with a lot of person type data recently at work and I&#8217;m using data from multiple sources. Not just two databases but two separate systems with similar and yet incompatible data. One of the biggest messes was the phone numbers. I need to convert a phone number from a completely un-normalized format to a very strict format. I&#8217;m no regular expression genius so thankfully a quick Google search produced a nice PHP method of doing pretty much exactly what I was looking for. (<a href="http://cnanney.com/journal/code/cleaning-phone-numbers-with-regex/">http://cnanney.com/journal/code/cleaning-phone-numbers-with-regex/</a>) I took that method and re-wrote it in C# and tweaked it a little for my application. I&#8217;m sure this isn&#8217;t the absolute best way to do this but it works for me.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">const</span> <span style="color: #FF0000;">string</span> pattern <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;\D*\(?(\d{3})?\)?\D*(\d{3})\D*(\d{4})\D*(\d{1,8})?&quot;</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">string</span> num, ext<span style="color: #008000;">;</span>
var matches <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Regex<span style="color: #000000;">&#40;</span>pattern<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Match</span><span style="color: #000000;">&#40;</span>number<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Groups</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>matches.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;(&quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;) &quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;-&quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;-&quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
ext <span style="color: #008000;">=</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">4</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">?</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">4</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">:</span> null<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
ext <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2010/02/clean-phone-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009: Year in Review</title>
		<link>http://www.dwradcliffe.com/blog/2010/01/2009-year-in-review/</link>
		<comments>http://www.dwradcliffe.com/blog/2010/01/2009-year-in-review/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 18:09:39 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/?p=132</guid>
		<description><![CDATA[Well I guess it&#8217;s about time I write about what has happened in the last 12 months. This past year has been the biggest year of changes in my life thus far. Here is the rundown: Started January at IWU, my final semester of college, living off campus (since September 2008) February 25th I joined [...]]]></description>
			<content:encoded><![CDATA[<p>Well I guess it&#8217;s about time I write about what has happened in the last 12 months. This past year has been the biggest year of changes in my life thus far. Here is the rundown:</p>
<ul>
<li>Started January at IWU, my final semester of college, living off campus (since September 2008)</li>
<li>February 25th I<a href="http://twitter.com/dwradcliffe/statuses/1248267266"> joined</a> Twitter</li>
<li>In February I <a href="http://twitter.com/dwradcliffe/statuses/1248279921">began</a> my job search</li>
<li>February 16th I took and passed the <a href="http://www.dwradcliffe.com/blog/2009/02/zend-php-5-certified-engineer/">Zend PHP 5 Certification</a></li>
<li>In April I was hired by FORUM Credit Union</li>
<li>April 25th I graduated from Indiana Wesleyan University with a B.S. in Computer Internet Development</li>
<li>April 26th I moved to Indianapolis, IN</li>
<li>April 29th I <a href="http://www.dwradcliffe.com/blog/2009/04/forum-credit-union/">began my new job at FORUM</a></li>
<li>May 21st I proposed to Katie Stipe, and she said YES!</li>
<li>In August we had <a href="http://www.dwradcliffe.com/blog/2009/08/engagement-photos/">engagement photos</a> taken</li>
<li>June, July, August, September and October was a blur of wedding preparations</li>
<li>October 17th I got married! (<a href="http://www.dwradcliffe.com/blog/2009/11/wedding-pictures/">photos</a>)</li>
<li>In December we took a vacation to <a href="http://www.daveandkate.us/2010/01/disney-versus-reality/">Disney in Florida</a> (I hadn&#8217;t been there since I was 6)</li>
</ul>
<p>It has been a great, full year.  I&#8217;m very much looking forward to a slower yet just as fulfilling 2010.</p>
<p><span style="color: #888888;">You should <a href="http://www.twitter.com/dwradcliffe">follow me on twitter</a> to get the latest from 2010.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2010/01/2009-year-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FORUM Solutions is hiring!</title>
		<link>http://www.dwradcliffe.com/blog/2009/11/forum-solutions-is-hiring/</link>
		<comments>http://www.dwradcliffe.com/blog/2009/11/forum-solutions-is-hiring/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 15:13:32 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/blog/?p=63</guid>
		<description><![CDATA[FORUM Solutions is looking for a senior level .NET developer to join our team. You can look at our official blog post. The official job posting is on FORUM&#8217;s openhire site. If you&#8217;re interested I encourage you to submit your resume and contact us! FORUM Solutions is currently looking for a senior level (5+ years) [...]]]></description>
			<content:encoded><![CDATA[<p>FORUM Solutions is looking for a senior level .NET developer to join our team.</p>
<p>You can look at our official <a href="http://forumsolutions.com/2009/11/16/forum-solutions-is-hiring">blog post</a>.</p>
<p>The official job posting is on <a href="http://hostedjobs.openhire.com/epostings/submit.cfm?fuseaction=app.jobinfo&amp;jobid=290028&amp;company_id=15726&amp;version=1&amp;source=ONLINE&amp;jobOwner=1006512&amp;aid=1">FORUM&#8217;s openhire site</a>.</p>
<p>If you&#8217;re interested I encourage you to submit your resume and contact us!</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<p>FORUM Solutions is currently looking for a senior level (5+ years) .NET developer.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2009/11/forum-solutions-is-hiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
