<?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>project-2501.net &#187; javascript</title>
	<atom:link href="http://project-2501.net/index.php/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://project-2501.net</link>
	<description>The net is vast and infinite.</description>
	<lastBuildDate>Tue, 08 Nov 2011 10:38:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Code Smell</title>
		<link>http://project-2501.net/index.php/2011/07/code-smell/</link>
		<comments>http://project-2501.net/index.php/2011/07/code-smell/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 03:26:06 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=319</guid>
		<description><![CDATA[&#8220;In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem.&#8221; &#8212; Wikipedia I found this piece of code this morning, I think it counts as something gone terribly, terribly wrong: return displayItemDetails(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, 14059111); (The code was in-line JavaScript, inserted into a onclick handler, generated [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem.&#8221; &#8212; <a href="http://en.wikipedia.org/wiki/Code_smell">Wikipedia</a></p></blockquote>
<p>I found this piece of code this morning, I think it counts as something gone terribly, terribly wrong:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">return displayItemDetails(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode, 14059111);</div></div>
<p><em>(The code was in-line JavaScript, inserted into a onclick handler, generated in PHP)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2011/07/code-smell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>javascript; sending me insane</title>
		<link>http://project-2501.net/index.php/2010/01/javascript-sending-me-insane/</link>
		<comments>http://project-2501.net/index.php/2010/01/javascript-sending-me-insane/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 03:55:38 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=228</guid>
		<description><![CDATA[&#62;&#62;&#62; &#91;&#93; &#91;&#93; &#62;&#62;&#62; &#91;&#93; == true false &#62;&#62;&#62; &#91;&#93; == false true &#62;&#62;&#62; &#91;&#93; == &#91;&#93; false &#62;&#62;&#62; false == false true]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&gt;&gt;&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><br />
<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><br />
<span style="color: #339933;">&gt;&gt;&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">true</span><br />
<span style="color: #003366; font-weight: bold;">false</span><br />
<span style="color: #339933;">&gt;&gt;&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span><br />
<span style="color: #003366; font-weight: bold;">true</span><br />
<span style="color: #339933;">&gt;&gt;&gt;</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><br />
<span style="color: #003366; font-weight: bold;">false</span><br />
<span style="color: #339933;">&gt;&gt;&gt;</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span><br />
<span style="color: #003366; font-weight: bold;">true</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2010/01/javascript-sending-me-insane/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>array_unique javascript snippet</title>
		<link>http://project-2501.net/index.php/2009/02/array_unique-javascript-snippet/</link>
		<comments>http://project-2501.net/index.php/2009/02/array_unique-javascript-snippet/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 06:07:34 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=139</guid>
		<description><![CDATA[function array_unique&#40;a&#41; &#123; &#160; &#160; return a.reduce&#40;function&#40;u, e&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; if&#40;!&#40;e in u&#41;&#41; &#160; &#160; &#160; &#160; &#160; &#160; u.push&#40;e&#41;; &#160; &#160; &#160; &#160; return u; &#160; &#160; &#125;, &#91;&#93;&#41;; &#125;]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> array_unique<span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> a.<span style="color: #660066;">reduce</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>u<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>e <span style="color: #000066; font-weight: bold;">in</span> u<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; u.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> u<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2009/02/array_unique-javascript-snippet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript map-sort</title>
		<link>http://project-2501.net/index.php/2009/01/javascript-map-sort/</link>
		<comments>http://project-2501.net/index.php/2009/01/javascript-map-sort/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 08:30:05 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=92</guid>
		<description><![CDATA[I&#8217;m sure sorting method has a real name, but I&#8217;ve had no luck searching for it. function mapSort&#40;array, mapFunction, sortFunction&#41; &#123; &#160; &#160; // Store both original value, and transformed value &#160; &#160; var mapData = array.map&#40;function&#40;e&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; return &#91;e, mapFunction&#40;e&#41;&#93;; &#160; &#160; &#125;&#41;; &#160; &#160; &#160; &#160; // [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure sorting method has a real name, but I&#8217;ve had no luck searching for it.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> mapSort<span style="color: #009900;">&#40;</span>array<span style="color: #339933;">,</span> mapFunction<span style="color: #339933;">,</span> sortFunction<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Store both original value, and transformed value</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> mapData <span style="color: #339933;">=</span> array.<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span>e<span style="color: #339933;">,</span> mapFunction<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Sort the data using the second element of each array item (the mapped one)</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> sortedData <span style="color: #339933;">=</span> mapData.<span style="color: #660066;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> sortFunction<span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> b<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Remove the extra transformed value from the sorted array</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> sortedData.<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> e<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Example</span><br />
<br />
<span style="color: #003366; font-weight: bold;">var</span> data <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;b&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;A&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;B&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;C&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;c&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> cmp &nbsp;<span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span> b<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> a <span style="color: #339933;">&gt;</span> b<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> map &nbsp;<span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ch<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> ch.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp;<br />
<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Normal: &nbsp; &quot;</span> <span style="color: #339933;">+</span> data.<span style="color: #660066;">sort</span><span style="color: #009900;">&#40;</span>cmp<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Map Sort: &quot;</span> <span style="color: #339933;">+</span> mapSort<span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> map<span style="color: #339933;">,</span> cmp<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Normal: &nbsp; A,B,C,a,b,c</span><br />
<span style="color: #006600; font-style: italic;">// Map Sort: a,A,B,b,c,C</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2009/01/javascript-map-sort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript&#8230;</title>
		<link>http://project-2501.net/index.php/2008/03/javascript/</link>
		<comments>http://project-2501.net/index.php/2008/03/javascript/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 13:40:13 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=75</guid>
		<description><![CDATA[Javascript is both infuriating and awesome at the same time. I don&#8217;t think I&#8217;ve ever speant so much time tracking down annoying bugs (even compared to PHP), yet at the same time it makes functions like the one below very simple to write. For reference, the below code returns a `getter` method that we use [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript is both infuriating and awesome at the same time.  I don&#8217;t think I&#8217;ve ever speant so much time tracking down annoying bugs (even compared to PHP), yet at the same time it makes functions like the one below very simple to write.</p>
<p>For reference, the below code returns a `getter` method that we use to instantiate objects via a cache system.</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> buildSimpleObjectGetter <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>cacheRef<span style="color: #339933;">,</span> objectRef<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> f <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;buildSimpleObjectGetter()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;UTILS.<span style="color: #660066;">checkArgs</span><span style="color: #009900;">&#40;</span>f<span style="color: #339933;">,</span> arguments<span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span>ObjectCache<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">Function</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>idRecord<span style="color: #339933;">,</span> idArg<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> cacheRef.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span> <span style="color: #339933;">+</span> idArg<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">new</span> objectRef<span style="color: #009900;">&#40;</span>idRecord<span style="color: #339933;">,</span> idArg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p></p>
<p>Update 20080327:</p>
<p>On the topic of stupid Javascript bugs, who thought auto terminating lines was a good default!</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> getWords<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'Hello'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'World!'</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
console.<span style="color: #660066;">info</span><span style="color: #009900;">&#40;</span>getWords<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// Ouput</span><br />
<span style="color: #006600; font-style: italic;">// &gt;&gt;&gt; undefined</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2008/03/javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very simple captcha decoding using the Canvas tag</title>
		<link>http://project-2501.net/index.php/2007/02/very-simple-captcha-decoding-using-the-canvas-tag/</link>
		<comments>http://project-2501.net/index.php/2007/02/very-simple-captcha-decoding-using-the-canvas-tag/#comments</comments>
		<pubDate>Sun, 11 Feb 2007 09:28:15 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=4</guid>
		<description><![CDATA[Ever since learning about the canvas tag, I&#8217;ve been wanting to try this&#8230;. Yes, the captcha I used is amazingly simple to break, but, I doubt I&#39;m smart enough to tackle anything more complicated. Though I feel it still serves a good proof of concept (espcially when combined with Greasemonkey) Canvas Captcha Results.png (57 KB)]]></description>
			<content:encoded><![CDATA[<p>Ever since learning about the <a href='http://en.wikipedia.org/wiki/Canvas_tag' target='_blank'>canvas tag</a>, I&#8217;ve been wanting to try this&#8230;. Yes, the captcha I used is amazingly simple to break, but, I doubt I&#39;m smart enough to tackle anything more complicated.  Though I  feel it still serves a good proof of concept (espcially when combined with <a href='http://greasemonkey.mozdev.org/' target='_blank'>Greasemonkey</a>)</p>
<p><a href='http://project-2501.net/gallery/development/canvas%20captcha%20results.png'><br />
<img src="http://project-2501.net/gallery/.thumbs/gallery_development_canvas_captcha_results.png.jpeg" alt="canvas captcha results.png" /><br />
Canvas Captcha Results.png</a> (57 KB)</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2007/02/very-simple-captcha-decoding-using-the-canvas-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Digg: Javascript overload?</title>
		<link>http://project-2501.net/index.php/2006/01/digg-javascript-overload/</link>
		<comments>http://project-2501.net/index.php/2006/01/digg-javascript-overload/#comments</comments>
		<pubDate>Sat, 28 Jan 2006 10:38:25 +0000</pubDate>
		<dc:creator>Matthew</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://project-2501.net/?p=6</guid>
		<description><![CDATA[The Digg front page (28KB) requires 2 (3?) CSS files and 17 Javascript files to be downloaded before it can be displayed. This shouldn&#8217;t be a problem as the files should be cached on the first visit. But I wouldn&#8217;t be here writing this if that was the case. It appears that max-age is set [...]]]></description>
			<content:encoded><![CDATA[<p>The Digg front page (28KB) requires 2 (3?) CSS files and 17 Javascript files to be downloaded before it can be displayed. This shouldn&#8217;t be a problem as the files should be cached on the first visit.  But I wouldn&#8217;t be here writing this if that was the case.  It appears that max-age is set to 60 minutes on almost everything, even the images.</p>
<p>I used the Live HTTP Headers extension for Firefox to examine all the HTTP responses sent when doing a full refresh, to see just how much data was being transfered.</p>
<p>File sizes are the actual number of bytes sent by the server (minus HTTP protocol overhead).  Most files have been compressed using gzip.</p>
<p></p>
<p><b>Front page:</b> 6,928 bytes in 1 file</p>
<ul>
<li>http://digg.com/ (6928)</li>
</ul>
<p></p>
<p><b>CSS:</b> 9,550 bytes in 3 files</p>
<ul>
<li>http://digg.com/css/digg2.css (8221)</li>
<li>http://digg.com/css/digg2-compact.css (656)</li>
<li>http://digg.com/css/toolbar.css (673)</li>
</ul>
<p></p>
<p><b>Javascript:</b> 238,830 bytes in 17 files</p>
<ul>
<li>http://digg.com/js/spellChecker.js (13061)</li>
<li>http://digg.com/js/utils.js (2074)</li>
<li>http://digg.com/js/xmlhttp.js (12429)</li>
<li>http://digg.com/js/wz_dragdrop.js (37711)</li>
<li>http://digg.com/js/hover.js (2511)</li>
<li>http://digg.com/js/label.js (6518)</li>
<li>http://digg.com/js/switcher.js (1362)</li>
<li>http://digg.com/js/prototype.js (47932)</li>
<li>http://digg.com/js/scriptaculous.js (2152)</li>
<li>http://digg.com/js/builder.js (3361)</li>
<li>http://digg.com/js/effects.js (32808)</li>
<li>http://digg.com/js/dragdrop.js (18776)</li>
<li>http://digg.com/js/controls.js (26195)</li>
<li>http://digg.com/js/slider.js (10752)</li>
<li>http://digg.com/js/aboutdigg.js (215)</li>
<li>http://www.google-analytics.com/urchin.js (5104)</li>
<li>http://digg.com/js/tooltip.js (15869)</li>
</ul>
<p></p>
<p><b>Images:</b> 32,030 bytes in 25 files</p>
<ul>
<li>Not interesting <img src='http://project-2501.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p></p>
<p><b>Time Comparison</b></p>
<ul>
<li>Minimum data to download (HTML + CSS + JS): <b>255,308 bytes</b></li>
<li>Everything (HTML + CSS + JS + Images): <b>287,338 bytes</b></li>
<li>Speed in bytes = (speed in bits / <img src='http://project-2501.net/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> * 0.85 (overhead)</li>
<li>This doesn&#8217;t take in consideration latency or HTTP overhead</li>
</ul>
<p></p>
<p><b>Minimum (no images)</b></p>
<ul>
<li>56k: <b>46.2</b> seconds</li>
<li>256: <b>9.4</b> seconds</li>
<li>512: <b>4.7</b> seconds</li>
<li>1500: <b>1.6</b> seconds</li>
</ul>
<p></p>
<p><b>Everything</b></p>
<ul>
<li>56k: <b>52.0</b> seconds</li>
<li>256: <b>10.6</b> seconds</li>
<li>512: <b>5.3</b> seconds</li>
<li>1500: <b>1.8</b> seconds</li>
</ul>
<p>Is this really acceptable for a website?  Or more importantly, a simple front page?</p>
<p>Just how many features are being used on the front page?</p>
<p>Why should (almost) everything expire in 60 minutes?</p>
]]></content:encoded>
			<wfw:commentRss>http://project-2501.net/index.php/2006/01/digg-javascript-overload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (Requested URI is rejected)
Database Caching 1/39 queries in 0.019 seconds using disk
Object Caching 729/812 objects using disk

Served from: project-2501.net @ 2012-02-07 20:59:14 -->
