<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>back of a napkin</title>
	
	<link>http://www.jeffmcfadden.com</link>
	<description />
	<pubDate>Tue, 18 Nov 2008 00:01:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/jeffmcfadden" type="application/rss+xml" /><feedburner:emailServiceId>1760023</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>Dear Mr. Cuban</title>
		<link>http://feeds.feedburner.com/~r/jeffmcfadden/~3/456550825/</link>
		<comments>http://www.jeffmcfadden.com/2008/11/17/dear-mr-cuban/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 00:01:33 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jeffmcfadden.com/?p=59</guid>
		<description><![CDATA[Mr. Cuban,
I realize that today is probably not the best day of your life, but I need to thank you.
I have an iPhone game called &#8220;Inside Trader&#8221; and the publicity that the news about you has generated has been a huge boon for sales.
As a fellow tech entrepreneur I hope you aren&#8217;t offended by the [...]]]></description>
			<content:encoded><![CDATA[<p>Mr. <span class="nfakPe">Cuban</span>,</p>
<p>I realize that today is probably not the best day of your life, but I need to thank you.</p>
<p>I have an iPhone game called &#8220;Inside Trader&#8221; and the publicity that the news about you has generated has been a huge boon for sales.</p>
<p>As a fellow tech entrepreneur I hope you aren&#8217;t offended by the opportunistic nature of my success. It&#8217;s certainly nothing personal, and I hope you make it through this crappy time as well as possible.</p>
<p>Thanks again for the free publicity, and I hope you&#8217;ll checkout the app sometime.</p>
<p><a href="http://www.insidetraderapp.com/" target="_blank">http://www.insidetraderapp.com</a> or search &#8220;Inside Trader&#8221; on the app store.</p>
<p>– Jeff McFadden</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=qX0IN"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=qX0IN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=ha46n"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=ha46n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=16dTn"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=16dTn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=dJ0KN"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=dJ0KN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=3tGIN"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=3tGIN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jeffmcfadden/~4/456550825" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffmcfadden.com/2008/11/17/dear-mr-cuban/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=jeffmcfadden&amp;itemurl=http%3A%2F%2Fwww.jeffmcfadden.com%2F2008%2F11%2F17%2Fdear-mr-cuban%2F</feedburner:awareness><feedburner:origLink>http://www.jeffmcfadden.com/2008/11/17/dear-mr-cuban/</feedburner:origLink></item>
		<item>
		<title>iPod Shuffle Charger</title>
		<link>http://feeds.feedburner.com/~r/jeffmcfadden/~3/346994483/</link>
		<comments>http://www.jeffmcfadden.com/2008/07/26/ipod-shuffle-charger/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 23:42:03 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
		
		<category><![CDATA[Projects]]></category>

		<category><![CDATA[Charger]]></category>

		<category><![CDATA[iPod Shuffle]]></category>

		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://www.jeffmcfadden.com/?p=24</guid>
		<description><![CDATA[Summary
The iPod Suffle is a really cool piece of hardware. One of the drawbacks, however, is that it has an internal battery that is recharged via USB power when it is plugged into your computer. This is all good and well except that it requires a good 4 hours to charge the Shuffle from completely [...]]]></description>
			<content:encoded><![CDATA[<h3>Summary</h3>
<p>The iPod Suffle is a really cool piece of hardware. One of the drawbacks, however, is that it has an internal battery that is recharged via USB power when it is plugged into your computer. This is all good and well except that it requires a good 4 hours to charge the Shuffle from completely dead to completely full. If you&#8217;re on the road this can be rather impractical. Thus, there was a need for a batterypack/charger device that can extend the usefulness of the Shuffle. Apple sells <a href="http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore?productLearnMore=M9759G/A">such a device</a> but it is rather expensive for what it does. Granted it looks very nice, but I knew I could make the same product for less. And who can give up a chance to solder?<span id="more-24"></span></p>
<h3>Alternatives</h3>
<p><a href="http://www.hackaday.com">Hack-A-Day</a> has a <a href="http://www.hackaday.com/entry/1234000270029372/">similar project</a>. The trick is that if you want the shuffle to function properly you have to tie both data pins (green and white wires) to ground. Pick you poison, this is the only trick you need to be aware of when making a Shuffle-specific charger.</p>
<h3>Ingredients</h3>
<p>To make a Shuffle Charger you will need the following:</p>
<ul>
<li>1 +5VDC Voltage Regulator (RadioShack #276-1770) - $1.59</li>
<li>1 9v Battery Snap Connector (RadioShack #270-325) - $1.99 for a 5 pack</li>
<li>1 Project enclosure (I used a RadioShack #270-1802) - $2.69</li>
<li>1 General purpose PC Board (*optional) (RadioShack #276-149) - $1.79</li>
<li>1 9v battery - $2.99 or less</li>
<li>A female type A usb connector. You can find this off of a USB extension cable, or maybe some old junk hardware somewhere. - $0.00 - $6.99</li>
</ul>
<p><strong>Total for parts: About $12 - $15.</strong></p>
<h3>Tools</h3>
<p>Additionally you will need the following tools:</p>
<ul>
<li>Soldering Iron</li>
<li>Solder</li>
<li>Possibly some very high gauge wire (26 - 28 gauge)</li>
<li>Screwdriver</li>
<li>Volt Meter</li>
</ul>
<h3>Disclaimer</h3>
<p>Look, I hardly know what I&#8217;m doing. This worked for me, but it might not work for you. If you solder together your own charger and something goes wrong and you fry your Shuffle don&#8217;t come crying to me. You take full responsibility for messing up your own Shuffle if you try this. If you are worried, buy apple&#8217;s battery pack and don&#8217;t take the chance. You have been warned.</p>
<h3>Assembly</h3>
<p><strong>Note: Read all directions before beginning!</strong></p>
<p>First, lay all the parts out on the table, and make sure that you have everything accessible.</p>
<p>Cut your usb cable in half and peel back the insulation so that you have all the wires out.</p>
<p>Strip the ends of the wires on the usb cable. Take the green, white, and black wires and twist them together.</p>
<p>Heat up the soldering iron and get it ready. Remember to always use saftey glasses when soldering!</p>
<p><img src="/images/shufflecharger/connections_closeup.jpg" alt="Solder overview" id="blackBorderImg" align="left" /></p>
<p>The first solder you&#8217;re going to make is from the 9v battery clip to the voltage regulator. Solder the RED (+) wire to the INPUT on the voltage regulator. Check the back of the box to make sure, but this is usually the left-most pole.</p>
<p>Next, solder the white, black, and green usb twisted wires, AND the ground (-) from the 9v clip to the ground on the voltage regulator. This is probably the middle pole on the voltage regulator.</p>
<p>Finally, solder the (+) RED wire on the USB cable to the OUTPUT of the voltage regulator. This is probably the rightmost pole.</p>
<p><img src="/images/shufflecharger/connections_overview.jpg" alt="Solder overview" id="blackBorderImg" align="left" /></p>
<p>Next, double check your solder connections to make sure they are correct and there is no solder bleed-over.</p>
<p><img src="/images/shufflecharger/connector_closeup.jpg" alt="Connector pinout" id="blackBorderImg" align="right" />Now connect the + probe on your volt meter to pin 1 on the usb connector, and the - (black) probe to the other pins. On each pin the volt meter should read +5v. <strong>It is critical that you verify the output voltage for each pin. If you mess this up you could break your Shuffle!</strong></p>
<p>If you are satisfied (and brave), connect the Shuffle to the usb connector. It should blink green, then yellow and green, and finally blink yellow steadily. If it does this, then your charger works. Congratulations! If not, check your solder joints and get your volt meter out again. And pray you didn&#8217;t fry your shuffle!</p>
<p><img src="/images/shufflecharger/into_case_angle.jpg" alt="Case being packed" id="blackBorderImg" align="left" /><br />
Finally, mount the parts inside the project case. I cut a notch on one end just wide enough for my usb connector, and filled the empty space with foam I had lying around from something I had shipped to myself. There&#8217;s no perfect way to do this. Just do what you think works. Heck you don&#8217;t have to mount it at all if you don&#8217;t want to!</p>
<p>Okay, now grab a beer and watch as your yellow light blinks on-off-on-off-on-off-on-off&#8230;</p>
<p><img src="/images/shufflecharger/all_connected.jpg" alt="All connected" id="blackBorderImg" /></p>
<p><img src="/images/shufflecharger/yellow_dot.jpg" alt="All connected" id="blackBorderImg" /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=IrQIcJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=IrQIcJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=Tzx40j"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=Tzx40j" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=41czbj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=41czbj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=5zrqcJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=5zrqcJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=Oe77QJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=Oe77QJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jeffmcfadden/~4/346994483" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffmcfadden.com/2008/07/26/ipod-shuffle-charger/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=jeffmcfadden&amp;itemurl=http%3A%2F%2Fwww.jeffmcfadden.com%2F2008%2F07%2F26%2Fipod-shuffle-charger%2F</feedburner:awareness><feedburner:origLink>http://www.jeffmcfadden.com/2008/07/26/ipod-shuffle-charger/</feedburner:origLink></item>
		<item>
		<title>SHFS On Fedora Core 2</title>
		<link>http://feeds.feedburner.com/~r/jeffmcfadden/~3/346994484/</link>
		<comments>http://www.jeffmcfadden.com/2008/07/26/shfs/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 23:41:26 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[SHFS]]></category>

		<guid isPermaLink="false">http://www.jeffmcfadden.com/?p=22</guid>
		<description><![CDATA[Intro
My additions are in the installation section. I was installing SHFS on Fedora Core 2 so I thought it might serve someone to have a little explanation of how to get it running quickly. The default installation instructions aren&#8217;t perfect if you&#8217;re installing on FC2.
If you want more information go to the shfs homepage.
About shfs
Shfs [...]]]></description>
			<content:encoded><![CDATA[<h3>Intro</h3>
<p>My additions are in the installation section. I was installing SHFS on Fedora Core 2 so I thought it might serve someone to have a little explanation of how to get it running quickly. The default installation instructions aren&#8217;t perfect if you&#8217;re installing on FC2.<span id="more-22"></span></p>
<p>If you want more information go to <a href="http://shfs.sourceforge.net/index.html">the shfs homepage</a>.</p>
<h3>About shfs</h3>
<p>Shfs is a simple and easy to use Linux kernel module which allows you to mount<br />
remote filesystems using a plain shell (ssh) connection. When using shfs, you can access<br />
all remote files just like the local ones, only the access is governed through the transport security<br />
of ssh. Shfs supports some nice features:</p>
<ul>
<li>file cache for access speedup</li>
<li>perl and shell code for the remote (server) side</li>
<li>could preserve uid/gid (root connection)</li>
<li>number of remote host platforms (Linux, Solaris, Cygwin, &#8230;)</li>
<li>Linux kernel 2.4.10+ and 2.6</li>
<li>arbitrary command used for connection (instead of ssh)</li>
<li>persistent connection (reconnect after ssh dies)</li>
</ul>
<p>The code was originally developed as an assignment for an Operating Systems course at the</p>
<p><a href="http://www.cuni.cz/index.php?lng=eng">Charles University</a>, Prague.</p>
<h3>Installation</h3>
<p>Installation should be straightforward. First, <a href="http://sourceforge.net/project/showfiles.php?group_id=72997&amp;package_id=93905">download sources (shfs-x.xx.tgz)</a>.</p>
<ol>
<li>unpack the tarball
<pre>
# tar -xzvf shfs-x.xx.tgz</pre>
</li>
<li>Check the top-level <tt>Makefile</tt> for <tt>KERNEL_SOURCES</tt> variable. It should<br />
contain path to your kernel directory (where include/linux resides).</li>
<li><strong>Important</strong> (kernel 2.4): check that your compiler is the same as used for compiling your kernel:
<pre>
# gcc --version
2.96
# cat /proc/version
Linux version 2.4.18 (root@host) (gcc version 2.96 20000731
(Red Hat Linux 7.1 2.96-98))</pre>
<p>If these versions differ, check for your configuration, how to call the kernel compiler<br />
(e.g. <tt>gcc-3.2</tt>). You will have to pass this to make (<tt>make CC=gcc-3.2</tt>).</li>
<li>make kernel module and shfsmount
<pre>
# make</pre>
<p>or (if you must specify the compiler):</p>
<pre>

# make CC=compiler</pre>
</li>
<li>     <em>This is where things get different.</em>
<p>Install (as root)</p>
<pre>
# make install</pre>
</li>
<li>    Insert the Kernel Module (as root)
<pre>
# /sbin/depmod
# /sbin/modprobe shfs</pre>
</li>
<li>     Mount something! (as root. If you want to mount as a user see the <a href="http://shfs.sourceforge.net/faq.html">FAQ</a>)
<pre>
# mount -t shfs user@hostname /mnt</pre>
<p><em>Note that you will mount the default dir unless you specify otherwise (i.e. user@hostname:/tmp for /tmp to be the mountpoint on the remote box)</em></li>
<p>If you have any problems or information to add please let me know.</ol>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=fI4fIJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=fI4fIJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=SApIlj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=SApIlj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=QuuwGj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=QuuwGj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=4fHH1J"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=4fHH1J" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=lfmH5J"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=lfmH5J" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jeffmcfadden/~4/346994484" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffmcfadden.com/2008/07/26/shfs/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=jeffmcfadden&amp;itemurl=http%3A%2F%2Fwww.jeffmcfadden.com%2F2008%2F07%2F26%2Fshfs%2F</feedburner:awareness><feedburner:origLink>http://www.jeffmcfadden.com/2008/07/26/shfs/</feedburner:origLink></item>
		<item>
		<title>How To Get High Quality Topo Maps For Free</title>
		<link>http://feeds.feedburner.com/~r/jeffmcfadden/~3/346994485/</link>
		<comments>http://www.jeffmcfadden.com/2008/07/26/how-to-get-high-quality-topo-maps-for-free/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 23:40:54 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[GIS]]></category>

		<category><![CDATA[Maps]]></category>

		<category><![CDATA[Topo]]></category>

		<guid isPermaLink="false">http://www.jeffmcfadden.com/?p=20</guid>
		<description><![CDATA[I really like a good map. A GPS + Laptop is great, but nothing works like a piece of paper when the batteries go dead or your laptop falls into the lake. Unfortunately, finding high quality topo maps for free is a chore.&#60;!&#8211;more&#8211;&#62;
When I first started searching for topo maps all I was able to [...]]]></description>
			<content:encoded><![CDATA[<p>I really like a good map. A GPS + Laptop is great, but nothing works like a piece of paper when the batteries go dead or your laptop falls into the lake. Unfortunately, finding high quality topo maps for free is a chore.&lt;!&#8211;more&#8211;&gt;</p>
<p>When I first started searching for topo maps all I was able to find were those provided by Jared Benedict over at <a href="http://www.redjar.org">redjar.org</a>. Then he started the map ransom project, which finally freed the maps. Now you can <a href="http://libremap.org/data/">download any of the US Quads you want</a> over at libre map. The drawback here is that the topos are all 100dpi scans (for most of the quads). Depending on how you print them, it can be difficult to make out some of the details.</p>
<p>Well, after some more searching I was directed to the <a href="http://fsgeodata.fs.fed.us/">USDA Forest Service geospatial data clearinghouse</a>. Here you can download high quality (300dpi mostly) raster TIFs of the same quads, produced by the NFS. One great thing about the NFS maps is that the forest roads are all numbered.</p>
<p>The downside is that some of the NFS maps don&#8217;t have roads the USGS topos have, and vice versa. In practice it&#8217;s definitely best to have as many maps as you can of an area if you want to have the best coverage of an area.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=GYUySJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=GYUySJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=DCWZ4j"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=DCWZ4j" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=98b81j"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=98b81j" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=awLp4J"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=awLp4J" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=3Dl74J"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=3Dl74J" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jeffmcfadden/~4/346994485" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffmcfadden.com/2008/07/26/how-to-get-high-quality-topo-maps-for-free/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=jeffmcfadden&amp;itemurl=http%3A%2F%2Fwww.jeffmcfadden.com%2F2008%2F07%2F26%2Fhow-to-get-high-quality-topo-maps-for-free%2F</feedburner:awareness><feedburner:origLink>http://www.jeffmcfadden.com/2008/07/26/how-to-get-high-quality-topo-maps-for-free/</feedburner:origLink></item>
		<item>
		<title>Geodesic Distance Function</title>
		<link>http://feeds.feedburner.com/~r/jeffmcfadden/~3/346994504/</link>
		<comments>http://www.jeffmcfadden.com/2008/07/26/geodesic-distance-function/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 23:39:50 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[Algorithms]]></category>

		<category><![CDATA[Geodesic Distance]]></category>

		<category><![CDATA[GIS]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jeffmcfadden.com/?p=18</guid>
		<description><![CDATA[I was working on some code to process some GPS track logs and I wanted to be able to accurately calculate the distance between 2 points in the log. I did some searches, but there were no obvious solutions written in PHP. However, I did run across Chris Veness&#8217; version in javascript. I worked through [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on some code to process some GPS track logs and I wanted to be able to accurately calculate the distance between 2 points in the log. I did some searches, but there were no obvious solutions written in PHP. However, I did run across <a href="http://www.movable-type.co.uk/scripts/LatLongVincenty.html">Chris Veness&#8217; version in javascript</a>. I worked through his function and mashed it up as PHP. The result seems to work, but for me with slightly less accuracy than the javascript version. At this point the problems seems to be the limit on the number of significant digits that PHP is using vs. JavaScript. If anyone finds any other problems, definitely let me know. <span id="more-18"></span></p>
<p>Why is this so great? Not only is this distance based on a curved surface, but you can vary the ellipsoid model being used (see vars $a, $b, and $f) to get a result with even greater accuracy. Just to clarify, the HowFar function does require the points to be in radians, not degrees, so be sure to use the deg2rad function to convert your lat/long into a usable format.<br />
[php]<br />
<?</p>
<p>function HowFar( $p1, $p2 ){</p>
<p>    // WGS-84 Ellipsoid<br />
    $a = 6378137;<br />
    $b = 6356752.3142;<br />
    $f = 1/289.257223563;</p>
<p>    $L = $p2->GetLong() - $p1->GetLong();<br />
    $U1 = atan( ( 1 - $f ) * tan( $p1->GetLat() ) );<br />
    $U2 = atan( ( 1 - $f ) * tan( $p2->GetLat() ) );</p>
<p>    //print &#8220;L:&#8221; . $L . &#8220;\n&#8221;;<br />
    //print &#8220;U1:&#8221; . $U1 . &#8220;\n&#8221;;<br />
    //print &#8220;U2:&#8221; . $U2 . &#8220;\n&#8221;;</p>
<p>    $sinU1 = sin( $U1 );<br />
    $cosU1 = cos( $U1 );</p>
<p>    //print &#8220;sinU1:&#8221; . $sinU1 . &#8220;\n&#8221;;<br />
    //print &#8220;cosU1:&#8221; . $cosU1 . &#8220;\n&#8221;;</p>
<p>    $sinU2 = sin( $U2 );<br />
    $cosU2 = cos( $U2 );</p>
<p>    //print &#8220;sinU2:&#8221; . $sinU2 . &#8220;\n&#8221;;<br />
    //print &#8220;cosU2:&#8221; . $cosU2 . &#8220;\n&#8221;;</p>
<p>    $lambda = $L;<br />
    $lambdaP = 2 * pi();</p>
<p>    $iterLimit = 20;</p>
<p>    while( abs( $lambda - $lambdaP ) > 0000000000001 &#038;&#038; &#8211;$iterLimit > 0 ){<br />
        $sinLambda = sin( $lambda );<br />
        //print &#8220;sinLambda:&#8221; . $sinLambda . &#8220;\n&#8221;;</p>
<p>        $cosLambda = cos( $lambda );<br />
        //print &#8220;cosLambda:&#8221; . $cosLambda . &#8220;\n&#8221;;</p>
<p>        $sinSigma  = sqrt( ( $cosU2 * $sinLambda ) * ( $cosU2 * $sinLambda ) + ( $cosU1 * $sinU2 - $sinU1 * $cosU2 * $cosLambda ) * ( $cosU1 * $sinU2 - $sinU1 * $cosU2 * $cosLambda ) );<br />
        //print &#8220;sinSigma:&#8221; . $sinSigma . &#8220;\n&#8221;;</p>
<p>        if( $sinSigma == 0 ){<br />
            return 0; //co-incident points<br />
        }</p>
<p>        $cosSigma   = $sinU1 * $sinU2 + $cosU1 * $cosU2 * $cosLambda;<br />
        //print &#8220;cosSigma:&#8221; . $cosSigma . &#8220;\n&#8221;;</p>
<p>        $sigma      = atan2( $sinSigma, $cosSigma );<br />
        //print &#8220;sigma:&#8221; . $sigma . &#8220;\n&#8221;;</p>
<p>        $sinAlpha   = $cosU1 * $cosU2 * $sinLambda / $sinSigma;<br />
        //print &#8220;sinAlpha:&#8221; . $sinAlpha . &#8220;\n&#8221;;</p>
<p>        $cosSqAlpha = 1 - $sinAlpha * $sinAlpha;<br />
        //print &#8220;cosSqAlpha:&#8221; . $cosSqAlpha . &#8220;\n&#8221;;</p>
<p>        $cos2SigmaM = $cosSigma - 2 * $sinU1 * $sinU2 / $cosSqAlpha;<br />
        //print &#8220;cos2SigmaM:&#8221; . $cos2SigmaM . &#8220;\n&#8221;;</p>
<p>        if( !is_numeric( $cosSigmaM ) ){<br />
            $cosSigmaM = 0; // Equatorial line<br />
        }</p>
<p>        $C = $f/16 * $cosSqAlpha * ( 4 + $f * ( 4 - 3 * $cosSqAlpha ) );</p>
<p>        $lambdaP = $lambda;<br />
        $lambda  = $L + ( 1 - $C ) * $f * $sinAlpha * ( $sigma + $C * $sinSigma * ( $cos2SigmaM + $C * $cosSigma * ( -1 + 2 * $cos2SigmaM * $cos2SigmaM ) ) );</p>
<p>    }</p>
<p>    if( $iterLimit == 0 ){<br />
        return false;<br />
    }</p>
<p>    $uSq = $cosSqAlpha * ( $a * $a - $b * $b ) / ( $b * $b );<br />
    //print &#8220;uSq:&#8221; . $uSq . &#8220;\n&#8221;;</p>
<p>    $A   = 1 + $uSq / 16384 * ( 4096 + $uSq * ( -768 + $uSq * ( 320 - 175 * $uSq ) ) );<br />
    //print &#8220;A:&#8221; . $A. &#8220;\n&#8221;;</p>
<p>    $B   = $uSq / 1024 * ( 256 + $uSq * ( -128 + $uSq * ( 74 - 47 * $uSq ) ) );<br />
    //print &#8220;B:&#8221; . $B. &#8220;\n&#8221;;</p>
<p>    $deltaSigma = $B * $sinSigma * ( $cos2SigmaM + $B / 4 * ( $cosSigma * ( -1 + 2 * $cos2SigmaM * $cos2SigmaM ) -<br />
                  $B / 6 * $cos2SigmaM * ( -3 + 4 * $sinSigma * $sinSigma ) * ( -3 + 4 * $cos2SigmaM * $cos2SigmaM ) ) );<br />
    $s = $b * $A * ( $sigma - $deltaSigma );</p>
<p>    return $s;<br />
}</p>
<p>class CPoint{<br />
    var $m_nLat;<br />
    var $m_nLong;<br />
    var $m_sTs;</p>
<p>    function CPoint( $lat, $long, $ts = &#8220;&#8221; ){<br />
        $this->m_nLat = $lat;<br />
        $this->m_nLong = $long;<br />
        $this->m_sTs   = strtotime( $ts );<br />
    }</p>
<p>    function GetLat(){<br />
        return $this->m_nLat;<br />
    }</p>
<p>    function GetLong(){<br />
        return $this->m_nLong;<br />
    }</p>
<p>    function GetTs(){<br />
        return $this->m_sTs;<br />
    }</p>
<p>    function Degrees2Radian(){<br />
        $this->m_nLat  = deg2rad( $this->m_nLat );<br />
        $this->m_nLong = deg2rad( $this->m_nLong );<br />
    }<br />
}</p>
<p>$Start = new CPoint( 33.399518681, -115.4098444488 );<br />
$Start->Degrees2Radian();<br />
$End   = new CPoint( 33.399843764, -115.4054863956 );<br />
$End->Degrees2Radian();</p>
<p>print HowFar( $Start, $End );</p>
<p>?><br />
[/php]</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=kyGRkJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=kyGRkJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=2fQypj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=2fQypj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=ytkpwj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=ytkpwj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=zFH1pJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=zFH1pJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=ZeYL6J"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=ZeYL6J" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jeffmcfadden/~4/346994504" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffmcfadden.com/2008/07/26/geodesic-distance-function/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=jeffmcfadden&amp;itemurl=http%3A%2F%2Fwww.jeffmcfadden.com%2F2008%2F07%2F26%2Fgeodesic-distance-function%2F</feedburner:awareness><feedburner:origLink>http://www.jeffmcfadden.com/2008/07/26/geodesic-distance-function/</feedburner:origLink></item>
		<item>
		<title>How My Wallet Destroyed 4 Hard Drives</title>
		<link>http://feeds.feedburner.com/~r/jeffmcfadden/~3/346994506/</link>
		<comments>http://www.jeffmcfadden.com/2008/07/26/how-my-wallet-destroyed-4-hard-drives/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 23:18:47 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[Hard Drive]]></category>

		<category><![CDATA[Magnets]]></category>

		<category><![CDATA[Wallet]]></category>

		<guid isPermaLink="false">http://www.jeffmcfadden.com/?p=11</guid>
		<description><![CDATA[About 7 days after I brought it home I was checking my email with the computer on my lap when I heard a loud PING! cry out from behind the case. It certainly didn’t sound like a good noise, and the grinding that followed was even worse...]]></description>
			<content:encoded><![CDATA[<h1><small><small>(And how yours could too)</small></small></h1>
<div class="quickJump" style="margin-top: 15px;padding: 5px; background-color: #444400;border: 1px solid #CCC">
<strong>Quick Jump:</strong> <a href="#Experiment">The Experiment</a> | <a href="#TestVideo">The Test Video</a> | <a href="#Conclusion">Conclusion</a>
</div>
<p><img src="http://farm2.static.flickr.com/1084/530454181_7a626684d2_m.jpg" alt="" align="right" />Hard disk drives are a marvel of modern technology. With the ability to store the data of millions of books on a single hard drive, we&#8217;ve never been able to store more data at a lower price than we are now, and storage capacity is only going up while prices are only going down.<span id="more-11"></span></p>
<p>Even more amazing is the sheer complexity at work in a modern drive. The electrical, chemical, mechanical, computer, and magnetic engineering that must take place to develop a drive boggles the mind. A hard disk drive is truly a monument to modern technological achievement, and at only a couple hundred dollars a piece, most people have at least a handful in the various electrical devices around the house. From the TiVo to the family laptop to a camcorder to an iPod, hard drives are in more and more of devices we own.</p>
<p>With access to such cheap and powerful storage, it&#8217;s easy to overlook the fragility of modern disk storage &#8212; a lesson I learned the hard way.</p>
<p>In April of 2007 I received my first MacBook Pro from Apple. I was upgrading from a Powerbook G4 I had owned for 2 years, which had served me with only a couple of part failures (a bad battery and a hard drive that failed after a year). I took the new laptop home and started copying my data over. After two days I had it all setup. It was working wonderfully.</p>
<p><a name="Story"> </a></p>
<h2>The Story</h2>
<p><img src="http://farm1.static.flickr.com/9/85083685_d58f41ee3d.jpg?v=1136953223" alt="" align="left" />About 7 days after I brought it home I was checking my email with the computer on my lap when I heard a loud PING! cry out from behind the case. It certainly didn&#8217;t sound like a good noise, and the grinding that followed was even worse. My programs started to lock up and my computer would not restart. Dejected, I took the laptop to the Apple store, where a new hard drive was installed. Two days later I took the laptop back home and spent days reinstalling software. I was partially surprised that there was a failure so soon in the life of the laptop, but hard drives do die, and some die quickly.</p>
<p>Back up and running things were going well until 4 days later when it happened again. I was opening up the laptop when PING! went the computer. The repair kept me computerless for 5 days.</p>
<p>With the second failure I was skeptical that this computer would ever work right, and my doubts were validated when the THIRD drive failed after only another 10 days. Same as the first two, pinging, clicking, and grinding signaled the death of my laptop.</p>
<p>This time the technicians at the Apple store heard my cries and replaced the unit. I walked home with a brand new sealed in box laptop, glad that my hard drive problems were over.</p>
<p>At least for 5 days anyway.</p>
<p>That&#8217;s when it happened for the FOURTH time, on a completely new computer. I was surfing the web on a Saturday when I heard the ping of death. My heart stopped and I wondered if I was cursed.</p>
<p><img src="http://farm2.static.flickr.com/1178/530500711_4e08c800c3.jpg?v=0" alt="" align="right" />When I took the laptop in they interrogated me for a while and eventually I left with a third brand new laptop (thank you Apple). As I was walking out of the store one of the questions a tech asked me rang again in my mind: &#8216;Did you expose the laptop to any strange magnetic fields?&#8217; Of course my answer was &#8216;No.&#8217; I couldn&#8217;t think of one. But then as I was leaving it occurred to me that my money clip wallet, which sits in my front pocket, does have a magnet. &#8216;But surely the laptop is shielded enough that couldn&#8217;t matter, could it?&#8217; I wondered.</p>
<p>As I pondered more and more it seemed plausible. Every failure followed a session using the notebook on my lap. And as I read up on hard drive operation it seemed evident that if you could get a magnetic field to reach into the drive, you could definitely destroy it.</p>
<p>That&#8217;s when I realized that we had to do an experiment. What we discovered is terrifying: modern hard drives are much more fragile than we often consider, and exposure to even weak magnetic fields from close range could render a working drive absolutely useless.</p>
<p><a name="Experiment"> </a></p>
<h2>The Experiment</h2>
<p>While it was suggested to me to purchase a notebook hard drive, expose it to a magnetic field, and see if we could break it, then return it to the store of purchase, I thought that a bit risky, unethical, and potentially pricey. Instead, I opted to do some simple testing under the premise that <em>if we can get a magnetic field into the drive operating area, then we can conclude that it is plausible that said magnetic field could ruin the drive</em>. In other words, if the magnet can affect the drive at all, consider the drive dead.</p>
<p>Enter my old Hitachi 2.5&#8242; notebook drive. It failed after one year of service, and I opened it up to see how it looked inside. Since the drive was already dead, it seemed like the best test subject.</p>
<p class="center"><img src="http://farm2.static.flickr.com/1409/530453741_0d26712cf5.jpg?v=0" alt="" /></p>
<p>Here is the plan:<br />
1. Place iron filings onto disk surface.<br />
2. Expose disk to magnets from varying distances.<br />
3. Look for fluctuations in filings when exposed to fields.</p>
<p>First, we get some filings (filed from a piece of steel lying around) and dump them onto the drive. Now, we get out the money clip. First we&#8217;ll test with the magnet that I think might have killed my computers, then we&#8217;ll test with other sources if that yields no results.</p>
<p class="center"><img src="http://farm2.static.flickr.com/1232/530492887_bf49ab0a7c.jpg?v=0" alt="" /></p>
<p>The first test is startling. Not only does the field easily penetrate the bottom of the drive, it&#8217;s incredibly strong at the point of the top of the platter.</p>
<p class="center"><img src="http://farm2.static.flickr.com/1119/530458001_d62391ed24.jpg?v=0" alt="" /></p>
<p>Moving the magnet away continues to yield disturbing results. We were able to make the pieces dance from a range of upwards of 5cm away!</p>
<p class="center"><img src="http://farm2.static.flickr.com/1420/530457969_37f69d92f3.jpg?v=0" alt="" /></p>
<p>And lest anyone ask, the top of the case has no obvious shielding properties.</p>
<p class="center"><img src="http://farm2.static.flickr.com/1174/530385900_63e2e0ea4d.jpg?v=0" alt="" /></p>
<p><a name="TestVideo"> </a></p>
<h3>Test Video</h3>
<p class="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/qukVYKdqb8o" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/qukVYKdqb8o" wmode="transparent"></embed></object></p>
<h2>So What?</h2>
<p>In plain english, any moderate magnetic field, from a speaker to a fridge magnet, could potentially disrupt the magnetic field of a hard drive, rendering it unreadable. Keeping all magnets of any kind <em>far</em> away from drives is vital.</p>
<p><a name="Conclusion"> </a></p>
<h2>The Conclusion</h2>
<p>Hard disk drives are remarkable pieces of electronics. They incorporate a variety of technologies to store the valuable information that we create each day. But for all their amazing qualities, we find them to be startlingly fragile. If ever you were looking for evidence to reinforce the need to spread data around as you back it up, look no further than the above.</p>
<p>As for my laptops, most likely the money clip&#8217;s magnet interfered with the operation of my hard drives (all four of them), causing the destructive effects that I witnessed. While perhaps not perfectly confirmed, this myth is definitely plausible.</p>
<p><a name="Appendix"> </a></p>
<h2>Appendix: Obvious Questions</h2>
<p>Since undoubtedly someone will ask these questions, or argue that this test is unreasonable, here are my thoughts on the most likely rebuttals.</p>
<p>1. You didn&#8217;t prove the drive would actually die. You just moved metal filings.</p>
<p>True. But if a magnetic field can get into the platter region it can interfere with the fields already in place, and since both movement and data storage/retrieval rely on magnetic actuation, it is perfectly reasonable to conclude that the drive would be damaged in some way.</p>
<p>2. You didn&#8217;t take the laptop case into account.</p>
<p>Also true. However, in the case of my powerbook, the aluminum case provides little to zero effective shielding. The hard drive is located on the bottom of the case, in the front left corner. The effective distance in a real world scenario would be approximately 1cm. We were able to move filings at least 5cm away from the magnet.</p>
<p>3. Not all laptops have the drive in a similar location.</p>
<p>Also true. And that does matter. Had the drives been on the other side of the case they probably never would have been affected by the magnet in my pocket. But since the magnet could easily penetrate an entire plastic case from bottom to top, no modern unshielded laptop seems secure.</p>
<p><a name="ExternalLinks"> </a></p>
<h2>Additional Information</h2>
<p><a href="http://www.flickr.com/photos/mcphat/sets/72157600310275411/">Flickr Photo Set</a><br />
The Flickr set with all the photos taken for the experiment.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=EFzdFJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=EFzdFJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=jVdrbj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=jVdrbj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=XkSGvj"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=XkSGvj" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=wnAKFJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=wnAKFJ" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/jeffmcfadden?a=3joOUJ"><img src="http://feeds.feedburner.com/~f/jeffmcfadden?i=3joOUJ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/jeffmcfadden/~4/346994506" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.jeffmcfadden.com/2008/07/26/how-my-wallet-destroyed-4-hard-drives/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=jeffmcfadden&amp;itemurl=http%3A%2F%2Fwww.jeffmcfadden.com%2F2008%2F07%2F26%2Fhow-my-wallet-destroyed-4-hard-drives%2F</feedburner:awareness><feedburner:origLink>http://www.jeffmcfadden.com/2008/07/26/how-my-wallet-destroyed-4-hard-drives/</feedburner:origLink></item>
	<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetFeedData?uri=jeffmcfadden</feedburner:awareness></channel>
</rss>
