<?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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkMERnozfyp7ImA9WhRVGE4.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098</id><updated>2012-01-17T15:06:47.487-06:00</updated><category term="Business" /><category term="Code" /><category term="Milyli" /><category term="Microsoft" /><category term="WCF" /><category term="SharePoint" /><category term="Hardware" /><category term="Design" /><category term="Management" /><category term="Security" /><category term="JavaScript" /><category term="Unit Testing" /><category term="Google" /><category term="XAML" /><category term="Open Source" /><category term="Silverlight" /><category term="ASP.NET" /><category term="Quality" /><title>Cozened Cognizance</title><subtitle type="html">Bits of wisdom about software development, project management and sometimes technology in general gleaned from people infinitely smarter than myself.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.cozcog.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.cozcog.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>73</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/CozenedCognizance" /><feedburner:info uri="cozenedcognizance" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>41.87355</geo:lat><geo:long>-87.788509</geo:long><entry gd:etag="W/&quot;C0QBRns5eip7ImA9Wx9TEEQ.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-4927339012619938983</id><published>2010-11-18T08:20:00.003-06:00</published><updated>2010-11-18T08:42:37.522-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-18T08:42:37.522-06:00</app:edited><title>Development Database Setup</title><content type="html">Hello Everyone,&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;If you're working on an application of any significant complexity, one of the tasks developers must deal with are database set up scripts. &amp;nbsp;One trend that I've noticed over the years is that projects where developers maintain a set of scripts that setup the databases from scratch tend to go more smoothly. &amp;nbsp;To be clear, this process&amp;nbsp;includes tearing down any existing database, rebuilding the database to the most recent release version, loading good test data, and finally running all change scripts for the next release. &amp;nbsp;Though those last two steps can be reversible depending on the project.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Example the first. &amp;nbsp;I have a system. &amp;nbsp;Yaay! &amp;nbsp;I need to make a change to the database. &amp;nbsp;It's a relatively complex change involving creating a new table including keys and indexes, copying data from an existing table to the new one, and removing columns on the old table. Booo! &amp;nbsp;After I make all these changes and have the scripts in place, I need to test that I did everything correctly. &amp;nbsp;On the plus side, I have a&amp;nbsp;thorough&amp;nbsp;rebuild process in place. &amp;nbsp;I can click a button and the whole system is rebuilt, I find problems and fix them myself and I know without bothering any other developers that the scripts are good. &amp;nbsp;Yaay!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Example the second. &amp;nbsp;I have a system. &amp;nbsp;Yaay! &amp;nbsp;I need to make a change to the database. &amp;nbsp;It's a relatively complex... yada yada yada...&amp;nbsp;I need to test that I did everything correctly &amp;nbsp;Booo! Unfortunately, databases are not torn down and rebuilt as part of the setup process, they are only modified. &amp;nbsp;What do I do to easily test my script. &amp;nbsp;I can undo the changes by hand and rerun the scripts to make sure, or I can check in the changes, hope for the best and let the next developer find any problems and repeat the cycle with yet another developer. &amp;nbsp;Which one do you think ends up happening more often? &amp;nbsp;Booo!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This may not be a huge issue that comes up a lot, but when I see emails going out a few times a month with issues lasting a couple of days because things are done the latter, it reminds me of how many things that developers already need to keep track of and this is just another disturbance. &amp;nbsp;In the end the amount of work to make the changes is the same, but having a complete rebuild is&amp;nbsp;a way to minimize disturbances and keep developers developing. &amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;If starting a new project, I highly recommend the complete rebuild approach because the hardest possible task would be overcoming momentum and switching from one process to the other.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-4927339012619938983?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FdgWIjsDJ-VSKYn_BZa0c2qcTf0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FdgWIjsDJ-VSKYn_BZa0c2qcTf0/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/FdgWIjsDJ-VSKYn_BZa0c2qcTf0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FdgWIjsDJ-VSKYn_BZa0c2qcTf0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/PmUQQR4AYdQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/4927339012619938983/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/11/development-database-setup.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4927339012619938983?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4927339012619938983?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/PmUQQR4AYdQ/development-database-setup.html" title="Development Database Setup" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/11/development-database-setup.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAEQX49fip7ImA9Wx5QEEg.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-1182356531990963398</id><published>2010-08-28T23:28:00.002-05:00</published><updated>2010-08-28T23:55:00.066-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-28T23:55:00.066-05:00</app:edited><title>Time to Leave Sprint?</title><content type="html">Not many people are fans of their cell phone companies lately.  Most people I know are getting upset at AT&amp;amp;T.  Their phones, mostly iPhones, are dropping their calls left and right.  Verizon's customer service doesn't seem to be up to par.  And Sprint, that's the one I get to complain about, I'm getting more and more upset with their phones.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I just picked up an EVO 4G.  On the surface, this is a great phone.  Easy to set up and use every app I've tried so far.  I then noticed that there's a bunch of apps that come prepackaged on the phone that I just have no interest in.  NASCAR?  What's that?  Voice mail?  I want to use Google Voice thanks much.  Uninstall prepackaged apps?  Good luck.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Yes there are people on the web that say they have done it.  I tend to believe them as there are videos documenting the process.  But it is a process that is not for the computer illiterate; sometimes consisting of multiple updates, flashes, backups and recoveries.  And in my case, while I'm not afraid of linux or ADB, all of the instructions I have found simply end with my phone displaying a disheartening message of "Update Fail!"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One post on the web asked the question, "Whose phone is this?"  We probably all agreed that the phones weren't ours when we signed those contracts to indicate that we had read said contracts even though in my case the sheaf of papers was barely on the counter long enough for me to dot the 'i' in my last name.  Even if that is the case, shouldn't the phone feel like it belongs to me?  If it doesn't, why would I want to use it?  Meh, I'll probably forget about it eventually...  until I go looking to use a nearby app... and remember all the folks that were able to remove that app... and then their phones got faster... and had longer battery life... grumble grumble... damn Sprint...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I suppose all the phone companies are being forced, at gun point of course, to cut corners somewhere to be competitive.  In the case of Sprint, apparently that means selling those corner seats out to advertisers.  I suppose it did get me talking about NASCAR... Ah well, might as well get in the spirit.  "Make that telco your bitch Ricky Bobby!"&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-1182356531990963398?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KCIJhHs2u4Yo7jLMbA9n0lJne-M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KCIJhHs2u4Yo7jLMbA9n0lJne-M/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/KCIJhHs2u4Yo7jLMbA9n0lJne-M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KCIJhHs2u4Yo7jLMbA9n0lJne-M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/tUkTQfdjOa0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/1182356531990963398/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/08/time-to-leave-sprint.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1182356531990963398?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1182356531990963398?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/tUkTQfdjOa0/time-to-leave-sprint.html" title="Time to Leave Sprint?" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/08/time-to-leave-sprint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQFQX84cSp7ImA9WxFVGE0.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-1983029683035178305</id><published>2010-06-17T09:33:00.006-05:00</published><updated>2010-06-17T14:51:50.139-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-17T14:51:50.139-05:00</app:edited><title>IQueryable and Repositories</title><content type="html">&lt;div&gt;One approach for coding repositories that I have seen a couple of times recently is that of exposing IQueryable collections through the repository interfaces.  On the one hand this allows an extremely convenient way of exposing a flexible data source to your business layer or controllers.  However, it also breaks the &lt;a href="http://www.objectmentor.com/resources/articles/srp.pdf"&gt;Single Responsibility Principle&lt;/a&gt; thus creating less reusable and testable solutions.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By allowing your business layer to define queries within its own methods, those methods are taking on two responsibilities, performing data access and performing logic on the results of that data operation.  It's all well and good to complain about not hitting some high ideal, but what affect does this have in the real world?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, if you happen to reuse the same data query in multiple parts of your application, you would have multiple places that you would then need to make changes and test.  DRY this isn't.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Second is the testability of this code.  In the terms of this &lt;a href="http://www.cozcog.com/2010/06/unitofwork.html"&gt;afore mentioned&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/ff714955.aspx"&gt;white paper&lt;/a&gt;, you would need to write your tests for your business layer or controller in such a way that the state is correct as well as the interactions, for each method.  As the paper says, testing the state aspect requires a larger set of data.  Why would you want to write that extra code for every method in your business layer / controller that uses the same query?  If you don't test each one, how do you know they work?  How do you know when they break?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The simple solution is to keep your queries in the repositories behind the repository interfaces.  Test the state of each one thoroughly and then you only need to test the interactions in your business layer.  Yes it requires an extra function call in your business layer, another method in your repository interface and another function declaration in the repository.  And while that might be a lot of words, it's only four or five more lines of code for each query (including brackets on their own line in C#.)  And if you reuse your queries, you get those extra lines back anyway.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I will certainly concede that no one paradigm fits all of the software problems out there.  Maybe what I suggest is overkill.  Maybe it's another example of a programmer too set in his ways.  But by exposing IQueryable collections through the repository interface, we're ignoring a number of the principles of coding that have been making our lives easier and our code better for a while now.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[Edit]&lt;/div&gt;&lt;div&gt;After a second read through of the article, K. specifically states that enumerables could be returned instead of queryables.  Not that this is the only publication I have read where queryables were suggested.  Let's just say that now all four of my regular readers know where I stand on the subject.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-1983029683035178305?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6bAQMZc9CVCCnyNFwFgiQMxTn1k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6bAQMZc9CVCCnyNFwFgiQMxTn1k/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/6bAQMZc9CVCCnyNFwFgiQMxTn1k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6bAQMZc9CVCCnyNFwFgiQMxTn1k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/lWlYG0jx578" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/1983029683035178305/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/06/iqueryable-and-repositories.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1983029683035178305?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1983029683035178305?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/lWlYG0jx578/iqueryable-and-repositories.html" title="IQueryable and Repositories" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/06/iqueryable-and-repositories.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUMR3k5eSp7ImA9WxFVF0U.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-1281991673997775401</id><published>2010-06-17T08:36:00.007-05:00</published><updated>2010-06-17T09:51:26.721-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-17T09:51:26.721-05:00</app:edited><title>UnitOfWork</title><content type="html">&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/ff714955.aspx"&gt;This white paper&lt;/a&gt; by &lt;a href="http://odetocode.com/Blogs/scott/archive/2010/06/14/testability-amp-entity-framework-4-0.aspx"&gt;K. Scott Allen&lt;/a&gt; is a great read and was my formal introduction to the Unit-Of-Work concept.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For a while, the recommended approach for providing data contexts was to create the context and store it in a session of some sort.  Each call to your server would provide a single data context  for all of the logic needed to render a new page or perform some sort of data operation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;UnitOfWork might not be a name that explains exactly what the object &lt;i&gt;is &lt;/i&gt;(a data context container).  But, it does describe what the object &lt;i&gt;does&lt;/i&gt;.  It frames a  the data context within a single logical unit of work.  The distinction being that it may take many logical routines to render a single web page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One advantage to the technique is that you are committing data changes at the end of each logical routine.  This means that many of the data changes for that routine can all be committed at once using fewer network and database resources over a shorter period of time.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another advantage is that you are holding the data necessary for each operation in memory for only as long as it is needed.  When the operation is done and the data is likely no longer needed, the memory is flushed and reused for other operations.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lastly (that I'll mention anyway), it separates your data context scope from session scope. The session will likely be different in web, windows and service applications.  This means that your session across different applications may comprise a different number of business methods which can have unforeseen affects on performance and functionality.  Instead, you can tie the scope of your data context to each business method as those make good candidates for a unit of work. This in turn means that your routines will perform more predictably across different types of applications.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-1281991673997775401?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/h9-F_NKTQsDdnknZSoxKZR-TAqI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h9-F_NKTQsDdnknZSoxKZR-TAqI/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/h9-F_NKTQsDdnknZSoxKZR-TAqI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/h9-F_NKTQsDdnknZSoxKZR-TAqI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/yDz1puXBSb8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/1281991673997775401/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/06/unitofwork.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1281991673997775401?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1281991673997775401?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/yDz1puXBSb8/unitofwork.html" title="UnitOfWork" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/06/unitofwork.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcHQX45fCp7ImA9WxFVGE0.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-7831680460000476927</id><published>2010-06-10T08:55:00.008-05:00</published><updated>2010-06-17T15:37:10.024-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-17T15:37:10.024-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google" /><title>Backgrounds, Google?  Really?</title><content type="html">&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;If you got to this post, you're probably wondering how to turn off Google backgrounds.  I for one am pretty sure that if there isn't already a setting, there will be one shortly.  I can't be the only person that want's my plain white, pleasant and &lt;span style="font-style: italic;"&gt;unobtrusive &lt;/span&gt;background back.  I'm also far too lazy to go look for that setting given that a link to it doesn't exist on the front page.&lt;br /&gt;&lt;br /&gt;That being the case, I created some 800 x 600 solid color backgrounds and uploaded them to Picasa.  800 x 600 by the way is the minimum resolution that can be used.  Yes, I do like the fact that Google is hosting my solution to my Google problem.  &lt;/span&gt;&lt;/span&gt;Download early, download often.  &lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;Here's the links:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://lh4.ggpht.com/_BWhYDXu2DYE/TBDwIezS1CI/AAAAAAAAAGc/WwWmugMm93w/s720/Blank.gif"&gt;White&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://lh5.ggpht.com/_BWhYDXu2DYE/TBDwIItEHbI/AAAAAAAAAGY/pXJL6H9-3oc/s720/Gray.gif"&gt;Gray&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://lh5.ggpht.com/_BWhYDXu2DYE/TBDwH_jR_hI/AAAAAAAAAGU/7Am3kyN7giY/s720/DarkGray.gif"&gt;Dark Gray&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://lh3.ggpht.com/_BWhYDXu2DYE/TBDwH6-bf8I/AAAAAAAAAGQ/AER4v4zpJcg/s720/Black.gif"&gt;Black&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;I recommend the dark gray though the white does give a good 'White Album' feel.   Obviously, you can also easily create your own image using MS Paint or any simple image editor if you prefer, say, color.  Click on the 'Change background image' link in the lower left hand of  the Google front page and upload the file from your computer.&lt;br /&gt;&lt;br /&gt;Fine, this didn't take much imagination or skill.  But I was so dumbstruck when I saw the page, it was all I could do to listen to various suggestions from coworkers.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[Edit]&lt;/div&gt;&lt;div&gt;In retrospect, this may have just been really good marketing.  Google did seem to have a fix in place fairly quickly.  I'm sure ours wasn't the only office where the new background had everyone talking for a few minutes.  And who knows how many bloggers out there were duped into creating buzz about it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;hrmmmm&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-7831680460000476927?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6EXH9sl9o11AxmyfCsvJ0N6b3gA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6EXH9sl9o11AxmyfCsvJ0N6b3gA/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/6EXH9sl9o11AxmyfCsvJ0N6b3gA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6EXH9sl9o11AxmyfCsvJ0N6b3gA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/-eGZJYOUI5I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/7831680460000476927/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/06/backgrounds-google-really.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7831680460000476927?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7831680460000476927?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/-eGZJYOUI5I/backgrounds-google-really.html" title="Backgrounds, Google?  Really?" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/06/backgrounds-google-really.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4HQnw5cSp7ImA9WxFQFkU.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-6895457293124913902</id><published>2010-04-14T13:42:00.005-05:00</published><updated>2010-05-12T13:28:53.229-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-12T13:28:53.229-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Milyli" /><title>Milyli Update</title><content type="html">They say that in order for a blog to be successful, you need to write about what your audience cares about.  Since I've started writing, I've only had one person ask me to give updates on how our little company / experiment is going.  Then again, I've only had one person leave comments about the coding tips I post here so I guess either topic is as valid as the other at the moment.  Which one will I talk about today?&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's right, it's company news.  Our little company has grown to 6 whole, full time employees.  That's right pretty soon, they'll out number us founders and then who knows what variants of heaven or hell they'll unleash on us.  Whichever it is, I'm sure things are just going to keep being interesting for a while.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We're also considering leasing out the rest of the floor in the building we're currently in.  It's a big step, but we've realized that there really is no substitute for closed off separated meeting places and work areas.  Keep the loud side loud and the quiet side quite.  We currently lack that separation and every new familyli member brings that fact into further relief. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We're in the home stretch of a nice long project as well.  I can't talk much about it, which is probably why I haven't posted here much.  Oh the mystery is killing you.  I know.  Hopefully though, I'll soon be able to take up posting on all the various interests I have, thus ensuring that my blog continues to wallow in obscurity.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Until then...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-6895457293124913902?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fYOnZFAUL3bUpbNRRPUwDCJdbQE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fYOnZFAUL3bUpbNRRPUwDCJdbQE/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/fYOnZFAUL3bUpbNRRPUwDCJdbQE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fYOnZFAUL3bUpbNRRPUwDCJdbQE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/TZBfXBUC7jo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/6895457293124913902/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/04/milyli-update.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/6895457293124913902?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/6895457293124913902?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/TZBfXBUC7jo/milyli-update.html" title="Milyli Update" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/04/milyli-update.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IAQ3g8fSp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-7861918100985052114</id><published>2010-02-10T07:35:00.003-06:00</published><updated>2010-04-14T13:59:02.675-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T13:59:02.675-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google" /><title>Google Applications</title><content type="html">I logged into GMail today and got an invitation to activate &lt;a href="http://www.google.com/buzz"&gt;Buzz&lt;/a&gt;, so I did.  I even posted a quick little message about my immediate impressions.  And a fine bit of useless drivel it turned out to be if I do say so myself.&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There was one thought that stuck me as interesting though.  The realization cemented in my mind that there is bit of a pattern Google has to creating their solutions.  They build or sometimes buy software that solves specific and difficult problems in easy to use ways that they provide for free.  And with advertising much less obtrusive than other applications. They have many such pieces of software at this point.  Now, they are finding the best possible ways to integrate them as elegantly as thy can.  Networking applications to solve social networking, if you will.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I know, I'm late in realizing this.  But I never accused myself of being overly watchful of other companies' strategies.  Many people will argue that the one point of entry provided by Facebook makes social networking more convenient.  My problem is that the utilities provided there just don't provide the functionality I want in photo management, calendars, email and event planning.&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/5959918065560189098-7861918100985052114?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fio1vxTIGQyCsXycWgMcn5JwptM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fio1vxTIGQyCsXycWgMcn5JwptM/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/fio1vxTIGQyCsXycWgMcn5JwptM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fio1vxTIGQyCsXycWgMcn5JwptM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/PNDtqnfmaVI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/7861918100985052114/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/02/google-applications.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7861918100985052114?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7861918100985052114?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/PNDtqnfmaVI/google-applications.html" title="Google Applications" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/02/google-applications.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0INRng8cSp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-3451467571425276098</id><published>2010-02-04T22:29:00.005-06:00</published><updated>2010-04-14T13:59:57.679-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T13:59:57.679-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>MVVC, Silverlight and Staying Grounded</title><content type="html">&lt;div&gt;I was reading some Visual Studio Magazine today and there was an article on MVVC gushing over how great it is.  I know it's not exactly new.  I also know that the pattern, when combined with the trend toward data binding is a powerful combination.  But it's surprising that many 'architects' apparently swear by this solution and insist on writing whole applications of every type without deviation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are many in-the-trenches sorts that believe that while it is useful in certain situations, it actually causes more work and creates less maintainable code much of the time as well.  I ran across many differing opinions all in the same day.  Probably the most sane of which were saying that it's a good architecture for mid size, data processing applications; too much for small tools and not flexible enough for large, interaction rich utilities.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As with all layers of an application, there appears to be different problems to solve in the UI.  The different paradigms are good at specific problems of certain sizes, but no one is best suited for all tasks of every caliber.  From messaging between disparate parts of a large application, to showing data in a small application, to interacting with complex UI's and business logic, it seems like you need to choose the solution(s) that will best fit the problem(s) at hand.  This might not help you out much in choosing the best model to use on your current project, but it may be ammunition against those of the one-solution-fits-all mind set.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Maybe it all comes back to the fact that a text box and button with some in line SQL in the code behind is a perfectly acceptable way to modify some simple data under certain circumstances...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I also read up a bunch on Silverlight 4 today.  I guess there's a slew of new technology being released along with .NET 4 and VS 2010.  The general summary is that it makes Silverlight a viable line-of-business application platform.  But, there seems to be a lot of bells and whistles that are more web 2.0'ish rather than business requirements.  Maybe there's some overlap there, or maybe there will be when businesses are ready for it.  That being said, it's probably worth looking into the specifics on the WCF changes as those were the hardest challenges that I remember having to overcome with the platform in a business application.  The whole printing thing is probably pretty nice too.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-3451467571425276098?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/A1SudI4IxkavlYAv4hvchUNopC8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/A1SudI4IxkavlYAv4hvchUNopC8/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/A1SudI4IxkavlYAv4hvchUNopC8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/A1SudI4IxkavlYAv4hvchUNopC8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/wRPQ1GeQomo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/3451467571425276098/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/02/mvvc-silverlight-and-staying-grounded.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3451467571425276098?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3451467571425276098?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/wRPQ1GeQomo/mvvc-silverlight-and-staying-grounded.html" title="MVVC, Silverlight and Staying Grounded" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/02/mvvc-silverlight-and-staying-grounded.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ACQn4ycSp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-4520656536312405905</id><published>2010-01-22T15:44:00.006-06:00</published><updated>2010-04-14T14:02:43.099-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:02:43.099-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Milyli" /><title>Milyli Update</title><content type="html">It would seem it's been a while since my last post.  As Google appears to be the largest source of my traffic, I don't think there's all that many loyal followers on RSS that need apologizin' to.  And I wouldn't want to assume that my words are so engrossing that the few regular readers I do have even realized I hadn't written.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So just read this thing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The past few months Milyli has been growing.  In addition to the three founders we have hired our first full time employee, we are on the look out for others, we have two part time employees and we just moved into a real office.  Fine, it's a big loft space that we use as an office, but it has desks, meeting tables, shelves and colorful network wire running every which way.  It's more of an office than the house that we moved out of.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Probably one of the best articles I have read that sums up the experience is &lt;a href="http://www.paulgraham.com/really.html"&gt;this one by Paul Graham&lt;/a&gt;.  I direct you in particular to the section at the end sub titled &lt;b&gt;The Super Pattern&lt;/b&gt;&lt;i&gt;.  &lt;/i&gt;It's worth a read, but the gist of the article is that so many people have written about the process of starting up a business that there should really be no surprises about what experiences you're in for.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What you probably will be surprised about however is the intensity of those experiences.  Yes, you will have to do all of the things that everybody always says you need to in order to start up a business.  But the peaks and valleys of this here roller coaster are far more extreme than I had anticipated.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-4520656536312405905?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AQjDaoYEfAPvO3WbMizr3H70X04/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AQjDaoYEfAPvO3WbMizr3H70X04/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/AQjDaoYEfAPvO3WbMizr3H70X04/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AQjDaoYEfAPvO3WbMizr3H70X04/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/4_FnP8hBozo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/4520656536312405905/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2010/01/milyli-update.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4520656536312405905?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4520656536312405905?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/4_FnP8hBozo/milyli-update.html" title="Milyli Update" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2010/01/milyli-update.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QAQngzfSp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-4813836655352124149</id><published>2009-11-06T09:20:00.000-06:00</published><updated>2010-04-14T13:55:43.685-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T13:55:43.685-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>ASP.NET PasswordRecovery Control and GMail</title><content type="html">I recently had need to whip up a quick ASP.NET web site with authentication.  Nothing fancy, so the default ASP.NET Membership provider tables and account controls worked  fine.  The one problem I ran into was that I needed to route the email the MembershipProvider and PasswordRecovery control create through GMail.  You see, GMail uses secure connections and the control doesn't seem to offer built in support.  But it isn't too hard to get it working.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's the approach I ended up with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;protected override void&lt;/span&gt; OnInit(&lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;EventArgs&lt;/span&gt; e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;base&lt;/span&gt;.OnInit(e);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PasswordRecoveryControl.SendingMail += PasswordRecoveryControl_SendingMail;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;void &lt;/span&gt;PasswordRecoveryControl_SendingMail(&lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;object &lt;/span&gt;sender, &lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;MailMessageEventArgs &lt;/span&gt;e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;// Create network credentials from SMTP configuration settings.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;var &lt;/span&gt;config = &lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;WebConfigurationManager&lt;/span&gt;.OpenWebConfiguration(&lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;HttpContext&lt;/span&gt;.Current.Request.ApplicationPath);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;var &lt;/span&gt;settings = (&lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;MailSettingsSectionGroup&lt;/span&gt;)config.GetSectionGroup(&lt;span class="Apple-style-span"  style="color:#990000;"&gt;"system.net/mailSettings"&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;var &lt;/span&gt;credentials = &lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;new &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;NetworkCredential&lt;/span&gt;(settings.Smtp.Network.UserName, settings.Smtp.Network.Password);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;// Send message over secure connection.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;var &lt;/span&gt;mailClient = &lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;new &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CCFF;"&gt;SmtpClient&lt;/span&gt;(settings.Smtp.Network.Host, settings.Smtp.Network.Port);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;mailClient.EnableSsl = &lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;true&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;mailClient.UseDefaultCredentials = &lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;false&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;mailClient.Credentials = credentials;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;mailClient.Send(e.Message);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;// Prevent control from sending message via default  implementation.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;e.Cancel = &lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;true&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Canceling the event still results in success as far as the control is concerned.   This means the SuccessText and SuccessUrl properties on the control behave the way you want them to if not quite the way you might expect them to.&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/5959918065560189098-4813836655352124149?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4YGB0iTsvKtQDbvxWiQh0T8Kj-s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4YGB0iTsvKtQDbvxWiQh0T8Kj-s/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/4YGB0iTsvKtQDbvxWiQh0T8Kj-s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4YGB0iTsvKtQDbvxWiQh0T8Kj-s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/UscXhHQzm24" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/4813836655352124149/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/11/aspnet-passwordrecovery-control-and.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4813836655352124149?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4813836655352124149?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/UscXhHQzm24/aspnet-passwordrecovery-control-and.html" title="ASP.NET PasswordRecovery Control and GMail" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/11/aspnet-passwordrecovery-control-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08AQ3o4fCp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-1005315869905316896</id><published>2009-09-22T08:38:00.002-05:00</published><updated>2010-04-14T14:04:02.434-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:04:02.434-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Inversion of Control</title><content type="html">I've been a fan of IoC frameworks for a little while now.  In particular, I have been using &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt;.  I knew that these frameworks were useful, but I didn't realize what I was missing until recently.  I would look at some of the proponents of the frameworks and their example code.  This code would have formal code Interfaces defined for almost every object and interaction in the system.  That always seemed like overkill to me.  I would think, "You are only ever going to have one class that fulfills each of those sets of functionality.  Why bother with all the extra coding for the interfaces?"  It didn't make sense... until now.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I started working on a new pet project in my spare time.  It's a program with a significant number of moving parts that all have different sets of functionality.  Following the &lt;a href="http://en.wikipedia.org/wiki/Single_responsibility_principle"&gt;single responsibility principle&lt;/a&gt;, I've broken down each of those sets of functionality into objects that each have their own domain of control.  Then I started writing unit tests.  And that's when the realization hit me.  There may only be one production implementation of most of the classes.  But combine those interfaces that define concise functionality with a good mock library and writing unit tests with few lines of code becomes a piece of cake.  I'm talking well tested code with tests that are at most twenty lines of code each; sometimes more, but most often less.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"Yes, IoC frameworks are cool for plugins and they make unit testing easier," I would say to myself.  But it turns out that I didn't fully grasp the full extent and usefulness of this paradigm.  That doesn't necessarily mean I'm all the way there yet either. But, I wanted to write something about this because it really was an eye opening experience; the difference between knowing and &lt;a href="http://en.wikipedia.org/wiki/Grok"&gt;grokking&lt;/a&gt;.  Also, I am not all that unique a person.  And since I wasn't putting all this together from reading documentation and blogs, I felt that perhaps there are others out there that might benefit from a different point of view on the subject as well.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-1005315869905316896?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gPz0L9lc9TGfYt3kk92xEi1iMxA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gPz0L9lc9TGfYt3kk92xEi1iMxA/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/gPz0L9lc9TGfYt3kk92xEi1iMxA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gPz0L9lc9TGfYt3kk92xEi1iMxA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/kcWjUyBgH3k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/1005315869905316896/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/09/inversion-of-control.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1005315869905316896?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/1005315869905316896?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/kcWjUyBgH3k/inversion-of-control.html" title="Inversion of Control" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/09/inversion-of-control.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08HRXg_eyp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-3684141240390416136</id><published>2009-08-27T18:39:00.006-05:00</published><updated>2010-04-14T14:03:54.643-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:03:54.643-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>ASP.NET MVC and ReverseDOS</title><content type="html">I've &lt;a href="http://www.cozcog.com/2009/05/techniques-to-fight-comment-spam.html"&gt;blogged&lt;/a&gt; a bit about &lt;a href="http://www.angrypets.com/tools/rdos/"&gt;ReverseDOS&lt;/a&gt; before. It's a neat utility that allows you to lock up and/or deny HTML requests from content spammers. You know, you have a web site users are allowed to create content on, comments in particular, and the Online Consortium of Gambling Websites has targeted your site as a nice place to do some free advertising. ReverseDOS very easily allows you to tie up their resources and ignore their offerings. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The point of this post is that there is a trick to get ReverseDOS to show custom errors when using ASP.NET MVC. I forget where the original information came from to get this done. It's already out on the web somewhere, I just don't remember where I pulled the pieces from. Just in case it isn't easy to find, I'll show you how I got it done.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, configure ReverseDOS just like the instructions tell you to. The one ReverseDOS configuration setting that you need to verify is that endRequest = false.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next, in your Global.asax file, you need to add a new event handler.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;protected &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;void &lt;/span&gt;Application_PreRequestHandlerExecute()&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;    var &lt;/span&gt;error = Context.Items[&lt;span class="Apple-style-span"  style="color:#990000;"&gt;"ReverseDOS_Exception"&lt;/span&gt;] as &lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;HttpException&lt;/span&gt;;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    if (&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;null &lt;/span&gt;!= error)&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    {&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;        ServeError(&lt;span class="Apple-style-span"  style="color:#990000;"&gt;"/Error/AccessDenied"&lt;/span&gt;, &lt;span class="Apple-style-span"  style="color:#ff0000;"&gt;403&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    }&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Obviously, change the path to your own error page. The ServerError() method is an example of how to render a different ASP.NET MVC action to the response stream from outside of the MVC framework. This is basically the same as supplying a different view to render when returning from an action. The method looks something like this:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;private void&lt;/span&gt; ServeError(&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;string &lt;/span&gt;path, &lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;int &lt;/span&gt;statusCode)&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;    var &lt;/span&gt;url = &lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;new &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33ccff;"&gt;StringBuilder&lt;/span&gt;();&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    url.Append(&lt;span class="Apple-style-span"  style="color:#33ccff;"&gt;VirtualPathUtility&lt;/span&gt;.ToAbsolute("~"));&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    url.Append(path);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    Server.ClearError();&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    Context.Response.Clear();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    &lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;string&lt;/span&gt; originalPath = Request.Path;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    Context.RewritePath(url.ToString(), &lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;false&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33ccff;"&gt;    IHttpHandler &lt;/span&gt;httpHandler = &lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;new &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33ccff;"&gt;MvcHttpHandler&lt;/span&gt;();&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    httpHandler.ProcessRequest(&lt;span class="Apple-style-span"  style="color:#33ccff;"&gt;HttpContext&lt;/span&gt;.Current);&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    Context.RewritePath(originalPath, &lt;span class="Apple-style-span"  style="color:#3366ff;"&gt;false&lt;/span&gt;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    Response.StatusCode = statusCode;&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;    Context.ApplicationInstance.CompleteRequest();&lt;/div&gt;&lt;div&gt;&lt;span style="WHITE-SPACE: pre" class="Apple-tab-span"&gt;&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Granted, there are probably other ways of handling this. In my admittedly limited experience however, this gives me the most control when setting up ReverseDOS along side custom error handling in ASP.NET MVC. It allows me to serve my own error pages with proper http response codes without redirects and without relying on IIS features.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy coding to you.&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/5959918065560189098-3684141240390416136?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/48Krr7k-hP_XfZnHaU66LCCJidg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/48Krr7k-hP_XfZnHaU66LCCJidg/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/48Krr7k-hP_XfZnHaU66LCCJidg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/48Krr7k-hP_XfZnHaU66LCCJidg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/93jfWTFRr2Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/3684141240390416136/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/08/aspnet-mvc-and-reversedos.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3684141240390416136?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3684141240390416136?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/93jfWTFRr2Q/aspnet-mvc-and-reversedos.html" title="ASP.NET MVC and ReverseDOS" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/08/aspnet-mvc-and-reversedos.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08GRXsyeyp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-5698167655351100900</id><published>2009-08-27T17:28:00.005-05:00</published><updated>2010-04-14T14:03:44.593-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:03:44.593-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>A Solution To My Repository Dilemma</title><content type="html">I woke up this morning and realized I had a better solution to &lt;a href="http://www.cozcog.com/2009/08/one-small-problem-with-repositories.html"&gt;my repository problem&lt;/a&gt;.  Create instances of your business logic that accept repository instances in their constructors.  Pass the models through the business logic to the repositories for simple data operations.  Perform business logic and relationship management on the models when needed before the data is stored.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's still not ideal though.  First, there's the potential for a lot of pass-throughs.  I can live with that I suppose.  Second, you end up losing a lot in the way of encapsulation in that the business methods that operate on the data are not contained in the same objects as the data they operate on.  But it's not like there isn't precedence for effectively relegating your business models to what amount to DTOs or data contracts.  Think web services.  You're just not passing those contracts over the wire.  Plus, mapping between models tailored to the application layer they are used in is becoming an accepted practice.  At least it is in the ASP.NET MVC world which is what prompted me to write about this anyway.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As I said, it may not be ideal, but I think I like it better than where I ended up at in my last post.  The code becomes more testable and you don't need to re-implement relationship management in every version of the repositories that you create.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-5698167655351100900?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6xrHmO-KCEL7A2-riK1pg50yPwY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6xrHmO-KCEL7A2-riK1pg50yPwY/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/6xrHmO-KCEL7A2-riK1pg50yPwY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6xrHmO-KCEL7A2-riK1pg50yPwY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/c9YgDsCtv7M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/5698167655351100900/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/08/solution-to-my-repository-dilemma.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/5698167655351100900?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/5698167655351100900?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/c9YgDsCtv7M/solution-to-my-repository-dilemma.html" title="A Solution To My Repository Dilemma" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/08/solution-to-my-repository-dilemma.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08FR3w_fyp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-4067899570537105300</id><published>2009-08-02T09:57:00.007-05:00</published><updated>2010-04-14T14:03:36.247-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:03:36.247-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>One Small Problem With Repositories</title><content type="html">&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; "&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;&lt;div&gt;It used to be that I wrote applications with a hard separation between layers; presentation calls business, business calls data, and other systems were wrapped in abstraction as needed.  This worked well enough and many large enterprise applications have been build this way.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One technique frequently implemented in this paradigm is that the entry points for the persistence routines of domain objects are encoded in the objects themselves.  While not perfect, one great upshot of this approach was that there was only one place where the relationships between business objects was defined.  E.g., if an Order is saved, the Order enforces that all of itsLineItems are also saved.  The code is written once and tested once.  If new repositories are needed for a new database, write the code, swap them out and as long as your business layer tests still pass, you know your relationship persistence is in tact.  The biggest problem with this paradigm though is that it leads to difficult to write tests for oh so many different reasons.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As test driven development is the way to go, I haven't written applications  like that for a couple of years.  I have been sharpening my saw and forcing myself to build more testable code.  In ASP.NET MVC, the prevailing winds seem to push in the direction that your controllers should be injected with repository instances and those instances should be used for data management.  This works exceptionally well from the stand point that I can pass repository mocks and stubs to my controller when testing actions.  This is just a better way to write code in general.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But one part of all this newer-fangeld code crafting still nags at me.  If the repository contains the relationship logic, that logic and all of the tests that enforce it travel with that implementation.  If I need to write a new data layer for a new database, I need to rebuild that logic and the tests for it and maintain multiple pieces of code that ultimately enforce the same rules.  In almost all cases, this is not a real world problem.  Most people never port their applications to multiple databases and so the interfaces are relegated to testing purposes only.  Most of us only ever have one set of repository code to test.  I'll live with it by ignoring it.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The perfectionist in me still wants to do something about it.  I've thought about crazy schemes like dividing the repository functionality into multiple components, CUD/R if you will, with methods targeted to the domain model and UI respectively.  I've thought about abstractions and composites and delegates, oh my!  But in the end, every solution solves some problems and creates others.  In the end, I suppose that knowing when good enough is good enough and being able to identify when it isn't is the way to handle this situation.&lt;/div&gt;&lt;/div&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/5959918065560189098-4067899570537105300?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KZkGtKxndy-2SLj55jMgRdc1pDU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KZkGtKxndy-2SLj55jMgRdc1pDU/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/KZkGtKxndy-2SLj55jMgRdc1pDU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KZkGtKxndy-2SLj55jMgRdc1pDU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/ktQbxMiKldQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/4067899570537105300/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/08/one-small-problem-with-repositories.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4067899570537105300?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/4067899570537105300?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/ktQbxMiKldQ/one-small-problem-with-repositories.html" title="One Small Problem With Repositories" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/08/one-small-problem-with-repositories.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08FQXYyfyp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-7306216622615453406</id><published>2009-07-28T10:35:00.003-05:00</published><updated>2010-04-14T14:03:30.897-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:03:30.897-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>WCF and IIS 7 Error</title><content type="html">I ran across this little nugget of frustration today when trying to hit my WCF services hosted by IIS 7 on a computer with a new build:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Error 403.3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The page you are requesting cannot be served because of the extension configuration...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Turns out that the .svc extension was never registered with IIS.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Simple problem, &lt;a href="http://msdn.microsoft.com/en-us/library/ms732012.aspx"&gt;simple solution&lt;/a&gt;. With administrative privelages run:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\servicemodelreg -i&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;or for 64 bit OS's&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;C:\Windows\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation\servicemodelreg -i&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just another post to bump the solution up Google a bit.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-7306216622615453406?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/k7FxwM4_cau5ihti-AVhKWCn2jA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/k7FxwM4_cau5ihti-AVhKWCn2jA/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/k7FxwM4_cau5ihti-AVhKWCn2jA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/k7FxwM4_cau5ihti-AVhKWCn2jA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/4p-VfJlmWGQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/7306216622615453406/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/07/wcf-and-iis-7-error.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7306216622615453406?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7306216622615453406?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/4p-VfJlmWGQ/wcf-and-iis-7-error.html" title="WCF and IIS 7 Error" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/07/wcf-and-iis-7-error.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08EQHoyfCp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-3804414878196959405</id><published>2009-07-25T14:00:00.003-05:00</published><updated>2010-04-14T14:03:21.494-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:03:21.494-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Unit Testing" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Rhino Mocks Out Ref Parameters</title><content type="html">I started playing with &lt;a href="http://ayende.com/projects/rhino-mocks.aspx"&gt;Rhino Mocks&lt;/a&gt; recently.  Yes, I'm late to the game.  And yes, that game is great.  If you've made it to this post I'm obviously preaching  to the choir, so let's get to it.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I ran across a need to mock up an out parameter today.  For the context of this article that would be a ByRef parameter to all you VBers.  What to do?  Well, it turns out to be a very simple task.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have several repository methods in a little project of mine that read paged data.  I like to return the total number of records in the same query from the database and so I use an out parameter in my repository methods.  The methods look something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;public &lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;IList&lt;/span&gt;&lt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;RecordModel&lt;/span&gt;&gt; ReadPaged(&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;int &lt;/span&gt;pageNumber, &lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;int &lt;/span&gt;pageSize, &lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;out int&lt;/span&gt; recordCount);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;This project of mine is written for ASP.NET MVC which, like every other ASP.NET MVC project, contains controllers.  My controllers makes calls on the repositories and push the models returned into the ViewDataDictionary.  The goal then is to create a stub for the IRecordRepository.ReadPaged() method that passes a content count, among other values, back to the controller so that the value may be pushed into the ViewDataDictionary and then validated in a unit test.  That's a lot of talk for one small method call:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;recordRepositoryStub&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;.Stub(m =&gt; m.ReadPaged(pageNumber, pageSize, &lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;out &lt;/span&gt;recordCount))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;.OutRef(&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;250&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;.Return(records);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That call to &lt;span class="Apple-style-span"  style="font-family:arial;"&gt;OutRef(&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;250&lt;/span&gt;)&lt;/span&gt; is what takes care of the out parameter.  The method accepts a parameter array of objects.  When the stub method is called by the controller, it populates its arguments into the out parameters in the order in which they are declared in the method signature.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Goal accomplished.&lt;/div&gt;&lt;/div&gt;&lt;div&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/5959918065560189098-3804414878196959405?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ybNLk40iAxNRjHirUqMkkUY-kC0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ybNLk40iAxNRjHirUqMkkUY-kC0/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/ybNLk40iAxNRjHirUqMkkUY-kC0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ybNLk40iAxNRjHirUqMkkUY-kC0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/uQA3kmkR6bQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/3804414878196959405/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/07/rhino-mocks-out-ref-parameters.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3804414878196959405?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3804414878196959405?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/uQA3kmkR6bQ/rhino-mocks-out-ref-parameters.html" title="Rhino Mocks Out Ref Parameters" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.cozcog.com/2009/07/rhino-mocks-out-ref-parameters.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8DQn09eCp7ImA9WxJUEE0.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-6569408503169157193</id><published>2009-07-06T09:23:00.004-05:00</published><updated>2009-07-07T16:07:53.360-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-07T16:07:53.360-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>IoC and Structure Map</title><content type="html">I started playing with &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; a couple of days ago.  It is a pretty decent framework for IoC and dependency injection.  It works well with ASP.NET MVC and makes it possible to write some good, testable code.  That's not to say that there isn't anything better out there, just that this gets the job done well and so I didn't need to look for anything better.  The features that I like most are the registry configuration system, and the dependency injection approach.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One way to configure StructureMap is to subclass the Registry class.  Methods in the class allow you to create mappings between interfaces or abstract classes and the concrete types that will be used during run time.  The simplest approach is to create one to one mappings for each interface / concrete type pair.  Nothing you couldn't do with a simple text or configuration file of some sort.  However, there are more powerful methods available that will automatically map all types against the interfaces they implement within a given assembly or namespace.  You can even map multiple types against the same interface and use a key to get the correct implementation for a given situation at run time.  Score one for the IoC framework.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As for creating the mapped instances, there are a couple different ways to get that done.  The simpler approach is just a factory method that accepts the interface name and optionally a key and returns the configured implementation.  Again, this is nothing that you can't do very quickly and easily with the Activator object in .NET.  Once again, a more powerful technique exists and that is to request an instance of an object that accepts mapped types in its constructor.  E.g. Suppose I have a class SiteController with a constructor defined as &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;void &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;SiteController&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;(&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;ISiteMapper&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; mapper, &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;ISiteRepository&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; repository)&lt;/span&gt; and that both the interfaces have mapped concrete classes configured.  I could request an instance of SiteController from the StructureMap ObjectFactory and it would create the SiteController container with the appropriate dependencies passed to the constructor.  This is another nice convenience that good IoC frameworks provide you with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Martin Fowler &lt;a href="http://martinfowler.com/articles/injection.html"&gt;said something I like&lt;/a&gt; about IoC:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;"When these containers talk about how they are so useful because they implement 'Inversion of Control' I end up very puzzled. Inversion of control is a common characteristic of frameworks, so saying that these lightweight containers are special because they use inversion of control is like saying my car is special because it has wheels." &lt;/blockquote&gt; &lt;/div&gt;&lt;div&gt;My take on this quote is that IoC is nothing more than good object oriented design that takes advantage of polymorphism and factory patterns.  It's a technique that has been around since the first OO languages and isn't some new advance in software design.  That being said, StructureMap and other frameworks like it do offer some great utilities that simplify the task of writing the code.&lt;/div&gt;&lt;div&gt;&lt;br /&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/5959918065560189098-6569408503169157193?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pKcOc4_WEji9_CCQuoVBxr-Pq8c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pKcOc4_WEji9_CCQuoVBxr-Pq8c/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/pKcOc4_WEji9_CCQuoVBxr-Pq8c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pKcOc4_WEji9_CCQuoVBxr-Pq8c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/KTB_F8p2WL8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/6569408503169157193/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/07/ioc-and-structure-map.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/6569408503169157193?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/6569408503169157193?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/KTB_F8p2WL8/ioc-and-structure-map.html" title="IoC and Structure Map" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/07/ioc-and-structure-map.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ADRX0-fyp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-6509616595486790356</id><published>2009-06-11T10:17:00.004-05:00</published><updated>2010-04-14T14:02:54.357-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:02:54.357-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Milyli" /><title>State of Milyli</title><content type="html">&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;It's been a little while since I wrote about our little company &lt;a href="http://www.milyli.com/"&gt;Milyli&lt;/a&gt;. Since that was one of the original purposes of starting this blog, I figured I'd give a little update. Things are going well, but it's a lot of hard work.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As for myself, being mostly in charge of product development can be a little frustrating working almost alone. It's not that I'm the only person working to make the company and product a success, not by a long shot. But I am effectively the only developer working on the code. Granted, I get to develop the application whichever way I want. But for a not small piece of software, that's not as ideal as it might sound. I really miss being able to bounce ideas off of other developers that have a good sense of how the application works. The small increments of work are also not as satisfying when you realize that no work has been done on the rest of the application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Besides the application, I did a bunch of project work early on and it looks like I'm about to get another load. I enjoy working on the consulting side. The projects are different and there's always a chance to learn a new trick of some sort. But it is frustrating to see so much of our already limited time not being spent on our product.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As for my two partners, they've been doing the bulk of the bill paying for the past number of months. They're each feeling the pain and glory in their own ways.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of them is working with technology older than even that used at our last place of employment. The old code is plenty crufty and has more than its share of best practice failings. That and interacting with and managing the client seems to be wearing him a bit thin of late.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My other partner spends his time schizophrenically jumping between business development, market analysis, office manager, project manager and consultant. Basically filling in wherever needs filling. I am not envious at all of that role.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All I can do is thank them and keep my head down and keep making software of all sorts work better. What's important to remember is that &lt;a href="http://www.squidoo.com/theDipBook"&gt;the Dip&lt;/a&gt; is worth getting through. I'm pretty sure we haven't seen the bottom yet and if by some miracle we have, that will just be a pleasant little surprise.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There have been a number of high points as well. We get to make the environment the way we like it including eating lunch together everyday that we are in the office. We have started to see some preliminary design ideas for the look of our application. They look great and I can't wait to start implementing. We have signed on some work that should pay our bills for a while. We have other new, exciting projects coming in that look like they will fit great with our skills and experience. And we keep meeting new people to talk about their problems and solutions even when we aren't necessarily the best folks to tackle the resulting projects.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And that's where it all stands right now; things are going well, but it's a lot of hard work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-6509616595486790356?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P38f0Qy7kzPo3jDxwIKI8_m6Gjs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P38f0Qy7kzPo3jDxwIKI8_m6Gjs/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/P38f0Qy7kzPo3jDxwIKI8_m6Gjs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P38f0Qy7kzPo3jDxwIKI8_m6Gjs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/yk6c7Y4TXMo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/6509616595486790356/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/06/state-of-milyli.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/6509616595486790356?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/6509616595486790356?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/yk6c7Y4TXMo/state-of-milyli.html" title="State of Milyli" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/06/state-of-milyli.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYGQn4-eCp7ImA9WxJXFko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-5336871157664234271</id><published>2009-06-10T17:34:00.009-05:00</published><updated>2009-06-10T18:22:03.050-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T18:22:03.050-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><title>Create SharePoint Job Timer Definitions</title><content type="html">So I realized recently that one of my MOSS applications did not have all of the timer jobs defined for it that it should have.  You know, you go to Central Admin -&gt; Operations -&gt; Job Timer Definitions and they just aren't all there.  Which ones should be there by default?  &lt;a href="http://blogs.msdn.com/jannemattila/archive/2007/08/31/moss-backup-and-restore-and-missing-timer-job-definitions.aspx"&gt;Here's a good list.&lt;/a&gt;  Just how do you go about getting some of those jobs in there?  There's a bunch of tricks and supported approaches.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The publishing tasks (Scheduled Approval, Scheduled Page Review, etc.) can be created in one shot by creating a new web site collection using the publishing portal template under the existing application and deleting it.  The timer definitions stay, the services start running and everyone is happy.  Yaaaay!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some of the definitions will be created if you set the appropriate properties using stsadm.&lt;br /&gt;E.g., stsadm -o setproperty -pn job-immediate-alerts -pv "Every 5 minutes between 0 and 59" -url http://your-site.com&lt;br /&gt;Once again the timer job shows up and most of the time your alerts start flowing.  Hooray for our side!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But there are a bunch of definitions that there don't appear to be tools to create on their own.  Sure you can back up the database, blow away the application, create a new application with the correct template and same name, restore the database, and fix the issues (there's always some).  I didn't want to go through all that, though I'm not sure that what I figured out was less work.  What I ended up doing was to write some crafty SQL.  Well, maybe it was just plain old mundane and obvious SQL, but that's what I did.  All the answers lie in the Objects table in your config database. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First find the id of your web application.  This is going to be the parent id of the timer record you will insert.  The following SQL worked pretty well for me.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT * FROM Objects WHERE &lt;yourapplication&gt;Properties LIKE '%SPWebApplication%'&lt;/yourapplication&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next, query the table and look for existing definitions of the jobs you are missing.  If you don't already have an application that contains them, you can create one.  The Name column of the records contains the stsadm property for each timer job.  &lt;a href="http://technet.microsoft.com/en-us/library/cc424953.aspx"&gt;Here's a list of a few&lt;/a&gt;.  And here's some SQL to help you out.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT * FROM Objects WHERE o.Name LIKE 'job-%'&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Find a record for the job you are interested in.  You will need two pieces of information: the ClassId and the Properties contents.  The classId tells the system which timer job to create and the Properties contain the frequency of the timer job and a couple of other easy to change settings.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Last, run a simple insert statement like the following...&lt;/div&gt;&lt;div&gt;&lt;div&gt;INSERT Objects(Id, ClassId, ParentId, Name, Status, Properties)&lt;/div&gt;&lt;div&gt;VALUES (NEWID(), '[JobClassId]&lt;jobclassid&gt;', '[ParentApplicationId]&lt;parentapplicationid&gt;', '[JobPropertyName]&lt;jobpropertyname&gt;', 0,'[PropertyContents]&lt;propertycontents&gt;')&lt;/propertycontents&gt;&lt;/jobpropertyname&gt;&lt;/parentapplicationid&gt;&lt;/jobclassid&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A quick refresh of the Timer Job Definitions page will show the new job ready to run.  You may need to restart the Windows SharePoint Services Timer service before the new jobs are picked up though.  Also, the Timer Job Status list will not show the new jobs until after the first time they are run.  Be patient for those weekly tasks.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Again with the disclaimer: I saw in some posts that Microsoft doesn't take to kindly to messing around with the SharePoint databases. If you want continued support, tweak at your own risk.  This should really only be used as a last resort in any case as there are usually other options.  I just happened across someone asking this question and decided to figure out how to do it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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/5959918065560189098-5336871157664234271?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/11aopAXd1doScikpo_glKNSTHl0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/11aopAXd1doScikpo_glKNSTHl0/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/11aopAXd1doScikpo_glKNSTHl0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/11aopAXd1doScikpo_glKNSTHl0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/cqoIMaH0mwk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/5336871157664234271/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/06/create-sharepoint-job-timer-definitions.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/5336871157664234271?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/5336871157664234271?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/cqoIMaH0mwk/create-sharepoint-job-timer-definitions.html" title="Create SharePoint Job Timer Definitions" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/06/create-sharepoint-job-timer-definitions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUAQHszcSp7ImA9WxJXFko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-3641998402611156786</id><published>2009-06-10T17:21:00.006-05:00</published><updated>2009-06-10T18:24:01.589-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T18:24:01.589-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><title>SharePoint Alerts Not Sending</title><content type="html">There are all sorts of reasons why your alerts might not be working in SharePoint.  There are a whole slew of causes as to why with the most common being a backup and restore to a new server, farm, environment, etc.  Googling will provide you with a bunch of options for the common problems pretty quickly.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;None of those really worked for me.  I did eventually solve my problem though.  One post pointed me at the EventBatches table in the content database.  This table contains two pieces of information, the last event time and the last event id processed.  It turned out that the id in the EventBatches table was FAR greater than the last id in the EventCache table.  This was probably the result of some less than optimal backup and restore voodoo that had gone on previously.  Regardless, I set the id in the EventBatches table equal to the last EventCache id and alerts started flowing freely from that point on.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I wasn't able to find anyone that just came flat out and said that, so there it is.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Disclaimer: I saw in some posts that Microsoft doesn't take to kindly to messing around with the SharePoint databases.  If you want continued support, tweak at your own risk.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-3641998402611156786?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ma3m2cgydxwlVU-hvgvrv4JenwQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ma3m2cgydxwlVU-hvgvrv4JenwQ/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/Ma3m2cgydxwlVU-hvgvrv4JenwQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ma3m2cgydxwlVU-hvgvrv4JenwQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/2GCzgqeVtUk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/3641998402611156786/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/06/sharepoint-alerts-not-sending.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3641998402611156786?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/3641998402611156786?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/2GCzgqeVtUk/sharepoint-alerts-not-sending.html" title="SharePoint Alerts Not Sending" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/06/sharepoint-alerts-not-sending.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcHQXsyfSp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-7205770511635475723</id><published>2009-05-30T17:20:00.003-05:00</published><updated>2010-04-14T14:07:10.595-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:07:10.595-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Comments By Google</title><content type="html">A couple of posts &lt;a href="http://www.cozcog.com/2009/05/techniques-to-fight-comment-spam.html"&gt;back&lt;/a&gt; I wrote about some techniques one can use to fight comment spam on their web site.  Just recently, I ran into another technique, one that is all the rage in so many other business aspects: outsource it.&lt;br /&gt;&lt;br /&gt;It turns out that Google has an interesting little service called &lt;a href="http://www.google.com/friendconnect"&gt;Friend Connect&lt;/a&gt;.  The features include comments, ratings, authentication and moderation tools to name a few.  I haven't set it up yet nor read all there is to read, but I'd be willing to bet they also throw some of their great spam filtering technology built for GMail at the comments as well.  An API exists so that developers can make use of the information tracked by Google to provide a more interactive experience.  Think privileges determined by karma and such.  And with a reasonably trustworthy third party writing a large chunk of your code, developers can focus on all the aspects of the site that deliver content instead.&lt;br /&gt;&lt;br /&gt;The biggest downside to this approach, and it can be a biggie in some cases, is that all that social data is going to be housed in a remote database.  That's probably OK for a great number of sites out there, but for some application, that may just be asking too much.&lt;br /&gt;&lt;br /&gt;Another downside is that the look and feel is going to be limited unless you code all of your own controls against their API.  That probably still does save &lt;em&gt;some &lt;/em&gt;time.  More importantly it means that you don't need to worry about the more demanding aspects of authentication.  But once again, it means that outsourcing may not yield all the time saving benefits so many people think it will.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-7205770511635475723?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Z9jpjVjtxQ_S8D1Hztu_nJAselQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Z9jpjVjtxQ_S8D1Hztu_nJAselQ/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/Z9jpjVjtxQ_S8D1Hztu_nJAselQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Z9jpjVjtxQ_S8D1Hztu_nJAselQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/fl8w4wXMhsk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/7205770511635475723/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/05/comments-by-google.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7205770511635475723?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/7205770511635475723?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/fl8w4wXMhsk/comments-by-google.html" title="Comments By Google" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/05/comments-by-google.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcAQ30zfip7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-683714606577124748</id><published>2009-05-26T21:46:00.002-05:00</published><updated>2010-04-14T14:07:22.386-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:07:22.386-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Hardware" /><title>Middle Mouse Button Broken</title><content type="html">I had a frustrating problem with my mouse tonight.  Basically, the middle mouse button stopped working on my &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;Razer&lt;/span&gt; Lachesis.  I tried searching for a resolution and all I found were suggestions on how to clean the mouse.  I'm too lazy for that.&lt;br /&gt;&lt;br /&gt;I found that a simple way to &lt;a href="http://help.razersupport.com/us-en/resolution.asp?sid=224234090526099177131023&amp;amp;pid=1621&amp;amp;pnm=Razer+Lachesis&amp;amp;seid=4520&amp;amp;pos=Windows+Vista&amp;amp;top=&amp;amp;rid=21507"&gt;test the buttons&lt;/a&gt; is to remap the button(s) in question to a keystroke; mouse button 3 to the number 3 in this case.  I opened up notepad, clicked, and lo and behold, a 3 every time I click.  What gives?&lt;br /&gt;&lt;br /&gt;I started to switch the mouse button function back to 'windows button 3' and... what gives again?  It's gone.  As I switched through the other mouse profiles though I noticed that button 3 was almost always set to 'universal scroll'.  "Let's try that," I thought to myself.  I applied the new setting.  Don't forget to apply the new setting!  And look, the mouse is as good as new.&lt;br /&gt;&lt;br /&gt;As near as I can figure it, I actually set the mouse button to 'windows button 3' at some point in some previous Windows version or application.  The interesting thing is that the profiles are stored in the mouse, not the driver software.  That's my guess at least as I removed the driver software and restarted the computer at one point and my middle mouse button was still pumping out 3's.  Combine that with the fact that the signal is evidently a bit different between Windows 7 and whatever program I set it on, and a little bit of profile changing butter fingers on my part and voila - apparently broken button.&lt;br /&gt;&lt;br /&gt;So, it turns out that my only real complaint about my nice, year old Lachesis is that it is too customizable for my clumsy self.  Aside from that, this is one heck of a mouse. &lt;br /&gt;&lt;br /&gt;Figured I'd share my experience in case some one else runs into this problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-683714606577124748?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/44WAwzoc1ddjTSmTZBvfsxS4tn4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/44WAwzoc1ddjTSmTZBvfsxS4tn4/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/44WAwzoc1ddjTSmTZBvfsxS4tn4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/44WAwzoc1ddjTSmTZBvfsxS4tn4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/h2e6AqhHoIU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/683714606577124748/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/05/middle-mouse-button-broken.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/683714606577124748?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/683714606577124748?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/h2e6AqhHoIU/middle-mouse-button-broken.html" title="Middle Mouse Button Broken" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.cozcog.com/2009/05/middle-mouse-button-broken.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcBRXo4cCp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-8626970867430083547</id><published>2009-05-26T12:48:00.003-05:00</published><updated>2010-04-14T14:07:34.438-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:07:34.438-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>MOSS Search Access Denied</title><content type="html">So I have been running into an issue on Office Share Point where the search service ends with an access denied error when it runs.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;"Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content."&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The fix for this in our situation turned out to come from &lt;a href="http://support.microsoft.com/kb/896861"&gt;Microsoft KB 896861&lt;/a&gt;.  A lot of solutions focus on making sure account permissions are set up correctly.  However, this lesser known issue is caused by a security feature in IIS that prevents reflection attacks.  The feature gets in the way of the shared services provider when it tries to crawl the site in a single server environment.  The recommended solution is to map a specific hostname to the loopback address.  Check out the KB for the details.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I originally found this article on &lt;a href="http://www.sharepointblogs.com/tommysegoro/archive/2009/02/03/moss-2007-search-crawling-error-access-denied.aspx"&gt;SharePoint Blogs&lt;/a&gt;. Hopefully, promoting this solution will help someone else out there.&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/5959918065560189098-8626970867430083547?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oBIJAmuqZ3QAyHUg_hVp7oNDtvM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oBIJAmuqZ3QAyHUg_hVp7oNDtvM/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/oBIJAmuqZ3QAyHUg_hVp7oNDtvM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oBIJAmuqZ3QAyHUg_hVp7oNDtvM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/sfFgcXf_SNk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/8626970867430083547/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/05/moss-search-access-denied.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/8626970867430083547?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/8626970867430083547?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/sfFgcXf_SNk/moss-search-access-denied.html" title="MOSS Search Access Denied" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/05/moss-search-access-denied.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcCSX8zcSp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-5245957364498389084</id><published>2009-05-19T10:33:00.006-05:00</published><updated>2010-04-14T14:07:48.189-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:07:48.189-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Techniques to Fight Comment Spam</title><content type="html">&lt;div&gt;The following post is a list of techniques that I have run across that attempt to deal with the problem of comment spam on sites.  This is a followup to my last post titled, "&lt;a href="http://www.cozcog.com/2009/05/preventing-comment-spam.html"&gt;Preventing Comment Spam.&lt;/a&gt;"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Requiring authentication is generally seen as a fairly effective approach to preventing comment spam.  However, the disadvantages are frequently enough to dissuade implementation on many sites.  One problem is that authentication is a feature requiring resources and expertise that not all development shops have enough of.  Another issue is that authentication results in a barrier to leaving comments on a site that casual visitors will probably not bother overcoming.  In addition, the challenge is not that great for technically adept spammers if the payoff is access to a large user base.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Building upon authentication is the idea of karma.  Forcing users to build karma based on quality of participation before they can take certain actions is usually a hurdle that is too high for most spammers to deal with.  Unfortunately, depending on your user base, it can be an equally high hurdle to legitimate participation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Moderation is another technique that comes up often.  It is generally regarded as the only foolproof approach.  Simply put, every post made to the site is screened by a human being.  The downside of course is that if your site is heavily trafficked by spammers, weeding quickly becomes a task that takes up all of your time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Filtering is another approach that can best be described as automated moderation.  As an example, I found &lt;a href="http://www.angrypets.com/tools/rdos/"&gt;ReverseDOS&lt;/a&gt;.  This is an easy to setup ASP.NET  HttpModule that reads all of the content of a request and determines whether or not the request is a spam attempt based on rules that you define.  The rules can include checking all or only a portion of the request against a set of regular expressions and can be turned on or off for each directory within a site.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another suggestion along these lines was to create a central repository for tracking spam.  Sites could query the repository which would try to determine if the submitted content was spam based on past submissions, user feedback and a bit of good natured artificial intelligence.  Regardless of the technique, the idea of filtering is to cut down the number of spam comments to an amount manageable by other means.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reverse Turing tests like CAPTCHA can sometimes be used to increase the difficulty of posting spam.  The problem is that the effectiveness of the most common implementation, retyping words presented as an image, wanes as image recognition tools get better and better.  The images must get more warped in order to prevent automated scanning, but that makes it more difficult for legitimate users as well.  E.g., Google's captcha for new emails is so difficult to read at times, that I only get one out of four correct.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Throttling can be used in order to prevent any user from posting too many times.  Limits can be set on the number of items that can be created over a span of time or making sure that no user posts multiple comments back to back in a single thread.  The challenge here lies in identifying users.  If no authentication is used, relying on IP address is inconsistent at best and runs the risk of blocking legitimate users.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the end, no single approach is probably good enough to stop spam. The pet project I am currently working on has been built with a mix of most of the techniques above.  I combined a bunch of existing frameworks with a little bit of custom code so it wasn't too much work.  At times I worry that I may have spent too much time on this aspect of the site.  Then again, the whole site was started as a learning endeavor.  If nothing else, I gained some knowledge and will have the tools in place to respond quickly if spammers begin to target the site.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-5245957364498389084?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/964ex8uMNhrpDnJjobbbpTN3p_I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/964ex8uMNhrpDnJjobbbpTN3p_I/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/964ex8uMNhrpDnJjobbbpTN3p_I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/964ex8uMNhrpDnJjobbbpTN3p_I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/jATDvXI_eOs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/5245957364498389084/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/05/techniques-to-fight-comment-spam.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/5245957364498389084?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/5245957364498389084?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/jATDvXI_eOs/techniques-to-fight-comment-spam.html" title="Techniques to Fight Comment Spam" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/05/techniques-to-fight-comment-spam.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcDSH4-eCp7ImA9WxFSEko.&quot;"><id>tag:blogger.com,1999:blog-5959918065560189098.post-2391847789217204222</id><published>2009-05-19T09:29:00.008-05:00</published><updated>2010-04-14T14:07:59.050-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-14T14:07:59.050-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><category scheme="http://www.blogger.com/atom/ns#" term="Code" /><title>Preventing Comment Spam</title><content type="html">I have taken up the coding challenge of dealing with comment spam.  As with most topics that I write about, I am by no means an expert.  But I have done a lot of reading recently, and here are some of my observations.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is no majority consensus on the single best approach to prevent spam filtering.  Everyone agrees something must be done, but few people agree on which one method is the most effective.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;The tactic that most people do agree on is that multiple techniques are necessary in order to achieve the desired levels of spam reduction, ease of maintenance and usability for visitors.  The business of spam is based on the idea that by getting a lot of content in front of a lot of users it is likely that enough people will respond to make a profit.  Countering spam is a process of making it difficult enough for spammers to post to your site that their time is better spent elsewhere.  The challenge lies in creating a system that is easy enough for your users to participate in that is at the same time complex or smart enough to discourage spammers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;The combination of most effective tools to employ varies depending on the site being targeted.  Your breadth of content and comment topics, user quantity and quality, and a host of other variables will determine the different tools that will achieve the best results fighting spam.  The larger and wider ranging each of those dimensions is, the smarter your techniques will need to become.  At some point, the easiest to implement approach may be to screen submissions by hand.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There seems to be a general feeling that if enough sites take steps to reduce spam, the web can be made a better place for everyone.  Spam will probably never go away.  If it does, it is likely that the infrastructure of the web was changed for the worse for everyone in some way.  But the idea is to make it difficult enough that spammers would make more money performing constructive services instead of annoying ones.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For a bit more on techniques used to prevent comment spam, check out &lt;a href="http://www.cozcog.com/2009/05/techniques-to-fight-comment-spam.html"&gt;this followup post&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5959918065560189098-2391847789217204222?l=www.cozcog.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oNoQNDOeUgVdEgNBQ0cUH8zf88s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oNoQNDOeUgVdEgNBQ0cUH8zf88s/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/oNoQNDOeUgVdEgNBQ0cUH8zf88s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oNoQNDOeUgVdEgNBQ0cUH8zf88s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CozenedCognizance/~4/ArwiW_c0F6s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cozcog.com/feeds/2391847789217204222/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cozcog.com/2009/05/preventing-comment-spam.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/2391847789217204222?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5959918065560189098/posts/default/2391847789217204222?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CozenedCognizance/~3/ArwiW_c0F6s/preventing-comment-spam.html" title="Preventing Comment Spam" /><author><name>Chuck Kinnan</name><uri>http://www.blogger.com/profile/00263136945746589896</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://4.bp.blogspot.com/_BWhYDXu2DYE/SM6_NDbbF1I/AAAAAAAAAA8/xL1Vss2fBnA/s1600-R/2954b72f8870ec98f09cdd6b4f53e07f%3Fs%3D80" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cozcog.com/2009/05/preventing-comment-spam.html</feedburner:origLink></entry></feed>

