<?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>Nate&#039;s blog</title>
	<atom:link href="http://www.natenewz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.natenewz.com</link>
	<description>My various projects</description>
	<lastBuildDate>Sat, 06 Mar 2010 16:43:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Disabling the Wordpress Flash Uploader</title>
		<link>http://www.natenewz.com/2010/03/06/disabling-the-wordpress-flash-uploader/</link>
		<comments>http://www.natenewz.com/2010/03/06/disabling-the-wordpress-flash-uploader/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 16:42:58 +0000</pubDate>
		<dc:creator>nate</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[disabling]]></category>
		<category><![CDATA[flash uploader]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/?p=328</guid>
		<description><![CDATA[Sometimes it can be finnigy &#8212; the wordpress flash uploader. When it works, it works nicely, but when it doesn&#39;t work it can be frustrating to troubleshoot and fix. If you ever decide that you don&#39;t want it anymore, there is a very simple snippet that will make it look like wordpress never had a [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it can be finnigy &#8212; the wordpress flash uploader. When it works, it works nicely, but when it doesn&#39;t work it can be frustrating to troubleshoot and fix. If you ever decide that you don&#39;t want it anymore, there is a very simple snippet that will make it look like wordpress never had a flash uploader at all, and all you see is the html uploader. Create a plugin, add these two lines of code to it, and activate it.</p>
<pre class="prettyprint" id="PHP">&lt;?php
// Disable the flash uploader
add_action(&#39;flash_uploader&#39;, &#39;disableFlashUploader&#39;);
function disableFlashUploader(){return false;}
?&gt;
</pre>
<p><a href="http://www.natenewz.com/wp-content/uploads/2010/03/before.png"><img alt="screenshot of before disabling flash uploader" class="alignleft size-full wp-image-339" height="147" src="http://www.natenewz.com/wp-content/uploads/2010/03/before.png" title="Before" width="486" /></a><a href="http://www.natenewz.com/wp-content/uploads/2010/03/after.png"><img alt="After Disabling the flash uploader" class="alignleft<br />
 size-full wp-image-338" height="147" src="http://www.natenewz.com/wp-content/uploads/2010/03/after.png" title="after" width="416" /></a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2010%2F03%2F06%2Fdisabling-the-wordpress-flash-uploader%2F&amp;linkname=Disabling%20the%20Wordpress%20Flash%20Uploader"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2010/03/06/disabling-the-wordpress-flash-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Euler&#8217;s Formula and Trig Identities</title>
		<link>http://www.natenewz.com/2009/12/16/eulers-identity-and-trig-identities/</link>
		<comments>http://www.natenewz.com/2009/12/16/eulers-identity-and-trig-identities/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 06:12:32 +0000</pubDate>
		<dc:creator>nate</dc:creator>
				<category><![CDATA[Complex Analysis]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[complex]]></category>
		<category><![CDATA[cubed]]></category>
		<category><![CDATA[derivation]]></category>
		<category><![CDATA[derive]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[sin]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[trig]]></category>
		<category><![CDATA[trigonometry]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/?p=250</guid>
		<description><![CDATA[Electrical Engineers tend to use imaginary numbers quite often for various reasons. The term &#8216;imaginary&#8217; can be misleading. In algebra II, when I heard that term, I was skeptical about the usefulness of an imaginary quantity. But if you can get over the name, they can be used as a powerful tool in many math, [...]]]></description>
			<content:encoded><![CDATA[<p>Electrical Engineers tend to use imaginary numbers quite often for various reasons. The term &#8216;imaginary&#8217; can be misleading. In algebra II, when I heard that term, I was skeptical about the usefulness of an imaginary quantity. But if you can get over the name, they can be used as a powerful tool in many math, and physics problems. I took a whole class on complex variable analysis in the spring of 09&#8242; after I realized how important they were to electrical engineering problems. Anyways, to illustrate one simple use of a complex number, I thought I would derive a trig formula. This technique comes in handy if you ever forget a trig formula, and you need to figure it out quick.<br />
<img src='http://s.wordpress.com/latex.php?latex=sin%28x%29%5E%7B3%7D%3D%3F&#038;bg=T&#038;fg=000000&#038;s=1' alt='sin(x)^{3}=?' title='sin(x)^{3}=?' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=sin%28x%29%3D%5Cfrac%7Be%5E%7Bix%7D-e%5E%7B-ix%7D%7D%7B2i%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='sin(x)=\frac{e^{ix}-e^{-ix}}{2i}' title='sin(x)=\frac{e^{ix}-e^{-ix}}{2i}' class='latex' />&#8211; Euler&#8217;s Identity<br />
<img src='http://s.wordpress.com/latex.php?latex=y%3De%5E%7Bix%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='y=e^{ix}' title='y=e^{ix}' class='latex' />&#8211; a Variable substitution to simplify things<br />
<img src='http://s.wordpress.com/latex.php?latex=sin%28x%29%5E%7B3%7D%3D%28%5Cfrac%7By-1%2Fy%7D%7B2i%7D%29%5E%7B3%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='sin(x)^{3}=(\frac{y-1/y}{2i})^{3}' title='sin(x)^{3}=(\frac{y-1/y}{2i})^{3}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%3D%5Cfrac%7B%28%7By-1%2Fy%7D%29%5E%7B3%7D%7D%7B%282i%29%5E3%7D%3D%5Cfrac%7By%5E3-3y%2B%5Cfrac%7B3%7D%7By%7D-%5Cfrac%7B1%7D%7By%5E3%7D%7D%7B%282i%29%5E3%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='=\frac{({y-1/y})^{3}}{(2i)^3}=\frac{y^3-3y+\frac{3}{y}-\frac{1}{y^3}}{(2i)^3}' title='=\frac{({y-1/y})^{3}}{(2i)^3}=\frac{y^3-3y+\frac{3}{y}-\frac{1}{y^3}}{(2i)^3}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%3D%5Cfrac%7By%5E3-1%2Fy%5E3%7D%7B%282i%29%5E3%7D-3%5Cfrac%7By-1%2Fy%7D%7B%282i%29%5E3%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='=\frac{y^3-1/y^3}{(2i)^3}-3\frac{y-1/y}{(2i)^3}' title='=\frac{y^3-1/y^3}{(2i)^3}-3\frac{y-1/y}{(2i)^3}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=i%2Ai%3D-1&#038;bg=T&#038;fg=000000&#038;s=1' alt='i*i=-1' title='i*i=-1' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%282i%29%5E3%3D-4%2A2i&#038;bg=T&#038;fg=000000&#038;s=1' alt='(2i)^3=-4*2i' title='(2i)^3=-4*2i' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%3D-%5Cfrac%7B1%7D%7B4%7D%5Cfrac%7By%5E3-1%2Fy%5E3%7D%7B2i%7D%2B%5Cfrac%7B3%7D%7B4%7D%5Cfrac%7By-1%2Fy%7D%7B2i%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='=-\frac{1}{4}\frac{y^3-1/y^3}{2i}+\frac{3}{4}\frac{y-1/y}{2i}' title='=-\frac{1}{4}\frac{y^3-1/y^3}{2i}+\frac{3}{4}\frac{y-1/y}{2i}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%3D-%5Cfrac%7B1%7D%7B4%7D%5Cfrac%7Be%5E%7Bi3x%7D-e%5E%7B-i3x%7D%7D%7B2i%7D%2B%5Cfrac%7B3%7D%7B4%7D%5Cfrac%7Be%5E%7Bix%7D-e%5E%7B-ix%7D%7D%7B2i%7D&#038;bg=T&#038;fg=000000&#038;s=1' alt='=-\frac{1}{4}\frac{e^{i3x}-e^{-i3x}}{2i}+\frac{3}{4}\frac{e^{ix}-e^{-ix}}{2i}' title='=-\frac{1}{4}\frac{e^{i3x}-e^{-i3x}}{2i}+\frac{3}{4}\frac{e^{ix}-e^{-ix}}{2i}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=sin%28x%29%5E3%3D-%5Cfrac%7B1%7D%7B4%7Dsin%283x%29%29%2B%5Cfrac%7B3%7D%7B4%7Dsin%28x%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='sin(x)^3=-\frac{1}{4}sin(3x))+\frac{3}{4}sin(x)' title='sin(x)^3=-\frac{1}{4}sin(3x))+\frac{3}{4}sin(x)' class='latex' /><br />
<img src="http://www.natenewz.com/wp-content/uploads/2009/12/sin3.bmp" alt="two functions graphed on top of each other" title="sin3" class="alignright size-full wp-image-260" style='width: 100%;'/></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F12%2F16%2Feulers-identity-and-trig-identities%2F&amp;linkname=Euler%26%238217%3Bs%20Formula%20and%20Trig%20Identities"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/12/16/eulers-identity-and-trig-identities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>US Bank &#8211; Funny Ad</title>
		<link>http://www.natenewz.com/2009/12/15/us-bank-funny-ad/</link>
		<comments>http://www.natenewz.com/2009/12/15/us-bank-funny-ad/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 04:20:43 +0000</pubDate>
		<dc:creator>nate</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[ad]]></category>
		<category><![CDATA[bank]]></category>
		<category><![CDATA[credit card]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[funny ad]]></category>
		<category><![CDATA[intelligence]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[smart]]></category>
		<category><![CDATA[stupid]]></category>
		<category><![CDATA[U.S. Bank]]></category>
		<category><![CDATA[US bank]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/?p=224</guid>
		<description><![CDATA[ If you get this Credit Card, We will hit you in the face with a golf club. &#8211; US Bank
Iowa State has a high dollar deal with U.S. Bank that allows students to use their university id as a debit card. They have it set up such that, if you come to ISU, during [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left; width: 50%;"><a href="http://www.natenewz.com/wp-content/uploads/2009/12/2009-12-10-12.30.27-725x1024.jpg"><img alt="2009-12-10 12.30.27" class="size-large wp-image-226 " src="http://www.natenewz.com/wp-content/uploads/2009/12/2009-12-10-12.30.27-725x1024.jpg" style="width: 94%;" title="2009-12-10 12.30.27" /></a> If you get this Credit Card, We will hit you in the face with a golf club. &#8211; US Bank</div>
<p>Iowa State has a high dollar deal with U.S. Bank that allows students to use their university id as a debit card. They have it set up such that, if you come to ISU, during your registration for classes, you automatically get routed into a line to sign up for a new U.S. bank debit card. And they make it seem like it is part of registering for ISU. A friend of mine called U.S. Bank about getting a loan. He asked them why he should get a loan from them if their rate wasn&#39;t that good. The service representative said, we have no reason to offer good rates, we make all of our money off of overdraft fees on college kids. Another friend of mine, over-drafted on accident. Each time she tried to use her debit card, for about 3 days, they charged her around $30. Her charges went up to over $500. We asked them why the card kept working if she was several hundred dollars in the negative, and the U.S. Bank employee replied, &quot;We allow it to continue working to save the customer from the embarrassment of their card not working in the grocery store.&quot; I personally would much rather be slightly embarrassed by my debit card not working than to get charged hundreds of dollars in overdraft fees.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F12%2F15%2Fus-bank-funny-ad%2F&amp;linkname=US%20Bank%20%26%238211%3B%20Funny%20Ad"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/12/15/us-bank-funny-ad/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Freebording &#8211; Snowboarding in the Summer</title>
		<link>http://www.natenewz.com/2009/11/29/freebording-snowboarding-in-the-summer/</link>
		<comments>http://www.natenewz.com/2009/11/29/freebording-snowboarding-in-the-summer/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 01:20:01 +0000</pubDate>
		<dc:creator>nate</dc:creator>
				<category><![CDATA[Recreation]]></category>
		<category><![CDATA[Freebording]]></category>
		<category><![CDATA[ISU Freebording]]></category>
		<category><![CDATA[ISU Freebording club]]></category>
		<category><![CDATA[summer snowboarding]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/?p=190</guid>
		<description><![CDATA[Skateboarding, a sport I enjoy, originated from surfers who wanted to &#34;surf the streets&#34;. A new sport, freebording, that some friends of mine at ISU are pioneering in the ISU Freebord Club, is allowing them to &#34;snowboard the streets&#34;.  A Freebord is like a long skateboard with two wheels placed along the center axis [...]]]></description>
			<content:encoded><![CDATA[<p>Skateboarding, a sport I enjoy, originated from surfers who wanted to &quot;surf the streets&quot;. A new sport, freebording, that some friends of mine at ISU are pioneering in the ISU Freebord Club, is allowing them to &quot;snowboard the streets&quot;. <img alt="Freebord" class="size-medium wp-image-191" src="http://www.natenewz.com/wp-content/uploads/2009/11/freebord-300x143.jpg" style="width: 80%; max-width: 300px;" title="freebord" /> A Freebord is like a long skateboard with two wheels placed along the center axis inline with the two outside wheels on the front and back. The center wheels are lower than the two outside wheels, and they swivel. This and the slip-in bindings allows the the freebord to carve sideways like a snowboard on the streets. I think that this sport might actually catch on because of the possible trick variations, no cost after initial investment, and close ties with snowboarding. Here is a video that some of my friends made. They have a better video that I will post as soon as they put it up. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="344" width="425"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/BFUmehnL1oA&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed allowfullscreen="true" allowscriptaccess="always" height="344" src="http://www.youtube.com/v/BFUmehnL1oA&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" width="425"></embed></object></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F11%2F29%2Ffreebording-snowboarding-in-the-summer%2F&amp;linkname=Freebording%20%26%238211%3B%20Snowboarding%20in%20the%20Summer"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/11/29/freebording-snowboarding-in-the-summer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convolution of Two Uniform Probability Distributions</title>
		<link>http://www.natenewz.com/2009/11/01/convolution-of-two-uniform-probability-distributions/</link>
		<comments>http://www.natenewz.com/2009/11/01/convolution-of-two-uniform-probability-distributions/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 10:36:27 +0000</pubDate>
		<dc:creator>nate</dc:creator>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[arrival time]]></category>
		<category><![CDATA[central limit theorem]]></category>
		<category><![CDATA[continuous]]></category>
		<category><![CDATA[convolution]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[probability density function]]></category>
		<category><![CDATA[step function]]></category>
		<category><![CDATA[uniform]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/?p=140</guid>
		<description><![CDATA[The Problem
Two friends A and B meet every morning at the Grand Central Station around 7 am. Suppose the actual times they arrive are independent and uniformly distributed between 6:55 am and 7:05am. Let Z denote the time between arrivals, i.e. Z = time B arrives &#8211; time A arrives (can be negative!).
(a) What is [...]]]></description>
			<content:encoded><![CDATA[<h3>The Problem</h3>
<p>Two friends A and B meet every morning at the Grand Central Station around 7 am. Suppose the actual times they arrive are independent and uniformly distributed between 6:55 am and 7:05am. Let Z denote the time between arrivals, i.e. Z = time B arrives &#8211; time A arrives (can be negative!).<br />
(a) What is the range of values of Z (i.e Im(Z))?<br />
(b) Find the density of Z (derive a formula similar to the convolution formula derived in class).</p>
<h3>The Solution</h3>
<p>(a) The times for Z can vary from -10 to 10. Suppose friend A arrives at 6:55 and friend B arrives at 7:05. Z would = -10. The other way around will result in Z = 10<br />
(b)</p>
<h4>Define Random Variables</h4>
<p>X = # of minutes (continuous) after 6:55 friend A arrives<br />
Y = # of minutes (continuous) after 6:55 friend B arrives</p>
<h4>Outline of Problem</h4>
<ul>
<li>The probability distribution functions of X and Y are uniform (constant and area = 1)</li>
<li>The convolution of the pdf&#8217;s of X and the negative of Y (X-Y) equal the pdf of Z</li>
<li>The result should look closer to the normal curve because of the Central Limit Theorem</li>
</ul>
<h4>The two input pdf&#8217;s and the result of the convolution which is the pdf of Z</h4>
<div style="overflow: auto;"><a href="http://fooplot.com/index.php?&amp;type0=0&amp;type1=0&amp;type2=0&amp;type3=0&amp;type4=0&amp;y0=1/10*%28-2x*u%28x%29%2B%28x%2B10%29*u%28x%2B10%29%2B%28x-10%29*u%28x-10%29%29&amp;y1=u%28x%29-u%28x-10%29&amp;y2=u%28x%2B10%29-u%28x%29&amp;y3=&amp;y4=&amp;r0=&amp;r1=&amp;r2=&amp;r3=&amp;r4=&amp;px0=&amp;px1=&amp;px2=&amp;px3=&amp;px4=&amp;py0=&amp;py1=&amp;py2=&amp;py3=&amp;py4=&amp;smin0=0&amp;smin1=0&amp;smin2=0&amp;smin3=0&amp;smin4=0&amp;smax0=2pi&amp;smax1=2pi&amp;smax2=2pi&amp;smax3=2pi&amp;smax4=2pi&amp;thetamin0=0&amp;thetamin1=0&amp;thetamin2=0&amp;thetamin3=0&amp;thetamin4=0&amp;thetamax0=2pi&amp;thetamax1=2pi&amp;thetamax2=2pi&amp;thetamax3=2pi&amp;thetamax4=2pi&amp;ipw=0&amp;ixmin=-5&amp;ixmax=5&amp;iymin=-3&amp;iymax=3&amp;igx=1&amp;igy=0.1&amp;igl=1&amp;igs=0&amp;iax=1&amp;ila=1&amp;xmin=-10.639526885769323&amp;xmax=10.834918728558375&amp;ymin=-0.23476296218988496&amp;ymax=1.6345029848685044"><img class="alignleft size-full wp-image-158" title="pdf's and the result of convolution" src="http://www.natenewz.com/wp-content/uploads/2009/11/save.png" alt="pdf's and the result of convolution" width="500" height="300" /></a></div>
<h4>Performing the convolution</h4>
<p><strong>Note: a=10</strong></p>
<ul style='list-style: none;'>
<li><img src='http://s.wordpress.com/latex.php?latex=Z%3DX-Y&#038;bg=T&#038;fg=000000&#038;s=1' alt='Z=X-Y' title='Z=X-Y' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=f_x%28t%29%20%3D%201%2Fa%2A%28u%28t%29%20%2B%20u%28t-a%29%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='f_x(t) = 1/a*(u(t) + u(t-a))' title='f_x(t) = 1/a*(u(t) + u(t-a))' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=f_y%28t%29%20%3D%201%2Fa%2A%28u%28t%29%20%2B%20u%28t-a%29%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='f_y(t) = 1/a*(u(t) + u(t-a))' title='f_y(t) = 1/a*(u(t) + u(t-a))' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%20%7Df_x%28t%29dt%20%3D%201&#038;bg=T&#038;fg=000000&#038;s=1' alt='\int_{-\infty}^{\infty }f_x(t)dt = 1' title='\int_{-\infty}^{\infty }f_x(t)dt = 1' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%20%7Df_y%28t%29dt%20%3D%201&#038;bg=T&#038;fg=000000&#038;s=1' alt='\int_{-\infty}^{\infty }f_y(t)dt = 1' title='\int_{-\infty}^{\infty }f_y(t)dt = 1' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=f_z%28t%29%3Df_x%28t%29%5Cstar%20f_y%28-t%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='f_z(t)=f_x(t)\star f_y(-t)' title='f_z(t)=f_x(t)\star f_y(-t)' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=f%28t%29%20%5Cstar%20g%28t%29%3D%5Cint_%7B-%5Cinfty%7D%5E%7B%5Cinfty%20%7Df%28%5Ctau%20%29g%28t-%5Ctau%20%29d%5Ctau%20&#038;bg=T&#038;fg=000000&#038;s=1' alt='f(t) \star g(t)=\int_{-\infty}^{\infty }f(\tau )g(t-\tau )d\tau ' title='f(t) \star g(t)=\int_{-\infty}^{\infty }f(\tau )g(t-\tau )d\tau ' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=f_x%28t%29%20%5Cstar%20f_y%28-t%29%3D%5Cfrac%7B1%7D%7Ba%7D%20%5Cint_%7B-a%7D%5E%7Ba%7D%5Bu%28%5Ctau%20%29-u%28%5Ctau%20-a%29%5D%5Bu%28t-%5Ctau%20%2Ba%29-u%28t-%5Ctau%20%29%5Dd%5Ctau%20&#038;bg=T&#038;fg=000000&#038;s=1' alt='f_x(t) \star f_y(-t)=\frac{1}{a} \int_{-a}^{a}[u(\tau )-u(\tau -a)][u(t-\tau +a)-u(t-\tau )]d\tau ' title='f_x(t) \star f_y(-t)=\frac{1}{a} \int_{-a}^{a}[u(\tau )-u(\tau -a)][u(t-\tau +a)-u(t-\tau )]d\tau ' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%3D%5Cfrac%7B1%7D%7Ba%7D%20%5Cint_%7B-a%7D%5E%7Ba%7Du%28%5Ctau%20%29u%28t-%5Ctau%20%2Ba%29%20-u%28%5Ctau%20%29u%28t-%5Ctau%20%29-u%28%5Ctau%20-a%29u%28t-%5Ctau%20%2Ba%29%2Bu%28%5Ctau%20-a%29u%28t-%5Ctau%29d%5Ctau%20&#038;bg=T&#038;fg=000000&#038;s=1' alt='=\frac{1}{a} \int_{-a}^{a}u(\tau )u(t-\tau +a) -u(\tau )u(t-\tau )-u(\tau -a)u(t-\tau +a)+u(\tau -a)u(t-\tau)d\tau ' title='=\frac{1}{a} \int_{-a}^{a}u(\tau )u(t-\tau +a) -u(\tau )u(t-\tau )-u(\tau -a)u(t-\tau +a)+u(\tau -a)u(t-\tau)d\tau ' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=0%3D%20%5Cint_%7B-a%7D%5E%7Ba%7Du%28%5Ctau%20-a%29u%28t-%5Ctau%20%2Ba%29%2Bu%28%5Ctau%20-a%29u%28t-%5Ctau%29d%5Ctau%20&#038;bg=T&#038;fg=000000&#038;s=1' alt='0= \int_{-a}^{a}u(\tau -a)u(t-\tau +a)+u(\tau -a)u(t-\tau)d\tau ' title='0= \int_{-a}^{a}u(\tau -a)u(t-\tau +a)+u(\tau -a)u(t-\tau)d\tau ' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%3D%5Cfrac%7B1%7D%7Ba%7D%5Cint_%7B-a%7D%5E%7Ba%7Du%28%5Ctau%20%29u%28t-%5Ctau%20%2Ba%29d%5Ctau%20%3D%20%5Cint_%7B0%7D%5E%7Ba%7Du%28t-%5Ctau%20%2Ba%29d%5Ctau&#038;bg=T&#038;fg=000000&#038;s=1' alt='=\frac{1}{a}\int_{-a}^{a}u(\tau )u(t-\tau +a)d\tau = \int_{0}^{a}u(t-\tau +a)d\tau' title='=\frac{1}{a}\int_{-a}^{a}u(\tau )u(t-\tau +a)d\tau = \int_{0}^{a}u(t-\tau +a)d\tau' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cint_%7B0%7D%5E%7Ba%7Du%28t-%5Ctau%20%2Ba%29d%5Ctau%5C%3B%20x%3Dt-%5Ctau%20%2Ba%5C%3B%20%5Cfrac%7B%5Cmathrm%7Bd%7D%20x%7D%7B%5Cmathrm%7Bd%7D%20%5Ctau%7D%20%3D%20-1&#038;bg=T&#038;fg=000000&#038;s=1' alt='\int_{0}^{a}u(t-\tau +a)d\tau\; x=t-\tau +a\; \frac{\mathrm{d} x}{\mathrm{d} \tau} = -1' title='\int_{0}^{a}u(t-\tau +a)d\tau\; x=t-\tau +a\; \frac{\mathrm{d} x}{\mathrm{d} \tau} = -1' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=-%5Cint_%7Bt%2B10%7D%5E%7Bt%7Du%28x%29dx&#038;bg=T&#038;fg=000000&#038;s=1' alt='-\int_{t+10}^{t}u(x)dx' title='-\int_{t+10}^{t}u(x)dx' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=-tu%28t%29%2B%28t%2Ba%29u%28t%2Ba%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='-tu(t)+(t+a)u(t+a)' title='-tu(t)+(t+a)u(t+a)' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cint_%7B0%7D%5E%7Ba%7Du%28t-%5Ctau%20%29d%5Ctau%5C%3B%20x%3Dt-%5Ctau%5C%3B%20%5Cfrac%7B%5Cmathrm%7Bd%7D%20x%7D%7B%5Cmathrm%7Bd%7D%20%5Ctau%7D%20%3D%20-1&#038;bg=T&#038;fg=000000&#038;s=1' alt='\int_{0}^{a}u(t-\tau )d\tau\; x=t-\tau\; \frac{\mathrm{d} x}{\mathrm{d} \tau} = -1' title='\int_{0}^{a}u(t-\tau )d\tau\; x=t-\tau\; \frac{\mathrm{d} x}{\mathrm{d} \tau} = -1' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cint_%7Bt%7D%5E%7Bt-10%7Du%28x%29dx&#038;bg=T&#038;fg=000000&#038;s=1' alt='\int_{t}^{t-10}u(x)dx' title='\int_{t}^{t-10}u(x)dx' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=%28t-a%29u%28t-a%29-tu%28t%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='(t-a)u(t-a)-tu(t)' title='(t-a)u(t-a)-tu(t)' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=f%28t%29%20%5Cstar%20g%28t%29%3D%5Cfrac%7B1%7D%7Ba%7D%28-2tu%28t%29%2B%28t%2Ba%29u%28t%2Ba%29%2B%28t-a%29u%28t-a%29%29&#038;bg=T&#038;fg=000000&#038;s=1' alt='f(t) \star g(t)=\frac{1}{a}(-2tu(t)+(t+a)u(t+a)+(t-a)u(t-a))' title='f(t) \star g(t)=\frac{1}{a}(-2tu(t)+(t+a)u(t+a)+(t-a)u(t-a))' class='latex' /></li>
</ul>
<h4>Simulation</h4>
<ul>
<li>Random number generator is a uniform distribution</li>
<li>Histogram of Randbetween(0,10)-Randbetween(0,10) 2092 times divided by 2092</li>
<li>Discrete version of this problem</li>
</ul>
<p><img class="alignleft size-full wp-image-182" style="width: 100%;" title="Excel Simulation" src="http://www.natenewz.com/wp-content/uploads/2009/11/simulation.jpg" alt="Excel Simulation" /></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F11%2F01%2Fconvolution-of-two-uniform-probability-distributions%2F&amp;linkname=Convolution%20of%20Two%20Uniform%20Probability%20Distributions"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/11/01/convolution-of-two-uniform-probability-distributions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating Zenphoto and Wordpress</title>
		<link>http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/</link>
		<comments>http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 05:28:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[seamless]]></category>
		<category><![CDATA[zenphoto]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/blog/?p=93</guid>
		<description><![CDATA[
Update: I am now using google picasa with the kpicasa plugin. I&#39;ve determined that this is the best method of putting a complete gallery onto a post or page. This completely eliminates zenphoto. If you are committed to using zenphoto, and you have your theme set up exactly the way you want it, then this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zenphoto.org/"><img alt="Zenphoto" class="size-medium wp-image-96" height="117" src="http://www.natenewz.com/wp-content/uploads/2009/10/zenphoto-300x108.jpg" title="zenphoto" width="329" /></a><a href="http://www.wordpress.org/"><img alt="wordpress" class="size-full wp-image-97" height="117" src="http://www.natenewz.com/wp-content/uploads/2009/10/wordpress-icon-512-300x300.png" title="wordpress-icon-512-300x300" width="117" /></a></p>
<p>Update: I am now using google picasa with the kpicasa plugin. I&#39;ve determined that this is the best method of putting a complete gallery onto a post or page. This completely eliminates zenphoto. If you are committed to using zenphoto, and you have your theme set up exactly the way you want it, then this method will work, but over time if you ever make a change to your wordpress theme, you have to update your look-alike zenphoto theme. Common plugins for zenphoto wordpress integration allow you to put individual albums or photos into posts.<br style="clear: both;" /><br />
	After reading <a href="http://wpengineer.com/embed-wordpress-functions-outside-wordpress/trackback/" target="_blank" title="Calling wordpress functions outside of wordpress">Frank&#39;s post on using wordpress functions outside of wordpress</a>, I had a good idea: Make a zenphoto theme with the wordpress navigation. This allows a nearly seamless level of integration between zenphoto and wordpress. The best starting point for this outline is if you already have a nice looking wordpress theme. The result of this will give you a wordpress &quot;page&quot; that redirects to a lookalike wordpress zenphoto theme complete with wordpress navigation, footer, page title, header, etc. First, you need a way of getting the paths of the blog directory, and the zenphoto directory. I have a www/blog/ folder and a www/gallery/ folder in this example. Place config.php in www/ config.php</p>
<pre class="prettyprint">< ?php
/* config file to unite wordpress and zenphoto */
define('BLOG_PATH', "$_SERVER['DOCUMENT_ROOT']/blog");
// do a var_dump($_SERVER); to find out what something is
define('GALLERY_PATH', "$_SERVER['DOCUMENT_ROOT']/gallery');
?></pre>
<p>You may have to var_dump($_SERVER) to find out the best way of getting to your site&#39;s directory. Okay, we have paths to reference from zenphoto to get to the wordpress directory. Let&#39;s dig into a zenphoto theme. Zenphoto themes are laid out with various files that are called depending on if you are at the zenphoto homepage (index.php), or if you have clicked on an album (album.php), or an image (image.php) and a few others. Your best bet is to copy the &#39;default&#39; zenphoto theme to a folder with a different name, such as nate-theme, then modify it. Let&#39;s look at index.php The first step is to follow Franks post and include the wordpress loader wp-load.php. Put at the very top of your zp-themes index.php file:</p>
<pre class="prettyprint" id="PHP">&lt; ?php
require_once(&quot;{$_SERVER[&#39;something&#39;]}/www/config.php&quot;);
require_once(BLOG_PATH.&quot;/wp-load.php&quot;);
// var_dump(get_current_theme()); // call this to see the name of the wordpress theme activated
if (get_current_theme() == &quot;My Wordpress Theme&quot;) // if the current theme is my wp theme, use it. otherwise use default zenphoto theme
{?&gt;
// wordpress html+php here
&lt; ?php
}else{
?&gt;
// original zenphoto default index.php file here
&lt;?php
}
?&gt;</pre>
<p>This is in case the wordpress theme get&#39;s changed to something else, zenphoto will revert back to the original html/php &#8212; whatever is in the else statement. So then, just copy the basic html structure from the header.php footer.php index.php files from your wordpress theme. You can now call the functions for listing the navigation, <a href="http://codex.wordpress.org/wp_list_pages">wp_list_pages()</a>, getting options <a href="http://codex.wordpress.org/Function_Reference/get_option">get_option()</a>, getting blog title and other information <a href="http://codex.wordpress.org/Template_Tags/bloginfo">bloginfo()</a>, etc. One requirement for this to work, is that the zenphoto and wordpress functions don&#39;t interfere. Luckily, no two functions have the same name, and so this does work. I haven&#39;t tested recreating the sidebar widgets in the zenphoto theme, although it should theoretically work. As for the zenphoto style sheet, I played a trick on apache to make this work. I told apache to parse .css files in the styles/ directory of zenphoto theme as a php file. Just make a .htaccess file in the styles directory, and add this line to it: AddType application/x-httpd-php .css This will allow you to apply the same technique as the index.php page with the if get_current_theme==xx else block. Just use the normal css in the else, and the wordpress css in the if parts. The last step to making this a nearly seamless integration is following my previous post on hardlinking the navigation. create the custom field redirect to the key /gallery/ or the url path to your gallery.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F10%2F13%2Fintegrating-zenphoto-and-wordpress%2F&amp;linkname=Integrating%20Zenphoto%20and%20Wordpress"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Accelerometer on Robot Finger</title>
		<link>http://www.natenewz.com/2009/10/12/accelerometer-on-robot-finger/</link>
		<comments>http://www.natenewz.com/2009/10/12/accelerometer-on-robot-finger/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 14:32:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Electronic Projects]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[adxl345]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[atmega 328]]></category>
		<category><![CDATA[brink]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[ISU robot]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/blog/?p=53</guid>
		<description><![CDATA[I helped attach an accelerometer to a robot at ISU, which has  been featured on Discovery Channels show, Brink.

We used an adxl345 digital accelerometer with the breakout board from sparkfun.com, in addition to an arduino.
We used the I^2c wire arduino library. This was a temporary solution so that the research assistants can gather surface [...]]]></description>
			<content:encoded><![CDATA[<p>I helped attach an accelerometer to a robot at ISU, which has  been featured on Discovery Channels show, <a title="Episode of Brink with IASTATE Robot" href="http://science.discovery.com/videos/brink-package-robots-become-human.html" target="_blank">Brink</a>.</p>
<div id="attachment_57" class="wp-caption left" style="width: 310px"><img class="size-medium wp-image-57" title="robot-arm" src="http://www.natenewz.com/wp-content/uploads/2009/10/robot-arm-300x225.jpg" alt="arduino taped onto robots arm" width="300" height="225" /><p class="wp-caption-text">arduino taped onto robots arm</p></div>
<p><div id="attachment_60" class="wp-caption left" style="width: 310px"><img class="size-medium wp-image-60" title="robot-finger" src="http://www.natenewz.com/wp-content/uploads/2009/10/robot-finger-300x225.jpg" alt="Accelerometer taped onto robot finger" width="300" height="225" /><p class="wp-caption-text">Accelerometer taped onto robot finger</p></div><br />
<br style="clear: both;" /></p>
<p>We used an adxl345 digital accelerometer with the breakout board from sparkfun.com, in addition to an arduino.</p>
<p>We used the I^2c wire arduino library. This was a temporary solution so that the research assistants can gather surface texture data to see if it is possible to categorize surfaces based on touch, essentially giving the robot a sense of touch similiar to our fingers.</p>
<p>The final project will most likely include several accelerometers and some sort of pic, hopefully sampling at 1200 Hz, the maximum sampling rate of the accelerometer.</p>
<p>We were only able to sample at 500 Hz max. The limiting factor was the serial port speed. 230400 baud was the highest speed we could use without getting gibberish input on the serial port. This proves that it is possible to go past what the Arduino documentation  for the serial library says <a title="serial library" href="http://www.arduino.cc/en/Serial/Begin" target="_blank">here.</a></p>
<p>We also noticed that the variance increased with the frequency, and so the usefulness of the higher sampling rate obtaining more data is still being analyzed.</p>
<p>The two signal wires are connected to analog in 4, and 5<br />
The two interrupt wires are open<br />
The rest are either held high, or low at 3.3V and Gnd off of the arduino.</p>
<p>Here is the arduino code we created:</p>
<pre id="C" class="prettyprint">
/* The MIT License

Copyright (c) <2009> < Vlad Sukhoy <sukhoy@iastate.edu>, Joe Coleman <jcoleman@iastate.edu>, Ritika Sahai <ritika@iastate.edu>, Nate Nuzum <natenewz@iastate.edu>>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
/*
 * Arduino Duemilanove programming to read the data from ADXL345 accelerometer.
 * This code is a part of tactile sense implementation in rc.
 *
 * It is not advised to use this code at data rates above 400 Hz (bandwidth = 200 Hz)
 * as Arduino serial I/O cannot keep up with the accelerometer at those bandwidths.
 * The actual data rate we can achieve is about 500 Hz, however the accelerometer
 * only supports data rates <= 400 Hz or >= 800 Hz, so we cannot get 500 Hz without
 * discarding some of the data.
 *
 * Using binary coding we might be able to actually transfer at 800 Hz.
 * Using compression we might be able to transfer however much we like, but this
 * will depend on the properties of the data stream.
 *
 * In scratching study we might not really need all 3 vectors, but the magnitude of the
 * deviation from g. Unfortunately, as the device might turn we don't really
 * know where g points to, so we smooth the acceleration vector and use that value
 * for g. If we settle down on that logic, it can be pushed down to Arduino and then we
 * only need to transfer one value per measurement which, together with binary coding
 * and/or compression should put us at 2000+ Hz.
 *
 * Authors:
 * Vlad Sukhoy <sukhoy@iastate.edu>
 * Joe Coleman <jcoleman@iastate.edu>
 * Ritika Sahai <ritika@iastate.edu>
 * Nate Nuzum <natenewz@iastate.edu>
 */

#include < Wire.h >

// The address of the accelerometer device in terms of Arduino board
#define ADXL_ADDR ((byte)0x1d)
// The bandwidth to use for the serial port
// It appears that Duemilanove only supports up to 230400 bits per second
#define SERIAL_BANDWIDTH 230400
#define BUFSIZE 1024

enum registers {
 power_ctl   = 0x2d,
 bw_rate     = 0x2c,
 data_format = 0x31,
 datax0      = 0x32,
 datax1,
 datay0,
 datay1,
 dataz0,
 dataz1,
 fifo_ctl    = 0x38,
 fifo_status = 0x39
};

// bits for the POWER_CTL register
enum power_ctl {
 pc_link        = (1 << 5),
 pc_auto_sleep  = (1 << 4),
 pc_measure     = (1 << 3),
 pc_sleep       = (1 << 2),
 pc_wakeup_mask = 3,
 // Frequency of readings in sleep mode
 pc_wakeup_8hz  = 0,
 pc_wakeup_4hz  = 1,
 pc_wakeup_2hz  = 2,
 pc_wakeup_1hz  = 3
};

// bits and masks for the BW_RATE register
enum bw_rate {
 bw_low_power   = (1 << 4),
 bw_rate_mask   = 0xf,
 // low power modes, the number of Hz is the bandwidth. the data rate is 2x that
 bw_lp_200hz    = bw_low_power | 0xc,
 bw_lp_100hz    = bw_low_power | 0xb,
 bw_lp_50hz     = bw_low_power | 0xa,
 bw_lp_25hz     = bw_low_power | 0x9,
 pw_lp_12dot5hz = bw_low_power | 0x8,
 pw_lp_6dot25hz = bw_low_power | 0x7,
 // regular modes
 bw_1600hz = 0xf, bw_800hz = 0xe, bw_400hz = 0xd, bw_200hz = 0xc, bw_100hz = 0xb,
 bw_50hz = 0xa, bw_25hz = 0x9, bw_12dot5hz = 0x8, bw_6dot25hz = 0x7,
 bw_3dot125hz = 0x6
};

// bits and masks for the DATA_FORMAT register
enum data_format {
 df_self_test  = (1 << 7),
 df_spi        = (1 << 6),
 df_int_invert = (1 << 5),
 df_full_res   = (1 << 3),
 df_justify    = (1 << 2),
 df_range_mask = 0x3,
 df_range_2g   = 0x0,
 df_range_4g   = 0x1,
 df_range_8g   = 0x2,
 df_range_16g  = 0x3
};

enum fifo_ctl {
 fc_mode_bypass  = 0,
 fc_mode_fifo    = (1 << 6),
 fc_mode_stream  = (1 << 7),
 fc_mode_trigger = (3 << 6),
 fc_trigger      = (1 << 5),
 fc_samples_mask = 0x1f,
 fc_samples_32   = 0x1f
};

enum fifo_status {
 fs_fifo_trig    = (1 << 7),
 fs_entries_mask = 0x3f
};

// transmit a register value to the accelerometer
static inline void reg_set(byte regid, byte value) {
 Wire.beginTransmission(ADXL_ADDR);
 byte data[] = {regid, value};
 Wire.send(data, sizeof(data)/sizeof(data[0]));
 Wire.endTransmission();
}

// receive a register value from the accelerometer
static inline byte reg_get(byte regid) {
 Wire.beginTransmission(ADXL_ADDR);
 Wire.send(regid);
 Wire.endTransmission();
 Wire.requestFrom(ADXL_ADDR, (byte)1);
 return Wire.receive();
}

static inline byte fifo_entries() { return reg_get(fifo_status) &amp; fs_entries_mask; }

// one accelerometer measurement
struct measurement {
 int16_t data[3];
};

static inline struct measurement reading() {
 // read 6 bytes from the accelerometer data registers and put the bytes in order
 struct measurement rv;
 Wire.beginTransmission(ADXL_ADDR);
 Wire.send(datax0);
 Wire.endTransmission();
 Wire.requestFrom(ADXL_ADDR, (byte)6);
 int i;
 byte lsb, msb;
 for (i=0; i< sizeof(rv.data)/sizeof(rv.data[0]); ++i) {
   lsb = Wire.receive();
   msb = Wire.receive();
   rv.data[i] = (((int16_t)msb) < < 8) | lsb;
 }
 return rv;
}

void setup() {
 Serial.begin(SERIAL_BANDWIDTH);
 Wire.begin(); // Join I2C bus as a master

 reg_set(power_ctl, 0);             // stand by
 reg_set(bw_rate, bw_200hz);        // bandwidth
 reg_set(data_format, df_range_2g); // request 2g resolution
 reg_set(fifo_ctl, fc_mode_fifo | fc_samples_32); // request 32 entry FIFO (max)
 reg_set(power_ctl, pc_measure);    // start measuring
}

void loop() {
 byte  n, b[BUFSIZE];
 int  bsz = 0;
 struct measurement m;
 while ((n = fifo_entries())) {
   while (n--) {
     m = reading();
     bsz += sprintf((char*)&amp;b[bsz], "%d\t%d\t%d\r\n", (int)m.data[0], (int)m.data[1],
       (int)m.data[2]);
     if (bsz > BUFSIZE - 30)
       goto quit;
   }
 }
 quit:
 Serial.write(b, bsz);
}
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F10%2F12%2Faccelerometer-on-robot-finger%2F&amp;linkname=Accelerometer%20on%20Robot%20Finger"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/10/12/accelerometer-on-robot-finger/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Hardlink Wordpress Navigation</title>
		<link>http://www.natenewz.com/2009/10/07/hardlink-wordpress-navigation/</link>
		<comments>http://www.natenewz.com/2009/10/07/hardlink-wordpress-navigation/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 21:10:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[hard]]></category>
		<category><![CDATA[hardlink]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/blog/?p=36</guid>
		<description><![CDATA[This cool little theme code snippet allows the wordpress navigation to link to a page outside of wordpress. It takes advantage of custom fields for pages.  Just place this code at the top of your themes header.php file
&#60;?php
/*
Copyright (c) 2009 &#60; Nate Nuzum &#62;
Use under terms of MIT license
*/
global $post;
$redirect = get_post_meta($post-&#62;ID, &#39;redirect&#39;, true);
if [...]]]></description>
			<content:encoded><![CDATA[<p>This cool little theme code snippet allows the wordpress navigation to link to a page outside of wordpress. It takes advantage of custom fields for pages. <img alt="custom-field" class="alignnone size-full wp-image-45" src="http://www.natenewz.com/wp-content/uploads/2009/10/custom-field.jpg" style="width: 80%;" title="custom-field" /> Just place this code at the top of your themes header.php file</p>
<pre class="prettyprint" id="PHP">&lt;?php
/*
Copyright (c) 2009 &lt; Nate Nuzum &gt;
Use under terms of MIT license
*/
global $post;
$redirect = get_post_meta($post-&gt;ID, &#39;redirect&#39;, true);
if ($redirect)
        wp_redirect($redirect);
?&gt;
</pre>
<p>Then create a page with the name having the link text you want to appear in the navigation add a custom field to the page called redirect and place the link url into the value field.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F10%2F07%2Fhardlink-wordpress-navigation%2F&amp;linkname=Hardlink%20Wordpress%20Navigation"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/10/07/hardlink-wordpress-navigation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FratHouseInsurance- Greasemonkey Script</title>
		<link>http://www.natenewz.com/2009/09/14/frathouseinsurance-greasemonkey-script/</link>
		<comments>http://www.natenewz.com/2009/09/14/frathouseinsurance-greasemonkey-script/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 22:14:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[meatspin]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[shock site]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/blog/?p=33</guid>
		<description><![CDATA[Meatspinning is the new term for leaving a shock site on somebody&#8217;s computer while they are gone to surprise them when they get back.
I wrote my first greasemonkey script yesterday. Protects me from being meatspinned, lemonpartied, or any of about 40 other shock sites. It was only two lines of javascript, but I think the [...]]]></description>
			<content:encoded><![CDATA[<p>Meatspinning is the new term for leaving a shock site on somebody&#8217;s computer while they are gone to surprise them when they get back.</p>
<p>I wrote my first greasemonkey script yesterday. Protects me from being meatspinned, lemonpartied, or any of about 40 other shock sites. It was only two lines of javascript, but I think the idea was the cool part.</p>
<p>Forwards you to a picture of a kitten and pops up an alert that says , &#8220;No thanks&#8221;.</p>
<p>You can change the redirect page and message if you don&#8217;t mind editing the source, it&#8217;s pretty simple.</p>
<p>Redirects from shock sites to www.google.com</p>
<p>** Greasemonkey only runs in firefox</p>
<p><strong>You can download</strong> the script after you <a title="Install Greasemonkey for Firefox" href="https://addons.mozilla.org/en-US/firefox/addon/748" target="_blank">install greasemonkey</a> for firefox here:</p>
<p><a href="http://userscripts.org/scripts/show/57740">FratHouseInsurance</a>.</p>
<p>You can also view the source at the above link.</p>
<p>Thanks Matt Carda, for the sweet idea.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F09%2F14%2Ffrathouseinsurance-greasemonkey-script%2F&amp;linkname=FratHouseInsurance-%20Greasemonkey%20Script"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/09/14/frathouseinsurance-greasemonkey-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Thinks Server is Spanish</title>
		<link>http://www.natenewz.com/2009/07/01/google-thinks-server-is-spanish/</link>
		<comments>http://www.natenewz.com/2009/07/01/google-thinks-server-is-spanish/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 15:40:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Spanish]]></category>
		<category><![CDATA[Wrong language]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.natenewz.com/blog/?p=31</guid>
		<description><![CDATA[I was working with google calendar xml feeds the other day, and the funniest thing was happening. If I went to the feed on my computer, it would show up in English. If my server downloaded it, it would show up in Spanish, with all of my events translated. After several hours of looking into [...]]]></description>
			<content:encoded><![CDATA[<p>I was working with google calendar xml feeds the other day, and the funniest thing was happening. If I went to the feed on my computer, it would show up in English. If my server downloaded it, it would show up in Spanish, with all of my events translated. After several hours of looking into why Google might think my server is Spanish, I discovered a fix. </p>
<p>Google gives you an xml feed URL that ends in &#8216;basic/&#8217;</p>
<p>Just add ?hl=en to the end of it.<br />
&#8216;basic/?hl=en&#8217;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.natenewz.com%2F2009%2F07%2F01%2Fgoogle-thinks-server-is-spanish%2F&amp;linkname=Google%20Thinks%20Server%20is%20Spanish"><img src="http://www.natenewz.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.natenewz.com/2009/07/01/google-thinks-server-is-spanish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
