<?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>TechStrut</title>
	<atom:link href="http://www.techstrut.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techstrut.com</link>
	<description>Technology Stuff</description>
	<lastBuildDate>Fri, 30 Oct 2009 00:14:06 +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>Joomla 1.6 Alpha 2 Released</title>
		<link>http://www.techstrut.com/2009/10/29/joomla-1-6-alpha-2-released/</link>
		<comments>http://www.techstrut.com/2009/10/29/joomla-1-6-alpha-2-released/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 00:05:13 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[1.6]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[content management system]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=160</guid>
		<description><![CDATA[Joomla 1.6 Alpha 2 was recently released. Joomla is an open source content management system. Since the release of Joomla 1.5 more than a year ago, Joomla has become increasingly more popular. Joomla 1.6 will contain many new features and improvements over Joomla 1.5. One of the major changes in Joomla 1.6 is an improved [...]]]></description>
			<content:encoded><![CDATA[<p>Joomla 1.6 Alpha 2 was recently released. Joomla is an open source content management system. Since the release of Joomla 1.5 more than a year ago, Joomla has become increasingly more popular. Joomla 1.6 will contain many new features and improvements over Joomla 1.5. One of the major changes in Joomla 1.6 is an improved ACL (Access Control List). The new ACL will provide the ability for administrators to assign specific permissions to individual content items. <span id="more-160"></span></p>
<p>There are many other improvements planned for Joomla 1.6 including</p>
<ul>
<li>Extenable user profile</li>
<li>New back-end and front-end Templates</li>
<li>Improved content Modules</li>
<li>New uploader for the Media Manager</li>
<li>Nested Categories and category parameters</li>
<li>New views in front-end: categories, category</li>
<li>and many more</li>
</ul>
<p>There are plans to add more database drivers. Currently Joomla uses MySQL. Official support for other databases such as Microsoft SQL is important.  The Joomla development team has been very committed to releasing Joomla 1.6 on schedule. An official release date for Joomla 1.6 has not been announced at this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/10/29/joomla-1-6-alpha-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 1.3 Alpha Released</title>
		<link>http://www.techstrut.com/2009/09/28/symfony-1-3-alpha-released/</link>
		<comments>http://www.techstrut.com/2009/09/28/symfony-1-3-alpha-released/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 22:55:56 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[1.3]]></category>
		<category><![CDATA[Framework]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=153</guid>
		<description><![CDATA[The alpha version of Symfony 1.3 has been released. Improvements in Symfony 1.3 include: performance, forms, mailer and more. In the new version there is a new default mailer based on SwiftMailer 4.1. When a new application is created with the generate:app task, the security settings escaping_strategy and csrf_secret are now enabled by default. When a [...]]]></description>
			<content:encoded><![CDATA[<p>The alpha version of Symfony 1.3 has been released. Improvements in Symfony 1.3 include: performance, forms, mailer and more. In the new version there is a new default mailer based on SwiftMailer 4.1. When a new application is created with the <code>generate:app</code> task, the security settings <code>escaping_strategy </code>and <code>csrf_secret</code> are now enabled by default. When a label is auto-generated from the field name, <code>_id</code> suffixes are now removed. All symfony autoloaders are now case-insensitive. PHP is case-insensitive, now so is symfony. The symfony CLI now attempts to detect the width of your terminal window and formats lines to fit. If detection is not possible the CLI defaults to 78 columns wide. Doctrine is now also the default configured ORM when creating a new project. There are many more changes and new features. Read the complete <a title="What's new in Symfony 1.3?" href="http://www.symfony-project.org/tutorial/1_3/en/whats-new">What&#8217;s new in Symfony 1.3</a> on the Syfomy project web site. The alpha version should not be used on production environments. Symfony 1.3 is scheduled to be released in November 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/09/28/symfony-1-3-alpha-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery Ribbon</title>
		<link>http://www.techstrut.com/2009/09/13/jquery-ribbon/</link>
		<comments>http://www.techstrut.com/2009/09/13/jquery-ribbon/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 19:49:06 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=139</guid>
		<description><![CDATA[I was expecting a JavaScript version of the popular ribbon to be released as soon as it made its first appearance in Microsoft Office. It&#8217;s finally here and it looks and functions just like the real thing.

It has been built on JQuery and it even comes with a Windows 7 theme. The ribbon supports drop [...]]]></description>
			<content:encoded><![CDATA[<p>I was expecting a JavaScript version of the popular ribbon to be released as soon as it made its first appearance in Microsoft Office. It&#8217;s finally here and it looks and functions just like the real thing.</p>
<p style="text-align: center;"><a href="http://www.techstrut.com/wp-content/uploads/2009/09/ribbon1.png"><img class="size-full wp-image-140 aligncenter" title="JQuery Ribbon Menu" src="http://www.techstrut.com/wp-content/uploads/2009/09/ribbon1.png" alt="JQuery Ribbon Close Up" width="363" height="135" /></a><span id="more-139"></span></p>
<p>It has been built on JQuery and it even comes with a Windows 7 theme. The ribbon supports drop down menus, forms, groups, lists, themes and more. It can also be minimized to reduce the amount of space that it uses.  Visit the <a title="JQuery Ribbon" href="http://vinkr.net/ribbon">JQuery Ribbon</a> website for a full demo and download information.</p>
<p style="text-align: center;"><a href="http://www.techstrut.com/wp-content/uploads/2009/09/ribbon2.png"><img class="size-full wp-image-141  aligncenter" title="JQuery Ribbon Menu  Opened" src="http://www.techstrut.com/wp-content/uploads/2009/09/ribbon2.png" alt="JQuery Ribbon Menu" width="564" height="448" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/09/13/jquery-ribbon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paint.Net Free Windows Image Editing Utility</title>
		<link>http://www.techstrut.com/2009/09/04/paint-net-free-windows-image-editing-utility/</link>
		<comments>http://www.techstrut.com/2009/09/04/paint-net-free-windows-image-editing-utility/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 01:11:29 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=129</guid>
		<description><![CDATA[I found Paint.Net a few weeks ago when someone asked me to change the opacity of an image. Paint.Net is a free image editing tools for Windows. It has some impressive features such as support for layers, unlimited undo, special effects and a wide variety of  useful and powerful tools. Best of all it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I found Paint.Net a few weeks ago when someone asked me to change the opacity of an image. Paint.Net is a free image editing tools for Windows. It has some impressive features such as support for layers, unlimited undo, special effects and a wide variety of  useful and powerful tools. Best of all it&#8217;s free! Download it at <a title="Paint.Net" href="http://www.getpaint.net/">Paint.Net</a>.</p>
<div id="attachment_130" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.techstrut.com/wp-content/uploads/2009/09/paintnet.jpg"><img class="size-medium wp-image-130" title="Paint.Net" src="http://www.techstrut.com/wp-content/uploads/2009/09/paintnet-300x223.jpg" alt="A free image editing utility for windows." width="300" height="223" /></a><p class="wp-caption-text">A free image editing utility for windows.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/09/04/paint-net-free-windows-image-editing-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Excel 2007 Cheat Sheet</title>
		<link>http://www.techstrut.com/2009/08/19/microsoft-excel-2007-cheat-sheet/</link>
		<comments>http://www.techstrut.com/2009/08/19/microsoft-excel-2007-cheat-sheet/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 00:34:53 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Micorsoft Office Excel]]></category>
		<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[Microsoft Excel]]></category>
		<category><![CDATA[Microsoft Office]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=106</guid>
		<description><![CDATA[Lately I have been using Microsoft Excel on a daily basis. I have mostly been working with macros but occasionally I need to do repetitive tasks. Memorizing some of the keyboard shortcuts should save me some time.  I have compiled a cheat sheet for the keyboard shortcuts using Microsoft Office help. You can download it from Microosft Excel [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have been using Microsoft Excel on a daily basis. I have mostly been working with macros but occasionally I need to do repetitive tasks. Memorizing some of the keyboard shortcuts should save me some time.  I have compiled a cheat sheet for the keyboard shortcuts using Microsoft Office help. You can download it from <a href="http://www.techstrut.com/wp-content/uploads/2009/08/Microosft-Excel-2007-Cheat-Sheet.pdf">Microosft Excel 2007 Cheat Sheet</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/08/19/microsoft-excel-2007-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony 1.0 Maintenance Ending Soon</title>
		<link>http://www.techstrut.com/2009/08/14/symfony-1-0-maintenance-ending-soon/</link>
		<comments>http://www.techstrut.com/2009/08/14/symfony-1-0-maintenance-ending-soon/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 03:57:34 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=92</guid>
		<description><![CDATA[Just a reminder that Symfony 1.0 maintenance will end in January 2010. After this time there will be no more maintenance patches. If you are planning on migrating &#8212; Symfony 1.2 has already been released and Symfony 1.3 is scheduled to be released in November 2009. Both versions will require at least PHP version 5.2.4 [...]]]></description>
			<content:encoded><![CDATA[<p>Just a reminder that Symfony 1.0 maintenance will end in <strong>January 2010</strong>. After this time there will be no more maintenance patches. If you are planning on migrating &#8212; Symfony 1.2 has already been released and Symfony 1.3 is scheduled to be released in November 2009. Both versions will require at least PHP version 5.2.4 so this might also be a good time to upgrade PHP as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/08/14/symfony-1-0-maintenance-ending-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Symfony 1.2 Reference Book</title>
		<link>http://www.techstrut.com/2009/08/14/new-symfony-12-reference-book/</link>
		<comments>http://www.techstrut.com/2009/08/14/new-symfony-12-reference-book/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 03:38:27 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Book]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=83</guid>
		<description><![CDATA[There is a new Symfony 1.2 Reference Book which is available. The book is written by Symfony pioneer Fabien Potencier and was published in May 2009. The book provides a much needed reference for Symfony configuration files. It includes references for the Settings, Factories, Generator YML configuration files and many more. The book also provides a good reference for [...]]]></description>
			<content:encoded><![CDATA[<p>There is a new <a title="Symfony 1.2 Reference Book" href="http://www.symfony-project.org/reference/1_2/en/">Symfony 1.2 Reference Book</a> which is available. The book is written by Symfony pioneer Fabien Potencier and was published in May 2009. The book provides a much needed reference for Symfony configuration files. It includes references for the Settings, Factories, Generator YML configuration files and many more. The book also provides a good reference for Symfony events and tasks.</p>
<p><span id="more-83"></span></p>
<p>&#8220;The book is the fastest way to find every available configuration thanks to a very detailed table of contents, an index of terms, cross-references inside the chapters, tables, and much more.&#8221; As usual the book is available for free online from the <a title="Symfony Project" href="http://www.symfony-project.org/">Symfony</a> web site and is also available for purchase.</p>
<div id="attachment_84" class="wp-caption aligncenter" style="width: 250px"><img class="size-full wp-image-84 " title="e4a8c0a398a05fa91fe82210_L__SL500_AA240_" src="http://www.techstrut.com/wp-content/uploads/2009/08/e4a8c0a398a05fa91fe82210_L__SL500_AA240_.jpg" alt="The symfony Reference Guide (Paperback)" width="240" height="240" /><p class="wp-caption-text">The symfony Reference Guide by Fabien Potencier. Paperback, 200 pages, Published by Sensio SA (May 19, 2009).</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/08/14/new-symfony-12-reference-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Windows 7 Upgrade Chart</title>
		<link>http://www.techstrut.com/2009/08/14/windows-7-upgrade-chart/</link>
		<comments>http://www.techstrut.com/2009/08/14/windows-7-upgrade-chart/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 02:04:46 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=65</guid>
		<description><![CDATA[The chart below describes the upgrade path from previous version of Windows to the new Microsoft Windows 7.  Many people have complained that this chart is difficult to read. Some have called it absolutely ridiculous - since there is no upgrade path from Windows XP. I find the chart to be  an excellent reference for anyone looking to upgrade to [...]]]></description>
			<content:encoded><![CDATA[<p>The chart below describes the upgrade path from previous version of Windows to the new Microsoft Windows 7.  Many people have complained that this chart is difficult to read. Some have called it absolutely ridiculous - since there is no upgrade path from Windows XP. I find the chart to be  an excellent reference for anyone looking to upgrade to Windows 7.<span id="more-65"></span>Find the current version of Windows which you are using and read the chart from left to right. The original post can be found on <a title="Windows 7 Upgrade Chart" href="http://clubhouse.microsoft.com/Public/Post/c3d7d289-3ae2-43ea-b275-2c7773d0f9a2">Microsoft&#8217;s Website</a>.</p>
<p><img class="aligncenter size-full wp-image-68" title="windows7-upgrade-large" src="http://www.techstrut.com/wp-content/uploads/2009/08/windows7-upgrade-large1.bmp" alt="Windows 7 Upgrade Chart" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/08/14/windows-7-upgrade-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed up Symfony Queries using Result Sets</title>
		<link>http://www.techstrut.com/2009/08/06/speeding-up-symfony-queries-using/</link>
		<comments>http://www.techstrut.com/2009/08/06/speeding-up-symfony-queries-using/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 22:58:45 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=23</guid>
		<description><![CDATA[Hydration is the process used by the Symfony ORM to populate objects with the results of a database query. By making a call to the ::doSelect() method on a peer class Symfony automatically hydrates the resulting objects.  In Symfony 1.0 the hydration process was slow and it is much faster in Symfony 1.2. Still, in [...]]]></description>
			<content:encoded><![CDATA[<p><em>Hydration</em> is the process used by the Symfony ORM to populate objects with the results of a database query. By making a call to the ::doSelect() method on a peer class <a title="Symfony" href="http://www.symfony-project.org/" target="_blank">Symfony</a> automatically hydrates the resulting objects.  In Symfony 1.0 the hydration process was slow and it is much faster in Symfony 1.2. Still, in some cases you may want to bypass hydration. Consider a simple example. Suppose we want to get the title of some news articles.</p>
<p><span id="more-23"></span></p>
<p>Instead of using</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$c</span> = <span class="kw2">new</span> Criteria<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">add</span><span class="br0">&#40;</span>ArticlePeer::<span class="me2">SECTION_ID</span>, Article::<span class="me2">SPORTS</span><span class="br0">&#41;</span>;<br />
<span class="re0">$articles</span> = ArticlePeer::<span class="me2">doSelect</span><span class="br0">&#40;</span><span class="re0">$c</span><span class="br0">&#41;</span>;</p>
<p><span class="re0">$names</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$articles</span> <span class="kw1">as</span> <span class="re0">$article</span><span class="br0">&#41;</span><br />
&nbsp; <span class="re0">$names</span><span class="br0">&#91;</span><span class="re0">$article</span>-&gt;<span class="me1">getId</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#93;</span> = <span class="re0">$article</span>-&gt;<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
<p>Instead we could use</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">// Symfony 1.0</span><br />
<span class="re0">$c</span> = <span class="kw2">new</span> Criteria<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">clearSelectColumns</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">addSelectColumn</span><span class="br0">&#40;</span>ArticlePeer::<span class="me2">NAME</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">add</span><span class="br0">&#40;</span>ArticlePeer::<span class="me2">SECTION_ID</span>, Article::<span class="me2">SPORTS</span><span class="br0">&#41;</span>;<br />
<span class="re0">$rs</span> = ArticlePeer::<span class="me2">doSelectRS</span><span class="br0">&#40;</span><span class="re0">$c</span><span class="br0">&#41;</span>;</p>
<p><span class="re0">$names</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="kw1">while</span><span class="br0">&#40;</span><span class="re0">$rs</span>-&gt;<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; <span class="re0">$names</span><span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="re0">$rs</span>-&gt;<span class="me1">getString</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Symfony 1.2</span><br />
<span class="re0">$c</span> = <span class="kw2">new</span> Criteria<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">clearSelectColumns</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">addSelectColumn</span><span class="br0">&#40;</span>ArticlePeer::<span class="me2">NAME</span><span class="br0">&#41;</span>;<br />
<span class="re0">$c</span>-&gt;<span class="me1">add</span><span class="br0">&#40;</span>ArticlePeer::<span class="me2">SECTION_ID</span>, Article::<span class="me2">SPORTS</span><span class="br0">&#41;</span>;<br />
<span class="re0">$rs</span> = ArticlePeer::<span class="me2">doSelectStmt</span><span class="br0">&#40;</span><span class="re0">$c</span><span class="br0">&#41;</span>;</p>
<p><span class="re0">$names</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="kw1">while</span><span class="br0">&#40;</span><span class="re0">$res</span> = <span class="re0">$stmt</span>-&gt;<span class="me1">fetchColumn</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; <span class="re0">$names</span><span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="re0">$res</span>;</div>
<p>The second method is slightly more efficient because it only returns the required columns, conserving memory and does not hydrate the Article objects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/08/06/speeding-up-symfony-queries-using/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 JavaScript Performance Tips</title>
		<link>http://www.techstrut.com/2009/08/04/10-javascript-performance-tips/</link>
		<comments>http://www.techstrut.com/2009/08/04/10-javascript-performance-tips/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 02:04:39 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.techstrut.com/?p=3</guid>
		<description><![CDATA[If you develop web sites which are used by millions of users, JavaScript performance is critical. A JavaScript intensive web site that takes a long time to load can be annoying and frustrating . Here are ten simple strategies I typically use to improve JavaScript performance.

1. Keep it linear. 
It is important to avoid nested [...]]]></description>
			<content:encoded><![CDATA[<p>If you develop web sites which are used by millions of users, JavaScript performance is critical. A JavaScript intensive web site that takes a long time to load can be annoying and frustrating . Here are ten simple strategies I typically use to improve JavaScript performance.</p>
<p><span id="more-3"></span></p>
<p><strong>1. Keep it linear. </strong></p>
<p>It is important to avoid nested for/while loops. Remember JavaScript is an interpreted language and the browser has to work hard behind the scenes to process the code. If you do need to use nested loops ensure you are not iterating through thousands of objects. This may seem like common sense but you would be surprised how often this is done, especially when there&#8217;s a strict deadline.</p>
<p>Avoid using</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>; i &lt; n; i++<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> j=<span class="nu0">0</span>; j &lt; m; j++<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// some code here</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p><strong>2. Use object-oriented JavaScript. </strong></p>
<p>JavaScript is not a true object-oriented language. There are no classes or inheritance. However there are efficient ways to mimic such behavior. By using OOP design your code will be easier to follow, read, debug and modify. It will even be easier to reuse the code in other applications. See John Resig <a href="http://ejohn.org/blog/simple-javascript-inheritance/">Simple JavaScript Inheritance</a> or search for &#8220;JavaScript Inheritance&#8221;  for details.</p>
<p><strong>3. Cache objects</strong></p>
<p>Cache objects if you are using it multiple times. For example if you are using a global array in a loop JavaScript has to search for the variable outside of the function. Consider the code below which initializes an array of events. The <em>events</em> array has been declared elsewhere in the code.</p>
<p>For instance, instead of using</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">// Initalize some events</span><br />
initializeEvents: <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>, n = events.<span class="me1">length</span>; i &lt; n; i++ <span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; events<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">initialize</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span>,</div>
<p>Use this</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">// Initalize some events</span><br />
initializeEvents: <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="co1">// cache the events array</span><br />
&nbsp; <span class="kw2">var</span> _events = events;</p>
<p>&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>, n = _events.<span class="me1">length</span>; i &lt; n; i++ <span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; _events<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">initialize</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span>,</div>
<p><strong>4. Declare local variables with </strong><em><strong>var</strong></em></p>
<p>It is important to declare local variables with <strong>var</strong> in functions and loops. This helps JavaScript to find variables faster.</p>
<p>Instead of using</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">var</span> i = <span class="nu0">0</span>;</p>
<p><span class="co1">// &#8230; some code here</span></p>
<p><span class="kw2">var</span> myFunction : <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>i=<span class="nu0">0</span>; i &lt; n; i++<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="co1">// some code here</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>Use this</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>; i &lt; n; i++<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">// some code here</span><br />
<span class="br0">&#125;</span></div>
<p><strong>5. Combine  JavaScript files</strong></p>
<p>Combine all of your JavaScript files into a single file. This will reduce the number of requests the browser needs to make when loading your web page. It is good practice to create a script that will do this for you automatically when deploying your code. This way you can still keep your code organized in separate files for development purposes.</p>
<p><strong>6. Minify your code.</strong></p>
<p>Minifying your code removes unnecessary characters for your JavaScript code, such as line breaks, comments, whitespace, etc. The minified code will have a much smaller file size. This will reduce bandwidth and the file will take less time to download for users The JavaScript code should be minified before it is put on your production server. I typically use a script to minify development code but always keep both versions in the repository. Minifying JavaScript code is safe and should not break any existing code. See the <a title="Minify" href="http://code.google.com/p/minify/">Minify!</a> project for PHP on Google Code for more information.</p>
<p><strong>7. Enabled GZip on your server.</strong></p>
<p>GZip compresses the web content or rendered web page which is sent to the user. The includes both HTML and JavaScript content. The browser will automatically decompress the data and display the web page. GZIP is an easy feature to enable on most web servers and will help make your pages load faster. However the feature might not be enabled by default. After enabling GZip you will notice a considerable difference in performance.</p>
<p><strong>8. Move JavaScript to the bottom</strong></p>
<p>Place your JavaScript code near the bottom on your page when possible. This will make your web pages load faster. Often it is not possible to do this and code which is used within your page should still be loaded at the top.</p>
<p><strong>9. Use a Framework</strong></p>
<p>Instead of writing all of your JavaScript code from scratch use a framework such as <a title="jQuery" href="http://jquery.com">jQuery</a>. The jQuery framework is used by millions of web sites around the world.  It is an efficient and light-weight framework with many available plugins.</p>
<p><strong>10. Use Array Hashing</strong></p>
<p>Array hashes provide fast look up and storage for objects.</p>
<p>For instance say we have a collection of cars</p>
<div class="dean_ch" style="white-space: wrap;"><span class="co1">// We can store each car by using</span><br />
<span class="kw2">var</span> length = collection.<span class="me1">length</span>;<br />
collection<span class="br0">&#91;</span>collection.<span class="me1">length</span><span class="br0">&#93;</span> = car;<br />
cars<span class="br0">&#91;</span>car.<span class="me1">getId</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#93;</span> = length;<br />
<span class="co1">// Now say we want to find the car with Id five we would use</span><br />
<span class="kw2">var</span> myCar = collection<span class="br0">&#91;</span>cars<span class="br0">&#91;</span><span class="nu0">5</span><span class="br0">&#93;</span><span class="br0">&#93;</span>;</div>
<p>Array hashing can be extended to multi-dimensional arrays as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techstrut.com/2009/08/04/10-javascript-performance-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
