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

<channel>
	<title>NotSoNerdy.com &#187; Programming</title>
	<atom:link href="http://www.notsonerdy.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.notsonerdy.com</link>
	<description>A not so nerdy developers look at programming and life.</description>
	<lastBuildDate>Mon, 18 May 2009 03:50:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8216;AJAXControlToolkit&#8217; is undefined &#8211; iislog sc-win32-status = 64 and sc-status = 200</title>
		<link>http://www.notsonerdy.com/2007/12/13/ajaxcontroltoolkit-is-undefined-iislog-sc-win32-status-64-and-sc-status-200/</link>
		<comments>http://www.notsonerdy.com/2007/12/13/ajaxcontroltoolkit-is-undefined-iislog-sc-win32-status-64-and-sc-status-200/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 00:23:33 +0000</pubDate>
		<dc:creator>Matthew Williams</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.notsonerdy.com/2007/12/13/ajaxcontroltoolkit-is-undefined-iislog-sc-win32-status-64-and-sc-status-200/</guid>
		<description><![CDATA[So I deployed a killer internal application today that well over 400 employees will be using on a daily basis. I decided to use the AJAX control toolkit to give the application better error checking and more of a windows application feel without having to deal with the deployment and maintenance of a windows app. [...]]]></description>
			<content:encoded><![CDATA[<p>So I deployed a killer internal application today that well over 400 employees will be using on a daily basis. I decided to use the AJAX control toolkit to give the application better error checking and more of a windows application feel without having to deal with the deployment and maintenance of a windows app.  We all know how fun that can be in an enterprise!!  Needless to say, the application passed through QA with flying colors and moved on to production. That is where we ran into some problems.  It was random, and it was very difficult to trace, not to mention we didn&#8217;t have technical people doing the troubleshooting at the client level.  As we started to parse the IIS logs, we found that we were getting a IIS Status 64 which is a network type error from IIS.  It was always preceeded with a success (200) status.  Our server engineering department went the route of verifying we were all good on the network side while I kept trying to get on an effected machine.</p>
<p>After finally getting on the phone with someone who was experiencing the issue, I was able to determine the issue was related to a JS error. &#8216;AJAXControlToolkit&#8217; is undefined.  GREAT, but WHY???</p>
<p><strong>SIDE NOTE:</strong> We were very early adopters of the toolkit during its beta stages.  MS was great with helping to resolve issues as well as incorporate our feedback in future releases.  One of those items was the script combiner in the library.  The toolkit is VERY heavy when it is not compressed (~500k) based on what controls you are using.  This amounts to 14 different scripts being pulled down on our servers which is one for every control type and a few for the framework itself.  As you can guess, this is pretty taxing on the client vs. just getting one file.  We manually implemented the script combining on our customer site which took 3 seconds off the average download time due to less items having to be called from the server.  Not to mention compression that took the ~500k script to ~90k.  With the following in the latest release you can do this without having a manual work around.</p>
<p><strong>The problem</strong></p>
<pre class="html4strict">Bad
<span style="color: #ddbb00;">&amp;lt;</span>ajaxtoolkit:ToolkitScriptManager ID=&quot;_ScriptManager&quot;
     runat=&quot;server&quot; combinescripts=&quot;true&quot; /<span style="color: #ddbb00;">&amp;gt;</span></pre>
<p>Great right?  Wrong&#8230; this is what was causing the issue!!!  The script combiner for some reason doesn&#8217;t always generate the script for the client.  It is pretty buggy actually.  We were finding that clearing the users cache would only work until the next build would come out.  After that, we would have to clear the cache again for all 400 clients.  Because of this we were ready to scrap the controls (which MADE the application) for standard ASP.NET controls.  </p>
<p>So, the workaround&#8230; go back to our standard hack that combined the files&#8230; and for those that don&#8217;t want to do the hack?  Switch the combinescripts tag to true and your problem will go away!</p>
<p><strong>The fix:</strong></p>
<pre class="html4strict">Good
<span style="color: #ddbb00;">&amp;lt;</span>ajaxtoolkit:ToolkitScriptManager ID=&quot;_ScriptManager&quot;
     runat=&quot;server&quot; combinescripts=&quot;false&quot; /<span style="color: #ddbb00;">&amp;gt;</span></pre>
<p>Needless to say, this was a big &#8220;phew&#8221; from us.  We believe the framework has a lot of great potential for internal apps by allowing us to have a windows like feel without the deployment nightmare.  The application has already proved to have a huge payoff with this fix alone.  We were able to deploy enterprise wide in less than 10 seconds with an automated build.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notsonerdy.com/2007/12/13/ajaxcontroltoolkit-is-undefined-iislog-sc-win32-status-64-and-sc-status-200/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Advanced Cookie Compression With .NET &amp; Ajax.NET</title>
		<link>http://www.notsonerdy.com/2007/09/28/advanced-cookie-compression-with-net-ajaxnet/</link>
		<comments>http://www.notsonerdy.com/2007/09/28/advanced-cookie-compression-with-net-ajaxnet/#comments</comments>
		<pubDate>Sat, 29 Sep 2007 00:04:04 +0000</pubDate>
		<dc:creator>Matthew Williams</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.notsonerdy.com/2007/09/28/advanced-cookie-compression-with-net-ajaxnet/</guid>
		<description><![CDATA[So I have been working on a project where we want to store more information in the cookie.  I was trying to figure out the best way to store an object to the cookie and get it back out so it was easy to use. I personally hate the flat nature of a cookie [...]]]></description>
			<content:encoded><![CDATA[<p>So I have been working on a project where we want to store more information in the cookie.  I was trying to figure out the best way to store an object to the cookie and get it back out so it was easy to use. I personally hate the flat nature of a cookie anyway.  Cookie dictionaries don&#8217;t really provide the level of sofistication some sites need for their cookies.  Serialization is great, but it is also very heavy in for the result in XML. I ended up making a very small object, very large.  Since I have been working extensively with the new MS Ajax framework, I started looking into JSON and the benefits it could provide for me. </p>
<p>Let&#8217;s start with a simple object:</p>
<pre class="csharp"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>.<span style="color: #0000FF;">Generic</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>;
&nbsp;
<span style="color: #0600FF;">namespace</span> JSONCookie.<span style="color: #0000FF;">Customer</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #000000;">&#91;</span>Serializable<span style="color: #000000;">&#93;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> Address
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">private</span> Guid _id;
        <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> _address1;
        <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> _address2;
        <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> _city;
        <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">string</span> _state;
        <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">int</span> _postalCode;
        <span style="color: #0600FF;">private</span> DateTime _lastUpdated;
&nbsp;
        <span style="color: #0600FF;">public</span> Guid ID
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _id; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _id = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Address1
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _address1; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _address1 = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Address2
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _address2; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _address2 = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> City
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _city; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _city = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> State
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _state; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _state = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> PostalCode
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _postalCode; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _postalCode = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> DateTime LastUpdated
        <span style="color: #000000;">&#123;</span>
            get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _lastUpdated; <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> _lastUpdated = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre>
<p>As you can see the above is a very simple object with strings, int, Guid, and DateTime fields just to show how the data looks when converted.  Now, say you want to store this object into a cookie*.  How would we get it to the text level we need for cookie use?  There are many articles out there on how to compress a cookie using .NET&#8217;s MemoryStram and DeflateStream compression, but all have been showing how to do this with the XML provided back from serialization of an object.</p>
<p>Here is are the two methods I will be comparing:</p>
<pre class="csharp"><span style="color: #008080; font-style: italic;">/// &amp;lt;summary&amp;gt;</span>
<span style="color: #008080; font-style: italic;">/// Here we are just doing plain 'ol serialization</span>
<span style="color: #008080; font-style: italic;">/// &amp;lt;/summary&amp;gt;</span>
<span style="color: #008080; font-style: italic;">/// &amp;lt;param name=&quot;obj&quot;&amp;gt;Object to serialize&amp;lt;/param&amp;gt;</span>
<span style="color: #008080; font-style: italic;">/// &amp;lt;returns&amp;gt;Serialized object as string&amp;lt;/returns&amp;gt;</span>
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> SerializeIt<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> obj<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    XmlSerializer ObjSerializer =
        <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> XmlSerializer<span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #000000;">&#40;</span>Customer.<span style="color: #0000FF;">Address</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
    TextWriter XMLObject = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StringWriter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    ObjSerializer.<span style="color: #0000FF;">Serialize</span><span style="color: #000000;">&#40;</span>XMLObject, obj<span style="color: #000000;">&#41;</span>;
&nbsp;
    <span style="color: #0600FF;">return</span> XMLObject.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">/// &amp;lt;summary&amp;gt;</span>
<span style="color: #008080; font-style: italic;">/// Here we take an object and Serialize it into JSON</span>
<span style="color: #008080; font-style: italic;">/// &amp;lt;/summary&amp;gt;</span>
<span style="color: #008080; font-style: italic;">/// &amp;lt;param name=&quot;obj&quot;&amp;gt;Object to be serialized&amp;lt;/param&amp;gt;</span>
<span style="color: #008080; font-style: italic;">/// &amp;lt;returns&amp;gt;JSON string&amp;lt;/returns&amp;gt;</span>
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> JSONit<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> obj<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    StringBuilder JSONObject = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StringBuilder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
    JavaScriptSerializer JSON = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> JavaScriptSerializer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    JSON.<span style="color: #0000FF;">Serialize</span><span style="color: #000000;">&#40;</span>obj, JSONObject<span style="color: #000000;">&#41;</span>;
&nbsp;
    <span style="color: #0600FF;">return</span> JSONObject.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre>
<p>Now, let&#8217;s see what the results are:</p>
<p><strong>Serialized</strong></p>
<pre class="xml"><span style="color: #ddbb00;">&amp;lt;</span>?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>ArrayOfCustomer
  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;<span style="color: #ddbb00;">&amp;gt;</span>
  <span style="color: #ddbb00;">&amp;lt;</span>Customer<span style="color: #ddbb00;">&amp;gt;</span>
    <span style="color: #ddbb00;">&amp;lt;</span>ID<span style="color: #ddbb00;">&amp;gt;</span>83a8e9c8-dc2c-4ba7-a17d-86a7f0d1820b<span style="color: #ddbb00;">&amp;lt;</span>/ID<span style="color: #ddbb00;">&amp;gt;</span>
    <span style="color: #ddbb00;">&amp;lt;</span>Name<span style="color: #ddbb00;">&amp;gt;</span>Carina<span style="color: #ddbb00;">&amp;lt;</span>/Name<span style="color: #ddbb00;">&amp;gt;</span>
    <span style="color: #ddbb00;">&amp;lt;</span>Blah<span style="color: #ddbb00;">&amp;gt;</span>Alberto<span style="color: #ddbb00;">&amp;lt;</span>/Blah<span style="color: #ddbb00;">&amp;gt;</span>
    <span style="color: #ddbb00;">&amp;lt;</span>Addresses<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>Address<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>ID<span style="color: #ddbb00;">&amp;gt;</span>26c71b32-6e91-4663-b740-81893c28939d<span style="color: #ddbb00;">&amp;lt;</span>/ID<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address1<span style="color: #ddbb00;">&amp;gt;</span>4957 Isabela<span style="color: #ddbb00;">&amp;lt;</span>/Address1<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address2<span style="color: #ddbb00;">&amp;gt;</span>Apt: 200<span style="color: #ddbb00;">&amp;lt;</span>/Address2<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>City<span style="color: #ddbb00;">&amp;gt;</span>Jaylyn<span style="color: #ddbb00;">&amp;lt;</span>/City<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>State<span style="color: #ddbb00;">&amp;gt;</span>Camden<span style="color: #ddbb00;">&amp;lt;</span>/State<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>PostalCode<span style="color: #ddbb00;">&amp;gt;</span>95638<span style="color: #ddbb00;">&amp;lt;</span>/PostalCode<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Updated<span style="color: #ddbb00;">&amp;gt;</span>2007-09-28T16:37:26.9334017-07:00<span style="color: #ddbb00;">&amp;lt;</span>/Updated<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>/Address<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>Address<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>ID<span style="color: #ddbb00;">&amp;gt;</span>156e4962-f810-4b7c-be39-6bb07f70989b<span style="color: #ddbb00;">&amp;lt;</span>/ID<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address1<span style="color: #ddbb00;">&amp;gt;</span>55114 Josephine<span style="color: #ddbb00;">&amp;lt;</span>/Address1<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address2<span style="color: #ddbb00;">&amp;gt;</span>Apt: 625<span style="color: #ddbb00;">&amp;lt;</span>/Address2<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>City<span style="color: #ddbb00;">&amp;gt;</span>Jermaine<span style="color: #ddbb00;">&amp;lt;</span>/City<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>State<span style="color: #ddbb00;">&amp;gt;</span>Konner<span style="color: #ddbb00;">&amp;lt;</span>/State<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>PostalCode<span style="color: #ddbb00;">&amp;gt;</span>31317<span style="color: #ddbb00;">&amp;lt;</span>/PostalCode<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Updated<span style="color: #ddbb00;">&amp;gt;</span>2007-09-28T16:37:26.9334017-07:00<span style="color: #ddbb00;">&amp;lt;</span>/Updated<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>/Address<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>Address<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>ID<span style="color: #ddbb00;">&amp;gt;</span>5cce9640-95d0-4579-b248-abce62c2225f<span style="color: #ddbb00;">&amp;lt;</span>/ID<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address1<span style="color: #ddbb00;">&amp;gt;</span>2940 Lillie<span style="color: #ddbb00;">&amp;lt;</span>/Address1<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address2<span style="color: #ddbb00;">&amp;gt;</span>Apt: 208<span style="color: #ddbb00;">&amp;lt;</span>/Address2<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>City<span style="color: #ddbb00;">&amp;gt;</span>Jonas<span style="color: #ddbb00;">&amp;lt;</span>/City<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>State<span style="color: #ddbb00;">&amp;gt;</span>Cael<span style="color: #ddbb00;">&amp;lt;</span>/State<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>PostalCode<span style="color: #ddbb00;">&amp;gt;</span>31946<span style="color: #ddbb00;">&amp;lt;</span>/PostalCode<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Updated<span style="color: #ddbb00;">&amp;gt;</span>2007-09-28T16:37:26.9334017-07:00<span style="color: #ddbb00;">&amp;lt;</span>/Updated<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>/Address<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>Address<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>ID<span style="color: #ddbb00;">&amp;gt;</span>85655341-4a98-41d8-8cae-155bf902240b<span style="color: #ddbb00;">&amp;lt;</span>/ID<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address1<span style="color: #ddbb00;">&amp;gt;</span>80959 Giovani<span style="color: #ddbb00;">&amp;lt;</span>/Address1<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address2<span style="color: #ddbb00;">&amp;gt;</span>Apt: 872<span style="color: #ddbb00;">&amp;lt;</span>/Address2<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>City<span style="color: #ddbb00;">&amp;gt;</span>Jade<span style="color: #ddbb00;">&amp;lt;</span>/City<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>State<span style="color: #ddbb00;">&amp;gt;</span>Keshawn<span style="color: #ddbb00;">&amp;lt;</span>/State<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>PostalCode<span style="color: #ddbb00;">&amp;gt;</span>98534<span style="color: #ddbb00;">&amp;lt;</span>/PostalCode<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Updated<span style="color: #ddbb00;">&amp;gt;</span>2007-09-28T16:37:26.9334017-07:00<span style="color: #ddbb00;">&amp;lt;</span>/Updated<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>/Address<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>Address<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>ID<span style="color: #ddbb00;">&amp;gt;</span>7718ea1c-3282-47b1-9f1f-b546ca905a61<span style="color: #ddbb00;">&amp;lt;</span>/ID<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address1<span style="color: #ddbb00;">&amp;gt;</span>76381 Maia<span style="color: #ddbb00;">&amp;lt;</span>/Address1<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Address2<span style="color: #ddbb00;">&amp;gt;</span>Apt: 367<span style="color: #ddbb00;">&amp;lt;</span>/Address2<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>City<span style="color: #ddbb00;">&amp;gt;</span>Graham<span style="color: #ddbb00;">&amp;lt;</span>/City<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>State<span style="color: #ddbb00;">&amp;gt;</span>Natalie<span style="color: #ddbb00;">&amp;lt;</span>/State<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>PostalCode<span style="color: #ddbb00;">&amp;gt;</span>79905<span style="color: #ddbb00;">&amp;lt;</span>/PostalCode<span style="color: #ddbb00;">&amp;gt;</span>
        <span style="color: #ddbb00;">&amp;lt;</span>Updated<span style="color: #ddbb00;">&amp;gt;</span>2007-09-28T16:37:26.9334017-07:00<span style="color: #ddbb00;">&amp;lt;</span>/Updated<span style="color: #ddbb00;">&amp;gt;</span>
      <span style="color: #ddbb00;">&amp;lt;</span>/Address<span style="color: #ddbb00;">&amp;gt;</span>
    <span style="color: #ddbb00;">&amp;lt;</span>/Addresses<span style="color: #ddbb00;">&amp;gt;</span>
  <span style="color: #ddbb00;">&amp;lt;</span>/Customer<span style="color: #ddbb00;">&amp;gt;</span>
<span style="color: #ddbb00;">&amp;lt;</span>/ArrayOfCustomer<span style="color: #ddbb00;">&amp;gt;</span></pre>
<p><strong>JSON&#8217;ized</strong></p>
<pre>[{&quot;ID&quot;:&quot;83a8e9c8-dc2c-4ba7-a17d-86a7f0d1820b&quot;,&quot;Name&quot;:&quot;Carina&quot;,&quot;Blah&quot;:&quot;Alberto&quot;,&quot;Addresses&quot;:[{&quot;ID&quot;:&quot;26c71b32-6e91-4663-b740-81893c28939d&quot;,&quot;Address1&quot;:&quot;4957 Isabela&quot;,&quot;Address2&quot;:&quot;Apt: 200&quot;,&quot;City&quot;:&quot;Jaylyn&quot;,&quot;State&quot;:&quot;Camden&quot;,&quot;PostalCode&quot;:95638,&quot;Updated&quot;:&quot;\/Date(1191022646933)\/&quot;},{&quot;ID&quot;:&quot;156e4962-f810-4b7c-be39-6bb07f70989b&quot;,&quot;Address1&quot;:&quot;55114 Josephine&quot;,&quot;Address2&quot;:&quot;Apt: 625&quot;,&quot;City&quot;:&quot;Jermaine&quot;,&quot;State&quot;:&quot;Konner&quot;,&quot;PostalCode&quot;:31317,&quot;Updated&quot;:&quot;\/Date(1191022646933)\/&quot;},{&quot;ID&quot;:&quot;5cce9640-95d0-4579-b248-abce62c2225f&quot;,&quot;Address1&quot;:&quot;2940 Lillie&quot;,&quot;Address2&quot;:&quot;Apt: 208&quot;,&quot;City&quot;:&quot;Jonas&quot;,&quot;State&quot;:&quot;Cael&quot;,&quot;PostalCode&quot;:31946,&quot;Updated&quot;:&quot;\/Date(1191022646933)\/&quot;},{&quot;ID&quot;:&quot;85655341-4a98-41d8-8cae-155bf902240b&quot;,&quot;Address1&quot;:&quot;80959 Giovani&quot;,&quot;Address2&quot;:&quot;Apt: 872&quot;,&quot;City&quot;:&quot;Jade&quot;,&quot;State&quot;:&quot;Keshawn&quot;,&quot;PostalCode&quot;:98534,&quot;Updated&quot;:&quot;\/Date(1191022646933)\/&quot;},{&quot;ID&quot;:&quot;7718ea1c-3282-47b1-9f1f-b546ca905a61&quot;,&quot;Address1&quot;:&quot;76381 Maia&quot;,&quot;Address2&quot;:&quot;Apt: 367&quot;,&quot;City&quot;:&quot;Graham&quot;,&quot;State&quot;:&quot;Natalie&quot;,&quot;PostalCode&quot;:79905,&quot;Updated&quot;:&quot;\/Date(1191022646933)\/&quot;}]}]</pre>
<p>The JSON version is a little more difficult to read, but honestly, who cares&#8230; that isn&#8217;t your job, you use .NET for that.  Now this is great, but not really all that helpful. We currently have one customer with 5 addresses and a lot of data&#8230; we could just jamb this into a cookie, but that would actually present some more format issues and to fix them we would nee to take up more space.  So&#8230; let&#8217;s compress.  I have attached the project for this so you can try it out and see how the compression works.  From here&#8230; just put it into your cookie.  Here are some interesting stats.</p>
<table border="0" cellpadding="5">
<tr>
<td><b>Serialization</b></td>
<td><b>Size in KB</b></td>
</tr>
<tr>
<td>JSON</td>
<td>0.98 KB</td>
</tr>
<tr>
<td>JSON Compressed</td>
<td>0.84 KB</td>
</tr>
<tr>
<td>Serialized</td>
<td>1.96 KB</td>
</tr>
<tr>
<td>Serialized Compressed</td>
<td>0.1.08 KB</td>
</tr>
</table>
<p>* This data is just an easy example of what you can do to cram into a cookie.  Customer data is a very bad example as you wouldn&#8217;t want to make this information public even if just session based.  There are many other applications for this to utilize the power of the client machine vs. relying on IIS to maintain state on your entire application.  This is actually a mini db at the client level.  Just make sure you realize how mini&#8230; 4kb total&#8230; or so they say. Still haven&#8217;t broken this with slightly larger cookies in most mainstream browsers.</p>
<p>- <a href='http://www.notsonerdy.com/wp-content/uploads/2007/09/jsoncookie.zip' title='JSON Cookie Example (.NET 2.0)'>JSON Cookie Example (.NET 2.0)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.notsonerdy.com/2007/09/28/advanced-cookie-compression-with-net-ajaxnet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2005 Slow &amp; How to Speed it up&#8230;</title>
		<link>http://www.notsonerdy.com/2006/06/05/visual-studio-2005-slow-how-to-speed-it-up/</link>
		<comments>http://www.notsonerdy.com/2006/06/05/visual-studio-2005-slow-how-to-speed-it-up/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 18:03:10 +0000</pubDate>
		<dc:creator>Matthew Williams</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.notsonerdy.com/2006/06/06/visual-studio-2005-slow-how-to-speed-it-up/</guid>
		<description><![CDATA[I am working with our corporate website which is to say the least, huge. I was compiling the site the other day after making some major mods.  The thing took about 20 minutes to compile!!
Simple solution!  Close all of your open docs that you are no longer using.  The compile time will [...]]]></description>
			<content:encoded><![CDATA[<p>I am working with our corporate website which is to say the least, huge. I was compiling the site the other day after making some major mods.  The thing took about 20 minutes to compile!!</p>
<p>Simple solution!  Close all of your open docs that you are no longer using.  The compile time will drop dramatically!</p>
<p>Word,<br />
Matt</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notsonerdy.com/2006/06/05/visual-studio-2005-slow-how-to-speed-it-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
