<?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>Aaron As a Chimp</title>
	<atom:link href="http://sachimp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sachimp.com</link>
	<description>with a typewriter</description>
	<lastBuildDate>Thu, 15 Jul 2010 00:01:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Adding feed to digg</title>
		<link>http://sachimp.com/2010/07/14/adding-feed-to-digg/</link>
		<comments>http://sachimp.com/2010/07/14/adding-feed-to-digg/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 00:01:37 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=228</guid>
		<description><![CDATA[9d3405a5e1ea4dd08e00744a577ec50c Subscribe to the comments for this post? Share this on del.icio.us Digg this! Post on Google Buzz Stumble upon something good? Share it on StumbleUpon Tweet This! Share this on Technorati]]></description>
			<content:encoded><![CDATA[<p>9d3405a5e1ea4dd08e00744a577ec50c</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2010/07/14/adding-feed-to-digg/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2010/07/14/adding-feed-to-digg/&amp;title=Adding+feed+to+digg" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2010/07/14/adding-feed-to-digg/&amp;title=Adding+feed+to+digg" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2010/07/14/adding-feed-to-digg/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2010/07/14/adding-feed-to-digg/&amp;title=Adding+feed+to+digg" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Adding+feed+to+digg+-+http://b2l.me/aarbu3&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2010/07/14/adding-feed-to-digg/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/07/14/adding-feed-to-digg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why width: 100% doesn&#8217;t do what you think it does</title>
		<link>http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/</link>
		<comments>http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 00:24:16 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Quickies]]></category>
		<category><![CDATA[box-model]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/</guid>
		<description><![CDATA[Something I run across every so often when fixing bugs is a problem of content overflowing its parent element. The child has padding, margins, or a border, and a width set to 100%. This seems like it should fill the available space, but it protrudes out instead. The weird behavior comes from the standard box [...]]]></description>
			<content:encoded><![CDATA[<p>Something I run across every so often when fixing bugs is a problem of content overflowing its parent element. The child has padding, margins, or a border, and a width set to 100%. This seems like it should fill the available space, but it protrudes out instead.</p>
<p>The weird behavior comes from the standard box model. According to the standard box model, when you set the width, it sets the width of the content area. The padding, border, and margin get wrapped around it. Meaning that the box, which is already the full width of it&#8217;s parent, gets pushed out beyond the edge.</p>
<p>The fix is painfully simple. Simply set width of the chid element to auto, or remove it entirely. Block level elements automatically fill the available space, and that calculation takes into account the borders, margin, and padding.  </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/&amp;title=Why+width%3A+100%25+doesn%27t+do+what+you+think+it+does" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/&amp;title=Why+width%3A+100%25+doesn%27t+do+what+you+think+it+does" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/&amp;title=Why+width%3A+100%25+doesn%27t+do+what+you+think+it+does" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Why+width%3A+100%25+doesn%27t+do+what+you+think+it+does+-+http://b2l.me/3jhmp&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/06/13/why-width-100-doesnt-do-what-you-think-it-does/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What&#8217;s a &nbsp;?</title>
		<link>http://sachimp.com/2010/05/30/nbsp-quickie/</link>
		<comments>http://sachimp.com/2010/05/30/nbsp-quickie/#comments</comments>
		<pubDate>Sun, 30 May 2010 13:06:24 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Quickies]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=208</guid>
		<description><![CDATA[The non-breaking space (&#38;nbsp;) is the workhorse of the web. It can be used in so many contexts from its use as a poor-mans indent or even to workaround bugs in IE6 and Firefox. Not many people know the true value of a non-breaking space. As its name implies, its primary purpose to prevent line [...]]]></description>
			<content:encoded><![CDATA[<p>The non-breaking space (&amp;nbsp;) is the workhorse of the web. It can be used in so many contexts from its use as a poor-mans indent or even to workaround bugs in IE6 and Firefox.</p>
<p>Not many people know the true value of a non-breaking space. As its name implies, its primary purpose to prevent line breaks. Essentially the opposite of a break tag.</p>
<h2>A few examples</h2>
<h3>Prevent widows:</h3>
<p>By replacing the last space in a paragraph you can prevent a widowed word.

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">In aliquet leo aliquet enim tincidunt non tristique tortor
feugiat. Donec gravida egestas risus quis eleifend. Donec
adipiscing dolor nec augue dignissim<span style="color: #ddbb00;">&amp;nbsp;</span>pharetra.</pre></div></div>

<h3>Ensure words always appear together</h3>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">In aliquet leo aliquet enim tincidunt non tristique tortor
feugiat. ACME<span style="color: #ddbb00;">&amp;nbsp;</span>Widget<span style="color: #ddbb00;">&amp;nbsp;</span>XL donec gravida egestas
risus quis eleifend. Donec adipiscing dolor nec augue
dignissim pharetra.</pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2010/05/30/nbsp-quickie/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2010/05/30/nbsp-quickie/&amp;title=What%27s+a+%26amp%3Bnbsp%3B%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2010/05/30/nbsp-quickie/&amp;title=What%27s+a+%26amp%3Bnbsp%3B%3F" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2010/05/30/nbsp-quickie/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2010/05/30/nbsp-quickie/&amp;title=What%27s+a+%26amp%3Bnbsp%3B%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=What%27s+a+%26amp%3Bnbsp%3B%3F+-+http://b2l.me/xxmwu&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2010/05/30/nbsp-quickie/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/05/30/nbsp-quickie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stacking the Deck</title>
		<link>http://sachimp.com/2010/05/23/stacking-the-deck-2/</link>
		<comments>http://sachimp.com/2010/05/23/stacking-the-deck-2/#comments</comments>
		<pubDate>Sun, 23 May 2010 23:38:47 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[heierarchy]]></category>
		<category><![CDATA[stylesheets]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=199</guid>
		<description><![CDATA[Managing styles can be frustrating. Most people just stuff everything into one stylesheet. This works for smaller sites really well, but it doesn&#8217;t scale to larger sites. The stylesheet gets so large that it&#8217;s difficult to know what is going to override what. You end up relying in tools like Firebug to find out how [...]]]></description>
			<content:encoded><![CDATA[<p>Managing styles can be frustrating. Most people just stuff everything into one stylesheet. This works for smaller sites really well, but it doesn&#8217;t scale to larger sites. The stylesheet gets so large that it&#8217;s difficult to know what is going to override what. You end up relying in tools like Firebug to find out how adding a new style is going to affect the site.</p>
<h3>She&#8217;s a brick house</h3>
<p>You can&#8217;t really get rid of that global stylesheet because defining styles that apply to the whole site incredibly useful. You don&#8217;t want have the same styles duplicated across multiple stylesheets. That causes bloat. It makes updating the styles difficult too, but it would be great to have page level granularity. So when the creative department comes down on you like a ton of bricks, you can change the blue to gold in a flash. (actually it was more of a amber-canary with a splash of wheat).</p>
<p>The trick is to do both. Start with a global stylesheet and define the most commonly used styles. Use good defaults: define all your font families and sizes; create classes for all of your sprites; and create all of the utility classes for floating and clearing elements. This will be the foundation for all of your future work.</p>
<p>Then create a set mid-level of stylesheets. You would include this one immediately after your global sheet.  One for each section of your site. These stylesheets will be your work horses. This is where you setup your layout fundamentals for section.</p>
<h3>And finally</h3>
<p>On the pages that need it. Create page specific stylesheets. Included after your section stylesheet. So, now, when the client says that they actually liked the blue better. It&#8217;s now a 5 second change. </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2010/05/23/stacking-the-deck-2/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2010/05/23/stacking-the-deck-2/&amp;title=Stacking+the+Deck" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2010/05/23/stacking-the-deck-2/&amp;title=Stacking+the+Deck" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2010/05/23/stacking-the-deck-2/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2010/05/23/stacking-the-deck-2/&amp;title=Stacking+the+Deck" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Stacking+the+Deck+-+http://b2l.me/xxmw8&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2010/05/23/stacking-the-deck-2/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/05/23/stacking-the-deck-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why plain, vanilla, anchors are a bad idea.</title>
		<link>http://sachimp.com/2010/03/29/bad-anchors/</link>
		<comments>http://sachimp.com/2010/03/29/bad-anchors/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:32:17 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Sachimp Labs]]></category>
		<category><![CDATA[anchors]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=153</guid>
		<description><![CDATA[A few days ago I was testing a soon to be released site. I followed a link I had never seen before and suddenly found my self confused and disoriented. In retrospect it could&#8217;ve been the fact I had just ran into a glass door on my way in (I totally didn&#8217;t see it there). [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I was testing a soon to be released site. I followed a link I had never seen before and suddenly found my self confused and disoriented.  In retrospect it could&#8217;ve been the fact I had just ran into a glass door on my way in (I totally didn&#8217;t see it there).</p>
<p>But, never the less, it lead me to tweet this:</p>
<p><a class="tweet" href="http://twitter.com/AaronAsAChimp/status/11090674594">GUIDELINE: Users should never &#8220;teleport&#8221; between areas of the page. This can be disorienting. Show the movement from one place to the other.</a></p>
<h3>Ice, Ice, Baby</h3>
<p>The reason why I suggested that is not because of the severe &#8220;bling&#8221; deficiency on the internet. Which, I might add, is getting worse by the day. Its, also, definitely not because I just got laid off and really need a job (see <a href="http://hire.sachimp.com/resume.html">my resume</a>). Its because its just plain <strong>bad UI design</strong>.</p>
<p>Now, don&#8217;t get me wrong. There are a lot of reasons you want link to a specific part of a document, but the way browsers implement this functionality is bad. Fortunately this is an easy fix if you use the <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html">scrollTo jQuery plugin</a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a[href^='#']&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> element <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hash</span><span style="color: #339933;">;</span>
		e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$.<span style="color: #660066;">scrollTo</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
			offset<span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">50</span><span style="color: #339933;">,</span>
			onAfter<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> <span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;background&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2010/03/29/bad-anchors/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2010/03/29/bad-anchors/&amp;title=Why+plain%2C+vanilla%2C+anchors+are+a+bad+idea." rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2010/03/29/bad-anchors/&amp;title=Why+plain%2C+vanilla%2C+anchors+are+a+bad+idea." rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2010/03/29/bad-anchors/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2010/03/29/bad-anchors/&amp;title=Why+plain%2C+vanilla%2C+anchors+are+a+bad+idea." rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Why+plain%2C+vanilla%2C+anchors+are+a+bad+idea.+-+http://b2l.me/mmcfz&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2010/03/29/bad-anchors/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/03/29/bad-anchors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scientific Notation &#8211; Quick JS Snippy</title>
		<link>http://sachimp.com/2010/01/16/scientific-notation-2/</link>
		<comments>http://sachimp.com/2010/01/16/scientific-notation-2/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 21:19:36 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Quickies]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=143</guid>
		<description><![CDATA[Number.prototype.toScientific = function &#40;x&#41; &#123; &#160; var parts = this.toExponential&#40;x&#41;.split&#40; /[e]\+?/i ,2&#41;; &#160; return parts&#91;0&#93; + &#40;&#40;parts&#91;1&#93; != 0 &#38;&#38; parts &#91;1&#93; != 1&#41;? &#34; &#38;times; 10&#60;sup&#62;&#34; + parts&#91;1&#93; + &#34;&#60;/sup&#62;&#34;: &#34;&#34;&#41;; &#125; Subscribe to the comments for this post? Share this on del.icio.us Digg this! Post on Google Buzz Stumble upon something good? Share [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Number.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">toScientific</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> parts <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">toExponential</span><span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/[e]\+?/i</span> <span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span> parts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>parts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">&amp;&amp;</span> parts <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot; &amp;times; 10&lt;sup&gt;&quot;</span> <span style="color: #339933;">+</span> parts<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/sup&gt;&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2010/01/16/scientific-notation-2/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2010/01/16/scientific-notation-2/&amp;title=Scientific+Notation+-+Quick+JS+Snippy" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2010/01/16/scientific-notation-2/&amp;title=Scientific+Notation+-+Quick+JS+Snippy" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2010/01/16/scientific-notation-2/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2010/01/16/scientific-notation-2/&amp;title=Scientific+Notation+-+Quick+JS+Snippy" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Scientific+Notation+-+Quick+JS+Snippy+-+http://b2l.me/dwdbu&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2010/01/16/scientific-notation-2/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2010/01/16/scientific-notation-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barbeque: A brainstorm on better Data interfaces</title>
		<link>http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/</link>
		<comments>http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 00:46:38 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[bbQuery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=89</guid>
		<description><![CDATA[So, with the release of PHP 5.3 some of the new features got me thinking about better ways to query and interact with data. I&#8217;m tentatively calling it bbQuery, or bbQ for short. Data Driven Apps Web applications are typically driven by data and interactions between it. A typical situation involves: Querying data from the [...]]]></description>
			<content:encoded><![CDATA[<p>So, with the release of <a href="http://www.php.net/archive/2009.php#id2009-06-30-1">PHP 5.3</a> some of the new features got me thinking about better ways to query and interact with data.  I&#8217;m tentatively calling it <strong>bbQuery</strong>, or <strong>bbQ</strong> for short.</p>
<h3>Data Driven Apps</h3>
<p>Web applications are typically driven by<strong> data </strong>and interactions<strong> between it</strong>.  A typical situation involves: Querying data from the database, formatting as HTML, outputting.  A few years ago it was just that simple.  <strong>Today</strong> you have JSON, RSS, and other various formats.</p>
<p>Going by the standard model, you have to create <strong>each</strong> page <strong>separately</strong> for all of the various formats, duplicating code.  I can&#8217;t say I solved this problem entirely, but I&#8217;m getting close.</p>
<h3>Grab the Steaks, It&#8217;s Time for a bbQ</h3>
<p>The goal is to be <strong>functionally similar</strong> to SQL but include a formatting layer that <strong>intelligently</strong> determines the way to display the data.  The following snippet show how the old model can be transitioned to bbQ.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Children'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'children_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dob'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fitness'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'status'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">${row['dob']}</span> - <span style="color: #006699; font-weight: bold;">${row['fitness']}</span> - <span style="color: #006699; font-weight: bold;">${row['status']}</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A simple example using the <a href="http://github.com/AaronAsAChimp/gfonted/blob/692129f6bb5bad40e302b98010358a95c08d32a2/db.sql">gFonted database</a>.  The first line selects the table from the database.  On the second we select the columns we want in the query.  The query results are then returned in to a callback from the format function.  Very quickly you could create predefined formatting functions.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Children'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">left_join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Template'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'children_id'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span><span style="color: #009900;">&#40;</span>bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">format_table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// predefined format functions</span></pre></div></div>

<p>But thats far from automatic, intelligent maybe.  Its impossible to guess what format anyone will need.  There are a few generic formats (JSON and XML) that could be dealt with automatically.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Children'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">left_join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Template'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'children_id'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">order_by</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fitness'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">asc</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// bbQuery::asc == &quot;asc&quot;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_type</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;application/json&quot;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Children'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">left_join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Template'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'children_id'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// is a variable that gets overwritten</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">order_by</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fitness'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">desc</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// order by's are string</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">order_by</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dob'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">asc</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// and gets appended to</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_type</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;application/xml&quot;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Going the Other Direction</h3>
<p>Sometimes its useful to put data into a database.  I guess thats an understatement.  Its also an understatement to say that doing so is a simple task.  An example of standard data insertion:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Correct'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">insert_into</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'children_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'correct'</span><span style="color: #009900;">&#41;</span>  <span style="color: #666666; font-style: italic;">// returns an insert object</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">values</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>However this could be greatly simplified.  MySQL already knows the datatype for the column, so validation could be automated.  The data could even be automatically inserted from a form.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;form&gt;
   &lt;input name=&quot;children_id&quot; type=&quot;text&quot; value=&quot;12&quot; /&gt;
   &lt;input name=&quot;correct&quot; type=&quot;checkbox&quot; /&gt;
&lt;/form&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000088;">$DB</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Children'</span><span style="color: #009900;">&#93;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">insert_into</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'children_id'</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">'correct'</span><span style="color: #009900;">&#41;</span>  <span style="color: #666666; font-style: italic;">// returns an insert object</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">from_form</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And finally some other useful snippets:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$DB</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;select * from Children&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">format</span><span style="color: #009900;">&#40;</span>bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">format_table</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">create_table</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// returns a create_table object</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">column</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_id'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">id_column</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// id is special if set as a primary key, unsigned integer autoincrement</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">column</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_foreign_id'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">id_column</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// just a unsigned integer</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">column</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_char'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">char_column</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// field length as parameter</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">column</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_int'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">integer_column</span><span style="color: #009900;">&#40;</span>bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">big</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// default as third parameter to column</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">column</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_enum'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">enum_column</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'val'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'val3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'val2'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// enum is varidaic</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">primary_key</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_id'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">foreign_key</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_foreign_id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Correct'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$DB</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">alter_table</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">// returns a alter_table object</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_timestamp'</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">timestamp_column</span><span style="color: #339933;">,</span> bbQuery<span style="color: #339933;">::</span><span style="color: #004000;">now</span><span style="color: #009900;">&#41;</span>
   <span style="color: #339933;">-&gt;</span><span style="color: #004000;">drop</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test_int'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$DB</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;truncate table test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// format is not appropriate here</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/&amp;title=Barbeque%3A+A+brainstorm+on+better+Data+interfaces" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/&amp;title=Barbeque%3A+A+brainstorm+on+better+Data+interfaces" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/&amp;title=Barbeque%3A+A+brainstorm+on+better+Data+interfaces" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Barbeque%3A+A+brainstorm+on+better+Data+interfaces+-+http://b2l.me/act9r&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2009/07/06/barbeque-a-brainstorm-on-better-data-interfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cosmic Sans source available at GitHub</title>
		<link>http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/</link>
		<comments>http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 19:22:07 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Original Fonts]]></category>
		<category><![CDATA["Google Docs"]]></category>
		<category><![CDATA[cosmic sans]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[GitHub]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=69</guid>
		<description><![CDATA[Cosmic Sans, a font showing the planets to scale, is now available at GitHub. If you are an artist, astronimer, or a space enthusiast you can help contribute.  A list of desired space objects are at Google Docs.  If your interested leave a comment, or just fork the get repository and send me a Pull [...]]]></description>
			<content:encoded><![CDATA[<p>Cosmic Sans, a font showing the planets to scale, is now available at <a href="http://github.com/AaronAsAChimp/cosmic-sans/tree/master">GitHub</a>.</p>
<p>If you are an artist, astronimer, or a space enthusiast you can help contribute.  A list of desired space objects are at <a href="http://spreadsheets.google.com/pub?key=r9XiKwkHRn0jsGAae5q5aKA&amp;output=html">Google Docs</a>.  If your interested leave a comment, or just fork the get repository and send me a <a href="http://github.com/guides/pull-requests">Pull Request</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/&amp;title=Cosmic+Sans+source+available+at+GitHub" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/&amp;title=Cosmic+Sans+source+available+at+GitHub" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/&amp;title=Cosmic+Sans+source+available+at+GitHub" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Cosmic+Sans+source+available+at+GitHub+-+http://b2l.me/acup2&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2009/06/05/cosmic-sans-source-available-at-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dr. JavaScript and Mr. PHP</title>
		<link>http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/</link>
		<comments>http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 00:27:40 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Sachimp Labs]]></category>
		<category><![CDATA[Billy Hoffman]]></category>
		<category><![CDATA[Hak .5]]></category>
		<category><![CDATA[hybrid code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=35</guid>
		<description><![CDATA[In my last post I wrote about JavaScript variables.  It stemmed from realizing that the dollar sign ($) was a valid character in JavaScript.  I struggled to find any use for all of these new characters – other than making code unreadable.  One thing stuck out in my mind.  An old episode of Hak .5 where [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a title="The many lives of JavaScript variables" href="/2008/12/13/javascript-variables/">last post</a> I wrote about JavaScript variables.  It stemmed from realizing that the dollar sign ($) was a valid character in JavaScript.  I struggled to find any use for all of these new characters – other than making code unreadable.  One thing stuck out in my mind.  An <a href="http://www.hak5.org/episodes/episode-2x09-release">old episode of Hak .5</a> where Billy Hoffman described a <a href="http://en.wikipedia.org/wiki/Computer_worm">worm</a> that would be written in a hybrid of Perl and JavaScript.  A <em>Dr. Jekyll and Mr. Hyde</em> scenario where the worm would embed itself in a web page and search for a &#8220;host&#8221;, and then infect that host.  That host would then serve pages with the worm embedded in it, creating exponential growth.  Unfortunately at the time he didn&#8217;t have a proof of concept.</p>
<h3>Hybrid Means Better Gas Mileage</h3>
<p>Unlike Billy&#8217;s technique I chose to use PHP instead of Perl.  Many of the language constructs are identical between PHP and JavaScript.  However there are few snags.</p>
<ul>
<li>PHP scripts have to start and end with &#8216;&lt;?&#8217; and &#8216;?&gt;&#8217; respectively.</li>
<li>PHP variables must start with a &#8216;$&#8217;.</li>
<li>Most of JavaScript&#8217;s standard functions are wrapped in objects.  Math, String, etc.</li>
<li>PHP uses the &#8216;.&#8217; for concatenation, while JavaScript uses &#8216;+&#8217;.</li>
<li>PHP uses C++ style definition for objects, while JavaScript uses a prototype definition.</li>
<li>JavaScript uses the C++ style const keyword to define constants, while PHP uses the define() function.</li>
</ul>
<h3>The Lucky Ones</h3>
<p>Not all of these problems can be worked around, but enough of them can be worked around that functioning code can be written.</p>
<dl>
<dt>PHP scripts have to start and end with &#8216;&lt;?&#8217; and &#8216;?&gt;&#8217; respectively.</dt>
<dd>The workaround for this is to run the script using the eval() function.  The PHP&#8217;s eval() function doesn&#8217;t require the opening and closing tags as feature.</dd>
<dt>PHP variables must start with a &#8216;$&#8217;.</dt>
<dd>The dollar sign is a valid character in JavaScript variables, so starting them with the dollar sign poses no problem.</dd>
<dt>Most of JavaScript&#8217;s standard functions are wrapped in objects.  Math, String, etc.</dt>
<dd><a title="PHP.js" href="http://phpjs.org/">PHP.js</a> can be used to wrap the standard JavaScript functions.  Acting as a compatibility layer.</dd>
<dt>JavaScript uses the C++ style const keyword to define constants, while PHP uses the define() function.</dt>
<dd>PHP version 5.3.0 allows for the const keyword.</dd>
</dl>
<h3>Taking the Plunge</h3>
<p>As a proof of concept I wrote a small function to calculate  the <a href="http://en.wikipedia.org/wiki/Great-circle_distance">great circle distance</a>.  It computes the distance in both PHP and JavaScript.  You can find it <a href="http://code.sachimp.com/labs/dualcode/">here</a> and hybrid PHP / JavaScript code <a href="http://code.sachimp.com/labs/dualcode/dualcode.js">here</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/&amp;title=Dr.+JavaScript+and+Mr.+PHP" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/&amp;title=Dr.+JavaScript+and+Mr.+PHP" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/&amp;title=Dr.+JavaScript+and+Mr.+PHP" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Dr.+JavaScript+and+Mr.+PHP+-+http://b2l.me/acup3&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2009/01/21/dr-javascript-and-mr-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The many lives of JavaScript variables</title>
		<link>http://sachimp.com/2008/12/13/javascript-variables/</link>
		<comments>http://sachimp.com/2008/12/13/javascript-variables/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 03:42:30 +0000</pubDate>
		<dc:creator>AaronAsAChimp</dc:creator>
				<category><![CDATA[Sachimp Labs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://sachimp.com/?p=13</guid>
		<description><![CDATA[So, It was about three months ago when I first met jQuery.  It&#8217;s a neat little library that helps JavaScript programmers easily do relatively complex things.  Among many of its features one stood out to me.  The $() function is an interesting beast that takes a CSS selector or XPath and returns a set of [...]]]></description>
			<content:encoded><![CDATA[<p>So, It was about three months ago when I first met jQuery.  It&#8217;s a neat little library that helps JavaScript programmers easily do relatively complex things.  Among many of its features one stood out to me.  The $() function is an interesting beast that takes a CSS selector or XPath and returns a set of matching nodes.  However, the application of it was not what attracted me to it.</p>
<h3>The Revelation</h3>
<p>The name, a single dollar sign, is what struck me.  I never knew that such a character could be used in a variable name.  As I, and many others, were taught the only character allowed were:</p>
<ol>
<li>letters</li>
<li>underscores</li>
<li>and numbers so long they are not the first character</li>
</ol>
<p>I was interested and decided to embark on quest to figure out what characters were allowed and which weren&#8217;t.  This took me to the <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262 specification</a>, the standard for JavaScript, or ECMA Script as its formally called. The standard states:</p>
<blockquote><p>Identifiers are interpreted according to the grammar given in Section 5.16 of the upcoming version 3.0 of the Unicode standard, with some small modifications.</p></blockquote>
<p>The <a href="http://www.unicode.org/reports/tr31/">Unicode Standard</a> allows for nearly 14,000 characters to be used in variables, as opposed to the measly 63 that are commonly used.</p>
<h3>The Disappointment</h3>
<p>I instantly tried to stuff Sigmas (Σ) and Double Struck N&#8217;s (ℕ) in to my code, but to my dismay, they didn&#8217;t work.  Disappointing? Yes.  Surprising? No.  It seems to be this way with all web standard&#8217;s, either implemented wrongly or incompletely (or both, heres looking at you Microsoft).  So, to test compliance I wrote a small JavaScript that creates a variable, using one of the Unicode characters, and assigns a value to it.  If throws an exception, then that means the browser doesn&#8217;t support that character.  Simple enough, but who wins this browser compliance battle.  So far Opera, it supports 99.5% of all characters.  Heres the data I&#8217;ve collected so far:</p>
<table border="0">
<thead>
<tr>
<td>Browser</td>
<td>Chars Tested</td>
<td>Non Supported Chars</td>
<td>% Not Supported</td>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Opera 9.27<br />
</strong>(Ubuntu Linux)</td>
<td>13935</td>
<td>78</td>
<td>0.5597416576964478</td>
</tr>
<tr>
<td><strong>Opera 9.63<br />
</strong>(Windows XP &amp; Ubuntu Linux)</td>
<td>13935</td>
<td>80</td>
<td>0.5740940078937926</td>
</tr>
<tr>
<td><strong>Internet Explorer 8<br />
</strong>(Windows 7 and XP)</td>
<td>13935</td>
<td>2131</td>
<td>15.292429135270902</td>
</tr>
<tr>
<td><strong>Google Chrome<br />
</strong>(Windows XP)</td>
<td>13935</td>
<td>2746</td>
<td>19.705776820954434</td>
</tr>
<tr>
<td><strong>Internet Explorer 7 &amp; 6<br />
</strong>(Windows XP)</td>
<td>13935</td>
<td>4340</td>
<td>31.144599928238246</td>
</tr>
<tr>
<td><strong>Firefox 3.0, 3.5, 3.6<br />
</strong>(Windows XP &amp; Ubuntu Linux)</td>
<td>13935</td>
<td>7220</td>
<td>51.811984212414785</td>
</tr>
</tbody>
</table>
<p>Yeah, I know thats a pathetically small dataset, but you can help run <a title="READ THE WARNING FIRST" href="http://code.sachimp.com/labs/unicode-support.html">the test script</a> and then post the last three lines in the comments along with the browser, version, and OS.  WARNING: This script takes a very long time to execute, it may appear to lock your browser up, but be patient.</p>
<p>On an unrelated note, Chrome&#8217;s Javascript engine was suprisingly fast.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://sachimp.com/2008/12/13/javascript-variables/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://sachimp.com/2008/12/13/javascript-variables/&amp;title=The+many+lives+of+JavaScript+variables" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://sachimp.com/2008/12/13/javascript-variables/&amp;title=The+many+lives+of+JavaScript+variables" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://sachimp.com/2008/12/13/javascript-variables/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://sachimp.com/2008/12/13/javascript-variables/&amp;title=The+many+lives+of+JavaScript+variables" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=The+many+lives+of+JavaScript+variables+-+http://b2l.me/acup4&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://sachimp.com/2008/12/13/javascript-variables/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://sachimp.com/2008/12/13/javascript-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
