<?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"
	>

<channel>
	<title>cpradio's tidbits of information</title>
	<atom:link href="http://cpradio.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://cpradio.org</link>
	<description>my life experience and information that may help others find what they need</description>
	<pubDate>Sun, 22 Jun 2008 17:23:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>When do you sanitize your input?</title>
		<link>http://cpradio.org/code/javascript/when-do-you-sanitize-your-input/</link>
		<comments>http://cpradio.org/code/javascript/when-do-you-sanitize-your-input/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 17:23:41 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://cpradio.org/?p=143</guid>
		<description><![CDATA[Here is a question I have been contemplating for a while&#8230;when to sanitize your input?  Do you sanitize it as soon as you receive it, or when you need to use it?
Any thoughts?
]]></description>
			<content:encoded><![CDATA[<p>Here is a question I have been contemplating for a while&#8230;when to sanitize your input?  Do you sanitize it as soon as you receive it, or when you need to use it?</p>
<p>Any thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/code/javascript/when-do-you-sanitize-your-input/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex and Flex Builder 3</title>
		<link>http://cpradio.org/personal/flex-and-flex-builder-3/</link>
		<comments>http://cpradio.org/personal/flex-and-flex-builder-3/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 00:39:42 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[Projects]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[adobe]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://cpradio.org/personal/flex-and-flex-builder-3/</guid>
		<description><![CDATA[I just have to tell everyone how cool Flex really is!  When I did flash work several years ago it was a real pain developing an entire site in Flash especially if you wanted to incorporate any backend to it.  This is definitely not the case with Flex and I have to give [...]]]></description>
			<content:encoded><![CDATA[<p>I just have to tell everyone how cool Flex really is!  When I did flash work several years ago it was a real pain developing an entire site in Flash especially if you wanted to incorporate any backend to it.  This is definitely not the case with Flex and I have to give Adobe its&#8217; props on this.</p>
<p>However, let me state, that I do want to see Flex Builder 3 ported to Linux.  I could then ditch my Windows Virtual Machine and run things natively, but that is my only complaint at this moment.</p>
<p><strong>So why do I love Flex?</strong><br />
Flex is just easy to use, the components built it are amazing and you have the ability to build components on your own too!  Much like Server Controls in .NET, .NET gives you a TON to begin with and you can create your own as well.  However, this is for Flash!  That is extremely important to acknowledge, as I do not have to have Macromedia Flash MX or whatever the latest version is on my PC to build a Flash application now.</p>
<p>Not only do I love being able to build a Flash application without Macromedia Flash, but I also love how it can work with an infinite number of backends without a lot of effort.  Got a web service you want to plugin to?  No problem, how about an RSS feed?  Again, No problem.  Well how about just a plain HTTP stream with a custom format?  No Problem!  I mean literally, you can plugin to any service that can send back a response.  If it is a custom type of response, then you can write a routine to read your custom format.  However, if you are using a Web Service, be in written in .NET and it returns an XML stream, then you literally have to do nothing!  It will read it without any custom code from you, the developer.  And that my friends is the &#8220;cream of the crop&#8221;.</p>
<p><strong>So where do we go from here?</strong><br />
I am going to be doing a lot of things with Flex fromt his point on.  I was just totally amazed by the simplicity and yet the complexity you can have within it.  I still have a lot to test.  Updating the grid&#8217;s data when it has changed, and similar events.  But time will tell and so far Adobe has bought me back with this wonderful technology.  Just bring it to Linux and I will move right next to your head-quarters Adobe!</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/personal/flex-and-flex-builder-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Software Mistakes</title>
		<link>http://cpradio.org/work/software-mistakes/</link>
		<comments>http://cpradio.org/work/software-mistakes/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 01:12:44 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[Norton]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/software-mistakes/</guid>
		<description><![CDATA[ Time and time again, software mistakes are made and cause havoc across a number of users.  Well that last part is true, if your software is fairly well known and well liked.  In the case of the image to the left, it would be Symantec&#8217;s latest and greatest update, or so some [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://cpradio.org/wp-content/uploads/2008/02/norton.jpg' title='Norton'><img src='http://cpradio.org/wp-content/uploads/2008/02/norton.thumbnail.jpg' alt='Norton' align='left' style='padding-right:10px;padding-bottom:10px' /></a> Time and time again, software mistakes are made and cause havoc across a number of users.  Well that last part is true, if your software is fairly well known and well liked.  In the case of the image to the left, it would be Symantec&#8217;s latest and greatest update, or so some were led to believe.</p>
<p>The update was far from great, in fact, I am willing to bet it was pushed on individuals so Norton didn&#8217;t have the cost of maintaining numerous versions (older versions) of their software.  Granted, that is a good reason to push an upgrade on your end users.  However, do it RIGHT!  There are two failures by this push that I noticed immediately, and there could be more.</p>
<p>Let me start by identifying how Norton was being used on the PC prior to the update.  Norton Anti-Virus and Norton Security were both installed.  Norton Security&#8217;s Outlook Express toolbar was installed to help stop spam, identify spam, and also identify items that were not spam.  Norton Anti-virus was set to do a full system scan at 8:00 AM every Sunday morning.</p>
<p>Now let me explain what happened after the update.  First of all, the Outlook Express toolbars disappeared.  Why is that bad?  Because, it shows Norton didn&#8217;t bother to check how their software was being used, before applying their update and removing what was found near and dear to the users&#8217; heart.  It was convenient to have those buttons available at the whim while working within Outlook or Outlook Express.  However, now the user has to download yet another large file called their &#8220;Addon Pack&#8221;.  The addon pack was nearly 16 MB, and quite frankly that is INSANE for being an Outlook/Outlook Express plugin, but nonetheless it did solve the initial problem.</p>
<p>Secondly, all of the scheduled jobs that were setup for Norton Anti-Virus were removed, and many of the Option settings had to be re-checked to ensure the system was setup.  Quite frankly, there is absolutely no reason this should have been affected and it was poor testing that led to this issue.  I can understand missing the Outlook/Outlook Express toolbars (I have made similar mistakes) but settings in the previous version?  How the hell do you mess that one up?</p>
<p>Now if anyone has taken a good look at the image, and clicked on it to enlarge it, you will spot I had excellent timing.  As I caught another major no-no as far as software design and practices go.  NEVER show the user meaningless information or system critical information.  Can anyone tell me what &#8220;ccPxyExt&#8221; is?  If that screen were to fail, do you think the common user would be able to remember the letters &#8220;ccPxyExt&#8221; over &#8220;Norton Proxy Extension&#8221;?  Keep the user informed during your processing and give them something that might be able to stick in their minds in case they need to contact your support.  You are not going to want to try and guess what they were typing when they randomly pick letters they thought they saw during the process.</p>
<p>Now as I stated earlier, I have made many of these mistakes in my software as well.  In fact, I have over the past week written two maintenances for software upgrades that did not go as &#8220;smoothly&#8221; as planned.  Now the causes for the issues were not created by me, but from a collection of choices that were made along a 4 month process.  When we finally flipped the switch to enable the new setup, everything came to a halt, well actually 1/3rd of our systems came to a halt.</p>
<p>The bug was truly something that was difficult to test and by the time we got around to it discovering the issue we had already committed too many changes to correct our development and test systems of the flaw.  So in short, testing, keeping track of how the system originally worked versus what your changes will do, is extremely critical.  Luckily we were able to fix our production issue within 3 days to help out our users.  Norton, I would hope this could influence you to try and do the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/software-mistakes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I&#8217;ve Fallen in Love (again)</title>
		<link>http://cpradio.org/work/ive-fallen-in-love-again/</link>
		<comments>http://cpradio.org/work/ive-fallen-in-love-again/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 04:24:29 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/ive-fallen-in-love-again/</guid>
		<description><![CDATA[At work we are going through a fairly large migration process, converting all of our .NET 1.1 applications in VS 2003 to .NET 3.0 using VS 2005/2008 (when it comes out).  During the process, I have fallen in love again with coding.  Generics just sweep me away like the first romance I ever [...]]]></description>
			<content:encoded><![CDATA[<p>At work we are going through a fairly large migration process, converting all of our .NET 1.1 applications in VS 2003 to .NET 3.0 using VS 2005/2008 (when it comes out).  During the process, I have fallen in love again with coding.  Generics just sweep me away like the first romance I ever had.</p>
<p>The .NET 3.0 features are just astounding, and it doesn&#8217;t just stop with Generics.  I truly find all pieces quite equal, from WCF to Generics to the enhancements in VS 2005.  Generics allowed me this week to take a very complex boxing and unboxing section of code and turn it into a fine tuned type specific beast that only took two lines to accomplish.</p>
<p>Not only do I throughly enjoy the new features in the actual framework and IDE, but Unit Testing is of great advantage, especially with the ability to publish your results.  We have been finding Team System Foundation to be the best decision we could of ever made, as the benefits were not only noticeable immediately, but the productivity was too.</p>
<p>Anyways, I wanted to share my enthusiasm, as if you are still writing in 1.1, you are missing out.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/ive-fallen-in-love-again/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Let the code work for you.</title>
		<link>http://cpradio.org/work/let-the-code-work-for-you/</link>
		<comments>http://cpradio.org/work/let-the-code-work-for-you/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 02:03:02 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[dynamic output]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/let-the-code-work-for-you/</guid>
		<description><![CDATA[The past two/three days (work days), I have been plagued with the task of working on a complex portion of a project.  The piece I am working on, I did not start, but I did write the foundation of it for 5 other projects and its&#8217; success and easy maintenance was largely due to [...]]]></description>
			<content:encoded><![CDATA[<p>The past two/three days (work days), I have been plagued with the task of working on a complex portion of a project.  The piece I am working on, I did not start, but I did write the foundation of it for 5 other projects and its&#8217; success and easy maintenance was largely due to how I designed it.</p>
<p>To keep a long story short, the architecture I used was not followed in this piece and now I am paying the price for something I didn&#8217;t do.  The original code was developed so the code would do 50-70% of the work for me dynamically.  Yes, this has performance cost implications but they were minimal (1-2 seconds at best), but the time it saves is nearly 60-75% of development time.</p>
<p>Now the particular piece I am referring to does a lot of output work.  It takes the data inputted by the user and develops a results page to the user describing the information the user typed.  Now, to make my life easier, I build a hash table of the user&#8217;s values and associate them with a code.  The code is related to a table that defines the text to display regarding that entry.</p>
<p>By creating code to associate the hash table data with the database table, the results page can be generated dynamically saving me the countless time of programming each possibility the user can come up with.</p>
<p>Thus, sometimes it is smarter to go a dynamic route at the cost of performance, than it is to develop the most efficient masterpiece you can imagine.</p>
<p>That is my food for thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/let-the-code-work-for-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dual Monitors and window.open(): Part 2</title>
		<link>http://cpradio.org/code/javascript/dual-monitors-and-windowopen-part-2/</link>
		<comments>http://cpradio.org/code/javascript/dual-monitors-and-windowopen-part-2/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 23:54:26 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[dual monitors]]></category>

		<category><![CDATA[window.open]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/dual-monitors-and-windowopen-part-2/</guid>
		<description><![CDATA[What? There is more?!  Of course.  Previously I tackled the horizontal setup of dual monitors, now we tackle the vertical!
So just like window.screenLeft versus window.screenX, window.screenTop only works in IE and window.screenY works in everything else.  So here is the code I used to setup a window.*property*:

// Find Top Boundary of current [...]]]></description>
			<content:encoded><![CDATA[<p>What? There is more?!  Of course.  Previously I tackled the horizontal setup of dual monitors, now we tackle the vertical!</p>
<p>So just like <code>window.screenLeft</code> versus <code>window.screenX</code>, <code>window.screenTop</code> only works in IE and <code>window.screenY</code> works in everything else.  So here is the code I used to setup a window.*property*:</p>
<pre class="js">
// Find Top Boundary of current Window
function FindTopWindowBoundary()
{
	// In Internet Explorer window.screenTop is the window's top boundry
	if (window.screenTop)
	{
		return window.screenTop;
	}

	// In Firefox window.screenY is the window's top boundry
	if (window.screenY)
		return window.screenY;

	return 0;
}

window.topWindowBoundary  = FindTopWindowBoundary;
</pre>
<p>Then just like the horizontal setup, I needed to find the Monitor&#8217;s Top Border.  Like the horizontal counter-part, you need to check the negative y-axis scenario, which left me with this code:</p>
<pre class="js">
// Find Top Boundary of the Screen/Monitor
function FindTopScreenBoundary()
{
	// Check if the window is off the primary monitor in a positive axis
	// X,Y                 S = Screen, W = Window
	// 0,0     ----------
	//        |          |
	//        |          |
	//        |        S |
	//         ----------
	// X,Y
	// 0,1280  ----------
	//        |  ---     |
	//        | | W |    |
	//        |  ---   S |
	//         ----------
	if (window.topWindowBoundary() > window.screen.height)
	{
		return window.topWindowBoundary() - (window.topWindowBoundary() - window.screen.height);
	}

	// Check if the window is off the primary monitor in a negative axis
	// X,Y                   S = Screen, W = Window
	// 0,-1024   ----------
	//          |  ---     |
	//          | | W |    |
	//          |  ---   S |
	//           ----------
	// X,Y
	// 0,0       ----------
	//          |          |
	//          |          |
	//          |        S |
	//           ----------
	// This only works in Firefox at the moment due to a bug in Internet Explorer opening new windows into a negative axis
	// However, you can move opened windows into a negative axis as a workaround
	if (window.topWindowBoundary() < 0 &#038;&#038; window.topWindowBoundary() > (window.screen.height * -1))
	{
		return (window.screen.height * -1);
	}

	// If neither of the above, the monitor is on the primary monitor whose&#8217;s screen Y should be 0
	return 0;
}
</pre>
<p>So now that we have the Top and Left boundaries written, we can open a window in any setup (2 monitors to 4 monitors to X monitors) using the following and be guaranteed that the new window will open in the same monitor as the parent window (except for IE where IE will not open windows in a negative axis).</p>
<pre class="js">window.open(thePage, 'windowName', 'resizable=1, scrollbars=1, fullscreen=0, height=200, width=650, screenX=' + window.leftScreenBoundary() + ' , left=' + window.leftScreenBoundary() + ',screenY=' + window.topScreenBoundary() + ',top=' + window.topScreenBoundary() + ', toolbar=0, menubar=0, status=1');</pre>
<p>And thus the finale of opening a child window in a dual, quad, whatever monitor setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/code/javascript/dual-monitors-and-windowopen-part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dual Monitors and window.open()</title>
		<link>http://cpradio.org/code/javascript/dual-monitors-and-windowopen/</link>
		<comments>http://cpradio.org/code/javascript/dual-monitors-and-windowopen/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 23:43:10 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[dual monitors]]></category>

		<category><![CDATA[window.open]]></category>

		<guid isPermaLink="false">http://cpradio.org/code/javascript/dual-monitors-and-windowopen/</guid>
		<description><![CDATA[Lately, I have been plagued with the complicated tasks of solving problems at work that require dual monitors.  However, I only have a single monitor.  Until Today!
Today, I got my PC setup with Dual Monitors and was asked to solve the following problem:
&#8220;When the user clicks on a link that opens a new [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, I have been plagued with the complicated tasks of solving problems at work that require dual monitors.  However, I only have a single monitor.  Until Today!</p>
<p>Today, I got my PC setup with Dual Monitors and was asked to solve the following problem:</p>
<blockquote><p>&#8220;When the user clicks on a link that opens a new window using window.open.  Make the window appear on the same monitor as its&#8217; parent.&#8221;</p></blockquote>
<p>So I got started.  Quickly I discovered that <code>window.screenLeft</code> (for IE) and <code>window.screenX</code> (for everyone else) will tell me where the window&#8217;s border is on the desktop.  So what better to do than to throw that in a window.*property* which gave me this code:</p>
<pre class="js">
// Find Left Boundry of current Window
function FindLeftWindowBoundry()
{
	// In Internet Explorer window.screenLeft is the window's left boundry
	if (window.screenLeft)
	{
		return window.screenLeft;
	}

	// In Firefox window.screenX is the window's left boundry
	if (window.screenX)
		return window.screenX;

	return 0;
}

window.leftWindowBoundry = FindLeftWindowBoundry;
</pre>
<p>Next, I needed to find the monitor&#8217;s left border.  Soon after, I figured out that there is no property currently for this, however, you can get the width of the current monitor your window is on by using <code>window.screen.width</code>.  There is a big pitfall that needs to be considered, you can have a monitor whose left border starts with a negative X-axis (ie: -1024&#215;0 to 0&#215;768).</p>
<p>So that left with me the following code:</p>
<pre class="js">
// Find Left Boundry of the Screen/Monitor
function FindLeftScreenBoundry()
{
	// Check if the window is off the primary monitor in a positive axis
	// X,Y                  X,Y                    S = Screen, W = Window
	// 0,0  ----------   1280,0  ----------
	//     |          |         |  ---     |
	//     |          |         | | W |    |
	//     |        S |         |  ---   S |
	//      ----------           ----------
	if (window.leftWindowBoundry() > window.screen.width)
	{
		return window.leftWindowBoundry() - (window.leftWindowBoundry() - window.screen.width);
	}

	// Check if the window is off the primary monitor in a negative axis
	// X,Y                  X,Y                    S = Screen, W = Window
	// 0,0  ----------  -1280,0  ----------
	//     |          |         |  ---     |
	//     |          |         | | W |    |
	//     |        S |         |  ---   S |
	//      ----------           ----------
	// This only works in Firefox at the moment due to a bug in Internet Explorer opening new windows into a negative axis
	// However, you can move opened windows into a negative axis as a workaround
	if (window.leftWindowBoundry() < 0 &#038;&#038; window.leftWindowBoundry() > (window.screen.width * -1))
	{
		return (window.screen.width * -1);
	}

	// If neither of the above, the monitor is on the primary monitor whose&#8217;s screen X should be 0
	return 0;
}

window.leftScreenBoundry = FindLeftScreenBoundry;
</pre>
<p>Now that the code is written, you can now use <code>window.open</code> to open a window on the monitor the parent window is on.</p>
<pre class="js">window.open(thePage, 'windowName', 'resizable=1, scrollbars=1, fullscreen=0, height=200, width=650, screenX=' + window.leftScreenBoundry() + ' , left=' + window.leftScreenBoundry() + ', toolbar=0, menubar=0, status=1');</pre>
<p>Oh yeah, IE has a bug in it that prevents opening windows with <code>window.open</code> in the negative X-axis.  You have to use <code>windowName.moveTo(-1024, 0);</code> to move it to the negative X-axis.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/code/javascript/dual-monitors-and-windowopen/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JSON versus XML</title>
		<link>http://cpradio.org/work/json-versus-xml/</link>
		<comments>http://cpradio.org/work/json-versus-xml/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 00:01:00 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/json-versus-xml/</guid>
		<description><![CDATA[There has been much debate on using XML or JSON with your AJAX, but in my mind, the debate is pointless.  Both are nice, one is quicker, one is slower.  However, when it comes to development pick what you know best and what you can implement/maintain easiest.
If you do this, you are guaranteed [...]]]></description>
			<content:encoded><![CDATA[<p>There has been much debate on using XML or JSON with your AJAX, but in my mind, the debate is pointless.  Both are nice, one is quicker, one is slower.  However, when it comes to development pick what you know best and what you can implement/maintain easiest.</p>
<p>If you do this, you are guaranteed the following:</p>
<ol>
<li>It is easy to maintain and understand the code you wrote months later</li>
<li>Chances are your application will not be the quickest in response</li>
<li>You will make use of techniques you fully understand than trying to adapt ones that you are unfamiliar with and may implement wrong</li>
</ol>
<p>So how does JSON differ from returning XML in your AJAX requests?  Lets first look at the advantages of XML.</p>
<ol>
<li>Standardized and easily serialized into via .NET</li>
<li>The XML is easy to read all within itself</li>
<li>You can make use of XSLT, DTDs, etc</li>
</ol>
<p>How about disadvantages of XML?</p>
<ol>
<li>It is slow in comparison to JSON</li>
<li>It can be clumsy when not designed properly</li>
</ol>
<p>Now for the advantages of JSON:</p>
<ol>
<li>It is faster than XML to parse in JavaScript</li>
<li>There are addin&#8217;s you can install in .NET or a library in PHP to serialize a JSON string from an object</li>
<li>It is hard to make this clumsy as it is based on the Object Design</li>
</ol>
<p>And the disadvantages of JSON:</p>
<ol>
<li>It is harder to read the serialized output</li>
<li>You can&#8217;t use XSLT, DTDs, or something of the sort to validate or style the request</li>
</ol>
<p>As for myself, I am a JSON person.  I didn&#8217;t used to be though.  My original AJAX applications were focused around XML primarily because I could make use of an XSLT and I always validated against a schema.  However, JSON has won me over due to speed.  JSON&#8217;s speed is just ridiculously fast and it showed when I converted a major application over to it.  I saved nearly a third of the time it took to do a fairly simple task.</p>
<p>However, pick the poison that you understand most, otherwise, it could have detrimental affects.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/json-versus-xml/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Refactoring - What a time-saver</title>
		<link>http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/</link>
		<comments>http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 02:52:52 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Projects]]></category>

		<category><![CDATA[Work]]></category>

		<category><![CDATA[kiosk]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/</guid>
		<description><![CDATA[This weekend has been a nice relaxing weekend for me and so when I got back home this afternoon (on Sunday the 16th), I was in a great mood to refactor some of my kiosk code base.  Now, I should start by saying, I decided to refactor code instead of write new code tonight [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend has been a nice relaxing weekend for me and so when I got back home this afternoon (on Sunday the 16th), I was in a great mood to refactor some of my kiosk code base.  Now, I should start by saying, I decided to refactor code instead of write new code tonight because I wanted to lessen the number of files that needed to load in the Ajax functionality.</p>
<p>Kiosk, uses Ajax in interesting ways to provide a better experience, but with that, the Ajax applications were built as each page was assembled.  This caused functionality across pages to get a bit messy or functionality shared across pages to get thrown into individual files.  Well the problem with individual files, is that is yet another file for the browser to download.</p>
<p>So before I get any further, let me discuss refactoring and how it can solve many performance binds your application may be experiencing.</p>
<p>To start off, refactoring is taking common code, or code that is used across pages or frequently and moving it to a more global location so it can be called easier and the code only has to be written once.</p>
<p>So where can this help?</p>
<ul>
<li>First of all, by refactoring code into a single global file, you can limit the number of HTTP requests if that file is accessible via the web.  Since your common code is in a single file, the browser only has to fetch that code once, and will then likely cache that file for each page after, giving you even better performance.</li>
<li>Secondly, by placing the common code in a global method/function, you are writing less code.  As now when you need to call that code on your second page, it is already written, so just call the function.  Otherwise, you would need to write the code all over again.</li>
<li>Thirdly, less code equals smaller files.  By refactoring your code, you can have smaller file sizes and in turn that is quicker to download, quicker to parse, and quicker to execute.</li>
</ul>
<p>Now in my situation, I took about 4 JavaScript files and combined them into a single file adequately named &#8220;general.js&#8221;.  The file contained code to automatically log the user out after a set amount of inactivity in the UI (User Interface).  Secondly, it contained the version checking mechanism calls that see if they are running the latest version of the software.  Unfortunately, those are the only two things it does right now, but as the project progresses, I am sure more utilities will get added in this file.</p>
<p>My next task is to refactor the Data Grid functionality so it is 1) XHTML, 2) easy to build complex columns with complex rows, 3) customizable by identifying StyleSheet classes for the columns and rows.  Hopefully, I can get my head around this idea and get it working with little trouble to the programmer.</p>
<p>So what can you think of that you need to refactor?  What performance gains do you suspect you will achieve with the refactoring you do?  Any performance markers?</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Harness Server Controls</title>
		<link>http://cpradio.org/work/harness-server-controls/</link>
		<comments>http://cpradio.org/work/harness-server-controls/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 01:41:03 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/harness-server-controls/</guid>
		<description><![CDATA[When you write a Server Control and write it well, it pays off immensely.  Today, I needed to rework our Custom Defaults screen (a screen that allows each user to define defaults for our quoting screens to use each time they write a new quote).  All of the fields on the Custom Defaults [...]]]></description>
			<content:encoded><![CDATA[<p>When you write a Server Control and write it well, it pays off immensely.  Today, I needed to rework our Custom Defaults screen (a screen that allows each user to define defaults for our quoting screens to use each time they write a new quote).  All of the fields on the Custom Defaults screen exist in the quote (duh, why would we provide something that didn&#8217;t? <img src='http://cpradio.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).  </p>
<p>Since everything in the quote is a server control, it was just drag and drop the controls onto the Custom Default page and it would act 100% like it does in the quote. <img src='http://cpradio.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  It could not have gone any faster, I probably only spent close to 5 minutes setting up the design and flow and 30 minutes getting the code behind functionality to work.</p>
<p>Thus, harness the power of Server Controls as they can be reused across numerous applications with little trouble and little programming.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/harness-server-controls/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.756 seconds -->
<!-- Cached page served by WP-Cache -->
